2023-11-22 15:33:16 -05:00
|
|
|
{
|
2023-12-08 12:50:38 -05:00
|
|
|
config,
|
2023-11-22 15:33:16 -05:00
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
2024-01-22 11:09:37 -05:00
|
|
|
}: let
|
2024-05-07 22:49:00 -04:00
|
|
|
inherit (config.vars) neovimIde;
|
|
|
|
inherit (lib) fileContents optionals;
|
2024-05-04 19:14:13 -04:00
|
|
|
inherit (pkgs) vimPlugins;
|
2023-10-27 01:15:33 -04:00
|
|
|
in {
|
2024-05-06 18:14:52 -04:00
|
|
|
imports = [
|
2024-05-07 22:49:00 -04:00
|
|
|
./coc.nix
|
|
|
|
./langs
|
|
|
|
./theme.nix
|
2024-05-06 18:14:52 -04:00
|
|
|
./treesitter.nix
|
|
|
|
];
|
|
|
|
|
2023-10-15 15:11:59 -04:00
|
|
|
programs = {
|
|
|
|
neovim = {
|
|
|
|
enable = true;
|
2023-10-20 21:06:44 -04:00
|
|
|
|
2024-05-07 22:49:00 -04:00
|
|
|
extraLuaConfig =
|
|
|
|
/*
|
|
|
|
lua
|
|
|
|
*/
|
|
|
|
''
|
|
|
|
-- by default, the indent is 2 spaces.
|
|
|
|
vim.opt.smartindent = true;
|
|
|
|
vim.opt.expandtab = true;
|
|
|
|
vim.opt.shiftwidth = 2;
|
|
|
|
vim.opt.softtabstop = 2;
|
|
|
|
vim.opt.tabstop = 2;
|
2023-10-26 16:33:40 -04:00
|
|
|
|
2024-05-07 22:49:00 -04:00
|
|
|
vim.opt.number = true;
|
|
|
|
vim.opt.relativenumber = true;
|
2023-10-20 21:06:44 -04:00
|
|
|
|
2024-05-07 22:49:00 -04:00
|
|
|
vim.opt.undofile = true;
|
|
|
|
vim.opt.undodir = '${config.xdg.cacheHome}/nvim/';
|
2023-10-20 21:06:44 -04:00
|
|
|
|
2024-05-07 22:49:00 -04:00
|
|
|
-- remove highlight on words
|
|
|
|
vim.cmd[[nnoremap <silent> <esc> :noh<cr><esc>]];
|
|
|
|
'';
|
2023-10-15 15:11:59 -04:00
|
|
|
|
2024-05-04 19:14:13 -04:00
|
|
|
plugins =
|
|
|
|
[
|
|
|
|
vimPlugins.fzfWrapper
|
|
|
|
vimPlugins.fzf-vim
|
|
|
|
vimPlugins.fugitive
|
|
|
|
{
|
|
|
|
plugin = vimPlugins.todo-comments-nvim;
|
|
|
|
type = "lua";
|
|
|
|
config =
|
|
|
|
/*
|
|
|
|
lua
|
|
|
|
*/
|
2024-05-07 22:49:00 -04:00
|
|
|
''
|
|
|
|
require('todo-comments').setup();
|
|
|
|
'';
|
2024-05-04 19:14:13 -04:00
|
|
|
}
|
|
|
|
{
|
|
|
|
plugin = vimPlugins.gitsigns-nvim;
|
|
|
|
type = "lua";
|
|
|
|
config = fileContents ./plugins/gitsigns.lua;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
plugin = vimPlugins.mini-nvim;
|
|
|
|
type = "lua";
|
|
|
|
config = fileContents ./plugins/mini.lua;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
plugin = vimPlugins.codewindow-nvim;
|
|
|
|
type = "lua";
|
2024-05-07 22:49:00 -04:00
|
|
|
config =
|
|
|
|
/*
|
|
|
|
lua
|
|
|
|
*/
|
|
|
|
''
|
|
|
|
require('codewindow').setup({
|
|
|
|
auto_enable = true,
|
|
|
|
minimap_width = 8,
|
|
|
|
relative = 'editor',
|
|
|
|
window_border = 'none',
|
|
|
|
});
|
|
|
|
'';
|
2024-05-04 19:14:13 -04:00
|
|
|
}
|
|
|
|
]
|
|
|
|
++ optionals neovimIde [
|
|
|
|
{
|
|
|
|
plugin = vimPlugins.nvim-autopairs;
|
|
|
|
type = "lua";
|
|
|
|
config = fileContents ./plugins/autopairs.lua;
|
|
|
|
}
|
|
|
|
];
|
2023-10-15 15:11:59 -04:00
|
|
|
};
|
2023-07-19 21:52:35 -04:00
|
|
|
};
|
|
|
|
}
|