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-11-22 02:48:41 -05:00
|
|
|
programs = mkIf cfg.enable {
|
2024-05-09 09:13:40 -04:00
|
|
|
# I love doing typos
|
|
|
|
bash.shellAliases = {
|
|
|
|
nivm = "nvim";
|
|
|
|
nivim = "nvim";
|
|
|
|
};
|
2024-05-07 22:49:00 -04:00
|
|
|
|
2024-05-09 09:13:40 -04:00
|
|
|
neovim = {
|
|
|
|
defaultEditor = true;
|
|
|
|
viAlias = true;
|
|
|
|
vimAlias = true;
|
2024-05-07 22:49:00 -04:00
|
|
|
|
2024-12-16 17:44:17 -05:00
|
|
|
extraPackages = mkIf cfg.enableIde (attrValues {
|
|
|
|
inherit
|
|
|
|
(pkgs.nodePackages)
|
|
|
|
bash-language-server
|
|
|
|
;
|
|
|
|
|
|
|
|
inherit
|
|
|
|
(pkgs)
|
|
|
|
shellcheck
|
|
|
|
;
|
|
|
|
});
|
2024-05-11 19:27:26 -04:00
|
|
|
|
2024-05-09 09:13:40 -04:00
|
|
|
extraLuaConfig =
|
2024-11-22 02:48:41 -05:00
|
|
|
mkIf cfg.enableIde
|
2024-06-09 22:49:30 -04:00
|
|
|
# lua
|
2024-05-09 09:13:40 -04:00
|
|
|
''
|
2024-05-09 17:14:55 -04:00
|
|
|
vim.api.nvim_create_autocmd('FileType', {
|
2024-06-09 22:49:30 -04:00
|
|
|
pattern = 'sh',
|
|
|
|
command = 'setlocal ts=4 sw=4 sts=0 expandtab',
|
2024-05-09 09:13:40 -04:00
|
|
|
});
|
2024-05-11 14:42:59 -04:00
|
|
|
|
2024-12-21 22:30:38 -05:00
|
|
|
local default_capabilities = require('cmp_nvim_lsp').default_capabilities();
|
|
|
|
|
2024-07-28 02:54:34 -04:00
|
|
|
require('lspconfig').bashls.setup({
|
2024-12-16 17:44:17 -05:00
|
|
|
capabilities = default_capabilities,
|
2024-07-28 02:54:34 -04:00
|
|
|
|
2024-05-11 14:42:59 -04:00
|
|
|
settings = {
|
|
|
|
bashIde = {
|
2024-08-31 19:16:06 -04:00
|
|
|
shellcheckPath = '${getExe pkgs.shellcheck}',
|
2024-05-11 14:42:59 -04:00
|
|
|
},
|
|
|
|
},
|
2024-07-28 02:54:34 -04:00
|
|
|
});
|
2024-05-09 09:13:40 -04:00
|
|
|
'';
|
2024-05-07 22:49:00 -04:00
|
|
|
};
|
2024-05-09 09:13:40 -04:00
|
|
|
};
|
|
|
|
}
|