Skip to content

Instantly share code, notes, and snippets.

@ddrscott
Last active May 18, 2017 22:35
Show Gist options
  • Save ddrscott/1b3a1ff5dfbaef5ca8676927bb834312 to your computer and use it in GitHub Desktop.
Save ddrscott/1b3a1ff5dfbaef5ca8676927bb834312 to your computer and use it in GitHub Desktop.
`v<Space>` zsh binding as a shortcut for `vim <CTRL-T>some_file_name<Enter>`
#!/bin/zsh
v-space-widget(){
zle self-insert;
if [[ $LBUFFER == 'v ' ]]; then
zle fzf-file-widget && zle accept-line
fi
}
zle -N v-space-widget
bindkey ' ' v-space-widget
alias v='vim'
@ddrscott
Copy link
Author

ddrscott commented May 18, 2017

Demo:
v-space-demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment