mirror of
https://github.com/hyzendust/KickestEnd.nvim.git
synced 2026-02-15 03:41:14 +01:00
Fix: <leader>qa global keymap implementation in alpha window button.
This commit is contained in:
12
init.lua
12
init.lua
@@ -1,6 +1,12 @@
|
|||||||
vim.g.mapleader = ' '
|
vim.g.mapleader = ' '
|
||||||
vim.g.maplocalleader = ' '
|
vim.g.maplocalleader = ' '
|
||||||
|
|
||||||
|
-- keymaps.lua
|
||||||
|
require 'keymaps'
|
||||||
|
|
||||||
|
-- Copy custom snippets from custom_friendly_snippets folder
|
||||||
|
require 'replace_with_custom_snippets'
|
||||||
|
|
||||||
-- :UpdateKickestEnd command to safely update KickestEnd.nvim config from origin/master
|
-- :UpdateKickestEnd command to safely update KickestEnd.nvim config from origin/master
|
||||||
require 'update_kickestend'
|
require 'update_kickestend'
|
||||||
|
|
||||||
@@ -274,12 +280,6 @@ require('lazy').setup({
|
|||||||
{ import = 'plugins.custom' },
|
{ import = 'plugins.custom' },
|
||||||
}, {})
|
}, {})
|
||||||
|
|
||||||
-- custom/keymaps.lua file
|
|
||||||
require 'keymaps'
|
|
||||||
|
|
||||||
-- Copy custom snippets from custom_friendly_snippets folder
|
|
||||||
require 'replace_with_custom_snippets'
|
|
||||||
|
|
||||||
-- [[ Setting options ]]
|
-- [[ Setting options ]]
|
||||||
-- See `:help vim.o`
|
-- See `:help vim.o`
|
||||||
|
|
||||||
|
|||||||
@@ -310,7 +310,7 @@ end, { desc = 'Discard changes in current window & quit' })
|
|||||||
|
|
||||||
-- [[ Close Neovim ]]
|
-- [[ Close Neovim ]]
|
||||||
-- Function to close Neovim, discarding all unsaved changes if confirmed
|
-- Function to close Neovim, discarding all unsaved changes if confirmed
|
||||||
local function close_nvim_with_prompt()
|
_G.close_nvim_with_prompt = function()
|
||||||
-- Get list of all listed buffers
|
-- Get list of all listed buffers
|
||||||
local buffers = vim.fn.getbufinfo { buflisted = 1 }
|
local buffers = vim.fn.getbufinfo { buflisted = 1 }
|
||||||
-- Check for unsaved buffers
|
-- Check for unsaved buffers
|
||||||
@@ -332,10 +332,10 @@ local function close_nvim_with_prompt()
|
|||||||
vim.cmd 'qa!'
|
vim.cmd 'qa!'
|
||||||
else
|
else
|
||||||
-- Cancel quitting
|
-- Cancel quitting
|
||||||
print 'Cancelled closing Neovim.'
|
print '\nCancelled closing Neovim.'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
vim.keymap.set('n', '<leader>qa', close_nvim_with_prompt, { noremap = true, silent = true, desc = 'Quit Neovim' })
|
vim.keymap.set('n', '<leader>qa', _G.close_nvim_with_prompt, { noremap = true, silent = true, desc = 'Quit Neovim' })
|
||||||
|
|
||||||
-- [[ Switch below/right split windows ]]
|
-- [[ Switch below/right split windows ]]
|
||||||
vim.keymap.set('n', '<leader><Tab>', '<C-W><C-W>')
|
vim.keymap.set('n', '<leader><Tab>', '<C-W><C-W>')
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ return {
|
|||||||
dashboard.button('i', ' New File', '<Cmd>ene <Bar> startinsert<CR>'),
|
dashboard.button('i', ' New File', '<Cmd>ene <Bar> startinsert<CR>'),
|
||||||
-- Open Neo-tree in starting directory
|
-- Open Neo-tree in starting directory
|
||||||
dashboard.button('<leader>n', ' Open Neo-tree', '<Cmd>cd ' .. vim.fn.fnameescape(start_dir) .. ' | Neotree toggle float<CR>'),
|
dashboard.button('<leader>n', ' Open Neo-tree', '<Cmd>cd ' .. vim.fn.fnameescape(start_dir) .. ' | Neotree toggle float<CR>'),
|
||||||
-- Quit Neovim
|
-- Quit Neovim using custom function
|
||||||
dashboard.button('<leader>qa', ' Quit', '<Cmd>qa<CR>'),
|
dashboard.button('<leader>qa', ' Quit', '<Cmd>lua close_nvim_with_prompt()<CR>'),
|
||||||
}
|
}
|
||||||
|
|
||||||
alpha.setup(dashboard.opts)
|
alpha.setup(dashboard.opts)
|
||||||
|
|||||||
Reference in New Issue
Block a user