aboutsummaryrefslogtreecommitdiffstats
path: root/.zsh.before
diff options
context:
space:
mode:
authorDavid Runge <david.runge@frqrec.com>2014-10-31 18:30:03 +0100
committerDavid Runge <david.runge@frqrec.com>2014-10-31 18:30:03 +0100
commitccf94b7df09799feb201d1a59928932fda4e24f4 (patch)
tree32a8352121f29c02ac3e3024deaae338c5fc04a3 /.zsh.before
parentca44a29e2ebd7c2fc80899139335ee1547867ea6 (diff)
downloaddotfiles-ccf94b7df09799feb201d1a59928932fda4e24f4.tar.gz
dotfiles-ccf94b7df09799feb201d1a59928932fda4e24f4.tar.bz2
dotfiles-ccf94b7df09799feb201d1a59928932fda4e24f4.tar.xz
dotfiles-ccf94b7df09799feb201d1a59928932fda4e24f4.zip
zsh: Adding config files for zprezto, zsh settings and prompts, to comply with the way zprezto gets started
Diffstat (limited to '.zsh.before')
-rw-r--r--.zsh.before/aliases.zsh11
-rw-r--r--.zsh.before/custom_prompt_path.zsh4
-rw-r--r--.zsh.before/functions.zsh7
-rw-r--r--.zsh.before/git.zsh4
-rw-r--r--.zsh.before/key-bindings.zsh10
-rw-r--r--.zsh.before/last-command.zsh7
-rw-r--r--.zsh.before/noglob.zsh4
-rw-r--r--.zsh.before/rm.zsh2
-rw-r--r--.zsh.before/vi-mode.zsh3
9 files changed, 51 insertions, 1 deletions
diff --git a/.zsh.before/aliases.zsh b/.zsh.before/aliases.zsh
index b38dc53..2fc2c1d 100644
--- a/.zsh.before/aliases.zsh
+++ b/.zsh.before/aliases.zsh
@@ -1 +1,10 @@
-alias brew='echo'
+# Global aliases
+alias -g ...='../..'
+alias -g ....='../../..'
+alias -g .....='../../../..'
+alias -g C='| wc -l'
+alias -g H='| head'
+alias -g L="| less"
+alias -g N="| /dev/null"
+alias -g S='| sort'
+alias -g G='| grep' # now you can do: ls foo G something
diff --git a/.zsh.before/custom_prompt_path.zsh b/.zsh.before/custom_prompt_path.zsh
new file mode 100644
index 0000000..18e68b9
--- /dev/null
+++ b/.zsh.before/custom_prompt_path.zsh
@@ -0,0 +1,4 @@
+#Load themes from yadr and from user's custom prompts (themes) in ~/.zsh.prompts
+autoload promptinit
+fpath=($HOME/.zsh.prompts $fpath)
+promptinit
diff --git a/.zsh.before/functions.zsh b/.zsh.before/functions.zsh
index 01bc224..4b2ef1a 100644
--- a/.zsh.before/functions.zsh
+++ b/.zsh.before/functions.zsh
@@ -1,3 +1,10 @@
+# Functions
+#
+# (f)ind by (n)ame
+# usage: fn foo
+# to find all files containing 'foo' in the name
+function fn() { ls **/*$1* }
+
if [ -e $HOME/bin/functions.sh ]
then
. $HOME/bin/functions.sh
diff --git a/.zsh.before/git.zsh b/.zsh.before/git.zsh
new file mode 100644
index 0000000..c87ec5a
--- /dev/null
+++ b/.zsh.before/git.zsh
@@ -0,0 +1,4 @@
+# Makes git auto completion faster favouring for local completions
+__git_files () {
+ _wanted files expl 'local files' _files
+}
diff --git a/.zsh.before/key-bindings.zsh b/.zsh.before/key-bindings.zsh
new file mode 100644
index 0000000..c1c7d8e
--- /dev/null
+++ b/.zsh.before/key-bindings.zsh
@@ -0,0 +1,10 @@
+# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html
+# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Zle-Builtins
+# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Standard-Widgets
+
+bindkey -v # Use vi key bindings
+bindkey '^r' history-incremental-search-backward # [Ctrl-r] - Search backward incrementally for a specified string. The string may begin with ^ to anchor the search to the beginning of the line.
+
+# emacs style
+bindkey '^a' beginning-of-line
+bindkey '^e' end-of-line
diff --git a/.zsh.before/last-command.zsh b/.zsh.before/last-command.zsh
new file mode 100644
index 0000000..9f7486b
--- /dev/null
+++ b/.zsh.before/last-command.zsh
@@ -0,0 +1,7 @@
+# Use Ctrl-x,Ctrl-l to get the output of the last command
+zmodload -i zsh/parameter
+insert-last-command-output() {
+LBUFFER+="$(eval $history[$((HISTCMD-1))])"
+}
+zle -N insert-last-command-output
+bindkey "^X^L" insert-last-command-output
diff --git a/.zsh.before/noglob.zsh b/.zsh.before/noglob.zsh
new file mode 100644
index 0000000..ede67c9
--- /dev/null
+++ b/.zsh.before/noglob.zsh
@@ -0,0 +1,4 @@
+# Don't try to glob with zsh so you can do
+# stuff like ga *foo* and correctly have
+# git add the right stuff
+alias git='noglob git'
diff --git a/.zsh.before/rm.zsh b/.zsh.before/rm.zsh
new file mode 100644
index 0000000..26508a3
--- /dev/null
+++ b/.zsh.before/rm.zsh
@@ -0,0 +1,2 @@
+# Override rm -i alias which makes rm prompt for every action
+alias rm='nocorrect rm'
diff --git a/.zsh.before/vi-mode.zsh b/.zsh.before/vi-mode.zsh
new file mode 100644
index 0000000..4ac7453
--- /dev/null
+++ b/.zsh.before/vi-mode.zsh
@@ -0,0 +1,3 @@
+set -o vi
+export EDITOR=vim
+export VISUAL=vim