feat: grompt
This commit is contained in:
parent
8027b46e5e
commit
33496feccd
14 changed files with 184 additions and 25 deletions
|
|
@ -1,4 +1,6 @@
|
|||
{
|
||||
imports = [./lsp/v-analyzer.nix];
|
||||
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
|
||||
|
|
@ -18,6 +20,7 @@
|
|||
./plugins/which-key.nix
|
||||
./plugins/conform.nix
|
||||
./plugins/treesitter.nix
|
||||
./plugins/term.nix
|
||||
|
||||
# lsp
|
||||
./lsp/default.nix
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
imports = [
|
||||
./nixd.nix
|
||||
./go.nix
|
||||
./v.nix
|
||||
];
|
||||
plugins = {
|
||||
lsp = {
|
||||
|
|
|
|||
31
home/modules/ide/nvim/lsp/v-analyzer.nix
Normal file
31
home/modules/ide/nvim/lsp/v-analyzer.nix
Normal 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;
|
||||
}
|
||||
10
home/modules/ide/nvim/lsp/v.nix
Normal file
10
home/modules/ide/nvim/lsp/v.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
plugins.lsp = {
|
||||
servers = {
|
||||
v_analyzer = {
|
||||
enable = true;
|
||||
package = null;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -27,6 +27,7 @@
|
|||
extraPackages = with pkgs; [
|
||||
stylua
|
||||
nixfmt-rfc-style
|
||||
vlang
|
||||
];
|
||||
|
||||
extraConfigLua = builtins.readFile ./config.lua;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,54 @@
|
|||
{
|
||||
plugins.mini-completion = {
|
||||
enable = true;
|
||||
plugins = {
|
||||
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;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
15
home/modules/ide/nvim/plugins/term.nix
Normal file
15
home/modules/ide/nvim/plugins/term.nix
Normal 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>]]";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -74,6 +74,8 @@ alias gss='git status -s'
|
|||
#compdef _git gss=git-status
|
||||
alias ga='git add'
|
||||
#compdef _git ga=git-add
|
||||
alias gav 'git add --verbose'
|
||||
#compdef _git gav=git-add
|
||||
alias gm='git merge'
|
||||
#compdef _git gm=git-merge
|
||||
alias grh='git reset HEAD'
|
||||
|
|
|
|||
|
|
@ -1,8 +1,32 @@
|
|||
# set prompt
|
||||
fish_config prompt choose minimalist
|
||||
|
||||
# setup direnv
|
||||
direnv hook fish | source
|
||||
|
||||
# set aliases
|
||||
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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
{pkgs, ...}: {
|
||||
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 = {
|
||||
enable = true;
|
||||
package = pkgs.fishMinimal;
|
||||
|
|
@ -15,11 +19,12 @@
|
|||
body = "__fish_default_command_not_found_handler $argv[1]";
|
||||
onEvent = "fish_command_not_found";
|
||||
};
|
||||
|
||||
fish_greeting = {
|
||||
body = "";
|
||||
};
|
||||
|
||||
fish_prompt = {
|
||||
body = "grompt";
|
||||
};
|
||||
gitignore = "curl -sL https://www.gitignore.io/api/$argv";
|
||||
};
|
||||
};
|
||||
|
|
|
|||
17
home/modules/shell/fish/grompt.json
Normal file
17
home/modules/shell/fish/grompt.json
Normal 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",
|
||||
": "
|
||||
]
|
||||
|
||||
|
|
@ -12,6 +12,8 @@ in {
|
|||
enabledExtensions = with spicePkgs.extensions; [
|
||||
adblock
|
||||
hidePodcasts
|
||||
shuffle
|
||||
beautifulLyrics
|
||||
];
|
||||
|
||||
theme = lib.mkForce spicePkgs.themes.text;
|
||||
|
|
|
|||
|
|
@ -115,26 +115,26 @@ in {
|
|||
};
|
||||
|
||||
extraConfig = ''
|
||||
set $opacity 0.97
|
||||
for_window [class=".*"] opacity $opacity
|
||||
for_window [app_id=".*"] opacity $opacity
|
||||
set $opacity 1
|
||||
for_window [class=".*"] opacity $opacity
|
||||
for_window [app_id=".*"] opacity $opacity
|
||||
|
||||
# borders
|
||||
default_border pixel 0
|
||||
default_floating_border pixel 0
|
||||
# borders
|
||||
default_border pixel 0
|
||||
default_floating_border pixel 0
|
||||
|
||||
# colors
|
||||
client.focused #3a3a3a #000000 #ffffff #3a3a3a #3a3a3a
|
||||
client.focused_inactive #2a2a2a #000000 #bbbbbb #2a2a2a #2a2a2a
|
||||
client.unfocused #1e1e1e #000000 #888888 #1e1e1e #1e1e1e
|
||||
client.urgent #5a5a5a #000000 #ffffff #5a5a5a #5a5a5a
|
||||
client.placeholder #1e1e1e #000000 #888888 #1e1e1e #1e1e1e
|
||||
# colors
|
||||
client.focused #3a3a3a #000000 #ffffff #3a3a3a #3a3a3a
|
||||
client.focused_inactive #2a2a2a #000000 #bbbbbb #2a2a2a #2a2a2a
|
||||
client.unfocused #1e1e1e #000000 #888888 #1e1e1e #1e1e1e
|
||||
client.urgent #5a5a5a #000000 #ffffff #5a5a5a #5a5a5a
|
||||
client.placeholder #1e1e1e #000000 #888888 #1e1e1e #1e1e1e
|
||||
|
||||
# mouse
|
||||
floating_modifier ${config.wayland.windowManager.sway.config.modifier} normal
|
||||
# mouse
|
||||
floating_modifier ${config.wayland.windowManager.sway.config.modifier} normal
|
||||
|
||||
# cursor
|
||||
seat seat0 xcursor_theme macOS 24
|
||||
# cursor
|
||||
seat seat0 xcursor_theme macOS 24
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
{pkgs, ...}: {
|
||||
home.packages = with pkgs; [
|
||||
ripgrep
|
||||
jq
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue