The buffers user-mode provides the a key mapping to switch to an alternate buffer, but it is currently just a pass-through to ga.
This PR adds a configurable option for setting a custom command for switching to an alternate buffer. The intended use case is to provide a command to switch to a test or spec file as the alternate file, if one exists, rather than the previous buffer.
While looking through the filetype scripts bundled with Kakoune I noticed that more than one filetype script provides an alternate file command along with an 'alt' alias. I think it would be a good idea to simply attempt the 'alt' command alias as a default for the 'a' mapping, with ga as a fallback because it would Just Work for certain file types without changing the behavior for others. However, I went the route of leaving the default behavior unchanged and up to the user, while suggesting this in the README instead.
The
buffers
user-mode provides thea
key mapping to switch to an alternate buffer, but it is currently just a pass-through toga
.This PR adds a configurable option for setting a custom command for switching to an alternate buffer. The intended use case is to provide a command to switch to a test or spec file as the alternate file, if one exists, rather than the previous buffer.
While looking through the filetype scripts bundled with Kakoune I noticed that more than one filetype script provides an alternate file command along with an 'alt' alias. I think it would be a good idea to simply attempt the 'alt' command alias as a default for the 'a' mapping, with
ga
as a fallback because it would Just Work for certain file types without changing the behavior for others. However, I went the route of leaving the default behavior unchanged and up to the user, while suggesting this in the README instead.