mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-05 18:30:13 +00:00
bind fzf shortcuts to fish commandline
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
function edit --description "Open a file in Vim"
|
||||
set vimfile (fzf)
|
||||
and vim $vimfile
|
||||
and set vimfile (echo $vimfile | tr -d '\r')
|
||||
and commandline -r "vim $vimfile"
|
||||
and commandline -f execute
|
||||
end
|
||||
|
||||
|
6
fish.configlink/functions/fish_user_key_bindings.fish
Normal file
6
fish.configlink/functions/fish_user_key_bindings.fish
Normal file
@ -0,0 +1,6 @@
|
||||
#!/usr/local/bin/fish
|
||||
|
||||
function fish_user_key_bindings
|
||||
bind -M insert \co 'edit'
|
||||
bind -M insert \ce 'recent'
|
||||
end
|
@ -1,4 +1,6 @@
|
||||
function recent --description "Open a recent file in Vim"
|
||||
set vimfile (fd --exec stat -f "%m%t%N" | sort -nr | cut -f2 | fzf)
|
||||
and vim $vimfile
|
||||
set vimfile (fd -t f --exec stat -f "%m%t%N" | sort -nr | cut -f2 | fzf)
|
||||
and set vimfile (echo $vimfile | tr -d '\r')
|
||||
and commandline -r "vim $vimfile"
|
||||
and commandline -f execute
|
||||
end
|
||||
|
Reference in New Issue
Block a user