Update Plugin Config

This commit is contained in:
Alexander Gehrke 2024-03-15 15:10:00 +01:00
parent 2a36c3fc7a
commit 2eca6c0d56
8 changed files with 124 additions and 249 deletions

View file

@ -1,51 +0,0 @@
local status1, mason = pcall(require, "mason")
local status2, mason_lspconfig = pcall(require, "mason-lspconfig")
if (not (status1 and status2)) then return end
return function(on_attach)
mason.setup {}
mason_lspconfig.setup {
ensure_installed = { 'jdtls', 'lua_ls' }
}
local no_autosetup = {
jdtls = true
}
local extra_config = {
lua_ls = {
on_attach = on_attach,
settings = {
Lua = {
diagnostics = { globals = { 'vim' } },
workspace = {
library = vim.api.nvim_get_runtime_file("", true),
checkThirdParty = false,
},
telemetry = { enable = false },
},
},
},
["pylsp"] = {
on_attach = on_attach,
settings = {
pylsp = {
plugins = {
rope_autoimport = { enabled = true, },
isort = { enabled = true, },
}
}
}
}
}
mason_lspconfig.setup_handlers {
function(server_name)
if (not no_autosetup[server_name]) then
require("lspconfig")[server_name].setup(
extra_config[server_name] or { on_attach = on_attach }
)
end
end,
}
end

View file

@ -1,53 +0,0 @@
local status, metals = pcall(require, "metals")
if (not status) then return function() end end
return function(on_attach)
metals_config = metals.bare_config()
metals_config.init_options.statusBarProvider = "on"
metals_config.settings = {
showImplicitArguments = true,
superMethodLensesEnabled = true,
}
metals_config.on_attach = function(client, bufnr)
require("metals").setup_dap()
on_attach(client, bufnr)
end
metals_config.capabilities = require("cmp_nvim_lsp").default_capabilities()
-- Debug settings if you're using nvim-dap
local dap = require("dap")
dap.configurations.scala = {
{
type = "scala",
request = "launch",
name = "RunOrTest",
metals = {
runType = "runOrTestFile",
--args = { "firstArg", "secondArg", "thirdArg" }, -- here just as an example
},
},
{
type = "scala",
request = "launch",
name = "Test Target",
metals = {
runType = "testTarget",
},
},
}
-- Autocmd that will actually be in charging of starting the whole thing
local nvim_metals_group = vim.api.nvim_create_augroup("nvim-metals", { clear = true })
vim.api.nvim_create_autocmd("FileType", {
-- NOTE: You may or may not want java included here. You will need it if you
-- want basic Java support but it may also conflict if you are using
-- something like nvim-jdtls which also works on a java filetype autocmd.
pattern = { "scala", "sbt" },
callback = function()
require("metals").initialize_or_attach(metals_config)
end,
group = nvim_metals_group,
})
return metals_config
end

View file

@ -1,13 +0,0 @@
local status, nvim_lsp = pcall(require, "lspconfig")
if (not status) then return function() end end
return function(on_attach)
local protocol = require('vim.lsp.protocol')
-- TypeScript
nvim_lsp.tsserver.setup {
on_attach = on_attach,
filetypes = { "typescript", "typescriptreact", "typescript.tsx" },
cmd = { "typescript-language-server", "--stdio" }
}
end

View file

