diff --git a/lazy-lock.json b/lazy-lock.json index e91a7b0..5b68657 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,32 +1,33 @@ { "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, "aerial.nvim": { "branch": "master", "commit": "c7cbbad40c2065fccfd1f1863bb2c08180c0533d" }, - "alpha-nvim": { "branch": "main", "commit": "2b3cbcdd980cae1e022409289245053f62fb50f6" }, "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, "cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" }, "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, - "fzf-lua": { "branch": "main", "commit": "bebc84e7ffc8fd86103f6ed6c590df72d524d342" }, + "fzf-lua": { "branch": "main", "commit": "96dede0bca5cc24868df7c8b46b5a32b89c2f19d" }, "gitsigns.nvim": { "branch": "main", "commit": "6e3c66548035e50db7bd8e360a29aec6620c3641" }, "gruvbox.nvim": { "branch": "main", "commit": "12c2624287dc827edb5d72b2bc4c9619e692a554" }, "harpoon": { "branch": "master", "commit": "1bc17e3e42ea3c46b33c0bbad6a880792692a1b3" }, + "hover.nvim": { "branch": "main", "commit": "24a43e0eda924f1f32361c76ee9a1f0e8cc25650" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, "lazygit.nvim": { "branch": "main", "commit": "3c524ebec6072568064235c407195e9f9fd0cb8a" }, "lspsaga.nvim": { "branch": "main", "commit": "8efe00d6aed9db6449969f889170f1a7e43101a1" }, "lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "5e085efe67fccb13372d54331d849219662a7e93" }, "mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" }, "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, - "nvim-lspconfig": { "branch": "master", "commit": "408cf07b97535825cca6f1afa908d98348712ba6" }, + "nvim-lspconfig": { "branch": "master", "commit": "f8474abbe3f0cf7cf2476331313b583207787148" }, "nvim-tree.lua": { "branch": "master", "commit": "fefa335f1c8f690eb668a1efd18ee4fc6d64cd3e" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-web-devicons": { "branch": "master", "commit": "f66cdfef5e84112045b9ebc3119fee9bddb3c687" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "telekasten.nvim": { "branch": "main", "commit": "b3ac2b07f2df504bb80112fec349714086a80037" }, + "telescope-undo.nvim": { "branch": "main", "commit": "928d0c2dc9606e01e2cc547196f48d2eaecf58e5" }, "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, "toggleterm.nvim": { "branch": "main", "commit": "9a88eae817ef395952e08650b3283726786fb5fb" }, - "typstar": { "branch": "main", "commit": "67a76bec16af7c726a77b9c3a15ef37b34967a9c" }, "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } } diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index 2a64be9..2e7322b 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -75,6 +75,7 @@ vim.keymap.set('n', 'oho', ':e ~/nixos/hosts') vim.keymap.set('n', 'll', ':Lazy') vim.keymap.set('n', 'sw', function() + local word = vim.fn.expand("") local replacement = vim.fn.input("Replace '" .. word .. "' with: ") if replacement ~= "" then diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index 435c984..0169a90 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -34,3 +34,5 @@ require("lazy").setup({ enabled = false, }, }) + +require("utils.after") diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 35db86b..4c73719 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -74,6 +74,17 @@ return { end, }, + { + "folke/lazydev.nvim", + ft = "lua", -- only load on lua files + opts = { + library = { + -- See the configuration section for more details + -- Load luvit types when the `vim.uv` word is found + { path = "${3rd}/luv/library", words = { "vim%.uv" } }, + }, + }, + }, { "hrsh7th/nvim-cmp", dependencies = { @@ -84,15 +95,17 @@ return { }, config = function() local cmp = require("cmp") + local border = "single" + local max_entries = 7 cmp.setup({ window = { completion = cmp.config.window.bordered({ - border = "rounded", + border = border, scrollbar = false, }), documentation = cmp.config.window.bordered({ - border = "rounded", + border = border, scrollbar = false, }), }, @@ -112,8 +125,7 @@ return { { name = "buffer" }, { name = "path" }, }), - performance = { max_view_entries = 25 }, - + performance = { max_view_entries = max_entries }, }) end }, @@ -127,15 +139,7 @@ return { local lspconfig = require("lspconfig") -- Custom overwrites for servers - local server_settings = { - lua_ls = { - settings = { - Lua = { - diagnostics = { globals = { "vim" } }, - }, - }, - }, - } + local server_settings = {} local capabilities = require("cmp_nvim_lsp").default_capabilities() @@ -153,10 +157,12 @@ return { vim.keymap.set("n", "rn", vim.lsp.buf.rename, opts) vim.keymap.set("n", "ca", vim.lsp.buf.code_action, opts) - vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) - vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts) - --vim.keymap.set("n", "e", vim.diagnostic.open_float, opts) - -- vim.keymap.set("n", "lq", vim.diagnostic.setloclist, opts) + vim.keymap.set("n", "]d", function() + vim.diagnostic.jump({count=1, float=true}) + end, opts) + vim.keymap.set("n", "[d", function() + vim.diagnostic.jump({count=-1, float=true}) + end, opts) vim.keymap.set("n", "lwa", vim.lsp.buf.add_workspace_folder, opts) vim.keymap.set("n", "lwr", vim.lsp.buf.remove_workspace_folder, opts) diff --git a/lua/plugins/searching.lua b/lua/plugins/searching.lua index 31ede9e..229e16a 100644 --- a/lua/plugins/searching.lua +++ b/lua/plugins/searching.lua @@ -70,4 +70,35 @@ return { }, config = true, }, + { + "debugloop/telescope-undo.nvim", + dependencies = { + { + "nvim-telescope/telescope.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + }, + }, + keys = { + { + "u", + "Telescope undo", + desc = "undo history", + }, + }, + opts = { + extensions = { + undo = { + side_by_side = true, + layout_strategy = "vertical", + layout_config = { + preview_height = 0.7, + }, + }, + }, + }, + config = function(_, opts) + require("telescope").setup(opts) + require("telescope").load_extension("undo") + end, + } } diff --git a/lua/utils/after.lua b/lua/utils/after.lua new file mode 100644 index 0000000..db7d3a6 --- /dev/null +++ b/lua/utils/after.lua @@ -0,0 +1,21 @@ +local function rounded_border() + return { '╭', '─', '╮', '│', '╯', '─', '╰', '│' } +end + +-- Buffer the original fuction +local nvim_open_win = vim.api.nvim_open_win + +-- Set color to a slight gray +vim.api.nvim_set_hl(0, 'FloatBorder', { bg = 'None', fg = '#a0a0a0' }) +vim.api.nvim_set_hl(0, 'NormalFloat', { bg = 'None' }) + +-- Border overwrite +vim.api.nvim_open_win = function(buf, enter, opts) + opts = opts or {} + + if opts.border == nil then + opts.border = rounded_border() + end + + return nvim_open_win(buf, enter, opts) +end diff --git a/lua/utils/functions.lua b/lua/utils/functions.lua index cae2091..aaafd6c 100644 --- a/lua/utils/functions.lua +++ b/lua/utils/functions.lua @@ -71,9 +71,10 @@ function M.get_lsp_servers() end if vim.fn.executable("deno") == 1 then - table.insert(servers, "denols") + --table.insert(servers, "denols") + table.insert(servers, "ts_ls") else - warn_once("deno", "[mason] Skipping denols (deno not found)") + warn_once("deno", "[mason] Skipping denols and tsserver (deno not found)") end -- Only configure zig when in local environment