infrastructure/nixos/hosts/thalassa/aoife/home/neovim.nix

95 lines
2.6 KiB
Nix
Raw Normal View History

2023-03-25 13:07:28 +01:00
{ inputs, pkgs, ... }: {
2022-12-06 14:28:03 +01:00
imports = [ inputs.nixvim.homeManagerModules.nixvim ];
programs.nixvim = {
enable = true;
package = pkgs.neovim-unwrapped;
2022-12-09 11:23:07 +01:00
vimAlias = true;
2022-12-06 14:28:03 +01:00
globals = { mapleader = " "; };
maps.normal = {
"<leader>ff" = "<cmd>lua require('telescope.builtin').find_files()<cr>";
"<leader>fg" = "<cmd>lua require('telescope.builtin').live_grep()<cr>";
2023-01-05 13:50:37 +01:00
"<C-_>" =
"<cmd>lua require('Comment.api').toggle.linewise.current()<cr>"; # map ctrl+/ to commenting code
2022-12-06 14:28:03 +01:00
};
extraPlugins = with pkgs.vimPlugins; [ catppuccin-nvim luasnip ];
colorscheme = "catppuccin-frappe";
2023-01-05 13:50:37 +01:00
extraConfigLua = builtins.readFile ./nvim.lua;
2022-12-06 14:28:03 +01:00
plugins = {
2023-04-05 12:26:14 +02:00
bufferline.enable = true;
2022-12-06 14:28:03 +01:00
nix.enable = true;
treesitter = {
enable = true;
2023-03-25 13:07:28 +01:00
nixGrammars = true;
# ensureInstalled = [ ];
2022-12-06 14:28:03 +01:00
};
surround.enable = true;
fugitive.enable = true;
2022-12-09 11:54:59 +01:00
gitgutter.enable = true;
2022-12-06 14:28:03 +01:00
lualine = {
enable = true;
theme = "catppuccin";
};
telescope = {
enable = true;
extensions.fzf-native.enable = true;
extensions.fzf-native.fuzzy = true;
};
2022-12-09 11:54:59 +01:00
comment-nvim = { enable = true; };
2022-12-06 14:28:03 +01:00
lsp = {
enable = true;
servers.rust-analyzer.enable = true;
servers.rnix-lsp.enable = true;
servers.pyright.enable = true;
2023-04-05 12:26:14 +02:00
servers.elixirls.enable = true;
2022-12-09 11:23:07 +01:00
servers.clangd.enable = true;
2022-12-06 14:28:03 +01:00
};
2022-12-09 11:23:07 +01:00
trouble.enable = true;
lspkind.enable = true;
2022-12-06 14:28:03 +01:00
nvim-cmp = {
enable = true;
2023-03-21 11:27:01 +01:00
autoEnableSources = true;
2022-12-06 14:28:03 +01:00
sources = [
{ name = "nvim_lsp"; }
{ name = "cmp-latex-symbols"; }
{
name = "luasnip";
option = { show_autosnippets = true; };
}
{ name = "cmp-spell"; }
{ name = "cmp-rg"; }
{ name = "path"; }
{ name = "buffer"; }
];
2023-03-21 11:27:01 +01:00
snippet.expand = "luasnip";
2022-12-06 14:28:03 +01:00
mappingPresets = [ "insert" "cmdline" ];
mapping = {
"<CR>" = "cmp.mapping.confirm({ select = true })";
"<Tab>" = {
modes = [ "i" "s" ];
action = ''
function(fallback)
local luasnip = require('luasnip')
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expandable() then
luasnip.expand()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end
'';
};
};
};
};
};
}