diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index ddb06d3..d50f805 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -8,11 +8,12 @@ "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, "conform.nvim": { "branch": "master", "commit": "9d5ba06d6ee7418c674f498634617416d15b6239" }, + "cpsm": { "branch": "master", "commit": "1a5fc1b6169bb80c29b0b986130c4f3f1a9ed82e" }, "diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" }, "fterm.nvim": { "branch": "master", "commit": "d1320892cc2ebab472935242d9d992a2c9570180" }, "fzy-lua-native": { "branch": "master", "commit": "820f745b7c442176bcc243e8f38ef4b985febfaf" }, "git-blame.nvim": { "branch": "master", "commit": "a0282d05adbee80aaf4e2ff35b81b52940b67bed" }, - "gitsigns.nvim": { "branch": "main", "commit": "1bb277b41d65f68b091e4ab093f59e68a0def2a6" }, + "gitsigns.nvim": { "branch": "main", "commit": "a4db718c78bff65198e3b63f1043f1e7bb5e05c8" }, "goto-preview": { "branch": "main", "commit": "527fd81a827234e26ca47891abe90497215db2a6" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, "knap": { "branch": "main", "commit": "d4ea571d2d4e139d288b758c5bab31788d30eea3" }, @@ -21,15 +22,15 @@ "lsp_signature.nvim": { "branch": "master", "commit": "c6aeb2f1d2538bbdfdaab1664d9d4c3c75aa9db8" }, "lspkind-nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, "lualine.nvim": { "branch": "master", "commit": "b5e8bb642138f787a2c1c5aedc2a78cb2cebbd67" }, - "luasnip": { "branch": "master", "commit": "79cc25c39878401d4e8b6ec42fcf14639426bafc" }, + "luasnip": { "branch": "master", "commit": "825a61bad1d60d917a7962d73cf3c683f4e0407e" }, "mapx.nvim": { "branch": "main", "commit": "c3dd43474a5fc2f266309bc04a69b74eb2524671" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "9dfcf2036c223920826140f0151d929a43f9eceb" }, "mason-null-ls.nvim": { "branch": "main", "commit": "e270134d83ba59425edc53356c6fd337b61bb8dd" }, "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, "modes.nvim": { "branch": "main", "commit": "4035a46aaabe43faf1b54740575af9dd5bb03809" }, - "none-ls.nvim": { "branch": "main", "commit": "e632688737b6b878e900ac69179a9aae734bb331" }, + "none-ls.nvim": { "branch": "main", "commit": "fff481b65d88415933b9574dc0e1947724bcf64a" }, "nvim-autopairs": { "branch": "master", "commit": "dbfc1c34bed415906395db8303c71039b3a3ffb4" }, - "nvim-cmp": { "branch": "main", "commit": "2fb2a3cf78bbc1b0bea030e8c8728985af1cf302" }, + "nvim-cmp": { "branch": "main", "commit": "ce16de5665c766f39c271705b17fff06f7bcb84f" }, "nvim-colorizer.lua": { "branch": "master", "commit": "0b3950aed7bc35b78200bc292156aa77d2a4d342" }, "nvim-docs-view": { "branch": "master", "commit": "78d88bca16f32a430572758677f9246f6d7f7b94" }, "nvim-hlslens": { "branch": "main", "commit": "c42b4526e6d83b904eb5f3d50e68d7c2fc4be4b5" }, @@ -38,10 +39,10 @@ "nvim-scrollbar": { "branch": "main", "commit": "35f99d559041c7c0eff3a41f9093581ceea534e8" }, "nvim-surround": { "branch": "main", "commit": "d47001f8ddf9646c24f16d2732d4d0255acd2121" }, "nvim-tree.lua": { "branch": "master", "commit": "d8d3a1590a05b2d8b5eb26e2ed1c6052b1b47a77" }, - "nvim-treesitter": { "branch": "master", "commit": "d31eb5442deb4940a98b5573b78eb822b74fbcea" }, + "nvim-treesitter": { "branch": "master", "commit": "54cf9180a36299265e217858e6e531245074c3f4" }, "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, "nvim-ts-rainbow": { "branch": "master", "commit": "ef95c15a935f97c65a80e48e12fe72d49aacf9b9" }, - "nvim-ufo": { "branch": "main", "commit": "458aa4451b98614cfab6b3d7beddc8caff5e3052" }, + "nvim-ufo": { "branch": "main", "commit": "49acf0010ccc08d727582da8cbf5e4c3f3b0cc53" }, "nvim-web-devicons": { "branch": "master", "commit": "3ee60deaa539360518eaab93a6c701fe9f4d82ef" }, "nvim-yarp": { "branch": "master", "commit": "bb5f5e038bfe119d3b777845a76b0b919b35ebc8" }, "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, diff --git a/.config/nvim/lua/keymap.lua b/.config/nvim/lua/keymap.lua index a73bdd3..bd2d145 100644 --- a/.config/nvim/lua/keymap.lua +++ b/.config/nvim/lua/keymap.lua @@ -1,5 +1,5 @@ -- setup keymap function -local m = require 'mapx'.setup { global = true, whichkey = true } +local m = require("mapx").setup({ global = true, whichkey = true }) -- setup keymap groups m.nname("g", "LSP: goto") @@ -14,71 +14,91 @@ m.nname("t", "Terminal") m.nname("", "Navigation") -- unmap unwanted commands -m.nnoremap("Zt", '') -m.nnoremap("ZT", '') -m.nnoremap("", '') -m.inoremap("", '') -m.inoremap("", '') -m.inoremap("", '') -m.inoremap("", '') -m.inoremap("", '') -m.inoremap("", '') -m.inoremap("", '') -m.nnoremap("", '') -m.inoremap("", '') -m.nnoremap("", '') -m.inoremap("", '') -m.nnoremap("", '') -m.inoremap("", '') -m.nnoremap("", '') +m.nnoremap("Zt", "") +m.nnoremap("ZT", "") +m.nnoremap("", "") +m.inoremap("", "") +m.inoremap("", "") +m.inoremap("", "") +m.inoremap("", "") +m.inoremap("", "") +m.inoremap("", "") +m.inoremap("", "") +m.nnoremap("", "") +m.inoremap("", "") +m.nnoremap("", "") +m.inoremap("", "") +m.nnoremap("", "") +m.inoremap("", "") +m.nnoremap("", "") + +-- spell +m.nmap("s", "z=", "Spell: display suggestions") -- shortcuts for quitting -m.nnoremap("ZA", ':xa', 'Exit: write and quit all buffers') -m.nnoremap("ZQ", ':conf q', 'Exit: quit current buffer') -m.nnoremap("ZZ", ':x', 'Exit: write and quit current buffer') +m.nnoremap("ZA", ":xa", "Exit: write and quit all buffers") +m.nnoremap("ZQ", ":conf q", "Exit: quit current buffer") +m.nnoremap("ZZ", ":x", "Exit: write and quit current buffer") -- shortcut for split navigation -m.nnoremap("", 'h', 'Navigation: go to left window') -m.nnoremap("", 'j', 'Navigation: go to lower window') -m.nnoremap("", 'k', 'Navigation: go to upper window') -m.nnoremap("", 'l', 'Navigation: go to right window') +m.nnoremap("", "h", "Navigation: go to left window") +m.nnoremap("", "j", "Navigation: go to lower window") +m.nnoremap("", "k", "Navigation: go to upper window") +m.nnoremap("", "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') +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("c", ':w! | !compiler %', 'Compile: current file') +m.nnoremap("c", ":w! | !compiler %", "Compile: current file") -- save file as sudo on files that require root permission -m.cnoremap("w!!", 'execute "silent! write !sudo tee % >/dev/null" edit!', 'Write: overwrite file over with sudo') +m.cnoremap( + "w!!", + 'execute "silent! write !sudo tee % >/dev/null" edit!', + "Write: overwrite file over with sudo" +) -- tpope/vim-abolish -m.nnoremap("sa", ':%S//g', 'Substitute: free form') -m.nnoremap("ss", ':%S/\\<\\>//g', 'Substitute: word under cursor') +m.nnoremap("sa", ":%S//g", "Substitute: free form") +m.nnoremap("ss", ":%S/\\<\\>//g", "Substitute: word under cursor") -- simrat39/symbols-outline.nvim -m.nmap('', ':SymbolsOutline', 'CTags: toggle') +m.nmap("", ":SymbolsOutline", "CTags: toggle") -- nvim-tree/nvim-tree.lua -m.nmap("", ':NvimTreeToggle toggle', 'File tree: toggle') +m.nmap("", ":NvimTreeToggle toggle", "File tree: toggle") -- mbbill/undotree -m.nmap("", ':UndotreeToggle', 'Undo tree: toggle') +m.nmap("", ":UndotreeToggle", "Undo tree: toggle") -- amrbashir/nvim-docs-view -m.nnoremap("go", ':DocsViewToggle', 'LSP: toggle documentation window') +m.nnoremap("go", ":DocsViewToggle", "LSP: toggle documentation window") -- numtostr/fterm.nvim -m.nnoremap("tt", require("FTerm").toggle, 'Terminal: open') -m.tnoremap("tt", require("FTerm").toggle, 'Terminal: open') +m.nnoremap("tt", require("FTerm").toggle, "Terminal: open") +m.tnoremap("tt", require("FTerm").toggle, "Terminal: open") local lazygit = require("FTerm"):new({ - cmd = 'lazygit', + cmd = "lazygit", }) -m.nnoremap("gt", function() lazygit:toggle() end, 'Git: open lazygit') -m.tnoremap("gt", function() lazygit:toggle() end, 'Git: open lazygit') -m.nnoremap("tg", function() lazygit:toggle() end, 'Terminal: open lazygit') -m.tnoremap("tg", function() lazygit:toggle() end, 'Terminal: open lazygit') +m.nnoremap("gt", function() + lazygit:toggle() +end, "Git: open lazygit") +m.tnoremap("gt", function() + lazygit:toggle() +end, "Git: open lazygit") +m.nnoremap("tg", function() + lazygit:toggle() +end, "Terminal: open lazygit") +m.tnoremap("tg", function() + lazygit:toggle() +end, "Terminal: open lazygit") -- sindrets/diffview.nvim m.nmap("gdo", ":DiffviewOpen", "Git: open diff") @@ -91,42 +111,78 @@ m.nmap("x", ":TroubleToggle", "LSP: toggle error list") 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("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("", function() require("conform").format({ async = true, lsp_fallback = true }) end, "LSP: format") +m.nnoremap("", 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") +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("", function() require("renamer").rename() end, "LSP: rename") +m.nnoremap("", function() + require("renamer").rename() +end, "LSP: rename") -- nvim-telescope/telescope.nvim -m.nnoremap("", ':Telescope find_files', "Telescope: find files") -m.nnoremap("ff", ':Telescope find_files', "Telescope: find files") +m.nnoremap("", ":Telescope find_files", "Telescope: find files") +m.nnoremap("ff", ":Telescope find_files", "Telescope: find files") -- kamykn/spelunker.vim -m.nnoremap("", ':call spelunker#toggle()', "Spelling: toggle spell check") +m.nnoremap("t", ":call spelunker#toggle()", "Spelunker: toggle spell check") +m.nnoremap("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() + 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", [[execute('normal! ' . v:count1 . 'n')lua require('hlslens').start()]], - 'silent', "Search: search forward") -m.nnoremap("N", [[execute('normal! ' . v:count1 . 'N')lua require('hlslens').start()]], - 'silent', "Search: search backwards") +m.nnoremap( + "n", + [[execute('normal! ' . v:count1 . 'n')lua require('hlslens').start()]], + "silent", + "Search: search forward" +) +m.nnoremap( + "N", + [[execute('normal! ' . v:count1 . 'N')lua require('hlslens').start()]], + "silent", + "Search: search backwards" +) -- sindrets/winshift.nvim m.nnoremap("m", ":WinShift", "Navigation: enter window shift mode") @@ -137,4 +193,6 @@ m.nnoremap("S", "(leap-backward)", "Navigation: enter leap mode for backwa m.nnoremap("gs", "(leap-from-window", "Navigation: enter leap mode for other windows") -- gnikdroy/projections.nvim -m.nnoremap("fp", function() vim.cmd("Telescope projections") end, "Telescope: find projects") +m.nnoremap("fp", function() + vim.cmd("Telescope projections") +end, "Telescope: find projects") diff --git a/.config/nvim/lua/plugins/wilder.lua b/.config/nvim/lua/plugins/wilder.lua index 1a8c764..9c5b46c 100644 --- a/.config/nvim/lua/plugins/wilder.lua +++ b/.config/nvim/lua/plugins/wilder.lua @@ -1,35 +1,36 @@ return { -- improved wild menu { - 'gelguy/wilder.nvim', + "gelguy/wilder.nvim", dependencies = { { "nvim-tree/nvim-web-devicons", - lazy = true + lazy = true, }, - 'roxma/nvim-yarp', - 'roxma/vim-hug-neovim-rpc', - 'romgrk/fzy-lua-native' + "roxma/nvim-yarp", + "roxma/vim-hug-neovim-rpc", + "romgrk/fzy-lua-native", + "nixprime/cpsm", }, config = function() - local wilder = require('wilder') + local wilder = require("wilder") wilder.setup({ - modes = {':', '/', '?'}, - accept_key = '', - reject_key = '' + modes = { ":", "/", "?" }, + accept_key = "", + reject_key = "", }) - wilder.set_option('pipeline', { + wilder.set_option("pipeline", { wilder.branch( wilder.python_file_finder_pipeline({ file_command = function(ctx, arg) - if string.find(arg, '.') ~= nil then - return {'fd', '-tf', '-H'} + if string.find(arg, ".") ~= nil then + return { "fd", "-tf", "-H" } else - return {'fd', '-tf'} + return { "fd", "-tf" } end end, - dir_command = {'fd', '-td'}, - filters = {'cpsm_filter'}, + dir_command = { "fd", "-td" }, + filters = { "cpsm_filter" }, }), wilder.substitute_pipeline({ pipeline = wilder.python_search_pipeline({ @@ -44,7 +45,9 @@ return { fuzzy_filter = wilder.lua_fzy_filter(), }), { - wilder.check(function(ctx, x) return x == '' end), + wilder.check(function(ctx, x) + return x == "" + end), wilder.history(), }, wilder.python_search_pipeline({ @@ -58,11 +61,14 @@ return { wilder.pcre2_highlighter(), wilder.lua_fzy_highlighter(), } - wilder.set_option('renderer', wilder.popupmenu_renderer({ - highlighter = highlighters, - left = { ' ', wilder.popupmenu_devicons() }, - right = { ' ', wilder.popupmenu_scrollbar() }, - })) + wilder.set_option( + "renderer", + wilder.popupmenu_renderer({ + highlighter = highlighters, + left = { " ", wilder.popupmenu_devicons() }, + right = { " ", wilder.popupmenu_scrollbar() }, + }) + ) end, - } + }, }