add core configuration
This commit is contained in:
parent
74c78e1c68
commit
f40517cff1
94 changed files with 2816 additions and 959 deletions
24
home-manager/modules/neovim/plugins/default.nix
Normal file
24
home-manager/modules/neovim/plugins/default.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{...}: {
|
||||
imports = [
|
||||
./telescope.nix
|
||||
./lualine.nix
|
||||
./treesitter.nix
|
||||
./gitsigns.nix
|
||||
./tree.nix
|
||||
./lsp
|
||||
# ./dap.nix
|
||||
];
|
||||
programs.nixvim.plugins = {
|
||||
sleuth.enable = true;
|
||||
comment.enable = true;
|
||||
indent-blankline.enable = true;
|
||||
web-devicons.enable = true;
|
||||
fugitive.enable = true;
|
||||
markdown-preview.enable = true;
|
||||
|
||||
git-worktree = {
|
||||
enable = true;
|
||||
enableTelescope = true;
|
||||
};
|
||||
};
|
||||
}
|
45
home-manager/modules/neovim/plugins/gitsigns.nix
Normal file
45
home-manager/modules/neovim/plugins/gitsigns.nix
Normal file
|
@ -0,0 +1,45 @@
|
|||
{...}: {
|
||||
programs.nixvim.plugins.gitsigns = {
|
||||
enable = true;
|
||||
settings = {
|
||||
signs = {
|
||||
add.text = "▎";
|
||||
change.text = "▎";
|
||||
delete.text = "";
|
||||
topdelete.text = "";
|
||||
changedelete.text = "▎";
|
||||
};
|
||||
|
||||
signs_staged_enable = true;
|
||||
signcolumn = true;
|
||||
numhl = false;
|
||||
linehl = false;
|
||||
word_diff = false;
|
||||
watch_gitdir = {
|
||||
interval = 1000;
|
||||
follow_files = true;
|
||||
};
|
||||
attach_to_untracked = true;
|
||||
current_line_blame = false;
|
||||
current_line_blame_opts = {
|
||||
virt_text = true;
|
||||
virt_text_pos = "eol";
|
||||
delay = 100;
|
||||
ignore_whitespace = true;
|
||||
};
|
||||
|
||||
current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> — <summary>";
|
||||
sign_priority = 6;
|
||||
status_formatter = null;
|
||||
update_debounce = 200;
|
||||
max_file_length = 40000;
|
||||
preview_config = {
|
||||
border = "rounded";
|
||||
style = "minimal";
|
||||
relative = "cursor";
|
||||
row = 0;
|
||||
col = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
85
home-manager/modules/neovim/plugins/lsp/cmp.nix
Normal file
85
home-manager/modules/neovim/plugins/lsp/cmp.nix
Normal file
|
@ -0,0 +1,85 @@
|
|||
{...}: {
|
||||
programs.nixvim.plugins = {
|
||||
cmp = {
|
||||
autoEnableSources = false;
|
||||
enable = true;
|
||||
settings = {
|
||||
snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end";
|
||||
formatting = {
|
||||
fields = ["kind" "abbr" "menu"];
|
||||
format = ''
|
||||
function(entry, vim_item)
|
||||
local kind_icons = {
|
||||
Text = "",
|
||||
Method = "",
|
||||
Function = "",
|
||||
Constructor = "",
|
||||
Field = " ",
|
||||
Variable = "",
|
||||
Class = "",
|
||||
Interface = "",
|
||||
Module = "",
|
||||
Property = "",
|
||||
Unit = "",
|
||||
Value = "",
|
||||
Enum = "",
|
||||
Keyword = "",
|
||||
Snippet = "",
|
||||
Color = "",
|
||||
File = "",
|
||||
Reference = "",
|
||||
Folder = "",
|
||||
EnumMember = "",
|
||||
Constant = "",
|
||||
Struct = "",
|
||||
Event = "",
|
||||
Operator = "",
|
||||
TypeParameter = " ",
|
||||
Misc = " ",
|
||||
}
|
||||
vim_item.kind = string.format("%s", kind_icons[vim_item.kind])
|
||||
vim_item.abbr = vim_item.abbr .. " " .. (vim_item.menu and vim_item.menu or "")
|
||||
if vim.fn.strchars(vim_item.abbr) > 50 then
|
||||
vim_item.abbr = vim.fn.strcharpart(vim_item.abbr, 0, 50) .. "..."
|
||||
end
|
||||
vim_item.menu = ({
|
||||
nvim_lsp = "[LSP]",
|
||||
luasnip = "[Snippet]",
|
||||
buffer = "[Buffer]",
|
||||
path = "[Path]"
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
end
|
||||
'';
|
||||
};
|
||||
mapping.__raw = '' cmp.mapping.preset.insert({
|
||||
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<CR>"] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
}),
|
||||
["<S-TAB>"] = cmp.mapping.select_prev_item(),
|
||||
["<TAB>"] = cmp.mapping.select_next_item(),
|
||||
})'';
|
||||
window = {
|
||||
completion.__raw = "cmp.config.window.bordered()";
|
||||
documentation.__raw = "cmp.config.window.bordered()";
|
||||
};
|
||||
sources = [
|
||||
{name = "nvim_lsp";}
|
||||
{name = "luasnip";}
|
||||
{name = "path";}
|
||||
{name = "buffer";}
|
||||
{name = "crates";}
|
||||
];
|
||||
};
|
||||
};
|
||||
cmp_luasnip.enable = true;
|
||||
cmp-buffer.enable = true;
|
||||
cmp-path.enable = true;
|
||||
cmp-nvim-lsp.enable = true;
|
||||
luasnip.enable = true;
|
||||
};
|
||||
}
|
192
home-manager/modules/neovim/plugins/lsp/default.nix
Normal file
192
home-manager/modules/neovim/plugins/lsp/default.nix
Normal file
|
@ -0,0 +1,192 @@
|
|||
{pkgs, ...}: {
|
||||
imports = [
|
||||
./cmp.nix
|
||||
];
|
||||
programs.nixvim.plugins = {
|
||||
crates.enable = true; # Does not work
|
||||
dressing.enable = true;
|
||||
};
|
||||
programs.nixvim.extraConfigVim = ''
|
||||
augroup unrecognized_filetypes
|
||||
autocmd!
|
||||
autocmd BufRead,BufNewFile *.vert set filetype=glsl
|
||||
autocmd BufRead,BufNewFile *.tesc set filetype=glsl
|
||||
autocmd BufRead,BufNewFile *.tese set filetype=glsl
|
||||
autocmd BufRead,BufNewFile *.frag set filetype=glsl
|
||||
autocmd BufRead,BufNewFile *.geom set filetype=glsl
|
||||
autocmd BufRead,BufNewFile *.comp set filetype=glsl
|
||||
autocmd BufRead,BufNewFile *.qml set filetype=qml
|
||||
autocmd BufRead,BufNewFile *.slint set filetype=slint
|
||||
autocmd BufRead,BufNewFile *.typ set filetype=typst
|
||||
augroup END
|
||||
'';
|
||||
programs.nixvim.plugins.lsp = {
|
||||
enable = true;
|
||||
|
||||
capabilities = ''
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true'';
|
||||
preConfig = ''
|
||||
local border = {
|
||||
{ "╭", "FloatBorder" },
|
||||
{ "─", "FloatBorder" },
|
||||
{ "╮", "FloatBorder" },
|
||||
{ "│", "FloatBorder" },
|
||||
{ "╯", "FloatBorder" },
|
||||
{ "─", "FloatBorder" },
|
||||
{ "╰", "FloatBorder" },
|
||||
{ "│", "FloatBorder" }
|
||||
}
|
||||
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = border })
|
||||
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = border })
|
||||
'';
|
||||
|
||||
inlayHints = true;
|
||||
servers = {
|
||||
clangd = {
|
||||
enable = true;
|
||||
settings.arguments = [
|
||||
"--clang-tidy"
|
||||
"--background-index"
|
||||
"--completion-style=detailed"
|
||||
"--cross-file-rename"
|
||||
"--header-insertion=iwyu"
|
||||
"--all-scopes-completion"
|
||||
];
|
||||
};
|
||||
# jdtls.enable = true;
|
||||
emmet_ls.enable = true;
|
||||
ts_ls.enable = true;
|
||||
cssls.enable = true;
|
||||
# glsl_analyzer.enable = true;
|
||||
glslls.enable = true;
|
||||
pyright.enable = true;
|
||||
nixd.enable = true;
|
||||
lua_ls = {
|
||||
enable = true;
|
||||
settings = {
|
||||
telemetry.enable = false;
|
||||
workspace.checkThirdParty = false;
|
||||
};
|
||||
};
|
||||
svelte = {
|
||||
enable = true;
|
||||
settings.enable_ts_plugin = true;
|
||||
};
|
||||
slint_lsp.enable = true;
|
||||
zls.enable = true;
|
||||
rust_analyzer = {
|
||||
enable = true;
|
||||
installRustc = false;
|
||||
installCargo = false;
|
||||
settings = {
|
||||
imports = {
|
||||
granularity.group = "crate";
|
||||
prefix = "self";
|
||||
preferNoStd = true;
|
||||
};
|
||||
check = {
|
||||
command = "clippy";
|
||||
allTargets = true;
|
||||
};
|
||||
completion = {
|
||||
fullFunctionSignatures.enable = false;
|
||||
autoimport.enable = true;
|
||||
};
|
||||
cargo = {
|
||||
allTargets = true;
|
||||
features = "all";
|
||||
};
|
||||
procMacro.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
keymaps = {
|
||||
silent = true;
|
||||
extra = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>rn";
|
||||
action.__raw = "vim.lsp.buf.rename";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>ca";
|
||||
action.__raw = "vim.lsp.buf.code_action";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>di";
|
||||
action.__raw = "vim.diagnostic.open_float";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>dv";
|
||||
action.__raw = "require('telescope.builtin').diagnostics";
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "gd";
|
||||
action.__raw = "vim.lsp.buf.definition";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "gr";
|
||||
action.__raw = "require('telescope.builtin').lsp_references";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "gI";
|
||||
action.__raw = "vim.lsp.buf.implementation";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>D";
|
||||
action.__raw = "vim.lsp.buf.type_definition";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>ds";
|
||||
action.__raw = "require('telescope.builtin').lsp_document_symbols";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>ws";
|
||||
action.__raw = "require('telescope.builtin').lsp_dynamic_workspace_symbols";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>K";
|
||||
action.__raw = "vim.lsp.buf.hover";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>k";
|
||||
action.__raw = "vim.lsp.buf.signature_help";
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>gD";
|
||||
action.__raw = "vim.lsp.buf.declaration";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>wa";
|
||||
action.__raw = "vim.lsp.buf.add_workspace_folder";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>wr";
|
||||
action.__raw = "vim.lsp.buf.remove_workspace_folder";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>wl";
|
||||
action.__raw = "function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
21
home-manager/modules/neovim/plugins/lualine.nix
Normal file
21
home-manager/modules/neovim/plugins/lualine.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{...}: {
|
||||
programs.nixvim.plugins.lualine = {
|
||||
enable = true;
|
||||
settings = {
|
||||
options = {
|
||||
icons_enabled = true;
|
||||
component_seperators = {
|
||||
left = "|";
|
||||
right = "|";
|
||||
};
|
||||
section_seperators = {
|
||||
left = "";
|
||||
right = "";
|
||||
};
|
||||
disabled_filetypes.statusline = ["NvimTree" "alpha"];
|
||||
disabled_filetypes.winbar = ["NvimTree" "alpha"];
|
||||
theme = null;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
47
home-manager/modules/neovim/plugins/telescope.nix
Normal file
47
home-manager/modules/neovim/plugins/telescope.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
{...}: {
|
||||
programs.nixvim.plugins.telescope = {
|
||||
enable = true;
|
||||
extensions = {
|
||||
fzf-native.enable = true;
|
||||
file-browser.enable = true;
|
||||
};
|
||||
settings = {
|
||||
theme = "dropdown";
|
||||
defaults = {
|
||||
prompt_prefix = " ";
|
||||
selection_caret = " ";
|
||||
entry_prefix = " ";
|
||||
initial_mode = "insert";
|
||||
selection_strategy = "reset";
|
||||
layout_config = {};
|
||||
mappings.i = {
|
||||
"<C-u>" = false;
|
||||
"<C-d>" = false;
|
||||
};
|
||||
file_ignore_patters = {};
|
||||
path_display = "smart";
|
||||
winblend = 0;
|
||||
border = {};
|
||||
borderchars = null;
|
||||
color_devicons = true;
|
||||
set_env = {COLORTERM = "truecolor";};
|
||||
};
|
||||
pickers = {
|
||||
planets = {
|
||||
show_pluto = true;
|
||||
show_moon = true;
|
||||
};
|
||||
git_files = {
|
||||
hidden = true;
|
||||
show_untracked = true;
|
||||
};
|
||||
colorscheme = {
|
||||
enable_preview = true;
|
||||
};
|
||||
find_files = {
|
||||
hidden = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
17
home-manager/modules/neovim/plugins/tree.nix
Normal file
17
home-manager/modules/neovim/plugins/tree.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
programs.nixvim.plugins.nvim-tree = {
|
||||
enable = true;
|
||||
disableNetrw = true;
|
||||
hijackNetrw = true;
|
||||
diagnostics.enable = true;
|
||||
preferStartupRoot = false;
|
||||
syncRootWithCwd = true;
|
||||
view = {
|
||||
side = "left";
|
||||
width = 30;
|
||||
};
|
||||
renderer.groupEmpty = true;
|
||||
actions.openFile.resizeWindow = true;
|
||||
git.ignore = false;
|
||||
};
|
||||
}
|
19
home-manager/modules/neovim/plugins/treesitter.nix
Normal file
19
home-manager/modules/neovim/plugins/treesitter.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{config, ...}: {
|
||||
programs.nixvim.plugins.treesitter = {
|
||||
enable = true;
|
||||
nixvimInjections = true;
|
||||
settings = {
|
||||
indent.enable = true;
|
||||
incremental_selection = {
|
||||
enable = true;
|
||||
# keymaps = {
|
||||
# init_selection = "<c-space>";
|
||||
# node_incremental = "<c-space>";
|
||||
# scope_incremental = "<c-s";
|
||||
# node_decremental = "<c-backspace>";
|
||||
# };
|
||||
};
|
||||
highlight.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue