nvim: updated plugins, improved keymaps

master
tiyn 2 months ago
parent 5541ec87b9
commit d4a1d0622c

@ -2,69 +2,69 @@
"action-hints.nvim": { "branch": "main", "commit": "ab10fef255dd4bc933c92d8f9969828f2f856e71" },
"barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp-under-comparator": { "branch": "master", "commit": "6857f10272c3cfe930cece2afa2406e1385bfef8" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
"conform.nvim": { "branch": "master", "commit": "393210360b9e807862e5329763526509f52b5218" },
"comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"conform.nvim": { "branch": "master", "commit": "40d4e98fcc3e6f485f0e8924c63734bc7e305967" },
"cpsm": { "branch": "master", "commit": "1a5fc1b6169bb80c29b0b986130c4f3f1a9ed82e" },
"diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" },
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
"fterm.nvim": { "branch": "master", "commit": "d1320892cc2ebab472935242d9d992a2c9570180" },
"fzy-lua-native": { "branch": "master", "commit": "820f745b7c442176bcc243e8f38ef4b985febfaf" },
"git-blame.nvim": { "branch": "master", "commit": "ad1d1365c9189d89797fe8d559677d5f55dc2830" },
"gitsigns.nvim": { "branch": "main", "commit": "805610a9393fa231f2c2b49cb521bfa413fadb3d" },
"goto-preview": { "branch": "main", "commit": "3552fad4a0244ffd9ac86508e29ccc5166f19eb8" },
"indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" },
"knap": { "branch": "main", "commit": "d4ea571d2d4e139d288b758c5bab31788d30eea3" },
"lazy.nvim": { "branch": "main", "commit": "d3974346b6cef2116c8e7b08423256a834cb7cbc" },
"leap.nvim": { "branch": "main", "commit": "f1f19fc268b406b00b50091f51f16d9634fbe449" },
"lsp_signature.nvim": { "branch": "master", "commit": "c6aeb2f1d2538bbdfdaab1664d9d4c3c75aa9db8" },
"lspkind-nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
"luasnip": { "branch": "master", "commit": "b152822e1a4bafb6bdf11a16cc26525cbd95ee00" },
"git-blame.nvim": { "branch": "master", "commit": "2883a7460f611c2705b23f12d58d398d5ce6ec00" },
"gitsigns.nvim": { "branch": "main", "commit": "863903631e676b33e8be2acb17512fdc1b80b4fb" },
"goto-preview": { "branch": "main", "commit": "1519ea3512828c944eed5b2bbb66a8f8deb92447" },
"indent-blankline.nvim": { "branch": "master", "commit": "e7a4442e055ec953311e77791546238d1eaae507" },
"knap": { "branch": "main", "commit": "0040760bb504a713ea5988c7c490a15faf477c57" },
"lazy.nvim": { "branch": "main", "commit": "1159bdccd8910a0fd0914b24d6c3d186689023d9" },
"leap.nvim": { "branch": "main", "commit": "c6bfb191f1161fbabace1f36f578a20ac6c7642c" },
"lsp_signature.nvim": { "branch": "master", "commit": "fc38521ea4d9ec8dbd4c2819ba8126cea743943b" },
"lspkind-nvim": { "branch": "master", "commit": "59c3f419af48a2ffb2320cea85e44e5a95f71664" },
"lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" },
"luasnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" },
"mapx.nvim": { "branch": "main", "commit": "c3dd43474a5fc2f266309bc04a69b74eb2524671" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "05744f0f1967b5757bd05c08df4271ab8ec990aa" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" },
"mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" },
"mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" },
"modes.nvim": { "branch": "main", "commit": "4035a46aaabe43faf1b54740575af9dd5bb03809" },
"none-ls.nvim": { "branch": "main", "commit": "f5632db2491fbe02b54f1a321a98548a8ba2bd15" },
"nvim-autopairs": { "branch": "master", "commit": "14e97371b2aab6ee70054c1070a123dfaa3e217e" },
"nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" },
"nvim-colorizer.lua": { "branch": "master", "commit": "0b3950aed7bc35b78200bc292156aa77d2a4d342" },
"nvim-docs-view": { "branch": "master", "commit": "78d88bca16f32a430572758677f9246f6d7f7b94" },
"nvim-hlslens": { "branch": "main", "commit": "3e8fceb2b030100857ee72741a8f48c9a1d8595e" },
"nvim-lspconfig": { "branch": "master", "commit": "97762065bf7e1ac617d0a8710eb7ec2d656287a9" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"modes.nvim": { "branch": "main", "commit": "326cff3282419b3bcc745061978c1e592cae055d" },
"none-ls.nvim": { "branch": "main", "commit": "6bdd9b3364e12ffb346ac224db3df37de0b1429b" },
"nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" },
"nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
"nvim-colorizer.lua": { "branch": "master", "commit": "6ed09146ee637006367b5e225be6208a1ea02579" },
"nvim-docs-view": { "branch": "master", "commit": "365593534e0acd762bfddce6e8313315ffa4fa36" },
"nvim-hlslens": { "branch": "main", "commit": "07afd4dd14405ad14b142a501a3abea6ae44b21b" },
"nvim-lspconfig": { "branch": "master", "commit": "d141895d1d9f41048fff201d62a2d6e96d299e32" },
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
"nvim-scrollbar": { "branch": "main", "commit": "35f99d559041c7c0eff3a41f9093581ceea534e8" },
"nvim-surround": { "branch": "main", "commit": "6d0dc3dbb557bcc6a024969da461df4ba803fc48" },
"nvim-tree.lua": { "branch": "master", "commit": "64f61e4c913047a045ff90bd188dd3b54ee443cf" },
"nvim-treesitter": { "branch": "master", "commit": "268611e3ece8463bfb5b09044dcd1b76a28ffbb6" },
"nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" },
"nvim-scrollbar": { "branch": "main", "commit": "d09f14aa16c9f2748e77008f9da7b1f76e4e7b85" },
"nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" },
"nvim-tree.lua": { "branch": "master", "commit": "1c9553a19f70df3dcb171546a3d5e034531ef093" },
"nvim-treesitter": { "branch": "master", "commit": "5a2ff8b7ca5470b1011ed82ef3fdd53139ffc467" },
"nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" },
"nvim-ts-rainbow": { "branch": "master", "commit": "ef95c15a935f97c65a80e48e12fe72d49aacf9b9" },
"nvim-ufo": { "branch": "main", "commit": "a5390706f510d39951dd581f6d2a972741b3fa26" },
"nvim-web-devicons": { "branch": "master", "commit": "5b9067899ee6a2538891573500e8fd6ff008440f" },
"nvim-ufo": { "branch": "main", "commit": "203c9f434feec57909ab4b1e028abeb3349b7847" },
"nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" },
"nvim-yarp": { "branch": "master", "commit": "bb5f5e038bfe119d3b777845a76b0b919b35ebc8" },
"plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" },
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
"popup-menu.nvim": { "branch": "master", "commit": "b618bd0c824a20417d845fa0022327228e6988a2" },
"projections.nvim": { "branch": "pre_release", "commit": "889914169fa1f5c00fb8659653b5a8330fb223e6" },
"promise-async": { "branch": "main", "commit": "93540c168c5ed2b030ec3e6c40ab8bbb85e36355" },
"promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" },
"renamer.nvim": { "branch": "master", "commit": "1614d466df53899f11dd5395eaac3c09a275c384" },
"spelunker.vim": { "branch": "master", "commit": "a0bc530f62798bbe053905555a4aa9ed713485eb" },
"symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" },
"tabular": { "branch": "master", "commit": "339091ac4dd1f17e225fe7d57b48aff55f99b23a" },
"tabular": { "branch": "master", "commit": "12437cd1b53488e24936ec4b091c9324cafee311" },
"tccs.nvim": { "branch": "master", "commit": "e50c1504286b5ee2700961a600f26c9b338bd042" },
"telescope.nvim": { "branch": "master", "commit": "776b509f80dd49d8205b9b0d94485568236d1192" },
"tidy.nvim": { "branch": "main", "commit": "58fcc63de53840fa78946e4161e8883e67213f92" },
"todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" },
"trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" },
"undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" },
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
"trouble.nvim": { "branch": "main", "commit": "254145ffd528b98eb20be894338e2d5c93fa02c2" },
"undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" },
"vim-abolish": { "branch": "master", "commit": "dcbfe065297d31823561ba787f51056c147aa682" },
"vim-hug-neovim-rpc": { "branch": "master", "commit": "93ae38792bc197c3bdffa2716ae493c67a5e7957" },
"vim-illuminate": { "branch": "master", "commit": "e522e0dd742a83506db0a72e1ced68c9c130f185" },
"vim-markdown": { "branch": "master", "commit": "a657e697376909c41475a686eeef7fc7a4972d94" },
"vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" },
"vim-markdown": { "branch": "master", "commit": "8f6cb3a6ca4e3b6bcda0730145a0b700f3481b51" },
"vim-renamer": { "branch": "master", "commit": "9c6346eb4556cf2d8ca55de6969247ab14fe2383" },
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" },
"which-key.nvim": { "branch": "main", "commit": "8badb359f7ab8711e2575ef75dfe6fbbd87e4821" },
"wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" },
"winshift.nvim": { "branch": "main", "commit": "37468ed6f385dfb50402368669766504c0e15583" }
}
}

