Update
This commit is contained in:
@@ -30,3 +30,17 @@ vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
|
|||||||
|
|
||||||
-- Format
|
-- Format
|
||||||
vim.keymap.set('n', '<space>f', function() vim.lsp.buf.format { async = true } end, bufopts)
|
vim.keymap.set('n', '<space>f', function() vim.lsp.buf.format { async = true } end, bufopts)
|
||||||
|
|
||||||
|
-- Copilot
|
||||||
|
--vim.keymap.set('i', '<C-k>', 'copilot#Accept("\\<CR>")', {
|
||||||
|
-- expr = true,
|
||||||
|
-- replace_keycodes = false
|
||||||
|
--})
|
||||||
|
--vim.g.copilot_no_tab_map = true
|
||||||
|
|
||||||
|
-- vim.g.codeium_disable_bindings = 1
|
||||||
|
-- Windsurf
|
||||||
|
-- vim.keymap.set('i', '<C-k>', 'codeium#Accept()', {
|
||||||
|
-- expr = true,
|
||||||
|
-- silent = true
|
||||||
|
-- })
|
||||||
|
|||||||
@@ -30,90 +30,138 @@ end
|
|||||||
|
|
||||||
local capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
local capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||||
|
|
||||||
require 'lspconfig'.clangd.setup {
|
vim.lsp.config('clangd', {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
}
|
})
|
||||||
require 'lspconfig'.ts_ls.setup {
|
vim.lsp.enable('clangd')
|
||||||
|
vim.lsp.config('ts_ls', {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
}
|
})
|
||||||
require 'lspconfig'.pyright.setup {
|
vim.lsp.enable('ts_ls')
|
||||||
|
vim.lsp.config('pyright', {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
}
|
})
|
||||||
require 'lspconfig'.eslint.setup {
|
vim.lsp.enable('pyright')
|
||||||
|
vim.lsp.config('gopls', {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
settings = {
|
})
|
||||||
format = false
|
vim.lsp.enable('gopls')
|
||||||
},
|
vim.lsp.config('rust_analyzer', {
|
||||||
}
|
|
||||||
require 'lspconfig'.rust_analyzer.setup {
|
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
cmd = {
|
cmd = {
|
||||||
"rustup", "run", "stable", "rust-analyzer",
|
"rustup", "run", "stable", "rust-analyzer",
|
||||||
},
|
},
|
||||||
}
|
})
|
||||||
require 'lspconfig'.phpactor.setup {
|
vim.lsp.enable('rust_analyzer')
|
||||||
|
vim.lsp.config('phpactor', {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
init_options = {
|
init_options = {
|
||||||
["language_server_phpstan.enabled"] = false,
|
["language_server_phpstan.enabled"] = false,
|
||||||
["language_server_psalm.enabled"] = false,
|
["language_server_psalm.enabled"] = false,
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
require 'lspconfig'.asm_lsp.setup {
|
vim.lsp.enable('phpactor')
|
||||||
|
vim.lsp.config('asm_lsp', {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
cmd = {
|
cmd = {
|
||||||
"/home/dobiadi/.cargo/bin/asm-lsp"
|
"/home/dobiadi/.cargo/bin/asm-lsp"
|
||||||
},
|
},
|
||||||
}
|
})
|
||||||
require 'lspconfig'.elixirls.setup {
|
vim.lsp.enable('asm_lsp')
|
||||||
|
vim.lsp.config('elixirls', {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
cmd = {
|
cmd = {
|
||||||
"elixir-ls"
|
"elixir-ls"
|
||||||
},
|
},
|
||||||
}
|
})
|
||||||
require'lspconfig'.terraformls.setup{
|
vim.lsp.enable('elixirls')
|
||||||
|
vim.lsp.config('terraformls', {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
|
})
|
||||||
|
vim.lsp.enable('terraformls')
|
||||||
|
vim.lsp.enable('oxfmt')
|
||||||
|
vim.lsp.enable('oxlint')
|
||||||
|
vim.lsp.config("jdtls", {
|
||||||
|
on_attach = on_attach,
|
||||||
|
capabilities = capabilities,
|
||||||
|
cmd = {
|
||||||
|
'/home/adamdobos/Downloads/jdtls/bin/jdtls'
|
||||||
|
},
|
||||||
|
settings = {
|
||||||
|
java = {
|
||||||
|
configuration = {
|
||||||
|
runtimes = {
|
||||||
|
{
|
||||||
|
name = "JavaSE-17",
|
||||||
|
path = "/usr/lib/jvm/java-17-openjdk-amd64/",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = "JavaSE-21",
|
||||||
|
path = "/usr/lib/jvm/java-21-openjdk-amd64/",
|
||||||
}
|
}
|
||||||
require 'lspconfig'.lua_ls.setup {
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
vim.lsp.enable("jdtls")
|
||||||
|
vim.lsp.config('lua_ls', {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_init = function(client)
|
on_init = function(client)
|
||||||
|
if client.workspace_folders then
|
||||||
local path = client.workspace_folders[1].name
|
local path = client.workspace_folders[1].name
|
||||||
if vim.loop.fs_stat(path .. '/.luarc.json') or vim.loop.fs_stat(path .. '/.luarc.jsonc') then
|
if
|
||||||
|
path ~= vim.fn.stdpath('config')
|
||||||
|
and (vim.uv.fs_stat(path .. '/.luarc.json') or vim.uv.fs_stat(path .. '/.luarc.jsonc'))
|
||||||
|
then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, {
|
client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, {
|
||||||
runtime = {
|
runtime = {
|
||||||
-- Tell the language server which version of Lua you're using
|
-- Tell the language server which version of Lua you're using (most
|
||||||
-- (most likely LuaJIT in the case of Neovim)
|
-- likely LuaJIT in the case of Neovim)
|
||||||
version = 'LuaJIT'
|
version = 'LuaJIT',
|
||||||
|
-- Tell the language server how to find Lua modules same way as Neovim
|
||||||
|
-- (see `:h lua-module-load`)
|
||||||
|
path = {
|
||||||
|
'lua/?.lua',
|
||||||
|
'lua/?/init.lua',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
-- Make the server aware of Neovim runtime files
|
-- Make the server aware of Neovim runtime files
|
||||||
workspace = {
|
workspace = {
|
||||||
checkThirdParty = false,
|
checkThirdParty = false,
|
||||||
library = {
|
library = {
|
||||||
vim.env.VIMRUNTIME
|
vim.env.VIMRUNTIME,
|
||||||
-- Depending on the usage, you might want to add additional paths here.
|
-- Depending on the usage, you might want to add additional paths
|
||||||
-- "${3rd}/luv/library"
|
-- here.
|
||||||
-- "${3rd}/busted/library",
|
-- '${3rd}/luv/library',
|
||||||
}
|
-- '${3rd}/busted/library',
|
||||||
-- or pull in all of 'runtimepath'. NOTE: this is a lot slower
|
},
|
||||||
-- library = vim.api.nvim_get_runtime_file("", true)
|
-- Or pull in all of 'runtimepath'.
|
||||||
}
|
-- NOTE: this is a lot slower and will cause issues when working on
|
||||||
|
-- your own configuration.
|
||||||
|
-- See https://github.com/neovim/nvim-lspconfig/issues/3189
|
||||||
|
-- library = vim.api.nvim_get_runtime_file('', true),
|
||||||
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
settings = {
|
settings = {
|
||||||
Lua = {}
|
Lua = {}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
|
vim.lsp.enable('lua_ls')
|
||||||
vim.opt.completeopt = { "menu", "menuone", "noselect" }
|
vim.opt.completeopt = { "menu", "menuone", "noselect" }
|
||||||
|
|
||||||
-- Set up nvim-cmp.
|
-- Set up nvim-cmp.
|
||||||
@@ -165,8 +213,6 @@ vim.diagnostic.config({
|
|||||||
|
|
||||||
require("null-ls").setup({
|
require("null-ls").setup({
|
||||||
sources = {
|
sources = {
|
||||||
-- JavaScript
|
|
||||||
require("null-ls").builtins.formatting.prettier,
|
|
||||||
-- Python
|
-- Python
|
||||||
require("null-ls").builtins.formatting.black.with({ extra_args = { "--fast" } }),
|
require("null-ls").builtins.formatting.black.with({ extra_args = { "--fast" } }),
|
||||||
require("null-ls").builtins.formatting.isort,
|
require("null-ls").builtins.formatting.isort,
|
||||||
@@ -180,3 +226,18 @@ require("null-ls").setup({
|
|||||||
require("null-ls").builtins.formatting.mix,
|
require("null-ls").builtins.formatting.mix,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
--require('avante').setup({
|
||||||
|
-- provider = "claude",
|
||||||
|
-- providers = {
|
||||||
|
-- claude = {
|
||||||
|
-- auth_type = "max"
|
||||||
|
-- }
|
||||||
|
-- },
|
||||||
|
-- selector = {
|
||||||
|
-- provider = "snacks"
|
||||||
|
-- },
|
||||||
|
-- input = {
|
||||||
|
-- provider = "snacks"
|
||||||
|
-- }
|
||||||
|
--})
|
||||||
|
|||||||
@@ -48,4 +48,25 @@ return require('packer').startup(function(use)
|
|||||||
|
|
||||||
-- Git
|
-- Git
|
||||||
use 'tpope/vim-fugitive'
|
use 'tpope/vim-fugitive'
|
||||||
|
|
||||||
|
-- Copilot
|
||||||
|
-- use 'github/copilot.vim'
|
||||||
|
|
||||||
|
-- Windsurf
|
||||||
|
-- use 'Exafunction/windsurf.vim'
|
||||||
|
|
||||||
|
-- jdtls
|
||||||
|
use 'mfussenegger/nvim-jdtls'
|
||||||
|
|
||||||
|
-- UI tools
|
||||||
|
use 'MunifTanjim/nui.nvim'
|
||||||
|
use 'MeanderingProgrammer/render-markdown.nvim'
|
||||||
|
use 'folke/snacks.nvim' -- for modern input UI
|
||||||
|
|
||||||
|
-- Avante
|
||||||
|
-- use {
|
||||||
|
-- 'yetone/avante.nvim',
|
||||||
|
-- branch = 'main',
|
||||||
|
-- run = 'make'
|
||||||
|
-- }
|
||||||
end)
|
end)
|
||||||
|
|||||||
Reference in New Issue
Block a user