forked from sorin-ionescu/prezto
-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.zsh
42 lines (35 loc) · 1.2 KB
/
init.zsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#
# Sets directory options and defines directory aliases.
#
# Authors:
# Joel Kuzmarski <leoj3n@gmail.com>
# James Cox <james@imaj.es>
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
#
# Options
#
setopt AUTO_CD # Auto changes to a directory without typing cd.
setopt AUTO_PUSHD # Push the old directory onto the stack on cd.
setopt PUSHD_IGNORE_DUPS # Do not store duplicates in the stack.
setopt PUSHD_SILENT # Do not print the directory stack after pushd or popd.
setopt PUSHD_TO_HOME # Push to home directory when no argument is given.
setopt CDABLE_VARS # Change directory to a path stored in a variable.
setopt AUTO_NAME_DIRS # Auto add variable-stored paths to ~ list.
setopt MULTIOS # Write to multiple descriptors.
setopt EXTENDED_GLOB # Use extended globbing syntax.
unsetopt CLOBBER # Do not overwrite existing files with > and >>.
# Use >! and >>! to bypass.
#
# Aliases
#
alias d='dirs -v'
for index ({1..9}) alias "$index"="cd +${index}"; unset index
alias cdd='cd -'
alias ...='cd ../..'
#
# Functions
#
function up() {
local x='';for i in $(seq ${1:-1});do x="$x../"; done;cd $x;
}