72 lines
2.0 KiB
Lua
72 lines
2.0 KiB
Lua
local map = vim.api.nvim_set_keymap
|
|
local function n(...) map("n", ...) end
|
|
local function x(...) map("x", ...) end
|
|
local function i(...) map("i", ...) end
|
|
local opts = { noremap = true, silent = true }
|
|
|
|
-- Telescope
|
|
n("<C-f>", "<cmd>lua require('telescope.builtin').find_files()<cr>", { noremap = true })
|
|
n("<C-b>", "<cmd>lua require('telescope.builtin').buffers()<cr>", { noremap = true })
|
|
n("<C-a>", "<cmd>lua require('telescope.builtin').lsp_code_actions()<cr>", { noremap = true })
|
|
|
|
-- Tabs
|
|
n('gT', ':BufferPrevious<CR>', {})
|
|
n('gt', ':BufferNext<CR>', {})
|
|
-- Re-order to previous/next
|
|
n('<A-<>', ':BufferMovePrevious<CR>', opts)
|
|
n('<A->>', ' :BufferMoveNext<CR>', opts)
|
|
-- Goto buffer in position...
|
|
n('<A-1>', ':BufferGoto 1<CR>', opts)
|
|
n('<A-2>', ':BufferGoto 2<CR>', opts)
|
|
n('<A-3>', ':BufferGoto 3<CR>', opts)
|
|
n('<A-4>', ':BufferGoto 4<CR>', opts)
|
|
n('<A-5>', ':BufferGoto 5<CR>', opts)
|
|
n('<A-6>', ':BufferGoto 6<CR>', opts)
|
|
n('<A-7>', ':BufferGoto 7<CR>', opts)
|
|
n('<A-8>', ':BufferGoto 8<CR>', opts)
|
|
n('<A-9>', ':BufferGoto 9<CR>', opts)
|
|
n('<A-0>', ':BufferLast<CR>', opts)
|
|
-- Close buffer
|
|
n('<A-c>', ':BufferClose<CR>', opts)
|
|
-- Wipeout buffer
|
|
-- :BufferWipeout<CR>
|
|
-- Close commands
|
|
-- :BufferCloseAllButCurrent<CR>
|
|
-- :BufferCloseBuffersLeft<CR>
|
|
-- :BufferCloseBuffersRight<CR>
|
|
-- Magic buffer-picking mode
|
|
n('<C-p>', ':BufferPick<CR>', opts)
|
|
|
|
-- Code actions
|
|
vim.cmd [[autocmd CursorHold,CursorHoldI * lua require'nvim-lightbulb'.update_lightbulb()]]
|
|
|
|
-- Tree
|
|
n("<S-T>", ":NvimTreeToggle<cr>", {})
|
|
|
|
-- Movement
|
|
n("<C-J>", "<C-W><C-J>", { noremap = true })
|
|
n("<C-K>", "<C-W><C-K>", { noremap = true })
|
|
n("<C-L>", "<C-W><C-L>", { noremap = true })
|
|
n("<C-H>", "<C-W><C-H>", { noremap = true })
|
|
|
|
-- Tabs
|
|
n("<C-T>", ":tabnew<cr>", {})
|
|
|
|
-- Split
|
|
n("<C-S>", ":vsplit<cr>", {})
|
|
n("<S-S>", ":split<cr>", {})
|
|
|
|
-- Quit
|
|
n("Q", "<nop>", { noremap = true })
|
|
vim.api.nvim_exec(
|
|
[[
|
|
:command WQ wq
|
|
:command Wq wq
|
|
:command W w
|
|
:command Q q
|
|
:command WQa wqa
|
|
:command Wqa wqa
|
|
]],
|
|
true)
|
|
|