2024-02-14 21:40:07 +01:00
|
|
|
{config, pkgs, inputs, ... }: {
|
2024-02-22 20:20:07 +01:00
|
|
|
home-manager.users.emily.imports = [
|
2024-02-14 21:40:07 +01:00
|
|
|
inputs.nixvim.homeManagerModules.nixvim
|
|
|
|
];
|
2024-02-22 20:20:07 +01:00
|
|
|
home-manager.users.emily.programs.nixvim = {
|
|
|
|
enable = true;
|
2024-02-29 21:24:55 +01:00
|
|
|
extraPlugins = with pkgs; [
|
|
|
|
vimPlugins.molokai
|
|
|
|
vimPlugins.vim-airline-themes
|
|
|
|
];
|
2024-02-22 20:20:07 +01:00
|
|
|
colorscheme = "molokai";
|
2024-02-14 21:40:07 +01:00
|
|
|
vimAlias = true;
|
2024-02-22 20:20:07 +01:00
|
|
|
highlightOverride.Normal = {
|
2024-02-14 21:40:07 +01:00
|
|
|
ctermbg = "NONE";
|
2024-02-22 20:20:07 +01:00
|
|
|
bg = "NONE";
|
2024-02-14 21:40:07 +01:00
|
|
|
};
|
|
|
|
options = {
|
|
|
|
number = true;
|
2024-02-29 21:24:55 +01:00
|
|
|
expandtab = true;
|
2024-02-14 21:40:07 +01:00
|
|
|
autoindent = true;
|
2024-02-22 20:20:07 +01:00
|
|
|
mouse = "";
|
2024-02-14 21:40:07 +01:00
|
|
|
encoding = "utf-8";
|
|
|
|
shiftwidth = 2;
|
|
|
|
smartindent = true;
|
|
|
|
tabstop = 2;
|
|
|
|
|
|
|
|
ignorecase = true;
|
|
|
|
incsearch = true;
|
|
|
|
smartcase = true;
|
|
|
|
};
|
|
|
|
keymaps = [
|
|
|
|
{
|
|
|
|
action = "<cmd>Neotree toggle<CR>";
|
|
|
|
key = "<C-n>";
|
|
|
|
mode = "n";
|
|
|
|
options.silent = true;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
action = "<C-\\><C-n>";
|
|
|
|
key = "<esc>";
|
|
|
|
mode = "t";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
plugins.nvim-cmp = {
|
|
|
|
enable = true;
|
|
|
|
sources = [
|
|
|
|
{ name = "nvim_lsp"; }
|
|
|
|
{ name = "luasnip"; }
|
|
|
|
{ name = "buffer"; }
|
|
|
|
{ name = "nvim_lua"; }
|
|
|
|
{ name = "path"; }
|
|
|
|
];
|
|
|
|
formatting = {
|
|
|
|
fields = [ "abbr" "kind" "menu" ];
|
|
|
|
format = ''
|
|
|
|
function(_, item)
|
|
|
|
local icons = {
|
|
|
|
Namespace = "",
|
|
|
|
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 = "",
|
|
|
|
Table = "",
|
|
|
|
Object = "",
|
|
|
|
Tag = "",
|
|
|
|
Array = "[]",
|
|
|
|
Boolean = "",
|
|
|
|
Number = "",
|
|
|
|
Null = "",
|
|
|
|
String = "",
|
|
|
|
Calendar = "",
|
|
|
|
Watch = "",
|
|
|
|
Package = "",
|
|
|
|
Copilot = "",
|
|
|
|
Codeium = "",
|
|
|
|
TabNine = "",
|
|
|
|
}
|
|
|
|
|
|
|
|
local icon = icons[item.kind] or ""
|
|
|
|
item.kind = string.format("%s %s", icon, item.kind or "")
|
|
|
|
return item
|
|
|
|
end
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
snippet = { expand = "luasnip"; };
|
|
|
|
window = {
|
|
|
|
completion = {
|
|
|
|
winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel";
|
|
|
|
scrollbar = false;
|
|
|
|
sidePadding = 0;
|
|
|
|
border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ];
|
|
|
|
};
|
|
|
|
documentation = {
|
|
|
|
border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ];
|
|
|
|
winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
mapping = {
|
|
|
|
"<C-n>" = "cmp.mapping.select_next_item()";
|
|
|
|
"<C-p>" = "cmp.mapping.select_prev_item()";
|
|
|
|
"<C-j>" = "cmp.mapping.select_next_item()";
|
|
|
|
"<C-k>" = "cmp.mapping.select_prev_item()";
|
|
|
|
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
|
|
|
|
"<C-f>" = "cmp.mapping.scroll_docs(4)";
|
|
|
|
"<C-Space>" = "cmp.mapping.complete()";
|
|
|
|
"<C-e>" = "cmp.mapping.close()";
|
|
|
|
"<CR>" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true })";
|
|
|
|
"<Tab>" = {
|
|
|
|
modes = [ "i" "s" ];
|
|
|
|
action = ''
|
|
|
|
function(fallback)
|
|
|
|
if cmp.visible() then
|
|
|
|
cmp.select_next_item()
|
|
|
|
elseif require("luasnip").expand_or_jumpable() then
|
|
|
|
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-expand-or-jump", true, true, true), "")
|
|
|
|
else
|
|
|
|
fallback()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
"<S-Tab>" = {
|
|
|
|
modes = [ "i" "s" ];
|
|
|
|
action = ''
|
|
|
|
function(fallback)
|
|
|
|
if cmp.visible() then
|
|
|
|
cmp.select_prev_item()
|
|
|
|
elseif require("luasnip").jumpable(-1) then
|
|
|
|
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-jump-prev", true, true, true), "")
|
|
|
|
else
|
|
|
|
fallback()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
plugins.lsp = {
|
|
|
|
enable = true;
|
|
|
|
keymaps.lspBuf = {
|
|
|
|
"K" = "hover";
|
|
|
|
"gd" = "definition";
|
|
|
|
"gD" = "references";
|
|
|
|
"gt" = "type_definition";
|
|
|
|
"gi" = "implementation";
|
|
|
|
};
|
|
|
|
servers = {
|
|
|
|
bashls.enable = true;
|
|
|
|
lua-ls.enable = true;
|
2024-02-28 22:43:20 +01:00
|
|
|
nixd = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
eval.depth = 5;
|
|
|
|
eval.workers = 6;
|
|
|
|
formatting.command = "nixpkgs-fmt";
|
|
|
|
options.enable = true;
|
|
|
|
};
|
|
|
|
};
|
2024-02-14 21:40:07 +01:00
|
|
|
ruff-lsp.enable = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
plugins.none-ls = {
|
|
|
|
enable = true;
|
|
|
|
sources.diagnostics = {
|
|
|
|
pylint.enable = true;
|
|
|
|
shellcheck.enable = true;
|
|
|
|
statix.enable = true;
|
|
|
|
};
|
|
|
|
sources.formatting = {
|
|
|
|
nixfmt.enable = true;
|
|
|
|
markdownlint.enable = true;
|
|
|
|
rustfmt.enable = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
plugins.neo-tree = {
|
|
|
|
enable = true;
|
|
|
|
closeIfLastWindow = true;
|
|
|
|
};
|
|
|
|
plugins.treesitter = {
|
|
|
|
enable = true;
|
|
|
|
nixGrammars = true;
|
|
|
|
indent = true;
|
|
|
|
};
|
2024-02-28 22:43:20 +01:00
|
|
|
plugins.airline.enable = true;
|
2024-02-14 21:40:07 +01:00
|
|
|
plugins.cmp-buffer.enable = true;
|
|
|
|
plugins.cmp-emoji.enable = true;
|
|
|
|
plugins.cmp-nvim-lsp.enable = true;
|
|
|
|
plugins.cmp-path.enable = true;
|
|
|
|
plugins.cmp_luasnip.enable = true;
|
|
|
|
plugins.luasnip.enable = true;
|
2024-02-28 22:43:20 +01:00
|
|
|
plugins.nvim-autopairs.enable = true;
|
2024-02-14 21:40:07 +01:00
|
|
|
plugins.rainbow-delimiters.enable = true;
|
|
|
|
plugins.rustaceanvim.enable = true;
|
|
|
|
plugins.treesitter-context.enable = true;
|
|
|
|
};
|
|
|
|
}
|