aliases/general: minor fixes
- Don't define some aliases if the target isn't installed, use _command_exists to check instead of `type` and `which`. - Use `$EDITOR` for the editor for aliases about editing, excep the `sudo` ones because maybe you want those specifically? - Fix `ls` aliases to match their common definitions (-A instead of -a: don't show '.' and '..' when displaying hidden files).pull/1950/head
parent
636cf50ede
commit
74ff3a9cc8
|
|
@ -9,8 +9,8 @@ fi
|
||||||
# List directory contents
|
# List directory contents
|
||||||
alias sl=ls
|
alias sl=ls
|
||||||
alias la='ls -AF' # Compact view, show hidden
|
alias la='ls -AF' # Compact view, show hidden
|
||||||
alias ll='ls -al'
|
alias ll='ls -Al'
|
||||||
alias l='ls -a'
|
alias l='ls -A'
|
||||||
alias l1='ls -1'
|
alias l1='ls -1'
|
||||||
alias lf='ls -F'
|
alias lf='ls -F'
|
||||||
|
|
||||||
|
|
@ -47,8 +47,8 @@ alias py='python'
|
||||||
alias ipy='ipython'
|
alias ipy='ipython'
|
||||||
|
|
||||||
# Pianobar can be found here: http://github.com/PromyLOPh/pianobar/
|
# Pianobar can be found here: http://github.com/PromyLOPh/pianobar/
|
||||||
|
_command_exists pianobar \
|
||||||
alias piano='pianobar'
|
&& alias piano='pianobar'
|
||||||
|
|
||||||
alias ..='cd ..' # Go up one directory
|
alias ..='cd ..' # Go up one directory
|
||||||
alias cd..='cd ..' # Common misspelling for going up one directory
|
alias cd..='cd ..' # Common misspelling for going up one directory
|
||||||
|
|
@ -69,11 +69,12 @@ alias md='mkdir -p'
|
||||||
alias rd='rmdir'
|
alias rd='rmdir'
|
||||||
|
|
||||||
# Shorten extract
|
# Shorten extract
|
||||||
alias xt='extract'
|
_command_exists 'extract' \
|
||||||
|
&& alias xt='extract'
|
||||||
|
|
||||||
# sudo editors
|
# sudo editors
|
||||||
alias svim='sudo ${VISUAL:-vim}'
|
alias svim='sudo "${VISUAL:-vim}"'
|
||||||
alias snano='sudo nano'
|
alias snano='sudo "${ALTERNATE_EDITOR:-nano}"'
|
||||||
|
|
||||||
# Display whatever file is regular file or folder
|
# Display whatever file is regular file or folder
|
||||||
function catt() {
|
function catt() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue