mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-23 17:49:57 +08:00
feat(todo): add enter key binding
This commit is contained in:
parent
fb679af13e
commit
e8fde994f2
@ -72,10 +72,11 @@ end
|
|||||||
-- }}}
|
-- }}}
|
||||||
local function open_todo() -- {{{
|
local function open_todo() -- {{{
|
||||||
local t = todos[vim.fn.line('.')]
|
local t = todos[vim.fn.line('.')]
|
||||||
close_todo_win()
|
vim.cmd('close')
|
||||||
|
vim.cmd(winnr .. 'wincmd w')
|
||||||
vim.cmd('e ' .. t.file)
|
vim.cmd('e ' .. t.file)
|
||||||
vim.fn.cursor(t.line, t.column)
|
vim.fn.cursor(t.line, t.column)
|
||||||
vim.cmd('noautocmd! normal! :')
|
vim.cmd('noautocmd normal! :')
|
||||||
end
|
end
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
||||||
@ -204,6 +205,9 @@ local function open_win() -- {{{
|
|||||||
]])
|
]])
|
||||||
bufnr = vim.fn.bufnr('%')
|
bufnr = vim.fn.bufnr('%')
|
||||||
update_todo_content()
|
update_todo_content()
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<Enter>', '', {
|
||||||
|
callback = open_todo
|
||||||
|
} )
|
||||||
end
|
end
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user