@ -8,7 +8,6 @@ return {
dependencies = { dependencies = {
"hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer", "hrsh7th/cmp-buffer",
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-path', 'hrsh7th/cmp-path',
'hrsh7th/cmp-cmdline', 'hrsh7th/cmp-cmdline',
-- 'hrsh7th/cmp-vsnip', -- 'hrsh7th/cmp-vsnip',
@ -103,7 +102,7 @@ return {
{ name = 'luasnip' }, { name = 'luasnip' },
{ name = "copilot" }, { name = "copilot" },
}, { }, {
{ name = 'buffer' }, { name = 'buffer', option = { keyword_pattern = [[\k\+]] } },
--{ name = 'path' }, --{ name = 'path' },
}), }),
formatting = { formatting = {

View file

@ -2,7 +2,6 @@ return {
"folke/which-key.nvim", "folke/which-key.nvim",
'pbrisbin/vim-mkdir', 'pbrisbin/vim-mkdir',
'fladson/vim-kitty', 'fladson/vim-kitty',
'tpope/vim-repeat', 'tpope/vim-repeat',
'tpope/vim-surround', 'tpope/vim-surround',
'tpope/vim-characterize', 'tpope/vim-characterize',
@ -17,8 +16,6 @@ return {
}, },
-- ii / ai -- ii / ai
'michaeljsmith/vim-indent-object', 'michaeljsmith/vim-indent-object',
{'lewis6991/gitsigns.nvim', config=true},
'neovim/nvim-lspconfig', 'neovim/nvim-lspconfig',
{ 'nvim-telescope/telescope.nvim', { 'nvim-telescope/telescope.nvim',
@ -34,15 +31,9 @@ return {
'folke/trouble.nvim', 'folke/trouble.nvim',
'folke/lsp-colors.nvim', 'folke/lsp-colors.nvim',
'nvim-lua/popup.nvim', 'nvim-lua/popup.nvim',
'junegunn/vim-easy-align', 'junegunn/vim-easy-align',
'machakann/vim-highlightedyank', 'machakann/vim-highlightedyank',
'lambdalisue/suda.vim', 'lambdalisue/suda.vim',
-- git
'lambdalisue/gina.vim',
'gregsexton/gitv',
'gisphm/vim-gitignore',
'sjl/splice.vim',
'jamessan/vim-gnupg', 'jamessan/vim-gnupg',
{'lervag/vimtex', {'lervag/vimtex',
@ -62,5 +53,7 @@ return {
'Glench/Vim-Jinja2-Syntax', 'Glench/Vim-Jinja2-Syntax',
'GEverding/vim-hocon', 'GEverding/vim-hocon',
'nfnty/vim-nftables', 'nfnty/vim-nftables',
'nfnty/vim-nftables',
'Everduin94/nvim-quick-switcher',
} }
-- 'powerman/vim-plugin-AnsiEsc', -- 'powerman/vim-plugin-AnsiEsc',

View file

@ -13,7 +13,7 @@ return {
tabline = { tabline = {
lualine_a = { 'branch' }, lualine_a = { 'branch' },
lualine_b = {}, lualine_b = {},
lualine_c = { { 'windows', show_filename_only = false, symbols = { modified = " ✏️]", alternate_file = " 🔃", folder = " 📁"} ,}}, lualine_c = { { 'buffers', show_filename_only = false, symbols = { modified = " ✏️]", alternate_file = " 🔃", folder = " 📁"} ,}},
lualine_x = {}, lualine_x = {},
lualine_y = {}, lualine_y = {},
lualine_z = { lualine_z = {
@ -35,16 +35,16 @@ return {
} } } }
}, },
sections = { sections = {
lualine_a = { filename }, lualine_a = { 'filename' },
lualine_b = { 'diff', 'diagnostics' }, lualine_b = { 'diff', 'diagnostics' },
lualine_x = { "require'lsp-status'.status()" }, lualine_x = { "require'lsp-status'.status()" },
lualine_y = { 'filetype' }, lualine_y = { 'filetype' },
lualine_z = { 'searchcount', 'location' } lualine_z = { 'searchcount', 'selectioncount', 'location' }
}, },
inactive_sections = { inactive_sections = {
lualine_a = {}, lualine_a = {},
lualine_b = {}, lualine_b = {},
lualine_c = { filename }, lualine_c = { 'filename' },
lualine_x = { 'location' }, lualine_x = { 'location' },
lualine_y = {}, lualine_y = {},
lualine_z = {} lualine_z = {}

View file

@ -50,6 +50,5 @@ return {
local telescope = require('telescope') local telescope = require('telescope')
telescope.setup(opts) telescope.setup(opts)
telescope.load_extension('fzf') telescope.load_extension('fzf')
telescope.load_extension('ui-select')
end, end,
} }

View file

@ -1,8 +1,9 @@
return { return {
{ {
'stevearc/dressing.nvim', 'stevearc/dressing.nvim',
enabled = true,
dependencies = { dependencies = {
'nvim-telescope/telescope-ui-select.nvim', --'nvim-telescope/telescope-ui-select.nvim',
}, },
opts = { opts = {
select = { select = {