From 63bd661602ab2ba56d95eaf1b58875be057f2611 Mon Sep 17 00:00:00 2001 From: venus Date: Tue, 10 Mar 2026 16:34:31 -0500 Subject: [PATCH] updated lsp with autocomplete --- init.lua | 4 +--- lazy-lock.json | 7 ++++--- lua/keybinds.lua | 4 ++-- lua/options.lua | 10 ++-------- lua/plugins/lsp.lua | 20 +++++++++++++++++++- lua/plugins/nerdtree.lua | 18 ++++++++++++++++++ 6 files changed, 46 insertions(+), 17 deletions(-) create mode 100644 lua/plugins/nerdtree.lua diff --git a/init.lua b/init.lua index a73105b..172f942 100644 --- a/init.lua +++ b/init.lua @@ -7,12 +7,11 @@ require('options') -- render keybinds require('keybinds') --- bootstrao lazy.nvim +-- bootstrap lazy.nvim require("config.lazy") -- lazy.nvim settings require("lazy").setup({ spec = { - -- import your plugins { import = "plugins" }, { 'tpope/vim-commentary', -- commenting lines with shortcut @@ -24,7 +23,6 @@ require("lazy").setup({ 'TamaMcGlinn/vim-termhere', --simple terminal QOL "smjonas/inc-rename.nvim", --lsp plugin for renaming variable 'basola21/PDFview', -- rendering pdfs in nvim - 'preservim/nerdtree', { 'norcalli/nvim-colorizer.lua', config = function() require('colorizer').setup{"*"} end,}, -- preview colors {'NMAC427/guess-indent.nvim', config = function() require('guess-indent').setup {} end,}, -- Detect tabstop and shiftwidth automatically { 'edluffy/hologram.nvim', auto_display = true,}, --image viewer diff --git a/lazy-lock.json b/lazy-lock.json index 53902c5..d483e92 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,8 +1,9 @@ { "PDFview": { "branch": "main", "commit": "972dfcce5c0de578865649940f44bf57a700498d" }, "base16-nvim": { "branch": "master", "commit": "190397833e53fdfd5cf400c5baaf1a4e533158e5" }, + "blink.cmp": { "branch": "main", "commit": "4b18c32adef2898f95cdef6192cbd5796c1a332d" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, - "fd": { "branch": "master", "commit": "cb3fad48bb2d366080efa421d8499ec968f60a6c" }, + "fd": { "branch": "master", "commit": "7027d45303b412be6fa9c09d689cc6276748fb38" }, "fzf-lua": { "branch": "main", "commit": "d9508cc1d05ffcdc91a32dfd38fc1013a56b20da" }, "gitsigns.nvim": { "branch": "main", "commit": "7c4faa3540d0781a28588cafbd4dd187a28ac6e3" }, "guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" }, @@ -14,13 +15,13 @@ "mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" }, "mini.nvim": { "branch": "main", "commit": "9d359222b3643f1fccbd8f3180445842e1cae00b" }, "mini.pick": { "branch": "main", "commit": "8521fe21df86e08d9e4b3c3f3a7d50e47954e1af" }, - "neogit": { "branch": "master", "commit": "8fd90675caf8b847280ca56f464b66030adad876" }, - "nerdtree": { "branch": "master", "commit": "690d061b591525890f1471c6675bcb5bdc8cdff9" }, + "neogit": { "branch": "master", "commit": "21f2f4e0aa655a21ea123f9509586260926cf8f2" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, "nvim-dap": { "branch": "master", "commit": "a9d8cb68ee7184111dc66156c4a2ebabfbe01bc5" }, "nvim-java": { "branch": "main", "commit": "602a5f7fa92f9c1d425a2159133ff9de86842f0a" }, "nvim-lspconfig": { "branch": "master", "commit": "d8bf4c47385340ab2029402201d4d7c9f99f437a" }, + "nvim-tree.lua": { "branch": "master", "commit": "4b30847c91d498446cb8440c03031359b045e050" }, "nvim-treesitter": { "branch": "main", "commit": "5cb05e1b0fa3c469958a2b26f36b3fe930af221c" }, "nvim-web-devicons": { "branch": "master", "commit": "737cf6c657898d0c697311d79d361288a1343d50" }, "obsidian.nvim": { "branch": "main", "commit": "350586c9e873143c3f65e3c2667bd0324964e89c" }, diff --git a/lua/keybinds.lua b/lua/keybinds.lua index 99fbb6f..6f960e1 100644 --- a/lua/keybinds.lua +++ b/lua/keybinds.lua @@ -17,7 +17,7 @@ vim.keymap.set("n", "l", function() -- Save position and buffer context local term = require("toggleterm.terminal").get(1) if term then - local original_window = vim.api.nvim_get_current_win() + local original_window = vim.api.nvim_get_current_win() local saved_view = vim.fn.winsaveview() -- Using \r (carriage return) or \n\n often bypasses shell interceptors term:send("clear\r") @@ -51,4 +51,4 @@ vim.keymap.set("n", "", "L", { desc = "Move window to the right" }) vim.keymap.set("n", "", "J", { desc = "Move window to the lower" }) vim.keymap.set("n", "", "K", { desc = "Move window to the upper" }) -vim.keymap.set("n", "e", "NERDTreeToggle", {desc = 'open [E]xplorer'}) +vim.keymap.set("n", "e", "NvimTreeToggle", {desc = 'open [E]xplorer'}) diff --git a/lua/options.lua b/lua/options.lua index 6852dd0..6624257 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -5,14 +5,8 @@ vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' vim.g.have_nerd_font = true --- netrw -vim.g.netrw_liststyle = 3 --tree view -vim.g.netrw_banner = 1 -vim.g.netrw_winsize = 70 -- Set the width of the "drawer" -vim.g.netrw_browse_split = 4 -- Open files in previous window. This emulates the typical "drawer" behavior -vim.g.netrw_preview = 1 -- opens in vertical if no open buffer -vim.g.netrw_altv = 1 -- Create the split of the Netrw window to the left - +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 -- [[Setting options]] vim.o.number = true -- Make line numbers default diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 2b3078b..ad51681 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -1,7 +1,25 @@ return { + { "neovim/nvim-lspconfig", dependencies = { { "mason-org/mason.nvim", config = true }, -- The "App Store" { "mason-org/mason-lspconfig.nvim", config = true }, -- The "Bridge" }, - } + }, + { + 'saghen/blink.cmp', + version = '*', -- Downloads pre-built binaries (fast!) + opts = { + keymap = { + preset = 'none', + [''] = { 'select_next', 'fallback' }, + [''] = { 'select_prev', 'fallback' }, + [''] = { 'accept', 'fallback' }, + [''] = { 'show', 'show_documentation', 'hide_documentation' }, + }, + sources = { + default = { 'lsp', 'path', 'snippets', 'buffer' }, + }, + }, + }, +} diff --git a/lua/plugins/nerdtree.lua b/lua/plugins/nerdtree.lua new file mode 100644 index 0000000..07b721f --- /dev/null +++ b/lua/plugins/nerdtree.lua @@ -0,0 +1,18 @@ +return { + 'nvim-tree/nvim-tree.lua', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + config = function() + require("nvim-tree").setup({ + view = { + side = "left", + width = 30, + }, + actions = { + open_file = { + -- This is the "open in adjacent pane" equivalent + window_picker = { enable = true }, + }, + }, + }) + end, +}