diff --git a/.config/nvim/after/plugin/chatgpt.lua b/.config/nvim/after/plugin/chatgpt.lua deleted file mode 100644 index 7fb7b11..0000000 --- a/.config/nvim/after/plugin/chatgpt.lua +++ /dev/null @@ -1,3 +0,0 @@ -require("chatgpt").setup({ - api_key_cmd = "pass api/chatgpt_neovim", -}) diff --git a/.config/nvim/after/plugin/lsp.lua b/.config/nvim/after/plugin/lsp.lua deleted file mode 100644 index d87e5aa..0000000 --- a/.config/nvim/after/plugin/lsp.lua +++ /dev/null @@ -1,103 +0,0 @@ -local use = require('lazy').use - -local lspconfig = require('lspconfig') - --- luasnip setup -local luasnip = require 'luasnip' - --- nvim-cmp setup -local cmp = require 'cmp' -cmp.setup { - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.confirm { - behavior = cmp.ConfirmBehavior.Replace, - select = true, - }, - --[''] = cmp.mapping(function(fallback) - -- if cmp.visible() then - -- cmp.select_next_item() - -- elseif luasnip.expand_or_jumpable() then - -- luasnip.expand_or_jump() - -- else - -- fallback() - -- end - --end, { 'i', 's' }), - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { 'i', 's' }), - }), - sources = { - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - }, -} - -vim.keymap.set('n', 't', vim.diagnostic.open_float, 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', 'd', vim.diagnostic.setloclist, opts) - --- Use an on_attach function to only map the following keys --- after the language server attaches to the current buffer -local on_attach = function(client, bufnr) - -- Enable completion triggered by - vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') - - -- Mappings. - -- See `:help vim.lsp.*` for documentation on any of the below functions - local bufopts = { noremap=true, silent=true, buffer=bufnr } - vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) - vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) - vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts) - vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) - vim.keymap.set('n', '', vim.lsp.buf.signature_help, bufopts) - vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, bufopts) - vim.keymap.set('n', 'rn', vim.lsp.buf.rename, bufopts) - vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, bufopts) - vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) - vim.keymap.set('n', 'f', function() vim.lsp.buf.format { async = true } end, bufopts) --- vim.api.nvim_create_autocmd( --- { "BufWrite" }, {command = "lua vim.lsp.buf.formatting()"} --- ) -end - -vim.diagnostic.config({ - virtual_text = false, -}) - -lspconfig.pylsp.setup { - capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()), - on_attach = on_attach, - settings = { - pylsp = { - plugins = { - jedi_completion = { - include_params = true, - }, - }, - }, - }, -} - -require('lspconfig')['rust_analyzer'].setup{ - capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()), - on_attach = on_attach, - -- Server-specific settings... - settings = { - ["rust-analyzer"] = {} - } -} diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index 839a7fb..4f4ffd4 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -28,11 +28,6 @@ require("lazy").setup({ {'nvim-treesitter/nvim-treesitter', build = ':TSUpdate'}, 'tpope/vim-fugitive', - 'neovim/nvim-lspconfig', - 'hrsh7th/nvim-cmp', -- Autocompletion plugin - 'hrsh7th/cmp-nvim-lsp', -- LSP source for nvim-cmp - 'saadparwaiz1/cmp_luasnip', -- Snippets source for nvim-cmp - 'L3MON4D3/LuaSnip', -- Snippets plugin {'lukas-reineke/indent-blankline.nvim', main = "ibl", opts = { indent = { @@ -43,15 +38,4 @@ require("lazy").setup({ 'lewis6991/gitsigns.nvim', 'github/copilot.vim', - { "jackMort/ChatGPT.nvim", - event = "VeryLazy", - config = function() - require("chatgpt").setup() - end, - dependencies = { - "MunifTanjim/nui.nvim", - "nvim-lua/plenary.nvim", - "nvim-telescope/telescope.nvim" - } -} })