Move from omf to fisher for fishshell

This commit is contained in:
Colin Powell
2018-12-05 23:28:44 -05:00
parent a90fcfab56
commit 162fb6f973
24 changed files with 1191 additions and 7 deletions

View File

@ -0,0 +1 @@
fisher copy-user-key-bindings

View File

@ -0,0 +1,9 @@
set -q FZF_TMUX_HEIGHT; or set -U FZF_TMUX_HEIGHT "40%"
set -q FZF_DEFAULT_OPTS; or set -U FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT"
set -q FZF_LEGACY_KEYBINDINGS; or set -U FZF_LEGACY_KEYBINDINGS 1
set -q FZF_PREVIEW_FILE_CMD; or set -U FZF_PREVIEW_FILE_CMD "head -n 10"
set -q FZF_PREVIEW_DIR_CMD; or set -U FZF_PREVIEW_DIR_CMD "ls"
function fzf_uninstall -e fzf_uninstall
# Erase env vars and __fzf functions here.
end

View File

@ -0,0 +1,41 @@
if test "$FZF_LEGACY_KEYBINDINGS" -eq 1
bind \ct '__fzf_find_file'
bind \cr '__fzf_reverse_isearch'
bind \ec '__fzf_cd'
bind \eC '__fzf_cd --hidden'
bind \cg '__fzf_open'
bind \co '__fzf_open --editor'
if bind -M insert >/dev/null 2>/dev/null
bind -M insert \ct '__fzf_find_file'
bind -M insert \cr '__fzf_reverse_isearch'
bind -M insert \ec '__fzf_cd'
bind -M insert \eC '__fzf_cd --hidden'
bind -M insert \cg '__fzf_open'
bind -M insert \co '__fzf_open --editor'
end
else
bind \cf '__fzf_find_file'
bind \cr '__fzf_reverse_isearch'
bind \eo '__fzf_cd'
bind \eO '__fzf_cd --hidden'
bind \cg '__fzf_open'
bind \co '__fzf_open --editor'
if bind -M insert >/dev/null 2>/dev/null
bind -M insert \cf '__fzf_find_file'
bind -M insert \cr '__fzf_reverse_isearch'
bind -M insert \eo '__fzf_cd'
bind -M insert \eO '__fzf_cd --hidden'
bind -M insert \cg '__fzf_open'
bind -M insert \co '__fzf_open --editor'
end
end
if set -q FZF_COMPLETE
bind \t '__fzf_complete'
end
function fzf_key_bindings_uninstall -e fzf_key_bindings_uninstall
# Erase key bindings here.
end

View File

@ -1,7 +0,0 @@
# Path to Oh My Fish install.
set -q XDG_DATA_HOME
and set -gx OMF_PATH "$XDG_DATA_HOME/omf"
or set -gx OMF_PATH "$HOME/.local/share/omf"
# Load Oh My Fish configuration.
source $OMF_PATH/init.fish

44
config/fish/conf.d/z.fish Normal file
View File

@ -0,0 +1,44 @@
if test -z "$Z_DATA"
if test -z "$XDG_DATA_HOME"
set -U Z_DATA_DIR "$HOME/.local/share/z"
else
set -U Z_DATA_DIR "$XDG_DATA_HOME/z"
end
set -U Z_DATA "$Z_DATA_DIR/data"
end
if test ! -e "$Z_DATA"
if test ! -e "$Z_DATA_DIR"
mkdir -p -m 700 "$Z_DATA_DIR"
end
touch "$Z_DATA"
end
if test -z "$Z_CMD"
set -U Z_CMD "z"
end
set -U ZO_CMD "$Z_CMD"o
if test ! -z $Z_CMD
function $Z_CMD -d "jump around"
__z $argv
end
end
if test ! -z $ZO_CMD
function $ZO_CMD -d "open target dir"
__z -d $argv
end
end
if not set -q Z_EXCLUDE
set -U Z_EXCLUDE $HOME
end
# Setup completions once first
__z_complete
function __z_on_variable_pwd --on-variable PWD
__z_add
end