From a96a8a05ef0d450e48448c56b7e6a9d5b007a349 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Sat, 22 Sep 2018 20:25:20 +0300 Subject: [PATCH] Rework readme --- README.md | 43 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index ce8b022..6f72c43 100644 --- a/README.md +++ b/README.md @@ -12,18 +12,13 @@ manager, add this to your `.kakrc`: plug andreyorst/fzf.kak ``` -Reload Kakoune and run `:plug-install`. Next time you launch Kakoune plugin will -be loaded automatically. +Reload Kakoune config by and run `:plug-install`. Or install this plugin any other preferred way. ## Usage -This plugin brings new command: `:fzf-mode` that is better should be mapped to -some mapping. **fzf.kak** doesn't provide any mapping by default so user may -configure it along with user's preference. For example: - -```kak -map global normal ':fzf-mode' -``` +**fzf.kak** doesn't provide any mapping by default. Instead there's now a `fzf-mode` command +which intentionally was made to simplify user mappings. +Each fzf command has mnemonic mapping, like `f` for opening files, `t` for tags and so on. In this mode new mappings are available: - f - Search for file and open it @@ -31,9 +26,36 @@ In this mode new mappings are available: - t - Browse ctags tags - g - Edit file in Git tree +You can set your own mapping to invoke `fzf-mode`: + +``` +map global normal ': fzf-mode' +# note that the space after colon is intentional to suppess fzf-mode to show in command history +``` + So for example pressing Ctrl+pf will open fzf at the bottom of the Kakoune buffer, showing you all possible files. +### Settings +You can configure what command to use to search for files, and it's arguments. +Supported tools are [GNU Find](https://www.gnu.org/software/findutils/), [The Silver Searcher](https://github.com/ggreer/the_silver_searcher), [ripgrep](https://github.com/BurntSushi/ripgrep). GNU find is used by default, but you can switch to another one. There are some default values for those, so you can go: + +```kak +set-option global fzf_file_command 'rg' # 'ag' or 'find' +``` + +Or if you don't like default file arguments, which are `find -type f`, and would like to disable searching in, say `.git` directories you can set it like so: + +```kak +set-option global fzf_file_command "find . \( -path '*/.svn*' -o -path '*/.git*' \) -prune -o -type f -print" +``` + +Also fzf.kak supports setting different path to your `tmp` folder so you can use it an any system, or with different path: + +```kak +set-option global fzf_tmp //path/to/tmp' +``` + ## Some demonstration gifs: ### Opening files: ![files](https://user-images.githubusercontent.com/19470159/45917778-3988e200-be85-11e8-890d-b180d013b99e.gif) @@ -49,3 +71,6 @@ bottom of the Kakoune buffer, showing you all possible files. ### Changing directories ![dirs](https://user-images.githubusercontent.com/19470159/45917776-3988e200-be85-11e8-89bf-7c1453806c83.gif) + +## Special thanks +Original script, that current implementation is based on, was implemented by [topisani](https://github.com/topisani). If you are here, thank you for your work, it is awesome!