diff --git a/Internal/os_nvim_init.vim b/Internal/os_nvim_init.vim index 03d9b35..254101a 100644 --- a/Internal/os_nvim_init.vim +++ b/Internal/os_nvim_init.vim @@ -35,8 +35,6 @@ call plug#begin(stdpath('config') . '/plugged') Plug 'L3MON4D3/LuaSnip' Plug 'hrsh7th/cmp-buffer' Plug 'hrsh7th/cmp-path' - Plug 'VonHeikemen/lsp-zero.nvim', {'branch': 'v3.x'} - Plug 'huggingface/llm.nvim' " lsp-zero end call plug#end() @@ -70,35 +68,19 @@ lua <', ':Make', {noremap = true}) -- LSP Setup ///////////////////////////////////////////////////////////////////////////////////// - local lsp_zero = require('lsp-zero') - lsp_zero.on_attach(function(client, bufnr) - -- see :help lsp-zero-keybindings - -- to learn the available actions - lsp_zero.default_keymaps({ - buffer = bufnr, - exclude = {''}, -- Disable code-format of current buffer - }) - local opts = {buffer = bufnr} - - vim.keymap.set({'v', 'x'}, 'gq', function() - vim.lsp.buf.format({async = false, timeout_ms = 10000}) - end, opts) - end) - - -- to learn how to use mason.nvim with lsp-zero - -- read this: https://github.com/VonHeikemen/lsp-zero.nvim/blob/v3.x/doc/md/guide/integrate-with-mason-nvim.md require('mason').setup({}) require('mason-lspconfig').setup({ ensure_installed = { "clangd" }, - handlers = { - lsp_zero.default_setup, - }, + automatic_enable = true }) - local cmp = require('cmp') - local cmp_action = require('lsp-zero').cmp_action() - local cmp_format = require('lsp-zero').cmp_format({details = true}) + local opts = { noremap = true, silent = true } + vim.keymap.set("n", "", vim.lsp.buf.rename, opts) + vim.keymap.set("n", "", vim.lsp.buf.code_action, opts) + vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) + vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts) + local cmp = require('cmp') cmp.setup({ sources = { {name = 'nvim_lsp'}, @@ -107,9 +89,9 @@ lua <'] = cmp_action.luasnip_supertab(), - [''] = cmp_action.luasnip_shift_supertab(), [''] = cmp.mapping.confirm({select = false}), + [''] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), + [''] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), }), snippet = { expand = function(args) @@ -219,6 +201,7 @@ lua <