Skip to content

Instantly share code, notes, and snippets.

@danr
Last active February 13, 2017 13:14
Show Gist options
  • Save danr/e69a55129a3fd27f1f098d4e167afccd to your computer and use it in GitHub Desktop.
Save danr/e69a55129a3fd27f1f098d4e167afccd to your computer and use it in GitHub Desktop.
simple Kakoune buffer changer
# Buffers (by danr 2017, public domain)
map global normal <a-,> :bp<ret>:bufinfo<ret>
map global normal <a-.> :bn<ret>:bufinfo<ret>
map global normal <a--> ga:bufinfo<ret>
map global normal <a-d> :db<ret>:bufinfo<ret>
map global normal <a-q> :db!<ret>:bufinfo<ret>
def bufinfo %{
%sh{
echo -n info -- %^
(while read -d : buf; do
if [[ "$buf" == "$kak_bufname" ]]; then
echo "> $buf <"
else
echo " $buf "
fi
done) <<< "$kak_buflist"
echo ^
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment