Skip to content

Commit

Permalink
write "key binding" as an open compound word
Browse files Browse the repository at this point in the history
Key binding, rather than keybinding, is the proper and most common way to write it, so I renamed most references. However, I didn't change the variable fzf_fish_custom_keybindings to avoid backwards incompatibility.
  • Loading branch information
PatrickF1 committed Aug 15, 2020
1 parent 29e12f8 commit 905536a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
fzf.fish
</h1>

A plugin that integrates [fzf](https://github.com/junegunn/fzf) into your [fish](http://fishshell.com) workflow. Comes with handy functions&mdash;each with its own mnemonic keybinding&mdash;that use fzf to
A plugin that integrates [fzf](https://github.com/junegunn/fzf) into your [fish](http://fishshell.com) workflow. Comes with handy functions&mdash;each with its own mnemonic key binding&mdash;that use fzf to

> Search for a **file or folder** in the current directory - `Ctrl+f` (f for file)
Expand Down Expand Up @@ -38,12 +38,12 @@ In addition to this plugin, you will also need to install
If you are on Mac, I recommend installing these two CLI tools using [brew](https://brew.sh/).

## Configuration
### Using custom keybindings
Each function is assigned mnemonic keybindings by default (see screenshots above) in [conf.d/fzf.fish](conf.d/fzf.fish). However, if you would like to customize them, you can prevent the default keybindings from executing by setting `fzf_fish_custom_keybindings` as a [universal variable](https://fishshell.com/docs/current/#more-on-universal-variables). You can do this by running
### Using custom key bindings
Each function is assigned mnemonic key bindings by default (see screenshots above) in [conf.d/fzf.fish](conf.d/fzf.fish). However, if you would like to customize them, you can prevent the default key bindings from executing by setting `fzf_fish_custom_key bindings` as a [universal variable](https://fishshell.com/docs/current/#more-on-universal-variables). You can do this by running
```fish
set --universal fzf_fish_custom_keybindings
set --universal fzf_fish_custom_key bindings
```
Do not try to set `fzf_fish_custom_keybindings` in your `config.fish` because `conf.d/fzf.fish` is sourced first on shell startup and so will not see it. Once it is set, you can set up your own keybindings.
Do not try to set `fzf_fish_custom_key bindings` in your `config.fish` because `conf.d/fzf.fish` is sourced first on shell startup and so will not see it. Once it is set, you can set up your own key bindings.

### Fzf default options
fzf supports setting default options via the [FZF_DEFAULT_OPTS](https://github.com/junegunn/fzf#environment-variables) environment variable. If it is set, fzf will implicitly prepend its value to the options passed in on every execution, scripted or interactive.
Expand Down Expand Up @@ -85,7 +85,7 @@ Fzf optionally comes with its [own fish extension](https://github.com/junegunn/f
- is easier to read, maintain, and contribute to
- includes timestamps when searching command history
- colorizes files when searching for files
- has configurable keybindings
- has configurable key bindings
- [autoloads](https://fishshell.com/docs/current/tutorial.html#autoloading-functions) its functions for faster shell startup
- will likely be more frequently updated

4 changes: 2 additions & 2 deletions conf.d/fzf.fish
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Set up the default, mnemonic keybindings unless the user has chosen to customize them
# Set up the default, mnemonic key bindings unless the user has chosen to customize them
if not set --query fzf_fish_custom_keybindings
# \cf is Ctrl+f
bind \cf '__fzf_search_current_dir'
Expand All @@ -8,7 +8,7 @@ if not set --query fzf_fish_custom_keybindings
# 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
# set up the same key bindings 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 \cr '__fzf_search_history'
Expand Down

0 comments on commit 905536a

Please sign in to comment.