Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Alt as modifier key to git log search key binding #17

Merged
merged 6 commits into from
Aug 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A plugin that integrates [fzf](https://github.com/junegunn/fzf) into your [fish]

![file search](/images/file_search.png)

> Search for a **commit** in the current git repository's log - `Ctrl+l` (l for log)
> Search for a **commit** in the current git repository's log - `Ctrl+Alt+l` (l for log, Alt to prevent overriding clear screen)

![git log search](/images/git_log_search.png)

Expand Down
8 changes: 5 additions & 3 deletions conf.d/fzf.fish
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# Set up the default, mnemonic keybindings unless the user has chosen to customize them
if not set --query fzf_fish_custom_keybindings
# \cf is ctrl+f, etc.
# \cf is Ctrl+f
bind \cf '__fzf_search_current_dir'
bind \cl '__fzf_search_git_log'
bind \cr '__fzf_search_history'
bind \cv '__fzf_search_shell_variables'
# __fzf_search_git_log's keybinding has Alt as an additional modifier key to avoid conflict with
# clear screen (Ctrl+l) and __fish_list_current_token (Alt+l)
bind \e\cl '__fzf_search_git_log'

# set up the same keybindings for insert mode if using fish_vi_key_bindings
if [ $fish_key_bindings = 'fish_vi_key_bindings' ]
bind --mode insert \cf '__fzf_search_current_dir'
bind --mode insert \cl '__fzf_search_git_log'
bind --mode insert \cr '__fzf_search_history'
bind --mode insert \cv '__fzf_search_shell_variables'
bind --mode insert \e\cl '__fzf_search_git_log'
end
end

Expand Down
2 changes: 1 addition & 1 deletion functions/uninstall.fish
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env fish
if not set --query fzf_fish_custom_keybindings
bind --erase --all \cf
bind --erase --all \cl
bind --erase --all \cr
bind --erase --all \cv
bind --erase --all \c\el

set_color --italics cyan
echo "fzf.fish key kindings removed"
Expand Down