-
Notifications
You must be signed in to change notification settings - Fork 721
Fuzzy finder
Alex Leferry 2 edited this page Feb 3, 2017
·
27 revisions
def find -params 1 -shell-candidates %{ find -type f } %{ edit %arg{1} }
def git-edit -params 1 -shell-candidates %{ git ls-files } %{ edit %arg{1} }
fzf is a basic fuzzy finder tool used to interactively filter large lists of data in a shell.
In the following snippets, a tmux pane is opened with fzf ready to filter a list of files and a list of current buffers.
Other kakoune lists could be filtered this way, taking fzf.vim as inspiration.
def -docstring 'invoke fzf to open a file' \
fzf-file %{ %sh{
if [ -z "$TMUX" ]; then
echo echo only works inside tmux
else
FILE=`fzf-tmux -d 15`
if [ -n "$FILE" ]; then
echo "eval -client '$kak_client' 'edit ${FILE}'" | kak -p ${kak_session}
fi
fi
}}
def -docstring 'invoke fzf to select a buffer' \
fzf-buffer %{ %sh{
if [ -z "$TMUX" ]; then
echo echo only works inside tmux
else
BUFFER=`echo ${kak_buflist} | tr : '\n' | fzf-tmux -d 15`
if [ -n "$BUFFER" ]; then
echo "eval -client '$kak_client' 'buffer ${BUFFER}'" | kak -p ${kak_session}
fi
fi
}}
Fast file finder: fasd integration
Add function k () kak `fasd -f $1`
to your .zshrc to open frecent files with k filename
- Normal mode commands
- Avoid the escape key
- Implementing user mode (Leader key)
- Kakoune explain
- Kakoune TV