From c551043634b5da056b1aeda8d43f2daf4e9e758e Mon Sep 17 00:00:00 2001 From: amolinae06 Date: Sun, 25 May 2025 15:09:40 -0600 Subject: [PATCH] neovim 0.11 --- .gitignore | 1 - init.lua | 1 + lazy-lock.json | 17 ++++------------- lsp/clangd.lua | 6 ++++++ lsp/tinymist.lua | 6 ++++++ lua/config/lazy.lua | 4 ++-- lua/config/lsp.lua | 13 +++++++++++++ lua/config/mappings.lua | 1 + lua/config/plugins/cmp.lua | 33 --------------------------------- lua/config/settings.lua | 1 + lua/plugins/autopairs.lua | 6 ------ lua/plugins/blink.lua | 23 +++++++++++++++++++++++ lua/plugins/cmp.lua | 31 ------------------------------- lua/plugins/lspconfig.lua | 9 --------- lua/plugins/mason.lua | 2 ++ lua/plugins/treesitter.lua | 2 +- lua/plugins/ui.lua | 4 ++-- 17 files changed, 62 insertions(+), 98 deletions(-) create mode 100644 lsp/clangd.lua create mode 100644 lsp/tinymist.lua create mode 100644 lua/config/lsp.lua delete mode 100644 lua/config/plugins/cmp.lua create mode 100644 lua/plugins/blink.lua delete mode 100644 lua/plugins/cmp.lua delete mode 100644 lua/plugins/lspconfig.lua diff --git a/.gitignore b/.gitignore index e0cf46a..6bd34c4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ .luarc.json *.sug - diff --git a/init.lua b/init.lua index 201f6eb..283e1f9 100644 --- a/init.lua +++ b/init.lua @@ -1,5 +1,6 @@ require("config.settings") require("config.lazy") +require("config.lsp") require("config.mappings") vim.cmd.colorscheme("tokyonight") diff --git a/lazy-lock.json b/lazy-lock.json index 706a6ce..cbd112b 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,25 +1,16 @@ { - "LuaSnip": { "branch": "master", "commit": "c1851d5c519611dfc451b6582961b2602e0af89b" }, + "LuaSnip": { "branch": "master", "commit": "faf3c94a44508cec1b961406d36cc65113ff3b98" }, + "blink.cmp": { "branch": "main", "commit": "022521a8910a5543b0251b21c9e1a1e989745796" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, - "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, - "cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" }, - "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" }, - "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, - "cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" }, - "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lualine.nvim": { "branch": "master", "commit": "0c6cca9f2c63dadeb9225c45bc92bb95a151d4af" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "ce0e87c0be12e7c48296a7513e90430e3eac7f24" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "3856bbb0da214d1f2f3d5a2dd3fea26591f930f9" }, "mason.nvim": { "branch": "main", "commit": "9eaedb864cdadc29c6eb7d761a6c0d8aee26c91b" }, - "moonfly": { "branch": "master", "commit": "e356d55cedb24a6c4251d83ce28e0e2010e99d2f" }, "neo-tree.nvim": { "branch": "main", "commit": "56f383aa157f1ff20a59154907cc5f9fe26e4db9" }, "nui.nvim": { "branch": "main", "commit": "f535005e6ad1016383f24e39559833759453564e" }, "nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" }, - "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-lspconfig": { "branch": "master", "commit": "ac1dfbe3b60e5e23a2cff90e3bd6a3bc88031a57" }, + "nvim-lspconfig": { "branch": "master", "commit": "f610208989e9c03561f9f601db3133f6ae398fcd" }, "nvim-treesitter": { "branch": "master", "commit": "066fd6505377e3fd4aa219e61ce94c2b8bdb0b79" }, "nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, diff --git a/lsp/clangd.lua b/lsp/clangd.lua new file mode 100644 index 0000000..e345a68 --- /dev/null +++ b/lsp/clangd.lua @@ -0,0 +1,6 @@ +---@type vim.lsp.Config +return { + cmd = { "/usr/bin/clangd" }, + filetypes = { "c", "cpp", "h", "hpp" }, + root_markers = { { "makefile", "Makefile" }, ".git" }, +} diff --git a/lsp/tinymist.lua b/lsp/tinymist.lua new file mode 100644 index 0000000..0f9be70 --- /dev/null +++ b/lsp/tinymist.lua @@ -0,0 +1,6 @@ +---@type vim.lsp.Config +return { + cmd = { "/usr/bin/tinymist" }, + filetypes = { "typ" }, +} + diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index ff9a50c..0413a82 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -27,6 +27,6 @@ require("lazy").setup({ -- import your plugins { import = "plugins" }, }, - install = { colorscheme = { "pywal16" } }, - checker = { enabled = true }, + install = { colorscheme = { "tokyonight" } }, + checker = { enabled = false }, }) diff --git a/lua/config/lsp.lua b/lua/config/lsp.lua new file mode 100644 index 0000000..83dcbee --- /dev/null +++ b/lua/config/lsp.lua @@ -0,0 +1,13 @@ +local capabilities = { + textDocument = { + foldingRange = { + dynamicRegistration = false, + lineFoldingOnly = true, + }, + }, +} + +capabilities = require("blink.cmp").get_lsp_capabilities(capabilities) + +-- Load all LSP's in "lsp/" +vim.lsp.enable({ "clangd", "tinymist", "lua-language-server", }) diff --git a/lua/config/mappings.lua b/lua/config/mappings.lua index d858e25..d9c2e4f 100644 --- a/lua/config/mappings.lua +++ b/lua/config/mappings.lua @@ -13,6 +13,7 @@ map("n", "", "Neotree toggle", { desc = "Open neotree"}) map("n", "", "Telescope find_files", { desc = "Telescope: Find files" }) map("n", "", "Telescope live_grep", { desc = "Telescope: Live grep" }) +-- LSP Stuff vim.api.nvim_create_autocmd("LspAttach", { group = vim.api.nvim_create_augroup("UserLspConfig", {}), callback = function(ev) diff --git a/lua/config/plugins/cmp.lua b/lua/config/plugins/cmp.lua deleted file mode 100644 index 690e54d..0000000 --- a/lua/config/plugins/cmp.lua +++ /dev/null @@ -1,33 +0,0 @@ -local cmp = require'cmp' -require("luasnip.loaders.from_vscode").lazy_load() - -cmp.setup({ - snippet = { - expand = function(args) - require('luasnip').lsp_expand(args.body) -- For `luasnip` users. - end, - }, - - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - }), - - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'luasnip' }, -- For luasnip users. - { name = 'nvim_lua' }, - -- { name = 'buffer' }, - { name = 'path' }, - { name = 'nvim_lsp_signature_help' }, - -- { name = 'cmdline' }, - }) -}) diff --git a/lua/config/settings.lua b/lua/config/settings.lua index 9974e13..054c59e 100644 --- a/lua/config/settings.lua +++ b/lua/config/settings.lua @@ -16,6 +16,7 @@ o.tabstop = 2 o.softtabstop = 2 o.number = true +o.relativenumber = true o.syntax = "on" o.cursorline = true o.expandtab = true diff --git a/lua/plugins/autopairs.lua b/lua/plugins/autopairs.lua index 0766b8c..394e00a 100644 --- a/lua/plugins/autopairs.lua +++ b/lua/plugins/autopairs.lua @@ -7,11 +7,5 @@ return { disable_filetype = { "TelescopePrompt", "vim" }, map_cr = true, }, - config = function(opts) - require("nvim-autopairs").setup(opts) - local cmp_autopairs = require "nvim-autopairs.completion.cmp" - local cmp = require('cmp') - require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done()) - end } } diff --git a/lua/plugins/blink.lua b/lua/plugins/blink.lua new file mode 100644 index 0000000..b96d6c9 --- /dev/null +++ b/lua/plugins/blink.lua @@ -0,0 +1,23 @@ +return { + { + "saghen/blink.cmp", + dependencies = { + "L3MON4D3/LuaSnip" + }, + version = "1.*", + ---@module "blink.cmp" + ---@type blink.cmp.Config + opts = { + keymap = { preset = "super-tab" }, + appearance = { + nerd_font_variant = "mono" + }, + completion = { documentation = { auto_show = false } }, + sources = { + default = { "lsp", "path", "snippets", "buffer" }, + }, + fuzzy = { implementation = "prefer_rust_with_warning" } + }, + opts_extend = { "sources.default" } + } +} diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua deleted file mode 100644 index 3c26641..0000000 --- a/lua/plugins/cmp.lua +++ /dev/null @@ -1,31 +0,0 @@ -return { - { - "hrsh7th/nvim-cmp", - dependencies = { - { "hrsh7th/cmp-nvim-lua" }, - { "hrsh7th/cmp-nvim-lsp-signature-help" }, - { "hrsh7th/cmp-cmdline" }, - { "hrsh7th/cmp-path" }, - { "hrsh7th/cmp-buffer" }, - }, - opts = function() - require "config.plugins.cmp" - end, - }, - { - "hrsh7th/cmp-nvim-lsp", - dependencies = {}, - config = function() - local lspconfig = require('lspconfig') - local capabilities = require('cmp_nvim_lsp').default_capabilities() - end, - }, - { - "L3MON4D3/LuaSnip", - dependencies = { - "saadparwaiz1/cmp_luasnip", - "rafamadriz/friendly-snippets" - }, - opts = {} - } -} diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua deleted file mode 100644 index daa3bd6..0000000 --- a/lua/plugins/lspconfig.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - { - "neovim/nvim-lspconfig", - dependencies= {}, - config = function() - local lspconfig = require("lspconfig") - end, - }, -} diff --git a/lua/plugins/mason.lua b/lua/plugins/mason.lua index e02cd38..00f52ad 100644 --- a/lua/plugins/mason.lua +++ b/lua/plugins/mason.lua @@ -14,9 +14,11 @@ return { { "mason-org/mason-lspconfig.nvim", dependencies = { + "mason-org/mason.nvim", "neovim/nvim-lspconfig", }, opts = { + ensure_installed = { "lua_ls" }, automatic_enable = true }, }, diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index ad75972..106425f 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -7,7 +7,7 @@ return { dependencies = {}, opts = { auto_install = true, - ensure_installed = { "lua" }, + ensure_installed = { "lua", "c", "vimdoc" }, highlight = { enable = true }, indent = { enable = true } } diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index 7974f23..cc7b9da 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -9,7 +9,7 @@ return { opts = { options = { icons_enabled = true, - theme = 'pywal16-nvim', + theme = 'tokyonight', component_separators = { left = "|", right = "|" }, section_separators = { left = "", right = "" }, }, @@ -24,7 +24,7 @@ return { mode = "buffers", diagnostics = "nvim_lsp", offsets = { - { + { filetype = "neo-tree", text = "File Explorer", text_align = "center", separator = true }