]> Sergey Matveev's repositories - dotfiles.git/blobdiff - zsh/.zshrc
Let's try to use suffix aliases
[dotfiles.git] / zsh / .zshrc
index a3ea22949fe45abb8c3f005934d84b4534412645..6e04b1aa3f243e802daed2b65909304c76e1a361 100644 (file)
@@ -82,7 +82,7 @@ alias -g W="| wc -l | sed 's/ //g'"
 alias mc="mc --nomouse"
 
 f() {
-    find . -name "*$1*" -print
+    bfs . -name "*$1*" -print
 }
 
 alias ssh="TERM=xterm ssh"
@@ -90,6 +90,11 @@ alias sshnm="ssh -S none"
 ssht() {
     ssh -C -t $1 tmux attach -t0
 }
+
+autoload -U zsh-mime-setup
+zsh-mime-setup
+alias -s html=lynx
+alias -s txt=less
 # }}}
 
 # Faster movement {{{
@@ -116,7 +121,7 @@ alias Gc="git checkout"
 alias Gd="git diff"
 alias Gdc="git diff --cached"
 alias Gs="git show --show-signature"
-alias Gm="git diff --name-only --diff-filter=M"
+alias Gm="git diff --name-only --diff-filter=M --relative"
 alias Gam="git commit --amend"
 alias Gl="git log --oneline --graph --decorate=short"
 alias Gld="git log --format=format:'%ai %Cgreen%h%Creset %s'"
@@ -137,9 +142,6 @@ GREP_ARGS=(
 g() {
     grep $GREP_ARGS $@ | less
 }
-GS() {
-    grep $GREP_ARGS $@ | sort --numeric-sort | less
-}
 alias -g G="| grep --colour=always"
 alias gg="git grep "
 # }}}
@@ -200,8 +202,11 @@ ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=cyan"
 
 # fzf {{{
 cf() {
-    local dir=$(find -L ${1:-.} -mindepth 1 -path "*/\.git" -prune -o -type d -print |
-        fzf --height 40% --reverse --preview="tree -CN {}")
+    local dir=$(bfs -L ${1:-.} -mindepth 1 \
+        -path "*/\.git" -prune -o \
+        -path "*/\.redo" -prune -o \
+        -type d -print 2>/dev/null |
+            fzf --height 40% --reverse --preview="tree -CN {}")
     [[ -z $dir ]] || { print -s cd $dir ; cd $dir }
 }
 # }}}