@ -1,198 +1,108 @@
-- setup keymap function
local m = require("mapx").setup({ global = true, whichkey = true })
-- setup keymap groups
m.nname("g", "LSP: goto")
m.nname("gp", "LSP: preview")
m.cname("w", "Write")
m.cname("w!", "Write: overwrite")
m.nname("<leader>g", "Git")
m.nname("<leader>f", "Telescope: find ...")
m.nname("<leader>gd", "Git: diff")
m.nname("<leader>s", "Substitute")
m.nname("<leader>t", "Terminal")
m.nname("<C-W>", "Navigation")
-- unmap unwanted commands
m.nnoremap("Zt", "<NOP>")
m.nnoremap("ZT", "<NOP>")
m.nnoremap("<Space>", "<NOP>")
m.inoremap("<F2>", "<NOP>")
m.inoremap("<F3>", "<NOP>")
m.inoremap("<F4>", "<NOP>")
m.inoremap("<F5>", "<NOP>")
m.inoremap("<F6>", "<NOP>")
m.inoremap("<F8>", "<NOP>")
m.inoremap("<F9>", "<NOP>")
m.nnoremap("<F9>", "<NOP>")
m.inoremap("<F10>", "<NOP>")
m.nnoremap("<F10>", "<NOP>")
m.inoremap("<F11>", "<NOP>")
m.nnoremap("<F11>", "<NOP>")
m.inoremap("<F12>", "<NOP>")
m.nnoremap("<F12>", "<NOP>")
-- spell
m.nmap("<F6>s", "z=", "Spell: display suggestions")
-- shortcuts for quitting
m.nnoremap("ZA", ":xa<CR>", "Exit: write and quit all buffers")
m.nnoremap("ZQ", ":conf q<CR>", "Exit: quit current buffer")
m.nnoremap("ZZ", ":x<CR>", "Exit: write and quit current buffer")
-- shortcut for split navigation
m.nnoremap("<C-h>", "<C-w>h", "Navigation: go to left window")
m.nnoremap("<C-j>", "<C-w>j", "Navigation: go to lower window")
m.nnoremap("<C-k>", "<C-w>k", "Navigation: go to upper window")
m.nnoremap("<C-l>", "<C-w>l", "Navigation: go to right window")
-- remap for dealing with word wrap
m.nmap(
"j",
"v:count == 0 ? 'gj' : 'j'",
{ "expr", "silent" },
"Navigation: go down in wrapped lines"
)
m.nmap("k", "v:count == 0 ? 'gk' : 'k'", { "expr", "silent" }, "Navigation: go up in wrapped lines")
-- compiler for languages
m.nnoremap("<leader>c", ":w! | !compiler <c-r>%<CR>", "Compile: current file")
-- save file as sudo on files that require root permission
m.cnoremap(
"w!!",
'execute "silent! write !sudo tee % >/dev/null" <bar> edit!',
"Write: overwrite file over with sudo"
)
-- tpope/vim-abolish
m.nnoremap("<leader>sa", ":%S//g<Left><Left>", "Substitute: free form")
m.nnoremap("<leader>ss", ":%S/\\<<C-r><C-w>\\>//g<Left><Left>", "Substitute: word under cursor")
-- simrat39/symbols-outline.nvim
m.nmap("<F3>", ":SymbolsOutline<CR>", "CTags: toggle")
-- nvim-tree/nvim-tree.lua
m.nmap("<F2>", ":NvimTreeToggle toggle<CR>", "File tree: toggle")
-- mbbill/undotree
m.nmap("<F1>", ":UndotreeToggle<CR>", "Undo tree: toggle")
-- amrbashir/nvim-docs-view
m.nnoremap("go", ":DocsViewToggle<CR>", "LSP: toggle documentation window")
-- numtostr/fterm.nvim
m.nnoremap("<leader>tt", require("FTerm").toggle, "Terminal: open")
m.tnoremap("<leader>tt", require("FTerm").toggle, "Terminal: open")
local lazygit = require("FTerm"):new({
cmd = "lazygit",
local wk = require("which-key")
local lazygit = require("FTerm"):new({ cmd = "lazygit" })
wk.add({
-- setup keymap groups
{mode = "n", "g", desc = "LSP: goto"},
{mode = "n", "gp", desc = "LSP: preview"},
{mode = "c", "w", desc = "Write"},
{mode = "c", "w!", desc = "Write: overwrite"},
{mode = "n", "<leader>g", desc = "Git"},
{mode = "n", "<leader>f", desc = "Telescope: find"},
{mode = "n", "<leader>gd", desc = "Git: diff"},
{mode = "n", "<leader>s", desc = "Substitute"},
{mode = "n", "<leader>t", desc = "Terminal"},
{mode = "n", "<C-W>", desc = "Navigation"},
-- unmap unwanted commands
{mode = "n", "Zt", "<NOP>", noremap = true},
{mode = "n", "ZT", "<NOP>", noremap = true},
{mode = "n", "<Space>", "<NOP>", noremap = true},
{mode = "n", "<F2>", "<NOP>", noremap = true},
{mode = "n", "<F3>", "<NOP>", noremap = true},
{mode = "n", "<F4>", "<NOP>", noremap = true},
{mode = "n", "<F5>", "<NOP>", noremap = true},
{mode = "n", "<F6>", "<NOP>", noremap = true},
{mode = "n", "<F8>", "<NOP>", noremap = true},
{mode = "n", "<F9>", "<NOP>", noremap = true},
{mode = "n", "<F9>", "<NOP>", noremap = true},
{mode = "n", "<F10>", "<NOP>", noremap = true},
{mode = "n", "<F10>", "<NOP>", noremap = true},
{mode = "n", "<F11>", "<NOP>", noremap = true},
{mode = "n", "<F11>", "<NOP>", noremap = true},
{mode = "n", "<F12>", "<NOP>", noremap = true},
{mode = "n", "<F12>", "<NOP>", noremap = true},
-- spell
{mode = "n", "<F6>s", "z=", desc = "Spell: display suggestions"},
-- shortcuts for quitting
{mode = "n", "ZA", ":xa<CR>", desc = "Exit: write and quit all buffers", noremap = true},
{mode = "n", "ZQ", ":conf q<CR>", desc = "Exit: quit current buffer", noremap = true},
{mode = "n", "ZZ", ":x<CR>", desc = "Exit: write and quit current buffer", noremap = true},
-- shortcut for split navigation
{mode = "n", "<C-h>", "<C-w>h", desc = "Navigation: go to left window", noremap = true},
{mode = "n", "<C-j>", "<C-w>j", desc = "Navigation: go to lower window", noremap = true},
{mode = "n", "<C-k>", "<C-w>k", desc = "Navigation: go to upper window", noremap = true},
{mode = "n", "<C-l>", "<C-w>l", desc = "Navigation: go to right window", noremap = true},
-- remap for dealing with word wrap
{mode = "n", "j", "gj", desc = "Navigation: go down in wrapped lines", silent = true},
{mode = "n", "k", "gk", desc = "Navigation: go up in wrapped lines", silent = true},
-- compiler for languages
{mode = "n", "<leader>c", ":w! | !compiler <c-r>%<CR>", desc = "Compile: current file", noremap = true},
{mode = "n", "w!!", 'execute "silent! write !sudo tee % >/dev/null" <bar> edit!', desc = "Write: overwrite file over with sudo", noremap = true},
-- tpope/vim-abolish
{mode = "n", "<leader>sa", ":%S//g<Left><Left>", desc = "Substitute: free form", noremap = true},
{mode = "n", "<leader>ss", ":%S/\\<<C-r><C-w>\\>//g<Left><Left>", desc = "Substitute: word under cursor", noremap = true},
-- simrat39/symbols-outline.nvim
{mode = "n", "<F3>", ":SymbolsOutline<CR>", desc = "CTags: toggle"},
-- nvim-tree/nvim-tree.lua
{mode = "n", "<F2>", ":NvimTreeToggle toggle<CR>", desc = "File tree: toggle"},
-- mbbill/undotree
{mode = "n", "<F1>", ":UndotreeToggle<CR>", desc = "Undo tree: toggle"},
-- amrbashir/nvim-docs-view
{mode = "n", "go", ":DocsViewToggle<CR>", desc = "LSP: toggle documentation window", noremap = true},
-- numtostr/fterm.nvim
{mode = "n", "<leader>tt", require("FTerm").toggle, desc = "Terminal: open", noremap = true},
{mode = "n", "<leader>gt", function() lazygit:toggle() end, desc = "Git: open lazygit", noremap = true},
{mode = "n", "<leader>tg", function() lazygit:toggle() end, desc = "Terminal: open lazygit", noremap = true},
{mode = "n", "<leader>tg", function() lazygit:toggle() end, desc = "Terminal: open lazygit", noremap = true},
-- sindrets/diffview.nvim
{mode = "n", "<leader>gdo", ":DiffviewOpen<CR>", desc = "Git: open diff"},
{mode = "n", "<leader>gdc", ":DiffviewClose<CR>", desc = "Git: close diff"},
-- folke/trouble.nvim
{mode = "n", "<leader>x", ":TroubleToggle<CR>", desc = "LSP: toggle error list"},
-- hrsh7th/nvim-cmp
{mode = "n", "gd", vim.lsp.buf.definition(), desc = "LSP: goto definition", noremap = true},
{mode = "n", "gD", vim.lsp.buf.declaration(), desc = "LSP: goto declaration", noremap = true},
{mode = "n", "gi", vim.lsp.buf.implementation(), desc = "LSP: list implementation", noremap = true},
{mode = "n", "gr", function() vim.lsp.buf.references() end, desc = "LSP: list references", noremap = true},
{mode = "n", "K", vim.lsp.buf.hover(), desc = "LSP: show documentation", noremap = true},
{mode = "n", "<F8>", function() require("conform").format({ async = true, lsp_fallback = true }) end, desc = "LSP: format", noremap = true},
-- rmagatti/goto-preview
{mode = "n", "gpd", function() require("goto-preview").goto_preview_definition() end, desc = "LSP: preview definition", noremap = true},
{mode = "n", "gpy", function() require("goto-preview").goto_preview_type_definition() end, desc = "LSP: preview type definition", noremap = true},
{mode = "n", "gpi", function() require("goto-preview").goto_preview_implementation() end, desc = "LSP: list preview implementation", noremap = true},
{mode = "n", "gpD", function() require("goto-preview").goto_preview_declaration() end, desc = "LSP: preview declaration", noremap = true},
{mode = "n", "gpr", function() require("goto-preview").goto_preview_references() end, desc = "LSP: list preview references", noremap = true},
{mode = "n", "gpc", function() require("goto-preview").close_all_win() end, desc = "LSP: close all preview windows", noremap = true},
-- filipdutescu/renamer.nvim
{mode = "n", "<F5>", function() require("renamer").rename() end, desc = "LSP: rename", noremap = true},
-- nvim-telescope/telescope.nvim
{mode = "n", "<F4>", ":Telescope find_files<CR>", desc = "Telescope: find files", noremap = true},
{mode = "n", "<leader>ff", ":Telescope find_files<CR>", desc = "Telescope: find files", noremap = true},
-- kamykn/spelunker.vim
{mode = "n", "<F6>t", ":call spelunker#toggle()<CR>", desc = "Spelunker: toggle spell check", noremap = true},
{mode = "n", "<F6>l", function() if vim.opt.spelllang._value == "de_de" then vim.opt.spelllang = "en_us" print("Spell language set to en_us") else vim.opt.spelllang = "de_de" print("Spell language set to de_de") end vim.opt.spell = false end, desc = "Spell: toggle spell language", noremap = true},
-- kevinhwang91/nvim-ufo
{mode = "n", "K", function() local winid = require("ufo").peekFoldedLinesUnderCursor() if not winid then vim.lsp.buf.hover() end end, desc = "LSP: peek folded section", noremap = true},
-- kevinhwang91/nvim-hlslens
{mode = "n", "n", [[<Cmd>execute('normal! ' . v:count1 . 'n')<CR><Cmd>lua require('hlslens').start()<CR>]], desc = "Search: search forward", noremap = true, silent = true},
{mode = "n", "N", [[<Cmd>execute('normal! ' . v:count1 . 'N')<CR><Cmd>lua require('hlslens').start()<CR>]], desc = "Search: search backwards", noremap = true, silent = true},
-- sindrets/winshift.nvim
{mode = "n", "<C-W>m", ":WinShift<CR>", desc = "Navigation: enter window shift mode", noremap = true},
-- ggandor/leap.nvim
{mode = "n", "f", "<Plug>(leap-forward)", desc = "Navigation: enter leap mode for forward movement", noremap = true},
{mode = "n", "F", "<Plug>(leap-backward)", desc = "Navigation: enter leap mode for backwards movement", noremap = true},
{mode = "n", "gf", "<Plug>(leap-from-window)", desc = "Navigation: enter leap mode for other windows", noremap = true},
-- gnikdroy/projections.nvim
{mode = "n", "<leader>fp", function() vim.cmd("Telescope projections") end, desc = "Telescope: find projects", noremap = true},
})
m.nnoremap("<leader>gt", function()
lazygit:toggle()
end, "Git: open lazygit")
m.tnoremap("<leader>gt", function()
lazygit:toggle()
end, "Git: open lazygit")
m.nnoremap("<leader>tg", function()
lazygit:toggle()
end, "Terminal: open lazygit")
m.tnoremap("<leader>tg", function()
lazygit:toggle()
end, "Terminal: open lazygit")
-- sindrets/diffview.nvim
m.nmap("<leader>gdo", ":DiffviewOpen<CR>", "Git: open diff")
m.nmap("<leader>gdc", ":DiffviewClose<CR>", "Git: close diff")
-- folke/trouble.nvim
m.nmap("<leader>x", ":TroubleToggle<CR>", "LSP: toggle error list")
-- hrsh7th/nvim-cmp
m.nnoremap("gd", vim.lsp.buf.definition(), "LSP: goto definition")
m.nnoremap("gD", vim.lsp.buf.declaration(), "LSP: goto declaration")
m.nnoremap("gi", vim.lsp.buf.implementation(), "LSP: list implementation")
m.nnoremap("gr", function()
vim.lsp.buf.references()
end, "LSP: list references")
m.nnoremap("gy", vim.lsp.buf.type_definition(), "LSP: goto type definition")
m.nnoremap("K", vim.lsp.buf.hover(), "LSP: show documentation")
m.nnoremap("<F8>", function()
require("conform").format({ async = true, lsp_fallback = true })
end, "LSP: format")
-- rmagatti/goto-preview
m.nnoremap("gpd", function()
require("goto-preview").goto_preview_definition()
end, "LSP: preview definition")
m.nnoremap("gpy", function()
require("goto-preview").goto_preview_type_definition()
end, "LSP: preview type definition")
m.nnoremap("gpi", function()
require("goto-preview").goto_preview_implementation()
end, "LSP: list preview implementation")
m.nnoremap("gpD", function()
require("goto-preview").goto_preview_declaration()
end, "LSP: preview declaration")
m.nnoremap("gpr", function()
require("goto-preview").goto_preview_references()
end, "LSP: list preview references")
m.nnoremap("gpc", function()
require("goto-preview").close_all_win()
end, "LSP: close all preview windows")
-- filipdutescu/renamer.nvim
m.nnoremap("<F5>", function()
require("renamer").rename()
end, "LSP: rename")
-- nvim-telescope/telescope.nvim
m.nnoremap("<F4>", ":Telescope find_files<CR>", "Telescope: find files")
m.nnoremap("<leader>ff", ":Telescope find_files<CR>", "Telescope: find files")
-- kamykn/spelunker.vim
m.nnoremap("<F6>t", ":call spelunker#toggle()<CR>", "Spelunker: toggle spell check")
m.nnoremap("<F6>l", function()
if vim.opt.spelllang._value == "de_de" then
vim.opt.spelllang = "en_us"
print("Spell language set to en_us")
else
vim.opt.spelllang = "de_de"
print("Spell language set to de_de")
end
vim.opt.spell = false
end, "Spell: toggle spell language")
-- kevinhwang91/nvim-ufo
m.nnoremap("K", function()
local winid = require("ufo").peekFoldedLinesUnderCursor()
if not winid then
vim.lsp.buf.hover()
end
end, "LSP: peek folded section")
-- kevinhwang91/nvim-hlslens
m.nnoremap(
"n",
[[<Cmd>execute('normal! ' . v:count1 . 'n')<CR><Cmd>lua require('hlslens').start()<CR>]],
"silent",
"Search: search forward"
)
m.nnoremap(
"N",
[[<Cmd>execute('normal! ' . v:count1 . 'N')<CR><Cmd>lua require('hlslens').start()<CR>]],
"silent",
"Search: search backwards"
)
-- sindrets/winshift.nvim
m.nnoremap("<C-W>m", ":WinShift<CR>", "Navigation: enter window shift mode")
-- ggandor/leap.nvim
m.nnoremap("f", "<Plug>(leap-forward)", "Navigation: enter leap mode for forward movement")
m.nnoremap("F", "<Plug>(leap-backward)", "Navigation: enter leap mode for backwards movement")
m.nnoremap("gf", "<Plug>(leap-from-window)", "Navigation: enter leap mode for other windows")
-- gnikdroy/projections.nvim
m.nnoremap("<leader>fp", function()
vim.cmd("Telescope projections")
end, "Telescope: find projects")

@ -1,9 +0,0 @@
return {
-- improved keybindings, previewing them
{
"b0o/mapx.nvim",
dependencies = {
"folke/which-key.nvim",
}
}
}

@ -34,7 +34,7 @@ return {
"r_language_server",
"sqlls",
"texlab",
"tsserver",
-- "tsserver",
"yamlls",
}
})

@ -0,0 +1,6 @@
return {
-- improved keybindings, previewing them
{
"folke/which-key.nvim",
}
}
Loading…
Cancel
Save