nvim: removed unused plugins
This commit is contained in:
parent
f91ac0b0ac
commit
0ef5669a65
|
|
@ -1,3 +0,0 @@
|
|||
require("chatgpt").setup({
|
||||
api_key_cmd = "pass api/chatgpt_neovim",
|
||||
})
|
||||
|
|
@ -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({
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<CR>'] = cmp.mapping.confirm {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
},
|
||||
--['<Tab>'] = 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' }),
|
||||
['<S-Tab>'] = 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', '<leader>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', '<leader>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 <c-x><c-o>
|
||||
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', '<C-k>', vim.lsp.buf.signature_help, bufopts)
|
||||
vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, bufopts)
|
||||
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, bufopts)
|
||||
vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||
vim.keymap.set('n', '<leader>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"] = {}
|
||||
}
|
||||
}
|
||||
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue