Compare commits
6 Commits
fc0cf2ff0a
...
a3e83e4844
| Author | SHA1 | Date | |
|---|---|---|---|
|
a3e83e4844
|
|||
|
0af6c9fb24
|
|||
|
3cf445e739
|
|||
|
688f8e18aa
|
|||
|
5baad5d7a2
|
|||
|
59863b28b3
|
@@ -117,6 +117,21 @@ bind -T copy-mode-vi WheelDownPane {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Make mouse wheel scroll down properly in alternate mode
|
||||||
|
bind -n WheelDownPane {
|
||||||
|
send -M
|
||||||
|
if -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" {
|
||||||
|
send -M
|
||||||
|
} {
|
||||||
|
if -F "#{alternate_on}" {
|
||||||
|
send -N5 down
|
||||||
|
} {
|
||||||
|
# we're already at the bottom of the history, so nothing
|
||||||
|
# needs to be done here
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Split panes with > and <
|
# Split panes with > and <
|
||||||
unbind %
|
unbind %
|
||||||
bind < splitw -v -c "#{pane_current_path}"
|
bind < splitw -v -c "#{pane_current_path}"
|
||||||
|
|||||||
2
.config/vim/ftplugin/bash.vim
Normal file
2
.config/vim/ftplugin/bash.vim
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
" source ./shell.vim (adds `-` to &iskeyword)
|
||||||
|
execute "source " .. expand("<sfile>:h") .. "/shell.vim"
|
||||||
@@ -1 +0,0 @@
|
|||||||
c.vim
|
|
||||||
2
.config/vim/ftplugin/shell.vim
Normal file
2
.config/vim/ftplugin/shell.vim
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
" Include `-` in keyword characters since command names can contain them
|
||||||
|
setlocal iskeyword+=-
|
||||||
2
.config/vim/ftplugin/zsh.vim
Normal file
2
.config/vim/ftplugin/zsh.vim
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
" source ./shell.vim (adds `-` to &iskeyword)
|
||||||
|
execute "source " .. expand("<sfile>:h") .. "/shell.vim"
|
||||||
@@ -192,7 +192,7 @@ fi
|
|||||||
(( ${${aliases[rm]}[(ei)rm]} > ${#${aliases[rm]}} )) ||
|
(( ${${aliases[rm]}[(ei)rm]} > ${#${aliases[rm]}} )) ||
|
||||||
add_flags rm -I
|
add_flags rm -I
|
||||||
add_flags mkdir -p
|
add_flags mkdir -p
|
||||||
add_flags lsblk -o NAME,LABEL,TYPE,FSTYPE,SIZE,FSAVAIL,MOUNTPOINT
|
add_flags lsblk -o NAME,LABEL,TYPE,FSTYPE,SIZE,FSAVAIL,MOUNTPOINTS
|
||||||
add_flags feh --start-at
|
add_flags feh --start-at
|
||||||
# Use multiple jobs when making
|
# Use multiple jobs when making
|
||||||
add_flags make -j
|
add_flags make -j
|
||||||
|
|||||||
@@ -248,11 +248,15 @@ bindkey '^[[1;5A' fzf-history-widget
|
|||||||
bindkey -M vicmd '^K' fzf-history-widget
|
bindkey -M vicmd '^K' fzf-history-widget
|
||||||
|
|
||||||
# Fuzzy finder bindings:
|
# Fuzzy finder bindings:
|
||||||
# ^T fzf-file-widget
|
#
|
||||||
# \ec (Alt-C) fzf-cd-widget
|
# - ^T fzf-file-widget
|
||||||
# ^R fzf-history-widget
|
# - \ec (Alt-C) fzf-cd-widget
|
||||||
# TODO: ^R should insert the history line in BUFFER to differ from ctrl-up
|
# - ^R fzf-history-widget
|
||||||
|
#
|
||||||
|
# are sourced via 90-external-plugins/50-fzf.key-bindings.zsh, but see also
|
||||||
|
# 55-fzf.key-bindings.config.zsh
|
||||||
|
|
||||||
|
# Discard stderr (i.e. permission denied)
|
||||||
FZF_CTRL_T_COMMAND="${FZF_DEFAULT_COMMAND} 2>/dev/null"
|
FZF_CTRL_T_COMMAND="${FZF_DEFAULT_COMMAND} 2>/dev/null"
|
||||||
|
|
||||||
# See .zprofile for FZF_ALT_C_COMMAND
|
# TODO: ^R should insert the history line in BUFFER to differ from ctrl-up
|
||||||
comp-source "$ZDOTDIR/plugins/fzf/shell/key-bindings.zsh"
|
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
# Overwrite fzf's Alt-C binding to be "in-prompt"
|
||||||
|
|
||||||
|
# Modified version of
|
||||||
|
# https://github.com/junegunn/fzf/blame/f864f8b5f7ab/shell/key-bindings.zsh#L81-L99
|
||||||
|
# that changes the directory "in-prompt", meaning that the `cd` command is
|
||||||
|
# executed in the background with a prompt redraw instead of via `$BUFFER` and
|
||||||
|
# `accept-line`. This behavior is inspired by cd-{forward,backward} written by
|
||||||
|
# romkatv (see keys.zsh).
|
||||||
|
fzf-cd-inprompt-widget() {
|
||||||
|
setopt localoptions pipefail no_aliases 2>/dev/null
|
||||||
|
local dir="$(
|
||||||
|
FZF_DEFAULT_COMMAND=${FZF_ALT_C_COMMAND:-} \
|
||||||
|
FZF_DEFAULT_OPTS=$(__fzf_defaults "--reverse --walker=dir,follow,hidden --scheme=path" "${FZF_ALT_C_OPTS-} +m") \
|
||||||
|
FZF_DEFAULT_OPTS_FILE='' $(__fzfcmd) < /dev/tty)"
|
||||||
|
if [[ -z "$dir" ]]; then
|
||||||
|
zle redisplay
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
# --- modifications start here ---
|
||||||
|
pushd -q "$dir"
|
||||||
|
redraw-prompt
|
||||||
|
}
|
||||||
|
zle -N fzf-cd-inprompt-widget
|
||||||
|
bindkey -M vicmd '\ec' fzf-cd-inprompt-widget
|
||||||
|
bindkey -M viins '\ec' fzf-cd-inprompt-widget
|
||||||
Reference in New Issue
Block a user