2024-05-07 22:49:00 -04:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
2024-11-22 02:48:41 -05:00
|
|
|
pkgs,
|
2024-05-07 22:49:00 -04:00
|
|
|
...
|
|
|
|
}: let
|
2024-12-16 17:44:17 -05:00
|
|
|
inherit (lib) attrValues getExe mkIf;
|
2024-11-22 02:48:41 -05:00
|
|
|
|
|
|
|
cfg = config.programs.neovim;
|
2024-05-09 09:13:40 -04:00
|
|
|
in {
|
2024-12-21 23:34:10 -05:00
|
|
|
config = mkIf cfg.enable {
|
|
|
|
programs = {
|
|
|
|
# I love doing typos
|
|
|
|
bash.shellAliases = {
|
|
|
|
nivm = "nvim";
|
|
|
|
nivim = "nvim";
|
|
|
|
};
|
|
|
|
|
|
|
|
neovim = {
|
|
|
|
defaultEditor = true;
|
|
|
|
viAlias = true;
|
|
|
|
vimAlias = true;
|
|
|
|
|
2024-12-22 00:04:13 -05:00
|
|
|
# We keep the packages here because shell scripts are too common
|
2024-12-21 23:34:10 -05:00
|
|
|
extraPackages = attrValues {
|
|
|
|
inherit
|
|
|
|
(pkgs.nodePackages)
|
|
|
|
bash-language-server
|
|
|
|
;
|
|
|
|
|
|
|
|
inherit
|
|
|
|
(pkgs)
|
|
|
|
shellcheck
|
|
|
|
;
|
|
|
|
};
|
|
|
|
|
|
|
|
extraLuaConfig =
|
|
|
|
# lua
|
|
|
|
''
|
|
|
|
vim.api.nvim_create_autocmd('FileType', {
|
|
|
|
pattern = 'sh',
|
|
|
|
command = 'setlocal ts=4 sw=4 sts=0 expandtab',
|
|
|
|
});
|
|
|
|
|
|
|
|
local default_capabilities = require('cmp_nvim_lsp').default_capabilities();
|
|
|
|
|
|
|
|
require('lspconfig').bashls.setup({
|
|
|
|
capabilities = default_capabilities,
|
|
|
|
|
|
|
|
settings = {
|
|
|
|
bashIde = {
|
|
|
|
shellcheckPath = '${getExe pkgs.shellcheck}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
'';
|
|
|
|
};
|
2024-05-07 22:49:00 -04:00
|
|
|
};
|
2024-05-09 09:13:40 -04:00
|
|
|
};
|
2024-12-21 23:34:10 -05:00
|
|
|
|
|
|
|
# For accurate stack trace
|
|
|
|
_file = ./default.nix;
|
2024-05-09 09:13:40 -04:00
|
|
|
}
|