Compare commits

..

No commits in common. "d7afbaa99964c9a769a4beff76d24178caedfe4a" and "200083a9105c56fe7c13e855a334a6aad2982c60" have entirely different histories.

5 changed files with 66 additions and 111 deletions

View File

@ -1,72 +0,0 @@
local cmp = require("cmp")
cmp.setup({
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
--vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+)
end,
},
window = {
-- completion = cmp.config.window.bordered(),
-- documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
['<C-y>'] = cmp.mapping.confirm({ select = true }),
['<C-Space>'] = cmp.mapping.complete(),
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'luasnip' }, -- For luasnip users.
{ name = 'buffer' },
{
name = 'path',
option = {
pathMappings = {
['@'] = '${folder}/src',
-- ['/'] = '${folder}/src/public/',
-- ['~@'] = '${folder}/src',
-- ['/images'] = '${folder}/src/images',
-- ['/components'] = '${folder}/src/components',
},
},
},
}),
completion = {
completeopt = 'menu,menuone,noinsert',
},
})
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ '/', '?' }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources(
{
{ name = 'path' }
},
{
{
name = 'cmdline',
option = {
ignore_cmds = { 'Man', '!' }
}
}
})
})
-- Set up lspconfig.
local capabilities = require('cmp_nvim_lsp').default_capabilities()
-- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled.
--require('lspconfig')['<YOUR_LSP_SERVER>'].setup {
-- capabilities = capabilities
--}

View File

@ -1,5 +1,34 @@
require("mason").setup() require("mason").setup()
local cmp = require('cmp')
local cmp_select = {behavior = cmp.SelectBehavior.Select}
cmp.setup({
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
['<C-y>'] = cmp.mapping.confirm({ select = true }),
['<C-Space>'] = cmp.mapping.complete(),
}),
sources = cmp.config.sources(
{
{ name = 'nvim_lsp' },
{ name = 'luasnip' }
},
{
{ name = 'buffer' },
{ name = 'path' },
{ name = 'cmdline' }
}),
completion = {
completeopt = 'menu,menuone,noinsert',
},
})
vim.lsp.enable("lua_ls") vim.lsp.enable("lua_ls")
vim.lsp.config("lua_ls", { vim.lsp.config("lua_ls", {
on_init = function(client) on_init = function(client)
@ -27,34 +56,38 @@ vim.lsp.config("lua_ls", {
} }
}) })
--vim.lsp.enable("clangd") vim.lsp.enable("clangd")
vim.lsp.config("clangd", {
vim.lsp.enable("rust_analyzer") capabilities = require('cmp_nvim_lsp').default_capabilities(),
vim.lsp.config("rust_analyzer", { cmd = {
cmd = { "~/.local/share/nvim/mason/bin/rust-analyzer" }, "clangd",
"--background-index",
"--clang-tidy",
"--completion-style=detailed",
"--all-scopes-completion",
}
}) })
vim.lsp.enable("pyright") vim.lsp.enable("pyright")
vim.lsp.config("pyright", { vim.lsp.config("pyright", {})
cmd = { "~/.local/share/nvim/mason/bin/pyright-langserver", "--stdio" },
})
vim.lsp.enable("html") vim.lsp.enable("html")
vim.lsp.config("html", { vim.lsp.config("html", {})
cmd = { "~/.local/share/nvim/mason/packages/html-lsp/node_modules/.bin/vscode-html-language-server", "--stdio" }, vim.lsp.enable("angularls")
}) vim.lsp.config("angularls", {})
--vim.lsp.enable("angularls")
--vim.lsp.config("angularls", {
-- cmd = { "ngserver", "--stdio", "--tsProbeLocations", "../..,?/node_modules", "--ngProbeLocations", "../../@angular/language-server/node_modules,?/node_modules/@angular/language-server/node_modules", "--angularCoreVersion", "" },
--})
vim.lsp.enable("ts_ls") vim.lsp.enable("ts_ls")
vim.lsp.config("ts_ls", { vim.lsp.config("ts_ls", {
cmd = { "~/.local/share/nvim/mason/packages/typescript-language-server/node_modules/typescript-language-server/lib/cli.mjs", "--stdio" }, cmd = { "/usr/lib/node_modules/typescript-language-server/lib/cli.mjs", "--stdio" },
filetypes = { "javascript", "typescript", "javascriptreact", "typescriptreact" },
init_options = {
plugins = {},
},
on_attach = function(client, bufnr)
client.server_capabilities.documentFormattingProvider = false -- Optional
end
}) })
vim.lsp.enable("jdtls") vim.lsp.enable("java-language-server")
vim.lsp.config("jdtls", { vim.lsp.config("java-language-server", {
cmd = { vim.fn.expand("~/.local/share/nvim/mason/bin/jdtls") }, cmd = {"java-language-server"}
}) })

View File

@ -1,9 +0,0 @@
local null_ls = require("null-ls")
null_ls.setup({
sources = {
null_ls.builtins.formatting.stylua,
null_ls.builtins.completion.spell,
--require("none-ls.diagnostics.eslint"), -- requires none-ls-extras.nvim
},
})

View File

@ -1,9 +1,21 @@
require 'nvim-treesitter.configs'.setup { require 'nvim-treesitter.configs'.setup {
-- A list of parser names, or "all" (the listed parsers MUST always be installed)
ensure_installed = { "javascript", "typescript", "c", "lua", "vim", "vimdoc", "query", "markdown", "markdown_inline" },
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
-- Automatically install missing parsers when entering buffer -- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true, auto_install = true,
highlight = { highlight = {
enable = true, enable = true,
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
}, },
} }

View File

@ -34,15 +34,6 @@ require("lazy").setup({
{ -- Formatter, Linter, etc bridge?? { -- Formatter, Linter, etc bridge??
'nvimtools/none-ls.nvim' 'nvimtools/none-ls.nvim'
}, },
{ -- LSP Configuration tool
'neovim/nvim-lspconfig'
},
{ -- Snippet engine?
"L3MON4D3/LuaSnip",
version = "v2.4", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
-- install jsregexp (optional!).
build = "make install_jsregexp"
},
{ -- Code completion { -- Code completion
'hrsh7th/nvim-cmp' 'hrsh7th/nvim-cmp'
}, },