Delapouite / kakoune-buffers

Ease navigation between opened buffers
http://kakoune.org
67 stars 8 forks source link

Add interactive buffer pick mode #14

Closed Crote closed 5 years ago

Crote commented 5 years ago

This adds a command which enables interactive buffer selection, by dynamically creating a user mode from the buffer info.

The reason for adding this is that I sometimes do :info-buffers, but when I enter the command to switch to the buffer I want, I'll have forgotten which buffer I actually wanted to switch to. In the buffer pick mode, one can directly switch to a buffer while the information is still displayed on the screen.

Some notes:

caksoylar commented 4 years ago

I ran into issues trying to use this function today. Looks like my sh does not like the ${keys:$index:1} syntax, this is what I get in the debug buffer after calling pick-buffers:

shell stderr: <<<
sh: 16: Bad substitution
>>>

Indeed when I try doing something similar in sh, I get the same error:

$ sh -c 'keys=abcd; index=0; echo ${keys:$index:1}'
sh: 1: Bad substitution

It works fine with bash. My sh maps to /bin/dash in Ubuntu 18.04.