aliases/directory: split out directory shortcuts

pull/2095/head
John D Pell 2022-02-17 21:41:59 -08:00 committed by John D Pell
parent 8e78294920
commit f36793bf2b
3 changed files with 29 additions and 24 deletions

View File

@ -0,0 +1,26 @@
# shellcheck shell=bash
about-alias 'Shortcuts for directory commands: ls, cd, &c.'
if command ls --color -d . &> /dev/null; then
alias ls='ls --color=auto'
# BSD `ls` doesn't need an argument (`-G`) when `$CLICOLOR` is set.
fi
# List directory contents
alias sl=ls
alias la='ls -AF' # Compact view, show hidden
alias ll='ls -Al'
alias l='ls -A'
alias l1='ls -1'
alias lf='ls -F'
# Change directory
alias ..='cd ..' # Go up one directory
alias cd..='cd ..' # Common misspelling for going up one directory
alias ...='cd ../..' # Go up two directories
alias ....='cd ../../..' # Go up three directories
alias -- -='cd -' # Go back
# Create or remove directory
alias md='mkdir -p'
alias rd='rmdir'

View File

@ -2,19 +2,6 @@
# shellcheck source-path=SCRIPTDIR
about-alias 'general aliases'
if command ls --color -d . &> /dev/null; then
alias ls='ls --color=auto'
# BSD `ls` doesn't need an argument (`-G`) when `$CLICOLOR` is set.
fi
# List directory contents
alias sl=ls
alias la='ls -AF' # Compact view, show hidden
alias ll='ls -Al'
alias l='ls -A'
alias l1='ls -1'
alias lf='ls -F'
alias _='sudo'
# Shortcuts to edit startup files
@ -49,15 +36,9 @@ alias ipy='ipython'
# Pianobar can be found here: http://github.com/PromyLOPh/pianobar/
if _command_exists pianobar; then
alias piano='pianobar'
alias piano='pianobar'
fi
alias ..='cd ..' # Go up one directory
alias cd..='cd ..' # Common misspelling for going up one directory
alias ...='cd ../..' # Go up two directories
alias ....='cd ../../..' # Go up three directories
alias -- -='cd -' # Go back
# Shell History
alias h='history'
@ -66,10 +47,6 @@ if ! _command_exists tree; then
alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'"
fi
# Directory
alias md='mkdir -p'
alias rd='rmdir'
# Shorten extract
alias xt='extract'
@ -95,3 +72,4 @@ function catt() {
# bash-it disable alias general
# bash-it enable alias bash-it
source "$BASH_IT/aliases/available/bash-it.aliases.bash"
source "$BASH_IT/aliases/available/directory.aliases.bash"

View File

@ -11,3 +11,4 @@ completion system
# aliases
aliases general
aliases bash-it
aliases directory