--- "lvim" configuration lvim.format_on_save = false lvim.lint_on_save = false lvim.colorscheme = "spacegray" lvim.builtin.dap.active = true lvim.builtin.dashboard.active = true lvim.builtin.terminal.active = true lvim.builtin.nvimtree.side = "right" lvim.builtin.nvimtree.show_icons.git = 0 lvim.builtin.telescope = { defaults = { layout_config = { prompt_position = "top" }, file_ignore_patterns = { ".git", "node_modules", "env", "target" }, }, } lvim.builtin.treesitter = { ensure_installed = { "javascript", "typescript", "jsdoc", "python", "lua", "go" }, highlight = { enable = true }, intent = { disable = { "python" } }, } --- Keymappings lvim.leader = "space" lvim.keys.normal_mode[""] = "write" lvim.keys.normal_mode[""] = "BufferClose" lvim.keys.normal_mode[""] = "vert res +2" lvim.keys.normal_mode[""] = "res -2" lvim.keys.normal_mode[""] = "res +2" lvim.keys.normal_mode[""] = "vert res -2" -- Beffer navigation for i = 1, 9 do lvim.keys.normal_mode[string.format("", i)] = string.format("BufferGoto %d", i) end lvim.builtin.which_key.mappings["z"] = { "ZenMode", "Zen" } lvim.builtin.which_key.mappings["t"] = { name = "Test", t = { "Ultest", "Run test" }, s = { "UltestStop", "Stop test" }, c = { "UltestClear", "Clear test result" }, n = { "UltestNearest", "Run test order by cursor" }, o = { "UltestOutput", "Show output order by cursor" }, j = { "(ultest-next-fail)", "Next fail" }, k = { "(ultest-prev-fail)", "Prev fail" }, } lvim.builtin.which_key.mappings["r"] = { name = "Replace", r = { "lua require('spectre').open()", "Replace" }, w = { "lua require('spectre').open_visual({select_word=true})", "Replace Word" }, f = { "lua require('spectre').open_file_search()", "Replace Buffer" }, } --- Plugins lvim.plugins = { { "tpope/vim-surround", keys = { "c", "d", "y" } }, { "folke/zen-mode.nvim", cmd = { "ZenMode" } }, { "rcarriga/vim-ultest", requires = { "vim-test/vim-test" }, cmd = { "Ultest", "UltestStop", "UltestClear", "UltestNearest", "UltestOutput" }, run = "UpdateRemotePlugins", }, { "vim-test/vim-test", cmd = { "TestFile", "TestLast", "TestSuite", "TestVisit", "TestMearest" }, }, { "windwp/nvim-spectre", event = "BufRead", config = function() require("user.spectre").setup() end, }, -- { "phaazon/hop.nvim", event = "BufRead", config = function() require("user.hop").setup() end }, { "vuki656/package-info.nvim", ft = "json", config = function() require("user.package-info").setup() end, }, } --- LSP lvim.lang.javascript.lsp.setup.handlers = { ["textDocument/publishDiagnostics"] = function(_, _, p, client_id, _, config) if p.diagnostics ~= nil then local i = 1 while i <= #p.diagnostics do if p.diagnostics[i].code == 80001 then table.remove(p.diagnostics, i) else i = i + 1 end end end vim.lsp.diagnostic.on_publish_diagnostics(_, _, p, client_id, _, config) end, }