diff --git a/alacritty.configlink/alacritty.yml b/alacritty.configlink/alacritty.yml index bccf316..ef004f6 100644 --- a/alacritty.configlink/alacritty.yml +++ b/alacritty.configlink/alacritty.yml @@ -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" } diff --git a/fish.configlink/functions/abbrs.fish b/fish.configlink/functions/abbrs.fish index e06d4a1..cd7ca94 100644 --- a/fish.configlink/functions/abbrs.fish +++ b/fish.configlink/functions/abbrs.fish @@ -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' diff --git a/fish.configlink/functions/commandline-git-commits.fish b/fish.configlink/functions/commandline-git-commits.fish new file mode 100644 index 0000000..e579742 --- /dev/null +++ b/fish.configlink/functions/commandline-git-commits.fish @@ -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 diff --git a/fish.configlink/functions/fish_user_key_bindings.fish b/fish.configlink/functions/fish_user_key_bindings.fish index ec73bc2..178199b 100644 --- a/fish.configlink/functions/fish_user_key_bindings.fish +++ b/fish.configlink/functions/fish_user_key_bindings.fish @@ -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 diff --git a/fish.configlink/functions/git-show-fuzzy.fish b/fish.configlink/functions/git-show-fuzzy.fish index 619d6cf..0e6cbaa 100644 --- a/fish.configlink/functions/git-show-fuzzy.fish +++ b/fish.configlink/functions/git-show-fuzzy.fish @@ -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 diff --git a/fish.configlink/functions/vim.fish b/fish.configlink/functions/vim.fish new file mode 100644 index 0000000..b567dfb --- /dev/null +++ b/fish.configlink/functions/vim.fish @@ -0,0 +1,4 @@ +# Defined via `source` +function vim --wraps=nvim --description 'alias vim=nvim' + nvim $argv; +end