Update nixvim

This commit is contained in:
albert 2024-04-03 20:07:58 +09:00
parent 0e7cf5007b
commit 0a1c8520fa
No known key found for this signature in database
GPG key ID: 64F6C4EB46C4543A
2 changed files with 7 additions and 88 deletions

View file

@ -11,9 +11,7 @@
}
)
vim.diagnostic.config {
float = { border = _border }
}
vim.diagnostic.config { float = { border = _border } }
require('lspconfig.ui.windows').default_options = { border = _border }
local signs = { Error = "󰅚 ", Warn = "󰀪 ", Hint = "󰌶 ", Info = " " }
@ -34,8 +32,8 @@
'';
plugins = {
lsp-lines.enable = false;
lsp-lines.currentLine = true;
lsp-lines.enable = true;
lsp-lines.currentLine = false;
crates-nvim.enable = true;
lspsaga = {
enable = false;
@ -78,20 +76,6 @@
};
onAttach = ''
vim.api.nvim_create_autocmd("CursorHold", {
buffer = bufnr,
callback = function()
local opts = {
focusable = false,
close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" },
border = 'rounded',
source = 'always',
prefix = ' ',
scope = 'cursor',
}
vim.diagnostic.open_float(nil, opts)
end
})
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with (
vim.lsp.handlers.hover, {
border = "rounded",
@ -99,7 +83,7 @@
)
'';
keymaps = {
silent = false;
silent = true;
diagnostic = {
"<leader>lk" = {
action = "goto_prev";

View file

@ -2,6 +2,7 @@
imports = [
./alpha.nix
./keymaps.nix
./cmp.nix
inputs.nixvim.homeManagerModules.nixvim
] ++ lib.optional (builtins.isString theme) ../../../../../stylix/themes/${theme}/home-manager/nixvim.nix;
@ -47,7 +48,7 @@
# Fancy popups, etc for vim
noice = {
enable = true;
popupmenu.enabled = true;
popupmenu.enabled = false;
lsp.hover.enabled = false;
};
notify = {
@ -126,16 +127,6 @@
# Code Related
# Parser generator tool
treesitter.enable = true;
# Snippet engine for neovim
luasnip.enable = true;
cmp_luasnip.enable = true;
# CMP Addons
cmp-buffer.enable = true;
cmp-path.enable = true;
cmp-nvim-lsp.enable = true;
cmp-nvim-lsp-document-symbol.enable = true;
cmp-nvim-lsp-signature-help.enable = true;
# List of linters for nixvim
lint = {
@ -230,63 +221,7 @@
};
};
};
nvim-cmp = {
enable = true;
autoEnableSources = true;
mapping = {
"<C-Space>" = "cmp.mapping.complete()";
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
"<C-e>" = "cmp.mapping.close()";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<CR>" = "cmp.mapping.confirm({ select = true })";
"<S-Tab>" = {
action = "cmp.mapping.select_prev_item()";
modes = [
"i"
"s"
];
};
"<Tab>" = {
action = "cmp.mapping.select_next_item()";
modes = [
"i"
"s"
];
};
};
sources = [
# { name = "nvim_lua"; }
{ name = "nvim_lsp"; }
{ name = "nvim_lsp_signature_help"; }
{ name = "calc"; }
{ name = "path"; }
{ name = "buffer"; }
{ name = "luasnip"; }
];
snippet.expand = "luasnip";
window = {
completion.border = "rounded";
documentation.border = "rounded";
};
formatting = {
fields = [ "menu" "abbr" "kind" ];
# https://rsdlt.github.io/posts/rust-nvim-ide-guide-walkthrough-development-debug/
format = ''
function(entry, item)
local menu_icon = {
nvim_lsp = 'λ',
luasnip = '',
buffer = 'Ω',
path = '🖫',
}
item.menu = menu_icon[entry.source.name]
return item
end,
'';
};
};
};
};
colorschemes = {
tokyonight.enable = true;