2023-11-22 15:33:16 -05:00
|
|
|
{
|
2023-12-08 12:50:38 -05:00
|
|
|
config,
|
2024-05-15 18:55:07 -04:00
|
|
|
neovim-nightly,
|
2023-11-22 15:33:16 -05:00
|
|
|
pkgs,
|
|
|
|
...
|
2024-01-22 11:09:37 -05:00
|
|
|
}: let
|
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-08 20:26:57 -04:00
|
|
|
./git.nix
|
2024-05-07 22:49:00 -04:00
|
|
|
./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;
|
2024-05-15 18:55:07 -04:00
|
|
|
package = neovim-nightly.packages.${pkgs.system}.neovim;
|
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-08 23:04:16 -04:00
|
|
|
-- Always show the signcolumn, otherwise it would shift
|
|
|
|
-- the text each time diagnostics appear/become resolved
|
|
|
|
vim.opt.signcolumn = 'yes';
|
|
|
|
|
2024-05-07 22:49:00 -04:00
|
|
|
-- remove highlight on words
|
2024-05-08 23:04:16 -04:00
|
|
|
vim.keymap.set('n', '<esc>', ':noh<cr><esc>', {
|
|
|
|
noremap = true,
|
|
|
|
silent = true,
|
|
|
|
});
|
2024-05-07 22:49:00 -04:00
|
|
|
'';
|
2023-10-15 15:11:59 -04:00
|
|
|
|
2024-05-08 20:26:57 -04:00
|
|
|
plugins = [
|
|
|
|
vimPlugins.fzfWrapper
|
|
|
|
vimPlugins.fzf-vim
|
|
|
|
|
|
|
|
{
|
|
|
|
plugin = vimPlugins.todo-comments-nvim;
|
|
|
|
type = "lua";
|
|
|
|
config =
|
|
|
|
/*
|
|
|
|
lua
|
|
|
|
*/
|
|
|
|
''
|
|
|
|
require('todo-comments').setup();
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
{
|
|
|
|
plugin = vimPlugins.mini-nvim;
|
|
|
|
type = "lua";
|
|
|
|
config =
|
|
|
|
/*
|
|
|
|
lua
|
|
|
|
*/
|
|
|
|
''
|
|
|
|
-- TODO: see how this works
|
|
|
|
local ts_input = require('mini.surround').gen_spec.input.treesitter;
|
|
|
|
|
|
|
|
require('mini.surround').setup({
|
|
|
|
custom_surroundings = {
|
|
|
|
-- Use tree-sitter to search for function call
|
|
|
|
f = {
|
|
|
|
input = ts_input({
|
|
|
|
outer = '@call.outer',
|
|
|
|
inner = '@call.inner',
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
];
|
2023-10-15 15:11:59 -04:00
|
|
|
};
|
2023-07-19 21:52:35 -04:00
|
|
|
};
|
|
|
|
}
|