feat(nvim): add various keybinds
parent
c5aaacf0f9
commit
5977d6a7e1
|
@ -44,7 +44,7 @@ in
|
|||
extraLuaConfig = lib.concatLines (
|
||||
builtins.map
|
||||
builtins.readFile
|
||||
[ ./options.lua ./init.lua ]
|
||||
[ ./options.lua ./keybinds.lua ./init.lua ]
|
||||
);
|
||||
extraPackages = with pkgs; [
|
||||
alejandra
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
require("impatient")
|
||||
|
||||
local wk = require("which-key")
|
||||
|
||||
require("nvim-treesitter.configs").setup({
|
||||
sync_install = false,
|
||||
auto_install = false,
|
||||
|
@ -142,7 +140,7 @@ vim.o.statuscolumn = "%= "
|
|||
.. "%= " -- spacing between end of column and start of text
|
||||
|
||||
-- Using ufo provider need remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself
|
||||
wk.register({
|
||||
require("which-key").register({
|
||||
z = {
|
||||
R = { require("ufo").openAllFolds, "Open all folds" },
|
||||
M = { require("ufo").closeAllFolds, "Close all folds" },
|
||||
|
@ -171,7 +169,7 @@ require("lspsaga").setup({
|
|||
|
||||
local lspconfig = require("lspconfig")
|
||||
local on_attach_def = function(_, bufnr)
|
||||
wk.register({
|
||||
require("which-key").register({
|
||||
K = { "<cmd>Lspsaga hover_doc ++quiet<cr>", "show info" },
|
||||
["<leader>"] = {
|
||||
l = {
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
-- buffers
|
||||
require("which-key").register({
|
||||
b = {
|
||||
name = "buffers",
|
||||
b = { "<cmd>Telescope buffers<cr>", "List buffers" },
|
||||
d = { "<cmd>bd<cr>", "Delete buffer" },
|
||||
n = { "<cmd>bnext<cr>", "Next buffer" },
|
||||
p = { "<cmd>bprevious<cr>", "Previous buffer" },
|
||||
},
|
||||
})
|
||||
|
||||
-- Clear search with <esc>
|
||||
require("which-key").register({
|
||||
["<esc>"] = { "<cmd>noh<cr><esc>", "Escape and clear hlsearch", mode = { "n", "i" } },
|
||||
})
|
||||
|
||||
-- better indenting
|
||||
require("which-key").register({
|
||||
["<"] = { "<gv", "Shift left" },
|
||||
[">"] = { ">gv", "Shift right" },
|
||||
}, { mode = "v" })
|
Loading…
Reference in New Issue