Refactor neovim config file structure
All plugins are now in their own files with their lazy specifications and configurations. Also moved lazy initialization to init.lua because it is very compact now
This commit is contained in:
parent
902c397e8b
commit
0ced314c90
36 changed files with 554 additions and 584 deletions
|
@ -1,29 +1,29 @@
|
|||
return function()
|
||||
local wk = require("which-key")
|
||||
local gitsigns = require("gitsigns")
|
||||
wk.setup({})
|
||||
-- Display possible keybinds
|
||||
-- Plugin specific keybinds are set up in plugin configuration file
|
||||
return {
|
||||
"folke/which-key.nvim",
|
||||
config = function()
|
||||
local wk = require("which-key")
|
||||
wk.setup({})
|
||||
|
||||
wk.register({
|
||||
f = { "<cmd>Neoformat<CR>", "Format with Neoformat" },
|
||||
h = { "<cmd>nohlsearch<CR>", "Turn off search highlight" },
|
||||
}, { prefix = "<leader>" })
|
||||
wk.register({
|
||||
h = { "<cmd>nohlsearch<CR>", "Turn off search highlight" },
|
||||
}, { prefix = "<leader>" })
|
||||
|
||||
wk.register({
|
||||
["<C-n>"] = { "<cmd>bnext<CR>", "Next buffer" },
|
||||
["<C-b>"] = { "<cmd>bprevious<CR>", "Previous buffer" },
|
||||
["["] = { h = { gitsigns.prev_hunk, "Previous hunk" } },
|
||||
["]"] = { h = { gitsigns.next_hunk, "Next hunk" } },
|
||||
})
|
||||
wk.register({
|
||||
["<C-n>"] = { "<cmd>bnext<CR>", "Next buffer" },
|
||||
["<C-b>"] = { "<cmd>bprevious<CR>", "Previous buffer" },
|
||||
})
|
||||
|
||||
-- Open cder
|
||||
wk.register({ cd = {
|
||||
function()
|
||||
vim.cmd("Telescope cder")
|
||||
end,
|
||||
"Change directories",
|
||||
} })
|
||||
-- Open cder
|
||||
wk.register({ cd = {
|
||||
function()
|
||||
vim.cmd("Telescope cder")
|
||||
end,
|
||||
"Change directories",
|
||||
} })
|
||||
|
||||
-- Exit terminal insert mode with esc
|
||||
vim.keymap.set("t", "<Esc>", "<C-\\><C-n>", {})
|
||||
|
||||
end
|
||||
-- Exit terminal insert mode with esc
|
||||
vim.keymap.set("t", "<Esc>", "<C-\\><C-n>", {})
|
||||
end,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue