1
0
Fork 0
Go to file
2018-09-25 16:34:46 +03:00
.github Create PULL_REQUEST_TEMPLATE.md 2018-09-22 20:53:19 +03:00
rc when using git show additional info 2018-09-25 16:34:46 +03:00
CODE_OF_CONDUCT.md Add some sort of contribution rules... 2018-09-22 22:59:14 +03:00
CONTRIBUTING.md Update CONTRIBUTING.md 2018-09-24 14:43:35 +03:00
LICENSE Initial commit 2018-09-22 13:59:28 +03:00
README.md fix copy errors 2018-09-24 17:45:51 +03:00

fzf.kak

GitHub release GitHub Release Date Github commits (since latest release) license

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:

  • f - Search for file and open it
  • b - Select buffer
  • t - Browse ctags tags
  • g - Edit file in Git tree

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. 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' 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.

Git

You also able to set what git command to use to provide git-tree. These are default argumens:

set-option global fzf_git_command 'git ls-tree --name-only -r HEAD' 

Other VCS are not supported officially, but might work.

ctags

It is also possible to add parametees to ctags search executable:

set-option global fzf_tag_command 'readtags -l | cut -f1 | sort -u | ... ' 

Misc

fzf.kak relies on tmp folder to work with all possible environments, however not every system features the same path to tmp. You can set different path to your or to any other directory with:

set-option global fzf_tmp //path/to/tmp'

Some demonstration gifs:

Opening files:

files

Searching tags with universal-ctags

ctags

Browsing Git tree files

git

Switching buffers

buffers

Changing directories

dirs

Special thanks

Original script, that current implementation is based on, was implemented by topisani. If you are here, thank you for your work, it is awesome!