Skip to content

Commit

Permalink
feat(configs): new keymap <C-n> & <C-p> to navigate when fuzzy-find
Browse files Browse the repository at this point in the history
  • Loading branch information
bekaboo committed Jan 24, 2024
1 parent d7716cd commit ffa36d8
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 74 deletions.
54 changes: 17 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -644,27 +644,17 @@ vim.ui.select = require('dropbar.utils.menu').select
end
menu:update_hover_hl({ mouse.line, mouse.column - 1 })
end,
['<Esc>'] = function()
api.fuzzy_find_toggle()
end,
['<Enter>'] = function()
api.fuzzy_find_click()
end,
['<Up>'] = api.fuzzy_find_prev,
['<Down>'] = api.fuzzy_find_next,
['<C-k>'] = api.fuzzy_find_prev,
['<C-j>'] = api.fuzzy_find_next,
['<C-p>'] = api.fuzzy_find_prev,
['<C-n>'] = api.fuzzy_find_next,
['<Esc>'] = api.fuzzy_find_toggle,
['<Enter>'] = api.fuzzy_find_click,
['<S-Enter>'] = function()
api.fuzzy_find_click(-1)
end,
['<Up>'] = function()
api.fuzzy_find_navigate('up')
end,
['<Down>'] = function()
api.fuzzy_find_navigate('down')
end,
['<C-k>'] = function()
api.fuzzy_find_navigate('up')
end,
['<C-j>'] = function()
api.fuzzy_find_navigate('down')
end,
},
win_configs = {},
prompt = '%#htmlTag# ',
Expand Down Expand Up @@ -1292,26 +1282,16 @@ appearance of the fuzzy finder interface.
end
menu:update_hover_hl({ mouse.line, mouse.column - 1 })
end,
['<Esc>'] = function()
require('dropbar.api').fuzzy_find_toggle()
end,
['<Enter>'] = function()
require('dropbar.api').fuzzy_find_click()
end,
['<Up>'] = api.fuzzy_find_prev,
['<Down>'] = api.fuzzy_find_next,
['<C-k>'] = api.fuzzy_find_prev,
['<C-j>'] = api.fuzzy_find_next,
['<C-p>'] = api.fuzzy_find_prev,
['<C-n>'] = api.fuzzy_find_next,
['<Esc>'] = api.fuzzy_find_toggle,
['<Enter>'] = api.fuzzy_find_click,
['<S-Enter>'] = function()
require('dropbar.api').fuzzy_find_click(-1)
end,
['<Up>'] = function()
require('dropbar.api').fuzzy_find_navigate('up')
end,
['<Down>'] = function()
require('dropbar.api').fuzzy_find_navigate('down')
end,
['<C-k>'] = function()
require('dropbar.api').fuzzy_find_navigate('up')
end,
['<C-j>'] = function()
require('dropbar.api').fuzzy_find_navigate('down')
api.fuzzy_find_click(-1)
end,
}
```
Expand Down
28 changes: 9 additions & 19 deletions doc/dropbar.txt
Original file line number Diff line number Diff line change
Expand Up @@ -700,26 +700,16 @@ appearance of the fuzzy finder interface.
end
menu:update_hover_hl({ mouse.line, mouse.column - 1 })
end,
['<Esc>'] = function()
require('dropbar.api').fuzzy_find_toggle()
end,
['<Enter>'] = function()
require('dropbar.api').fuzzy_find_click()
end,
['<Up>'] = api.fuzzy_find_prev,
['<Down>'] = api.fuzzy_find_next,
['<C-k>'] = api.fuzzy_find_prev,
['<C-j>'] = api.fuzzy_find_next,
['<C-p>'] = api.fuzzy_find_prev,
['<C-n>'] = api.fuzzy_find_next,
['<Esc>'] = api.fuzzy_find_toggle,
['<Enter>'] = api.fuzzy_find_click,
['<S-Enter>'] = function()
require('dropbar.api').fuzzy_find_click(-1)
end,
['<Up>'] = function()
require('dropbar.api').fuzzy_find_navigate('up')
end,
['<Down>'] = function()
require('dropbar.api').fuzzy_find_navigate('down')
end,
['<C-k>'] = function()
require('dropbar.api').fuzzy_find_navigate('up')
end,
['<C-j>'] = function()
require('dropbar.api').fuzzy_find_navigate('down')
api.fuzzy_find_click(-1)
end,
}
<
Expand Down
26 changes: 8 additions & 18 deletions lua/dropbar/configs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -398,27 +398,17 @@ M.opts = {
end
menu:update_hover_hl({ mouse.line, mouse.column - 1 })
end,
['<Esc>'] = function()
api.fuzzy_find_toggle()
end,
['<Enter>'] = function()
api.fuzzy_find_click()
end,
['<Up>'] = api.fuzzy_find_prev,
['<Down>'] = api.fuzzy_find_next,
['<C-k>'] = api.fuzzy_find_prev,
['<C-j>'] = api.fuzzy_find_next,
['<C-p>'] = api.fuzzy_find_prev,
['<C-n>'] = api.fuzzy_find_next,
['<Esc>'] = api.fuzzy_find_toggle,
['<Enter>'] = api.fuzzy_find_click,
['<S-Enter>'] = function()
api.fuzzy_find_click(-1)
end,
['<Up>'] = function()
api.fuzzy_find_navigate('up')
end,
['<Down>'] = function()
api.fuzzy_find_navigate('down')
end,
['<C-k>'] = function()
api.fuzzy_find_navigate('up')
end,
['<C-j>'] = function()
api.fuzzy_find_navigate('down')
end,
},
win_configs = {},
prompt = '%#htmlTag# ',
Expand Down

0 comments on commit ffa36d8

Please sign in to comment.