mirror of
https://github.com/ThePrimeagen/harpoon.git
synced 2025-07-14 01:50:27 +00:00
Merge pull request #100 from mikatpt/quit-bindings
Add convenience bindings for exiting quick menu
This commit is contained in:
commit
7bf7929a15
@ -78,6 +78,8 @@ You can simply edit this list as if it were a document in vim. `:wq` to save
|
|||||||
the new edits or `:q` to ignore the edits. There is to save upon call to
|
the new edits or `:q` to ignore the edits. There is to save upon call to
|
||||||
toggle if you prefer that way.
|
toggle if you prefer that way.
|
||||||
|
|
||||||
|
You can also exit the list with `q` or `<ESC>`, which will call `toggle_quick_menu()` again.
|
||||||
|
|
||||||
### Terminal Navigation
|
### Terminal Navigation
|
||||||
#### Motivation for terminals in neovim
|
#### Motivation for terminals in neovim
|
||||||
I want to use the terminal since I can gF and <c-w>gF to any errors arising
|
I want to use the terminal since I can gF and <c-w>gF to any errors arising
|
||||||
|
@ -78,7 +78,7 @@ M.sendCommand = function(idx, cmd, ...)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if global_config.enter_on_sendcmd then
|
if global_config.enter_on_sendcmd then
|
||||||
cmd = cmd .. "\n"
|
cmd = cmd .. "\n"
|
||||||
end
|
end
|
||||||
|
|
||||||
if cmd then
|
if cmd then
|
||||||
|
@ -99,6 +99,20 @@ M.toggle_quick_menu = function()
|
|||||||
vim.api.nvim_buf_set_option(Harpoon_bufh, "filetype", "harpoon")
|
vim.api.nvim_buf_set_option(Harpoon_bufh, "filetype", "harpoon")
|
||||||
vim.api.nvim_buf_set_option(Harpoon_bufh, "buftype", "acwrite")
|
vim.api.nvim_buf_set_option(Harpoon_bufh, "buftype", "acwrite")
|
||||||
vim.api.nvim_buf_set_option(Harpoon_bufh, "bufhidden", "delete")
|
vim.api.nvim_buf_set_option(Harpoon_bufh, "bufhidden", "delete")
|
||||||
|
vim.api.nvim_buf_set_keymap(
|
||||||
|
Harpoon_bufh,
|
||||||
|
"n",
|
||||||
|
"q",
|
||||||
|
":lua require('harpoon.ui').toggle_quick_menu()<CR>",
|
||||||
|
{ silent = true }
|
||||||
|
)
|
||||||
|
vim.api.nvim_buf_set_keymap(
|
||||||
|
Harpoon_bufh,
|
||||||
|
"n",
|
||||||
|
"<ESC>",
|
||||||
|
":lua require('harpoon.ui').toggle_quick_menu()<CR>",
|
||||||
|
{ silent = true }
|
||||||
|
)
|
||||||
vim.api.nvim_buf_set_keymap(
|
vim.api.nvim_buf_set_keymap(
|
||||||
Harpoon_bufh,
|
Harpoon_bufh,
|
||||||
"n",
|
"n",
|
||||||
@ -126,6 +140,9 @@ M.toggle_quick_menu = function()
|
|||||||
Harpoon_bufh
|
Harpoon_bufh
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
vim.cmd(
|
||||||
|
"autocmd BufLeave <buffer> ++nested ++once :silent lua require('harpoon.ui').toggle_quick_menu()"
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
M.select_menu_item = function()
|
M.select_menu_item = function()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user