diff --git a/.gitignore b/.gitignore index 62f3df1..1ea608e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ repos/ cacheDir/ *.result/ +.luarc.json diff --git a/cli/vim/neovim/lua/keybindings.lua b/cli/vim/neovim/lua/keybindings.lua index d1c098e..a8ba6d7 100644 --- a/cli/vim/neovim/lua/keybindings.lua +++ b/cli/vim/neovim/lua/keybindings.lua @@ -17,6 +17,15 @@ vim.api.nvim_create_user_command("CloseOtherBuffers", function() end end, {}) +vim.api.nvim_create_user_command("Exit", function() + for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do + if vim.api.nvim_buf_is_loaded(bufnr) and not vim.api.nvim_buf_get_option(bufnr, "buflisted") then + vim.cmd(":bd! " .. bufnr) + end + end + vim.cmd(":qall") +end, {}) + keymap(NORMAL, '', ':bnext', { noremap = true }) keymap(NORMAL, '', ':bprev', { noremap = true }) @@ -31,7 +40,7 @@ keymap(NORMAL, 'yn', ':let @+=expand("%:t")', { noremap = true }) keymap(NORMAL, 'yl', ':let @+=expand("%") . ":" . line(".")', { noremap = true }) keymap(VISUAL, 'p', '"0p', { noremap = true }) keymap(NORMAL, 'q', ':bd', { noremap = true }) -keymap(NORMAL, 'qq', ':qall', { noremap = true }) +keymap(NORMAL, 'qq', ':Exit', { noremap = true }) keymap(NORMAL, 'ne', ':e %:h', { noremap = true }) keymap(NORMAL, '', ':w', { noremap = true }) keymap(INSERT, '', ':wa', { noremap = true })