feat: switch to fish as an interactive shell
All checks were successful
/ check (push) Successful in 8s
/ check-renovaterc (push) Successful in 4s
/ build-packages (push) Successful in 14s
/ build-vm (push) Successful in 2s
/ report-size (push) Successful in 4s

Now that it is written in Rust I am interested!
This commit is contained in:
Jalil David Salamé Messina 2025-03-23 21:44:28 +01:00
parent 6bf3851d5a
commit cd4fb19335
Signed by: jalil
GPG key ID: F016B9E770737A0B
6 changed files with 117 additions and 139 deletions

View file

@ -21,6 +21,7 @@ let
"typos_lsp"
# "typst_lsp" # Not using it
"zls"
"fish_lsp"
];
in
{
@ -95,6 +96,7 @@ in
pkgs.stylua
pkgs.taplo
pkgs.yamlfmt
pkgs.fish
];
plugins.conform-nvim = {
enable = true;
@ -111,6 +113,7 @@ in
toml = [ "taplo" ];
yaml = [ "yamlfmt" ];
zig = [ "zigfmt" ];
fish = [ "fish_indent" ];
};
};
};
@ -127,7 +130,6 @@ in
# latex = [ "chktex" ]; # Not in use
nix = [ "statix" ];
sh = [ "dash" ];
zsh = [ "zsh" ];
};
};
}

View file

@ -4,129 +4,102 @@ let
in
{
config.plugins = {
cmp = {
enable = true;
cmdline = {
"/" = {
mapping =
mkRaw
# lua
''
cmp.mapping.preset.cmdline()
'';
sources = [
{ name = "rg"; }
{ name = "buffer"; }
];
cmp =
let
srcWithIndex = groupIndex: name: { inherit name groupIndex; };
in
{
enable = true;
cmdline = {
"/" = {
mapping =
mkRaw
# lua
''
cmp.mapping.preset.cmdline()
'';
sources = [
{ name = "rg"; }
{ name = "buffer"; }
];
};
":" = {
mapping =
mkRaw
# lua
"cmp.mapping.preset.cmdline()";
sources = [
{ name = "path"; }
{ name = "cmdline"; }
];
};
};
":" = {
mapping =
mkRaw
# lua
''
cmp.mapping.preset.cmdline()
'';
sources = [
{ name = "path"; }
{ name = "cmdline"; }
];
};
};
settings = {
# Snippets
snippet.expand =
# lua
''
function(args) require('luasnip').lsp_expand(args.body) end
'';
# Completion Sources
sources = [
{
name = "buffer";
groupIndex = 3;
}
{
name = "calc";
groupIndex = 2;
}
{
name = "conventionalcommits";
groupIndex = 1;
}
{
name = "crates";
groupIndex = 1;
}
{
name = "luasnip";
groupIndex = 1;
}
{
name = "nvim_lsp";
groupIndex = 1;
}
{
name = "nvim_lsp_document_symbol";
groupIndex = 1;
}
{
name = "nvim_lsp_signature_help";
groupIndex = 1;
}
{
name = "path";
groupIndex = 2;
}
{
name = "spell";
groupIndex = 2;
}
{
name = "treesitter";
groupIndex = 2;
}
];
mapping =
mkRaw
settings = {
# Snippets
snippet.expand =
# lua
''
cmp.mapping.preset.insert({
["<C-n>"] = function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif require("luasnip").expand_or_jumpable() then
require("luasnip").expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end,
["<C-p>"] = function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif require("luasnip").jumpable(-1) then
require("luasnip").jump(-1)
else
fallback()
end
end,
["<C-u>"] = cmp.mapping(function(fallback)
if require("luasnip").choice_active() then
require("luasnip").next_choice()
else
fallback()
end
end),
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete { },
["<C-e>"] = cmp.mapping.close(),
["<CR>"] = cmp.mapping.confirm { select = true },
})
'';
"function(args) require('luasnip').lsp_expand(args.body) end";
# Completion Sources
sources = [
# very specific (not noisy)
(srcWithIndex 1 "calc")
(srcWithIndex 1 "crates")
(srcWithIndex 1 "fish")
(srcWithIndex 1 "luasnip")
(srcWithIndex 1 "nvim_lsp")
# Generally ok
(srcWithIndex 2 "conventionalcommits")
(srcWithIndex 2 "nvim_lsp_document_symbol")
(srcWithIndex 2 "nvim_lsp_signature_help")
# Noisy
(srcWithIndex 2 "path")
(srcWithIndex 3 "spell")
(srcWithIndex 3 "treesitter")
# Very noisy
(srcWithIndex 4 "buffer")
];
mapping =
mkRaw
# lua
''
cmp.mapping.preset.insert({
["<C-n>"] = function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif require("luasnip").expand_or_jumpable() then
require("luasnip").expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end,
["<C-p>"] = function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif require("luasnip").jumpable(-1) then
require("luasnip").jump(-1)
else
fallback()
end
end,
["<C-u>"] = cmp.mapping(function(fallback)
if require("luasnip").choice_active() then
require("luasnip").next_choice()
else
fallback()
end
end),
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete { },
["<C-e>"] = cmp.mapping.close(),
["<CR>"] = cmp.mapping.confirm { select = true },
})
'';
};
};
};
cmp-fish.enable = true;
gitsigns.enable = true;
lualine = {
enable = true;