diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 9bafbce..0d1df21 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,13 +1,12 @@ { "LazyVim": { "branch": "main", "commit": "68ff818a5bb7549f90b05e412b76fe448f605ffb" }, "LuaSnip": { "branch": "master", "commit": "1f4ad8bb72bdeb60975e98652636b991a9b7475d" }, - "SchemaStore.nvim": { "branch": "main", "commit": "357fe900baae09e1a3fcef913e49733d05d1f888" }, + "SchemaStore.nvim": { "branch": "main", "commit": "9fb873af43568464f9a1936fc334dfa3d7a59418" }, "alpha-nvim": { "branch": "main", "commit": "234822140b265ec4ba3203e3e0be0e0bb826dff5" }, "bufferline.nvim": { "branch": "main", "commit": "9e8d2f695dd50ab6821a6a53a840c32d2067a78a" }, "catppuccin": { "branch": "main", "commit": "a8dfb969e76d1a0752d98b5347be9ffb9bca9592" }, "clangd_extensions.nvim": { "branch": "main", "commit": "34c8eaa12be192e83cd4865ce2375e9f53e728f2" }, "cmake-tools.nvim": { "branch": "master", "commit": "4b965b5785776b6d258d57ce8fb7efa1a8170a7b" }, - "cmp-async-path": { "branch": "main", "commit": "d8229a93d7b71f22c66ca35ac9e6c6cd850ec61d" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, @@ -17,17 +16,13 @@ "dressing.nvim": { "branch": "master", "commit": "fe3071330a0720ce3695ac915820c8134b22d1b0" }, "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, "friendly-snippets": { "branch": "main", "commit": "43727c2ff84240e55d4069ec3e6158d74cb534b6" }, - "git-blame.nvim": { "branch": "master", "commit": "f07e913b7143f19edd6787229f2d51759b478600" }, - "gitsigns.nvim": { "branch": "main", "commit": "37d26d718f8120a8c5c107c580c8c98cf89fdf1f" }, - "harpoon": { "branch": "master", "commit": "c1aebbad9e3d13f20bedb8f2ce8b3a94e39e424a" }, + "gitsigns.nvim": { "branch": "main", "commit": "0ccd5fb2316b3f8d8b2f775bc31cae7bc6a77a55" }, "headlines.nvim": { "branch": "master", "commit": "e3d7bfdf40e41a020d966d35f8b48d75b90367d2" }, "indent-blankline.nvim": { "branch": "master", "commit": "29be0919b91fb59eca9e90690d76014233392bef" }, - "instant.nvim": { "branch": "master", "commit": "294b6d08143b3db8f9db7f606829270149e1a786" }, "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, - "ltex_extra.nvim": { "branch": "master", "commit": "9bed99b2b8488cc2daf66c76d2e0cf051ee80d13" }, "lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "faeb361507aa1ef1b0e5645781e2aa0d36a4aa84" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "ab640b38ca9fa50d25d2d249b6606b9456b628d5" }, "mason.nvim": { "branch": "main", "commit": "41e75af1f578e55ba050c863587cffde3556ffa6" }, "mini.ai": { "branch": "main", "commit": "4a2e387b121352dfb478f440c9a5313a9d97006c" }, "mini.bufremove": { "branch": "main", "commit": "f53c7f27e36009fe61563c11cde154b94a0e5b94" }, @@ -35,24 +30,21 @@ "mini.indentscope": { "branch": "main", "commit": "c8fdafa7bf603d758986a27eb546c55a5c73b1a3" }, "mini.pairs": { "branch": "main", "commit": "71f117fd57f930da6ef4126b24f594dd398bac26" }, "mini.surround": { "branch": "main", "commit": "af8129efcabe95fc08a233e9f91569829bed031f" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "f053f09962819c1558cd93639aa80edf7c314c17" }, "neoconf.nvim": { "branch": "main", "commit": "64437787dba70fce50dad7bfbb97d184c5bc340f" }, "neodev.nvim": { "branch": "main", "commit": "b2881eeb395d2b268de5fe9b5e201a8f1816beb8" }, - "neoscroll.nvim": { "branch": "master", "commit": "e85740d1a54ab0f10127b08c67a291053bc3acfa" }, "neotest": { "branch": "master", "commit": "d424d262d01bccc1e0b038c9a7220a755afd2a1f" }, - "neotest-dotnet": { "branch": "main", "commit": "f7bdb60c3d7716f75fb04582f64dae8efb7716f1" }, - "neotest-go": { "branch": "main", "commit": "1a15e1136db43775214a3e7a598f8930c29c94b7" }, - "neotest-java": { "branch": "main", "commit": "5b915ad065e24149983a672c63e7273fe742fc0e" }, "neotest-python": { "branch": "master", "commit": "c969a5b0073f2b5c8eaf017d1652f9251d761a15" }, "neotest-rust": { "branch": "main", "commit": "f4e58d5278344440f65c5a5177f16711337e44f7" }, + "noice.nvim": { "branch": "main", "commit": "92433164e2f7118d4122c7674c3834d9511722ba" }, "nui.nvim": { "branch": "main", "commit": "c0c8e347ceac53030f5c1ece1c5a5b6a17a25b32" }, - "null.nvim": { "branch": "main", "commit": "bc6ea9deac03b791cdd980d8c84a5d923a26381c" }, "nvim-cmp": { "branch": "main", "commit": "0b751f6beef40fd47375eaf53d3057e0bfa317e4" }, "nvim-jdtls": { "branch": "master", "commit": "503a399e0d0b5d432068ab5ae24b9848891b0d53" }, "nvim-lint": { "branch": "master", "commit": "15fcab91e6a4e2a3e41dc55c5b3471f66c11ce39" }, - "nvim-lspconfig": { "branch": "master", "commit": "29939f6f07bc0f3b9fc563fbfbee06ac88c8c439" }, + "nvim-lspconfig": { "branch": "master", "commit": "48347089666d5b77d054088aa72e4e0b58026e6e" }, + "nvim-notify": { "branch": "master", "commit": "e4a2022f4fec2d5ebc79afa612f96d8b11c627b3" }, "nvim-spectre": { "branch": "master", "commit": "a18a58015b46f02b4fe537ebfffd82e46110ff24" }, - "nvim-tree.lua": { "branch": "master", "commit": "80cfeadf179d5cba76f0f502c71dbcff1b515cd8" }, - "nvim-treesitter": { "branch": "master", "commit": "8199529bc42ab275786d2f2cc83903f35ff6db9e" }, + "nvim-treesitter": { "branch": "master", "commit": "557561fbc17269cdd4e9e88ef0ca1a9ff0bbf7e6" }, "nvim-treesitter-context": { "branch": "master", "commit": "c03f8aab1e6649036d69ba7e3af4d09cb7e4d977" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "dbcd9388e3b119a87c785e10a00d62876077d23d" }, "nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" }, @@ -63,20 +55,14 @@ "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, "rust-tools.nvim": { "branch": "master", "commit": "0cc8adab23117783a0292a0c8a2fbed1005dc645" }, "tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "bc25c56083939f274edcfe395c6ff7de23b67c50" }, - "telescope-file-browser.nvim": { "branch": "master", "commit": "f41675fddb1ea9003187d07ecc627a8bf8292633" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, - "telescope-project.nvim": { "branch": "master", "commit": "5460c6c60d48618c5c746e5b1cad4c3e8262fdae" }, - "telescope-zoxide": { "branch": "main", "commit": "68966349aa1b8e9ade403e18479ecf79447389a7" }, "telescope.nvim": { "branch": "master", "commit": "18774ec7929c8a8003a91e9e1f69f6c32258bbfe" }, "todo-comments.nvim": { "branch": "main", "commit": "4a6737a8d70fe1ac55c64dfa47fcb189ca431872" }, "tokyonight.nvim": { "branch": "main", "commit": "f247ee700b569ed43f39320413a13ba9b0aef0db" }, "tree-sitter-hypr": { "branch": "master", "commit": "90b3ddf8a85b5ea3d9dc4920fddb16182a192e14" }, "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, - "typst.vim": { "branch": "main", "commit": "e72561f0023860eb83bd7680573b05ecfc016c55" }, "venv-selector.nvim": { "branch": "main", "commit": "c259dacb20a00fb84ec6006e9a24b4085b27120a" }, "vim-illuminate": { "branch": "master", "commit": "3bd2ab64b5d63b29e05691e624927e5ebbf0fb86" }, "vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" }, - "vim-visual-multi": { "branch": "master", "commit": "aec289a9fdabaa0ee6087d044d75b32e12084344" }, - "vimtex": { "branch": "master", "commit": "a630f0f75d9468d10c9125f2f1b0049e479c2f54" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } } \ No newline at end of file diff --git a/nvim/lua/config/autocmds.lua b/nvim/lua/config/autocmds.lua index 88d3468..d68377c 100644 --- a/nvim/lua/config/autocmds.lua +++ b/nvim/lua/config/autocmds.lua @@ -17,45 +17,3 @@ vim.api.nvim_create_autocmd("LspAttach", { end end, }) - -local modifiedBufs = function(bufs) - local t = 0 - for _, v in pairs(bufs) do - if v.name:match("NvimTree_") == nil then - t = t + 1 - end - end - return t -end - -vim.api.nvim_create_autocmd("BufEnter", { - nested = true, - callback = function() - if - #vim.api.nvim_list_wins() == 1 - and vim.api.nvim_buf_get_name(0):match("NvimTree_") ~= nil - and modifiedBufs(vim.fn.getbufinfo({ bufmodified = 1 })) == 0 - then - vim.cmd("quit") - end - end, -}) - -local function open_nvim_tree(data) - -- buffer is a directory - local directory = vim.fn.isdirectory(data.file) == 1 - - if not directory then - return - end - - -- change to the directory - if directory then - vim.cmd.cd(data.file) - end - - -- open the tree - require("nvim-tree.api").tree.open() -end - -vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree }) diff --git a/nvim/lua/config/keymaps.lua b/nvim/lua/config/keymaps.lua index dbd795d..f98d3b4 100644 --- a/nvim/lua/config/keymaps.lua +++ b/nvim/lua/config/keymaps.lua @@ -43,11 +43,6 @@ map("i", "", [[wincmd h]], opts) map("i", "", [[wincmd l]], opts) map("i", "", [[wincmd j]], opts) --- file tree -map("n", "", function() - require("nvim-tree.api").tree.toggle() -end, opts) - -- toggle terminal local lazyterm = function() Util.terminal(nil, { cwd = Util.root(), esc_esc = false, ctrl_hjkl = false }) @@ -142,6 +137,11 @@ require("neoscroll.config").set_mappings(t) -- trouble map("n", "t", "TroubleToggle", term_opts) +-- format +map({ "n", "v" }, "", function() + Util.format({ force = true }) +end, { desc = "Format" }) + -- better yank function Better_yank(opts) local current_line = unpack(vim.api.nvim_win_get_cursor(0)) diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua index 885f3ed..50a2ce0 100644 --- a/nvim/lua/config/lazy.lua +++ b/nvim/lua/config/lazy.lua @@ -1,15 +1,18 @@ local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then - -- bootstrap lazy.nvim - -- stylua: ignore - vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", - lazypath }) + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", + lazypath, + }) end vim.opt.rtp:prepend(vim.env.LAZY or lazypath) require("lazy").setup({ spec = { - -- add LazyVim and import its plugins { "LazyVim/LazyVim", import = "lazyvim.plugins" }, { import = "lazyvim.plugins.extras.lang.rust" }, { import = "lazyvim.plugins.extras.lang.java" }, @@ -26,32 +29,18 @@ require("lazy").setup({ { import = "lazyvim.plugins.extras.ui.alpha" }, { import = "plugins" }, { import = "plugins.plugins" }, - -- import any extras modules here - -- { import = "lazyvim.plugins.extras.lang.typescript" }, - -- { import = "lazyvim.plugins.extras.lang.json" }, - -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, - -- import/override with your plugins }, defaults = { - -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. - -- If you - lazy = false, - -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, - -- have outdated releases, which may break your Neovim install. - version = false, -- always use the latest git commit - -- version = "*", -- try installing the latest stable version for plugins that support semver + lazy = true, + version = false, }, install = { colorscheme = { "tokyonight", "catppuccin-mocha" } }, checker = { enabled = true, notify = false }, - change_detection = { enabled = true, notify = false }, --know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. + change_detection = { enabled = true, notify = false }, performance = { rtp = { - -- disable some rtp plugins disabled_plugins = { "gzip", - -- "matchit", - -- "matchparen", - -- "netrwPlugin", "tarPlugin", "tohtml", "tutor", diff --git a/nvim/lua/config/lsp-keymap.lua b/nvim/lua/config/lsp-keymap.lua index 5218d6c..1951e04 100644 --- a/nvim/lua/config/lsp-keymap.lua +++ b/nvim/lua/config/lsp-keymap.lua @@ -15,7 +15,7 @@ function M.get() { "cl", "LspInfo", desc = "Lsp Info" }, { "ca", "Telescope lsp_definitions", desc = "Goto Definition", has = "definition" }, { "cs", "Telescope lsp_references", desc = "References" }, - { "gD", vim.lsp.buf.declaration, desc = "Goto Declaration" }, + { "cA", vim.lsp.buf.declaration, desc = "Goto Declaration" }, { "cf", "Telescope lsp_implementations", desc = "Goto Implementation" }, { "cd", "Telescope lsp_type_definitions", desc = "Goto Type Definition" }, { "ce", vim.lsp.buf.hover, desc = "Hover" }, @@ -27,8 +27,8 @@ function M.get() { "[e", M.diagnostic_goto(false, "ERROR"), desc = "Prev Error" }, { "]w", M.diagnostic_goto(true, "WARN"), desc = "Next Warning" }, { "[w", M.diagnostic_goto(false, "WARN"), desc = "Prev Warning" }, - { "", format, desc = "Format Document", has = "formatting" }, - -- { "cf", format, desc = "Format Range", mode = "v", has = "documentRangeFormatting" }, + { "", format, desc = "Format Range", mode = "v", has = "documentRangeFormatting" }, + { "cr", ":IncRename ", desc = "FUCK", has = "rename" }, { "cq", function() @@ -68,20 +68,6 @@ function M.get() has = "codeAction", }, } - if require("lazyvim.util").has("inc-rename.nvim") then - M._keys[#M._keys + 1] = { - "cr", - function() - require("inc_rename") - return ":IncRename " .. vim.fn.expand("") - end, - expr = true, - desc = "Rename", - has = "rename", - } - else - M._keys[#M._keys + 1] = { "cr", vim.lsp.buf.rename, desc = "Rename", has = "rename" } - end end return M._keys end diff --git a/nvim/lua/plugins/dap b/nvim/lua/plugins/dap deleted file mode 100644 index f55d805..0000000 --- a/nvim/lua/plugins/dap +++ /dev/null @@ -1,301 +0,0 @@ -return { - { - "rcarriga/nvim-dap-ui", - keys = {}, - opts = {}, - config = function(_, opts) - local dap = require("dap") - local dapui = require("dapui") - dapui.setup(opts) - dap.listeners.after.event_initialized["dapui_config"] = function() - dapui.open({}) - end - dap.listeners.before.event_terminated["dapui_config"] = function() - dapui.close({}) - end - dap.listeners.before.event_exited["dapui_config"] = function() - dapui.close({}) - end - end, - }, - { - "mfussenegger/nvim-dap", - lazy = true, - dependencies = { - "rcarriga/nvim-dap-ui", - "theHamsta/nvim-dap-virtual-text", - { - "jay-babu/mason-nvim-dap.nvim", - opts = { - ensure_installed = { - "node2", - "python", - "javadbg", - "javatest", - "codelldb", - "firefox", - "bash", - "delve", - "coreclr", - }, - automatic_installation = true, - automatic_setup = true, - }, - config = function(_, opts) - require("mason-nvim-dap").setup(opts) - -- require("mason-nvim-dap").setup_handlers({ - -- javadbg = function() end, - -- }) - end, - }, - }, - config = function() - local dap = require("dap") - dap.adapters.lldb = { - type = "executable", - command = "/usr/bin/lldb-vscode", - name = "lldb", - } - dap.adapters.nlua = function(callback, config) - callback({ type = "server", host = config.host or "127.0.0.1", port = config.port or 8086 }) - end - dap.adapters.bashdb = { - type = "executable", - command = vim.fn.stdpath("data") .. "/mason/packages/bash-debug-adapter/bash-debug-adapter", - name = "bashdb", - } - dap.adapters.coreclr = { - type = "executable", - command = "netcoredbg", - args = { "--interpreter=vscode" }, - } - - -- local rust_dap = Get_git_root().cwd - -- local filename = "" - -- for w in rust_dap:gmatch("([^/]+)") do - -- filename = w - -- end - -- filename = filename:gsub("-", "_") - -- filename = string.lower(filename) - - -- dap.configurations.rust = { - -- { - -- type = "lldb", - -- request = "launch", - -- program = function() - -- return rust_dap .. "/target/debug/" .. filename - -- end, - -- --program = '${fileDirname}/${fileBasenameNoExtension}', - -- cwd = "${workspaceFolder}", - -- terminal = "integrated", - -- initCommands = function() - -- -- Find out where to look for the pretty printer Python module - -- local rustc_sysroot = vim.fn.trim(vim.fn.system("rustc --print sysroot")) - -- - -- local script_import = 'command script import "' .. rustc_sysroot .. '/lib/rustlib/etc/lldb_lookup.py"' - -- local commands_file = rustc_sysroot .. "/lib/rustlib/etc/lldb_commands" - -- - -- local commands = {} - -- local file = io.open(commands_file, "r") - -- if file then - -- for line in file:lines() do - -- table.insert(commands, line) - -- end - -- file:close() - -- end - -- table.insert(commands, 1, script_import) - -- - -- return commands - -- end, - -- }, - -- } - - dap.configurations.cpp = { - { - name = "debug cpp", - type = "lldb", - request = "launch", - program = function() - return vim.fn.input("Path to executable: ", Get_git_root().cwd .. "/build/", "file") - end, - cwd = "${workspaceFolder}", - terminal = "integrated", - }, - } - dap.configurations.c = dap.configurations.cpp - - dap.configurations.python = { - { - type = "python", -- the type here established the link to the adapter definition: `dap.adapters.python` - request = "launch", - name = "Launch file", - program = "${file}", -- This configuration will launch the current file if used. - pythonPath = function() - local cwd = vim.fn.getcwd() - if vim.fn.executable(cwd .. "/venv/bin/python") == 1 then - return cwd .. "/venv/bin/python" - elseif vim.fn.executable(cwd .. "/.venv/bin/python") == 1 then - return cwd .. "/.venv/bin/python" - else - return "/usr/bin/python" - end - end, - }, - } - dap.configurations.java = { - { - request = "attach", - name = "Debug (Attach) - Remote", - hostName = "127.0.0.1", - port = 5005, - }, - } - dap.configurations.go = { - { - type = "delve", - name = "Debug", - request = "launch", - program = "${file}", - }, - { - type = "delve", - name = "Debug test", -- configuration for debugging test files - request = "launch", - mode = "test", - program = "${file}", - }, - { - type = "delve", - name = "Debug test (go.mod)", - request = "launch", - mode = "test", - program = "./${relativeFileDirname}", - }, - } - dap.configurations.javascript = { - { - name = "Launch", - type = "js", - request = "launch", - program = "${file}", - cwd = vim.fn.getcwd(), - sourceMaps = true, - protocol = "inspector", - console = "integratedTerminal", - }, - } - dap.configurations.typescript = { - { - name = "Debug with Firefox", - type = "firefox", - request = "launch", - reAttach = true, - url = "http://localhost:3000", - webRoot = "${workspaceFolder}", - firefoxExecutable = "/usr/bin/firefox", - }, - } - dap.configurations.lua = { - { - type = "nlua", - request = "attach", - name = "Attach to running Neovim instance", - }, - } - dap.configurations.cs = { - { - type = "coreclr", - name = "launch - netcoredbg", - request = "launch", - program = function() - return vim.fn.input("Path to dll: ", Get_git_root().cwd, "file") - end, - -- args = function() - -- vim.fn.input("args: ", Get_git_root().cwd, "file") - -- end, - }, - } - dap.configurations.sh = { - { - type = "bashdb", - request = "launch", - name = "Launch file", - showDebugOutput = true, - pathBashdb = vim.fn.stdpath("data") .. "/mason/packages/bash-debug-adapter/extension/bashdb_dir/bashdb", - pathBashdbLib = vim.fn.stdpath("data") .. "/mason/packages/bash-debug-adapter/extension/bashdb_dir", - trace = true, - file = "${file}", - program = "${file}", - cwd = "${workspaceFolder}", - pathCat = "cat", - pathBash = "/bin/bash", - pathMkfifo = "mkfifo", - pathPkill = "pkill", - args = {}, - env = {}, - terminalKind = "integrated", - }, - } - require("dapui").setup({ - icons = { expanded = "▾", collapsed = "▸", current_frame = "▸" }, - mappings = { - expand = { "", "<2-LeftMouse>" }, - open = "o", - remove = "d", - edit = "e", - repl = "r", - toggle = "t", - }, - expand_lines = vim.fn.has("nvim-0.7") == 1, - layouts = { - { - elements = { - { id = "scopes", size = 0.25 }, - "breakpoints", - "stacks", - "watches", - }, - size = 40, -- 40 columns - position = "left", - }, - { - elements = { - "repl", - "console", - }, - size = 0.25, -- 25% of total lines - position = "bottom", - }, - }, - controls = { - enabled = true, - element = "repl", - icons = { - pause = "", - play = "", - step_into = "", - step_over = "", - step_out = "", - step_back = "", - run_last = "↻", - terminate = "□", - }, - }, - floating = { - max_height = nil, -- These can be integers or a float between 0 and 1. - max_width = nil, -- Floats will be treated as percentage of your screen. - border = "single", -- Border style. Can be "single", "double" or "rounded" - mappings = { - close = { "q", "" }, - }, - }, - windows = { indent = 1 }, - render = { - max_type_length = nil, -- Can be integer or nil. - max_value_lines = 100, -- Can be integer or nil. - }, - }) - require("nvim-dap-virtual-text").setup() - end, - }, -} diff --git a/nvim/lua/plugins/disabled.lua b/nvim/lua/plugins/disabled.lua index c143d0e..2db2e59 100644 --- a/nvim/lua/plugins/disabled.lua +++ b/nvim/lua/plugins/disabled.lua @@ -1,7 +1,4 @@ return { - { - { "nvim-neo-tree/neo-tree.nvim", enabled = false }, - }, { { "rcarriga/nvim-notify", enabled = false }, }, diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua index 60429d9..603bc0a 100644 --- a/nvim/lua/plugins/lsp.lua +++ b/nvim/lua/plugins/lsp.lua @@ -146,7 +146,6 @@ return { opencl_ls = {}, yamlls = {}, lua_ls = { - -- mason = false, -- set to false if you don't want this server to be installed with mason settings = { Lua = { workspace = { @@ -165,35 +164,28 @@ return { end, }, }, - setup = function(_, _) - local Util = require("lazyvim.util") - Util.lsp.on_attach(function(client, buffer) - require("config.lsp-keymap").on_attach(client, buffer) - end) - - vim.cmd([[highlight LspInlayHint guibg=#1A1B26]]) + init = function() + local keys = require("lazyvim.plugins.lsp.keymaps").get() + local my_keys = require("config.lsp-keymap").get() + local count = 0 + for _ in pairs(my_keys) do + keys[#keys + 1] = my_keys[count] + count = count + 1 + end end, }, { - "DashieTM/null.nvim", - event = { "BufReadPre", "BufNewFile" }, - dependencies = { "mason.nvim" }, + "stevearc/conform.nvim", opts = function() - local nls = require("null-ls") - return { - root_dir = require("null-ls.utils").root_pattern(".null-ls-root", ".neoconf.json", "Makefile", ".git"), - - sources = { - nls.builtins.formatting.fish_indent, - nls.builtins.diagnostics.fish, - nls.builtins.formatting.stylua, - nls.builtins.formatting.shfmt, - nls.builtins.diagnostics.flake8, - nls.builtins.formatting.autopep8, - nls.builtins.formatting.prettierd, - nls.builtins.formatting.typst, + local opts = { + formatters_by_ft = { + lua = { "stylua" }, + fish = { "fish_indent" }, + sh = { "shfmt" }, + typst = { "typstfmt" }, }, } + return opts end, }, } diff --git a/nvim/lua/plugins/nvimtree.lua b/nvim/lua/plugins/nvimtree.lua deleted file mode 100644 index 903f4af..0000000 --- a/nvim/lua/plugins/nvimtree.lua +++ /dev/null @@ -1,104 +0,0 @@ -return { - { - "nvim-tree/nvim-tree.lua", - lazy = true, - opts = { - on_attach = function(bufnr) - local api = require("nvim-tree.api") - local function opts(desc) - return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true } - end - vim.keymap.set("n", "", api.tree.change_root_to_node, opts("CD")) - vim.keymap.set("n", "", api.node.open.replace_tree_buffer, opts("Open: In Place")) - vim.keymap.set("n", "", api.node.show_info_popup, opts("Info")) - vim.keymap.set("n", "", api.fs.rename_sub, opts("Rename: Omit Filename")) - vim.keymap.set("n", "", api.node.open.tab, opts("Open: New Tab")) - vim.keymap.set("n", "", api.node.open.vertical, opts("Open: Vertical Split")) - vim.keymap.set("n", "", api.node.open.horizontal, opts("Open: Horizontal Split")) - vim.keymap.set("n", "", api.node.navigate.parent_close, opts("Close Directory")) - vim.keymap.set("n", "", api.node.open.edit, opts("Open")) - vim.keymap.set("n", "", api.node.open.preview, opts("Open Preview")) - vim.keymap.set("n", ">", api.node.navigate.sibling.next, opts("Next Sibling")) - vim.keymap.set("n", "<", api.node.navigate.sibling.prev, opts("Previous Sibling")) - vim.keymap.set("n", ".", api.node.run.cmd, opts("Run Command")) - vim.keymap.set("n", "-", api.tree.change_root_to_parent, opts("Up")) - vim.keymap.set("n", "a", api.fs.create, opts("Create")) - vim.keymap.set("n", "bmv", api.marks.bulk.move, opts("Move Bookmarked")) - vim.keymap.set("n", "B", api.tree.toggle_no_buffer_filter, opts("Toggle No Buffer")) - vim.keymap.set("n", "c", api.fs.copy.node, opts("Copy")) - vim.keymap.set("n", "C", api.tree.toggle_git_clean_filter, opts("Toggle Git Clean")) - vim.keymap.set("n", "[c", api.node.navigate.git.prev, opts("Prev Git")) - vim.keymap.set("n", "]c", api.node.navigate.git.next, opts("Next Git")) - vim.keymap.set("n", "d", api.fs.remove, opts("Delete")) - vim.keymap.set("n", "D", api.fs.trash, opts("Trash")) - vim.keymap.set("n", "E", api.tree.expand_all, opts("Expand All")) - vim.keymap.set("n", "e", api.fs.rename_basename, opts("Rename: Basename")) - vim.keymap.set("n", "]e", api.node.navigate.diagnostics.next, opts("Next Diagnostic")) - vim.keymap.set("n", "[e", api.node.navigate.diagnostics.prev, opts("Prev Diagnostic")) - vim.keymap.set("n", "", api.live_filter.clear, opts("Clean Filter")) - vim.keymap.set("n", "F", api.live_filter.start, opts("Filter")) - vim.keymap.set("n", "g?", api.tree.toggle_help, opts("Help")) - vim.keymap.set("n", "gy", api.fs.copy.absolute_path, opts("Copy Absolute Path")) - vim.keymap.set("n", "H", api.tree.toggle_hidden_filter, opts("Toggle Dotfiles")) - vim.keymap.set("n", "I", api.tree.toggle_gitignore_filter, opts("Toggle Git Ignore")) - vim.keymap.set("n", "J", api.node.navigate.sibling.last, opts("Last Sibling")) - vim.keymap.set("n", "K", api.node.navigate.sibling.first, opts("First Sibling")) - vim.keymap.set("n", "m", api.marks.toggle, opts("Toggle Bookmark")) - vim.keymap.set("n", "o", api.node.open.edit, opts("Open")) - vim.keymap.set("n", "O", api.node.open.no_window_picker, opts("Open: No Window Picker")) - vim.keymap.set("n", "p", api.fs.paste, opts("Paste")) - vim.keymap.set("n", "P", api.node.navigate.parent, opts("Parent Directory")) - vim.keymap.set("n", "q", api.tree.close, opts("Close")) - vim.keymap.set("n", "r", api.fs.rename, opts("Rename")) - vim.keymap.set("n", "R", api.tree.reload, opts("Refresh")) - vim.keymap.set("n", "s", api.node.run.system, opts("Run System")) - vim.keymap.set("n", "S", api.tree.search_node, opts("Search")) - vim.keymap.set("n", "U", api.tree.toggle_custom_filter, opts("Toggle Hidden")) - vim.keymap.set("n", "W", api.tree.collapse_all, opts("Collapse")) - vim.keymap.set("n", "x", api.fs.cut, opts("Cut")) - vim.keymap.set("n", "y", api.fs.copy.filename, opts("Copy Name")) - vim.keymap.set("n", "Y", api.fs.copy.relative_path, opts("Copy Relative Path")) - vim.keymap.set("n", "<2-LeftMouse>", api.node.open.edit, opts("Open")) - vim.keymap.set("n", "<2-RightMouse>", api.tree.change_root_to_node, opts("CD")) - end, - -- respect_buf_cwd = true, - sync_root_with_cwd = true, - prefer_startup_root = true, - view = { - centralize_selection = false, - side = "right", - }, - renderer = { - group_empty = true, - special_files = { "cargo.toml", "makefile", "readme.md", "readme.md" }, - symlink_destination = true, - }, - hijack_directories = { - enable = true, - auto_open = true, - }, - update_focused_file = { - enable = true, - -- update_cwd = true, - update_root = false, - ignore_list = {}, - }, - system_open = { - cmd = "", - args = {}, - }, - actions = { - use_system_clipboard = true, - change_dir = { - enable = true, - global = false, - restrict_above_cwd = false, - }, - expand_all = { - max_folder_discovery = 300, - exclude = {}, - }, - }, - }, - }, -} diff --git a/nvim/lua/plugins/plugins.lua b/nvim/lua/plugins/plugins.lua index ef35632..c1bb195 100644 --- a/nvim/lua/plugins/plugins.lua +++ b/nvim/lua/plugins/plugins.lua @@ -1,3 +1,5 @@ +local Util = require("lazyvim.util") + return { { "LazyVim/LazyVim", @@ -266,4 +268,48 @@ return { ft = { "markdown", "tex", "typst", "typ" }, lazy = true, }, + { + "smjonas/inc-rename.nvim", + lazy = true, + event = "BufEnter", + config = function() + require("inc_rename").setup({ + cmd_name = "IncRename", -- the name of the command + hl_group = "Substitute", -- the highlight group used for highlighting the identifier's new name + preview_empty_name = true, -- whether an empty new name should be previewed; if false the command preview will be cancelled instead + show_message = true, -- whether to display a `Renamed m instances in n files` message after a rename operation + input_buffer_type = nil, -- the type of the external input buffer to use (the only supported value is currently "dressing") + post_hook = nil, -- callback to run after renaming, receives the result table (from LSP handler) as an argument + }) + end, + }, + { + "nvim-neo-tree/neo-tree.nvim", + opts = { + window = { + position = "right", + mappings = { + ["l"] = "none", + }, + }, + }, + keys = { + { + "fe", + function() + require("neo-tree.command").execute({ position = "right", toggle = true, dir = Util.root() }) + end, + desc = "Explorer NeoTree (root dir)", + }, + { + "fE", + function() + require("neo-tree.command").execute({ position = "right", toggle = true, dir = vim.loop.cwd() }) + end, + desc = "Explorer NeoTree (cwd)", + }, + { "", "fe", desc = "Explorer NeoTree (root dir)", remap = true }, + { "", "fE", desc = "Explorer NeoTree (cwd)", remap = true }, + }, + }, }