.github | ||
rc | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
LICENSE | ||
README.md |
fzf.kak
fzf.kak is a plugin for Kakoune editor, that brings integration with fzf tool. This plugin is being tested against Kakoune 2018.09.04.
Dependencies
Tool | Information |
---|---|
tmux | This plugin depends on fzf-tmux script. |
X11 | Script works with X11 via termcmd option. |
GNU Screen | GNU Screen is not yet supported. |
Installation
Recommended way to install is to use plug.kak plugin
manager. You can install fzf.kak by adding this to your kakrc
:
plug andreyorst/fzf.kak
Then reload Kakoune config or restart Kakoune and run :plug-install
.
Or install this plugin any other preferred way.
Usage
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:
- b - Select buffer
- c - Switch servers working directory
- f - Search for file and open it
- v - Edit file in version control system tree
- V - Explicitly select which vcs command to run
- s - Search over buffer contents and jump to result line
- t - Browse ctags tags
You can set your own mapping to invoke fzf-mode
:
map global normal <c-p> ': fzf-mode<ret>'
# 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
Files
You can configure what command to use to search for files, and it's arguments. Supported tools are GNU Find, The Silver Searcher, ripgrep, fd. GNU find is used by default, but you can switch to another one. There are some default values for those, so you can go:
set-option global fzf_file_command 'rg' # 'ag', 'fd' 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:
set-option global fzf_file_command "find . \( -path '*/.svn*' -o -path '*/.git*' \) -prune -o -type f -print"
The same pattern applies for other commands, except buffer
, and cd
.
VCS
This script supports these version control systems: Git, Subversion, GNU Bazaar, Mercurial.
By default v mapping from fzf mode
will detect your version control system and open fzf for you.
If you wish to explicitly use some particular vcs command, you can use V
mapping, which includes
all supported vcs shortcuts.
You also able to set parameters to vcs command to use to provide project files. Supported options:
fzf_git_command
fzf_svn_command
fzf_bzr_command
fzf_hg_command
Other VCS are not supported officially. Open a feature request if you want some unsupported VCS to be included. You also can change one of options to contain your vcs command, and use this command explicitly from vcs submode.
ctags
It is also possible to add parameters to ctags search executable. like sort -u
and others:
set-option global fzf_tag_command 'readtags -l | cut -f1 | sort -u | ... '
Preview
You can turn on the preview window in fzf window by setting fzf_preview
option to true
:
set-option global fzf_preview true
You also can specify which highlighter to use within the preview window with fzf_highlighter
option.
Supported tools are:
- Rouge
- Highlight
- Coderay