mirror of
https://github.com/nmasur/dotfiles
synced 2024-12-24 17:44:52 +00:00
git fuzzy binding
This commit is contained in:
parent
0bd93f7aa3
commit
96dcac70d8
@ -597,6 +597,7 @@ key_bindings:
|
||||
- { key: D, mods: Super, chars: "\x14" } # CMD-D sends CTRL-T for fzf
|
||||
- { key: O, mods: Super, chars: "\x0f" } # CMD-O sends CTRL-O for fish/vim
|
||||
- { key: R, mods: Super, chars: "\x05" } # CMD-R sends CTRL-E for fish/vim
|
||||
- { key: G, mods: Super, chars: "\x07" } # CMD-G sends CTRL-G for fish/vim
|
||||
|
||||
- { key: Return, mods: Shift, chars: "\x1b[13;2u" }
|
||||
- { key: Return, mods: Control, chars: "\x1b[13;5u" }
|
||||
|
@ -50,7 +50,7 @@ function abbrs --description 'All abbreviations'
|
||||
|
||||
# Vim
|
||||
if command -v nvim > /dev/null
|
||||
alias vim='nvim'
|
||||
alias --save vim='nvim'
|
||||
abbr -a vimrc 'vim $HOME/.config/nvim/init.vim'
|
||||
else
|
||||
abbr -a vimrc 'vim $HOME/.vimrc'
|
||||
|
10
fish.configlink/functions/commandline-git-commits.fish
Normal file
10
fish.configlink/functions/commandline-git-commits.fish
Normal file
@ -0,0 +1,10 @@
|
||||
#!/usr/local/bin/fish
|
||||
|
||||
function commandline-git-commits
|
||||
set commit (git-commits)
|
||||
if [ $commit ]
|
||||
commandline -i "$commit"
|
||||
else
|
||||
commandline -i "HEAD"
|
||||
end
|
||||
end
|
@ -3,4 +3,5 @@
|
||||
function fish_user_key_bindings
|
||||
bind -M insert \co 'edit'
|
||||
bind -M insert \ce 'recent'
|
||||
bind -M insert \cg 'commandline-git-commits'
|
||||
end
|
||||
|
@ -1,4 +1,8 @@
|
||||
function git-show-fuzzy
|
||||
set commit (git log --pretty=oneline | fzf | cut -d' ' -f1)
|
||||
set commitline (git log \
|
||||
--pretty="format:%C(auto)%ar %h%d %s" \
|
||||
| fzf \
|
||||
)
|
||||
and set commit (echo $commitline | cut -d" " -f4 )
|
||||
and git show $commit
|
||||
end
|
||||
|
4
fish.configlink/functions/vim.fish
Normal file
4
fish.configlink/functions/vim.fish
Normal file
@ -0,0 +1,4 @@
|
||||
# Defined via `source`
|
||||
function vim --wraps=nvim --description 'alias vim=nvim'
|
||||
nvim $argv;
|
||||
end
|
Loading…
Reference in New Issue
Block a user