75 lines
2.0 KiB
Nix
Raw Normal View History

2024-12-21 01:30:34 +01:00
{ config, pkgs, lib, mail, ... }:
{
# TODO
# Linter (ale)
# Markdown spellcheck
# Autocomplete
# Missing plugins
# Telescope and fuzzy finder
# Ruff linter for python and black
# Format on exit
# Good example: https://github.com/fred-drake/neovim/blob/master/config/python/language.nix
programs.nixvim = {
colorscheme = "sonokai";
enable = true;
extraPlugins = [
pkgs.vimPlugins.indentLine
pkgs.vimPlugins.polyglot
pkgs.vimPlugins.sonokai
];
globals = {
mapleader = ",";
sonokai_style = "atlantis";
sonokai_disable_italic_comment = 1;
};
keymaps = [
{
key = "<leader>t";
action = "<cmd>Neotree toggle<CR>";
}
];
opts = {
colorcolumn = "88";
cursorline = true;
number = true;
termguicolors = true;
};
plugins = {
cmp = {
enable = true; # Completion
autoEnableSources = true;
settings.sources = [
{ name = "nvim_lsp"; }
{ name = "path"; }
{ name = "buffer"; }
];
settings.mapping = {
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<C-Space>" = "cmp.mapping.complete()";
"<C-e>" = "cmp.mapping.close()";
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item({behavior = cmp.SelectBehavior.Select}), {'i', 's'})";
"<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item({behavior = cmp.SelectBehavior.Select}), {'i', 's'})";
"<CR>" = "cmp.mapping.confirm({ select = false, behavior = cmp.ConfirmBehavior.Replace })";
};
};
committia.enable = true;
gitgutter.enable = true;
guess-indent.enable = true;
lsp.enable = true;
lsp.servers.pylsp = {
enable = true;
settings.plugins = {
black.enabled = true;
isort.enabled = true;
ruff.enabled = true;
};
};
lualine.enable = true;
neo-tree.enable = true;
web-devicons.enable = true;
};
};
}