Merge branch 'dev' into gentoo

zsh: opam configuration
nvim:
        fix nvim-cmp config
        improve lsp config
This commit is contained in:
David JULIEN 2021-10-12 14:02:33 +02:00
commit 64e5f011cb
No known key found for this signature in database
GPG Key ID: 4B388E8BD9D47382
5 changed files with 18 additions and 6 deletions

View File

@ -3,11 +3,18 @@
-- License : GPLv3 -- License : GPLv3
-- Description : clangd config file for lsp -- Description : clangd config file for lsp
-- The nvim-cmp almost supports LSP's capabilities so You should advertise it to LSP servers..
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
require("lspconfig").clangd.setup { require("lspconfig").clangd.setup {
cmd = { "clangd", cmd = { "clangd",
"--background-index", "--background-index",
"--suggest-missing-includes", "--suggest-missing-includes",
"--clang-tidy", "--clang-tidy",
"--header-insertion=iwyu" "--header-insertion=iwyu"
} },
-- The following example advertise capabilities to `clangd`.
capabilities = capabilities,
} }

View File

@ -21,7 +21,7 @@ require'lspconfig'.sumneko_lua.setup {
}, },
diagnostics = { diagnostics = {
-- Get the language server to recognize the `vim` global -- Get the language server to recognize the `vim` global
globals = {'vim'}, globals = {"vim", "use", "globals", "utils"},
}, },
workspace = { workspace = {
-- Make the server aware of Neovim runtime files -- Make the server aware of Neovim runtime files

View File

@ -58,8 +58,8 @@ cmp.setup {
select = true, select = true,
}), }),
["<Tab>"] = cmp.mapping(function(fallback) ["<Tab>"] = cmp.mapping(function(fallback)
if vim.fn.pumvisible() == 1 then if cmp.visible() then
vim.fn.feedkeys(t "<C-n>", "n") cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump() luasnip.expand_or_jump()
elseif check_backspace() then elseif check_backspace() then
@ -69,8 +69,8 @@ cmp.setup {
end end
end, { "i", "s" }), end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback) ["<S-Tab>"] = cmp.mapping(function(fallback)
if vim.fn.pumvisible() == 1 then if cmp.visible() then
vim.fn.feedkeys(t "<C-p>", "n") cmp.select_prev_item()
elseif luasnip.jumpable(-1) then elseif luasnip.jumpable(-1) then
luasnip.jump(-1) luasnip.jump(-1)
else else

View File

@ -22,6 +22,8 @@ export ANDROID_PREFS_ROOT="$XDG_CONFIG_HOME/android"
export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc-2.0" export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc-2.0"
export TEXMFHOME="$XDG_DATA_HOME/texmf" export TEXMFHOME="$XDG_DATA_HOME/texmf"
export CARGO_HOME="$XDG_DATA_HOME/cargo" export CARGO_HOME="$XDG_DATA_HOME/cargo"
export OPAMROOT="$XDG_DATA_HOME/opam"
export COQBIN="$OPAMROOT/default/bin"
## default programs ## default programs
export GPG_ASKPASS="/usr/bin/pinentry-curses" export GPG_ASKPASS="/usr/bin/pinentry-curses"

View File

@ -78,3 +78,6 @@ typeset -A ZSH_HIGHLIGHT_STYLES
ZSH_HIGHLIGHT_STYLES[alias]='fg=green,bold' ZSH_HIGHLIGHT_STYLES[alias]='fg=green,bold'
ZSH_HIGHLIGHT_STYLES[path]='fg=magenta,bold' ZSH_HIGHLIGHT_STYLES[path]='fg=magenta,bold'
ZSH_HIGHLIGHT_STYLES[unknown-token]='bg=red,fg=white,bold' ZSH_HIGHLIGHT_STYLES[unknown-token]='bg=red,fg=white,bold'
# opam configuration
test -r "$OPAMROOT/opam-init/init.zsh" && . "$OPAMROOT/opam-init/init.zsh" > /dev/null 2> /dev/null || true