fix: cmp finally works?
This commit is contained in:
parent
1c9bf7056c
commit
6e570fbc2e
@ -1,7 +1,7 @@
|
||||
-- theming
|
||||
-- Default options
|
||||
--vim.opt.termguicolors = true
|
||||
--vim.cmd.colorscheme 'duskfox'
|
||||
vim.opt.termguicolors = true
|
||||
vim.cmd.colorscheme 'duskfox'
|
||||
|
||||
-- turn on relative line numbers
|
||||
vim.opt.relativenumber = true
|
||||
@ -52,16 +52,6 @@ vim.cmd([[
|
||||
au BufNewFile,BufRead *.hrl filetype indent off
|
||||
]])
|
||||
|
||||
----Set completeopt to have a better completion experience
|
||||
---- :help completeopt
|
||||
---- menuone: popup even when there's only one match
|
||||
---- noinsert: Do not insert text until a selection is made
|
||||
---- noselect: Do not select, force to select one from the menu
|
||||
---- shortness: avoid showing extra messages when using completion
|
||||
---- updatetime: set updatetime for CursorHold
|
||||
--vim.opt.completeopt = {'menuone', 'noselect', 'noinsert'}
|
||||
--vim.opt.shortmess = vim.opt.shortmess + { c = true}
|
||||
--vim.api.nvim_set_option('updatetime', 300)
|
||||
--
|
||||
--https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
||||
-- TODO(jwall): See about proper snippet support (ie. license comments?)
|
||||
@ -74,7 +64,16 @@ cmp.setup({
|
||||
vim.fn["vsnip#anonymous"](args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert(),
|
||||
mapping = cmp.mapping.preset.insert {
|
||||
['<C-k>'] = cmp.mapping.select_prev_item(),
|
||||
['<C-j>'] = cmp.mapping.select_next_item(),
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<CR>'] = cmp.mapping.confirm {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
},
|
||||
},
|
||||
-- Installed sources:
|
||||
sources = cmp.config.sources(
|
||||
{
|
||||
@ -93,32 +92,13 @@ cmp.setup({
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
formatting = {
|
||||
fields = {'menu', 'abbr', 'kind'},
|
||||
format = function(entry, item)
|
||||
local menu_icon ={
|
||||
nvim_lsp = 'λ',
|
||||
vsnip = '⋗',
|
||||
buffer = 'Ω',
|
||||
path = '🖫',
|
||||
}
|
||||
item.menu = menu_icon[entry.source.name]
|
||||
return item
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
local caps = vim.tbl_deep_extend(
|
||||
'force',
|
||||
vim.lsp.protocol.make_client_capabilities(),
|
||||
{}
|
||||
);
|
||||
|
||||
local lspconfig = require("lspconfig")
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
|
||||
-- Nix language server support
|
||||
lspconfig.nil_ls.setup{}
|
||||
--lspconfig.nil_ls.setup{}
|
||||
|
||||
local vim_pid = vim.fn.getpid()
|
||||
|
||||
@ -149,16 +129,23 @@ lspconfig.omnisharp.setup {
|
||||
handlers = {
|
||||
["textDocument/definition"] = require('omnisharp_extended').handler,
|
||||
},
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
--ocaml
|
||||
lspconfig.ocamllsp.setup{}
|
||||
lspconfig.ocamllsp.setup{
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
-- Java language server support
|
||||
lspconfig.java_language_server.setup{}
|
||||
lspconfig.java_language_server.setup{
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
-- Typescript language server support
|
||||
lspconfig.tsserver.setup{}
|
||||
lspconfig.tsserver.setup{
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
-- Rust language server support
|
||||
lspconfig.rust_analyzer.setup{
|
||||
@ -167,7 +154,7 @@ lspconfig.rust_analyzer.setup{
|
||||
|
||||
-- lua language server setup.
|
||||
lspconfig.lua_ls.setup{
|
||||
settings = {
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = { version = 'LuaJIT', },
|
||||
diagnostics = {
|
||||
@ -185,6 +172,7 @@ lspconfig.lua_ls.setup{
|
||||
},
|
||||
},
|
||||
},
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
-- lsp configuration
|
||||
|
6
nix/darwin/flake.lock
generated
6
nix/darwin/flake.lock
generated
@ -34,12 +34,12 @@
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1,
|
||||
"narHash": "sha256-uA4sSuHPv0RuNibC98a+mBh/GnMS1vXrwFIE1XP8AIs=",
|
||||
"path": "/nix/store/pzjnc2vf0y96kai86a1m9m54m33lxwpq-source/nix/base-system",
|
||||
"narHash": "sha256-KJ88AyD8/ZvqJOPPQmIlima5o21MEmFOOJzXRyGAfdE=",
|
||||
"path": "/nix/store/bb6cc8gqhmh7rx05pyamshg1cq9bvrrh-source/nix/base-system",
|
||||
"type": "path"
|
||||
},
|
||||
"original": {
|
||||
"path": "/nix/store/pzjnc2vf0y96kai86a1m9m54m33lxwpq-source/nix/base-system",
|
||||
"path": "/nix/store/bb6cc8gqhmh7rx05pyamshg1cq9bvrrh-source/nix/base-system",
|
||||
"type": "path"
|
||||
}
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user