-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Go to currently opened buffer #39
Comments
As a sidenote: Another way to implement this would be to not add a new keybind, but instead make Enter respect whatever |
Just added that feature to my refactored branch: https://github.com/jeff-dh/expJABS.nvim Exactly how you described it. Hit 'g' and it'll take you to a(!) window that has the file open (I assume it's always the window with the lowest window id). I decided to take that optoins, because I often want to open a file a second time in a second window and that would not be possible if we would "overload" This is really just straight forward implemented without reasoning about it, I'll think about it for a little while, maybe I'll have some more ideas about it (sorting open buffers first?, Notice: that branch is an experimental refactored fork of JABS. It should be backwards compatible and seems to work but is only tested in a nut shell and has no documentation yet, therefor some nice new features (sorting buffers, restoring deleted buffers, help popup,... ;) If you're having any issues (including issues not related to this issue) let me now!. PS: |
I did some minor improvements and I think that's now what you want. By default the With the following config you should get exactly what you want I guess: -- uninstall regular jabs and install expJABS
-- use 'matbme/JABS.nvim'
use {'jeff-dh/expJABS.nvim', branch = 'expJABS'}
--config
require('jabs').setup{
sort_mru = true, -- if you don't like sorting by most recently used disable it
position = {'right', 'bottom'},
keymap = {
jump = '<S-CR>',
switch_to = '<CR>',
},
-- you might need to adjust the highlighting, see JABS docs for default values
} With that config |
@jeff-dh Yep, that's exactly what I wanted! Thanks a lot man! |
As an example, in the setup below, I have a couple of buffers opened:
init.vim
,mappings.lua
(in the second tab),plugins_portable.lua
, andplugins_complete.lua
(in the first tab).init.vim
is currently focused.If I press Enter in
mappings.lua
, it'll open it in the current window, overridinginit.vim
. Same for any other buffer. It'll open the buffer in the current window focused (which happens to beinit.vim
).My feature request, is that I could press a key (perhaps g), and I could go to that buffer's window if it's already opened. In the example above, pressing g on
mapping.lua
would jump to the second window, as it's already opened there. Pressing g onplugins_portable.lua
would jump to the first tab, first window (where it's currently opened), etc.This would make navigating between currently opened buffers very convenient.
The text was updated successfully, but these errors were encountered: