Move plugin keymaps to lazy keys option
This commit is contained in:
parent
68a73c417e
commit
0982ebf334
7 changed files with 46 additions and 38 deletions
|
@ -1,9 +1,11 @@
|
||||||
-- Formatter plugin
|
-- Formatter plugin
|
||||||
return {
|
return {
|
||||||
"sbdchd/neoformat",
|
"sbdchd/neoformat",
|
||||||
config = function()
|
keys = {
|
||||||
require("which-key").register({
|
{
|
||||||
f = { "<cmd>Neoformat<CR>", "Format with Neoformat" },
|
desc = "Format with Neoformat",
|
||||||
}, { prefix = "<leader>" })
|
"<leader>f",
|
||||||
end,
|
"<cmd>Neoformat<cr>",
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,16 +19,11 @@ return {
|
||||||
lsp_doc_border = true,
|
lsp_doc_border = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
keys = {
|
||||||
require("noice").setup(opts)
|
{
|
||||||
|
desc = "Dismiss notifications",
|
||||||
require("which-key").register({
|
"<leader>d",
|
||||||
d = {
|
"<cmd>NoiceDismiss<cr>",
|
||||||
function()
|
},
|
||||||
vim.cmd("NoiceDismiss")
|
|
||||||
end,
|
|
||||||
"Dismiss notifications",
|
|
||||||
},
|
},
|
||||||
}, { prefix = "<leader>" })
|
|
||||||
end,
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,9 +17,9 @@ return {
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
{
|
{
|
||||||
|
desc = "Open/close nvim-tree",
|
||||||
"<leader>o",
|
"<leader>o",
|
||||||
"<cmd>NvimTreeToggle<cr>",
|
"<cmd>NvimTreeToggle<cr>",
|
||||||
desc = "Open/close nvim-tree",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ return {
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{
|
{
|
||||||
"lewis6991/gitsigns.nvim",
|
"lewis6991/gitsigns.nvim",
|
||||||
opts = {},
|
config = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
|
|
|
@ -54,27 +54,35 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
desc = "Open Telescope",
|
||||||
|
"<C-s>",
|
||||||
|
"<cmd>Telescope<cr>",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
desc = "Change directories",
|
||||||
|
"cd",
|
||||||
|
"<cmd>Telescope cder<cr>",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
desc = "Find files",
|
||||||
|
"<C-f>",
|
||||||
|
"<cmd>Telescope find_files<cr>",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
desc = "Grep files",
|
||||||
|
"<C-g>",
|
||||||
|
"<cmd>Telescope live_grep<cr>",
|
||||||
|
},
|
||||||
|
},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
local telescope = require("telescope")
|
local telescope = require("telescope")
|
||||||
telescope.setup(opts)
|
telescope.setup(opts)
|
||||||
|
|
||||||
-- Add extensions
|
-- Load extensions
|
||||||
telescope.load_extension("fzf")
|
telescope.load_extension("fzf")
|
||||||
telescope.load_extension("ui-select")
|
telescope.load_extension("ui-select")
|
||||||
telescope.load_extension("cder")
|
telescope.load_extension("cder")
|
||||||
|
|
||||||
-- Keybinds
|
|
||||||
local builtin = require("telescope.builtin")
|
|
||||||
require("which-key").register({
|
|
||||||
cd = {
|
|
||||||
function()
|
|
||||||
vim.cmd("Telescope cder")
|
|
||||||
end,
|
|
||||||
"Change directories",
|
|
||||||
},
|
|
||||||
["<C-s>"] = { vim.cmd.Telescope, "Open Telescope" },
|
|
||||||
["<C-f>"] = { builtin.find_files, "Telescope find files" },
|
|
||||||
["<C-g>"] = { builtin.live_grep, "Telescope live grep" },
|
|
||||||
})
|
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,9 @@ return {
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
init = function(plugin)
|
init = function(plugin)
|
||||||
require("nvim-treesitter.install").update({ with_sync = true })
|
require("nvim-treesitter.install").update({
|
||||||
|
with_sync = true,
|
||||||
|
})
|
||||||
end,
|
end,
|
||||||
---@type TSConfig
|
---@type TSConfig
|
||||||
---@diagnostic disable-next-line: missing-fields
|
---@diagnostic disable-next-line: missing-fields
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
-- Display possible keybinds
|
-- Display possible keybinds
|
||||||
|
-- Here I have also defined some generic keybinds
|
||||||
-- Plugin specific keybinds are set up in plugin configuration file
|
-- Plugin specific keybinds are set up in plugin configuration file
|
||||||
return {
|
return {
|
||||||
"folke/which-key.nvim",
|
"folke/which-key.nvim",
|
||||||
|
@ -7,12 +8,12 @@ return {
|
||||||
wk.setup()
|
wk.setup()
|
||||||
|
|
||||||
wk.register({
|
wk.register({
|
||||||
h = { "<cmd>nohlsearch<CR>", "Turn off search highlight" },
|
h = { "<cmd>nohlsearch<cr>", "Turn off search highlight" },
|
||||||
}, { prefix = "<leader>" })
|
}, { prefix = "<leader>" })
|
||||||
|
|
||||||
wk.register({
|
wk.register({
|
||||||
["<C-n>"] = { "<cmd>bnext<CR>", "Next buffer" },
|
["<C-n>"] = { "<cmd>bnext<cr>", "Next buffer" },
|
||||||
["<C-b>"] = { "<cmd>bprevious<CR>", "Previous buffer" },
|
["<C-b>"] = { "<cmd>bprevious<cr>", "Previous buffer" },
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Exit terminal insert mode with esc
|
-- Exit terminal insert mode with esc
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue