feat: grompt

This commit is contained in:
Elisiei Yehorov 2026-02-27 23:44:37 +01:00
parent 8027b46e5e
commit 33496feccd
Signed by: elisiei
GPG key ID: BA1D158DCE3DF089
14 changed files with 184 additions and 25 deletions

View file

@ -1,4 +1,6 @@
{ {
imports = [./lsp/v-analyzer.nix];
programs.nixvim = { programs.nixvim = {
enable = true; enable = true;
@ -18,6 +20,7 @@
./plugins/which-key.nix ./plugins/which-key.nix
./plugins/conform.nix ./plugins/conform.nix
./plugins/treesitter.nix ./plugins/treesitter.nix
./plugins/term.nix
# lsp # lsp
./lsp/default.nix ./lsp/default.nix

View file

@ -2,6 +2,7 @@
imports = [ imports = [
./nixd.nix ./nixd.nix
./go.nix ./go.nix
./v.nix
]; ];
plugins = { plugins = {
lsp = { lsp = {

View file

@ -0,0 +1,31 @@
# from https://github.com/dimkauzh/nixos/blob/a60627bbf45d249b115f0ba0296e02676dd988ea/modules/home/programs/v-analyzer.nix
{pkgs, ...}: let
settingsFormat = pkgs.formats.toml {};
vAnalyzerSettings = {
custom_vroot = "${pkgs.vlang}/lib";
enable_semantic_tokens = "full";
inlay_hints = {
enable = true;
enable_range_hints = true;
enable_type_hints = true;
enable_implicit_err_hints = true;
enable_parameter_name_hints = true;
enable_constant_type_hints = true;
enable_enum_field_value_hints = true;
};
code_lens = {
enable = true;
enable_run_lens = true;
enable_inheritors_lens = true;
enable_super_interfaces_lens = true;
enable_run_tests_lens = true;
};
};
analyzerSettingsFile = settingsFormat.generate "config.toml" vAnalyzerSettings;
in {
home.file.".config/v-analyzer/config.toml".source = analyzerSettingsFile;
}

View file

@ -0,0 +1,10 @@
{
plugins.lsp = {
servers = {
v_analyzer = {
enable = true;
package = null;
};
};
};
}

View file

@ -27,6 +27,7 @@
extraPackages = with pkgs; [ extraPackages = with pkgs; [
stylua stylua
nixfmt-rfc-style nixfmt-rfc-style
vlang
]; ];
extraConfigLua = builtins.readFile ./config.lua; extraConfigLua = builtins.readFile ./config.lua;

View file

@ -1,5 +1,54 @@
{ {
plugins.mini-completion = { plugins = {
enable = true; blink-cmp = {
enable = true;
settings = {
appearance.use_nvim_cmp_as_default = true;
completion = {
list.selection.preselect = false;
documentation = {
auto_show = true;
};
ghost_text.enabled = true;
};
signature = {
enabled = true;
};
sources = {
default = [
"lsp"
"path"
"snippets"
"buffer"
];
providers = {
lsp.score_offset = 3;
path.score_offset = 2;
snippets.score_offset = 2;
buffer.score_offset = 1;
};
};
keymap = {
preset = "enter";
"<Tab>" = [
"select_next"
"fallback"
];
"<S-Tab>" = [
"select_prev"
"fallback"
];
"<C-n>" = [
"snippet_forward"
"fallback"
];
"<C-p>" = [
"snippet_backward"
"fallback"
];
};
};
};
blink-compat.enable = true;
}; };
} }

View file

@ -0,0 +1,15 @@
{
plugins.toggleterm = {
enable = true;
settings = {
direction = "float";
float_opts = {
border = "single";
height = 30;
width = 130;
};
shell = "fish";
open_mapping = "[[<c-t>]]";
};
};
}

View file

@ -74,6 +74,8 @@ alias gss='git status -s'
#compdef _git gss=git-status #compdef _git gss=git-status
alias ga='git add' alias ga='git add'
#compdef _git ga=git-add #compdef _git ga=git-add
alias gav 'git add --verbose'
#compdef _git gav=git-add
alias gm='git merge' alias gm='git merge'
#compdef _git gm=git-merge #compdef _git gm=git-merge
alias grh='git reset HEAD' alias grh='git reset HEAD'

View file

@ -1,8 +1,32 @@
# set prompt
fish_config prompt choose minimalist
# setup direnv # setup direnv
direnv hook fish | source direnv hook fish | source
# set aliases # set aliases
source ~/.config/fish/aliases/git.fish source ~/.config/fish/aliases/git.fish
# path
fish_add_path -g ~/bin ~/.config/v-analyzer/bin
# custom
function vir
set dest (command vir $argv)
and cd $dest
end
# prompt functions
function git_branch
set -l branch (git rev-parse --abbrev-ref HEAD 2>/dev/null)
if test $status -eq 0
echo ' ( '$branch')'
else
echo ""
end
end
function nix_shell
if test -n "$IN_NIX_SHELL"
echo " (nix)"
else
echo ""
end
end

View file

@ -1,5 +1,9 @@
{pkgs, ...}: { {pkgs, ...}: {
home.file.".config/fish/aliases".source = ./aliases; home.file.".config/fish/aliases".source = ./aliases;
# note: grompt was installed manually, once grompt is available in nixpkgs,
# this will change.
home.file.".config/grompt.json".source = ./grompt.json;
programs.fish = { programs.fish = {
enable = true; enable = true;
package = pkgs.fishMinimal; package = pkgs.fishMinimal;
@ -15,11 +19,12 @@
body = "__fish_default_command_not_found_handler $argv[1]"; body = "__fish_default_command_not_found_handler $argv[1]";
onEvent = "fish_command_not_found"; onEvent = "fish_command_not_found";
}; };
fish_greeting = { fish_greeting = {
body = ""; body = "";
}; };
fish_prompt = {
body = "grompt";
};
gitignore = "curl -sL https://www.gitignore.io/api/$argv"; gitignore = "curl -sL https://www.gitignore.io/api/$argv";
}; };
}; };

View file

@ -0,0 +1,17 @@
[
"fg:green",
"${spwd}",
"fg:yellow",
"exec:fish -c 'git_branch'",
{
"git_status_noclean": ["fg:red", " (+)"]
},
{
"git_status_clean": []
},
"fg:blue",
"exec:fish -c 'nix_shell'",
"fg:red",
": "
]

View file

@ -12,6 +12,8 @@ in {
enabledExtensions = with spicePkgs.extensions; [ enabledExtensions = with spicePkgs.extensions; [
adblock adblock
hidePodcasts hidePodcasts
shuffle
beautifulLyrics
]; ];
theme = lib.mkForce spicePkgs.themes.text; theme = lib.mkForce spicePkgs.themes.text;

View file

@ -115,26 +115,26 @@ in {
}; };
extraConfig = '' extraConfig = ''
set $opacity 0.97 set $opacity 1
for_window [class=".*"] opacity $opacity for_window [class=".*"] opacity $opacity
for_window [app_id=".*"] opacity $opacity for_window [app_id=".*"] opacity $opacity
# borders # borders
default_border pixel 0 default_border pixel 0
default_floating_border pixel 0 default_floating_border pixel 0
# colors # colors
client.focused #3a3a3a #000000 #ffffff #3a3a3a #3a3a3a client.focused #3a3a3a #000000 #ffffff #3a3a3a #3a3a3a
client.focused_inactive #2a2a2a #000000 #bbbbbb #2a2a2a #2a2a2a client.focused_inactive #2a2a2a #000000 #bbbbbb #2a2a2a #2a2a2a
client.unfocused #1e1e1e #000000 #888888 #1e1e1e #1e1e1e client.unfocused #1e1e1e #000000 #888888 #1e1e1e #1e1e1e
client.urgent #5a5a5a #000000 #ffffff #5a5a5a #5a5a5a client.urgent #5a5a5a #000000 #ffffff #5a5a5a #5a5a5a
client.placeholder #1e1e1e #000000 #888888 #1e1e1e #1e1e1e client.placeholder #1e1e1e #000000 #888888 #1e1e1e #1e1e1e
# mouse # mouse
floating_modifier ${config.wayland.windowManager.sway.config.modifier} normal floating_modifier ${config.wayland.windowManager.sway.config.modifier} normal
# cursor # cursor
seat seat0 xcursor_theme macOS 24 seat seat0 xcursor_theme macOS 24
''; '';
}; };

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = with pkgs; [ home.packages = with pkgs; [
ripgrep ripgrep
jq jq