nushell: completions, colors, zoxide
This commit is contained in:
parent
91167bd614
commit
9dbf41d394
3 changed files with 48 additions and 9 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
$env.config.buffer_editor = "/home/thegeneralist/.nix-profile/bin/nvim"
|
$env.config.buffer_editor = "/etc/profiles/per-user/thegeneralist/bin/nvim"
|
||||||
$env.config.show_banner = false
|
$env.config.show_banner = false
|
||||||
|
|
||||||
$env.config = {
|
$env.config = {
|
||||||
|
|
@ -13,6 +13,32 @@ $env.config = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$env.config.completions = {
|
||||||
|
algorithm: prefix
|
||||||
|
case_sensitive: false
|
||||||
|
partial: true
|
||||||
|
quick: true
|
||||||
|
external: {
|
||||||
|
enable: true
|
||||||
|
max_results: 100
|
||||||
|
completer: {|tokens: list<string>|
|
||||||
|
let expanded = scope aliases | where name == $tokens.0 | get --ignore-errors expansion.0
|
||||||
|
|
||||||
|
mut expanded_tokens = if $expanded != null and $tokens.0 != "cd" {
|
||||||
|
$expanded | split row " " | append ($tokens | skip 1)
|
||||||
|
} else {
|
||||||
|
$tokens
|
||||||
|
}
|
||||||
|
|
||||||
|
$expanded_tokens.0 = ($expanded_tokens.0 | str trim --left --char "^")
|
||||||
|
|
||||||
|
fish --command $"complete '--do-complete=($expanded_tokens | str join ' ')'"
|
||||||
|
| $"value(char tab)description(char newline)" + $in
|
||||||
|
| from tsv --flexible --no-infer
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Basic Aliases
|
# Basic Aliases
|
||||||
alias v = nvim .
|
alias v = nvim .
|
||||||
alias ff = fastfetch --load-config examples/10.jsonc
|
alias ff = fastfetch --load-config examples/10.jsonc
|
||||||
|
|
@ -41,5 +67,3 @@ alias ah = cd ~/dotfiles/hosts/thegeneralist
|
||||||
alias ai3 = nvim /home/thegeneralist/dotfiles/hosts/thegeneralist/dotfiles/i3/config
|
alias ai3 = nvim /home/thegeneralist/dotfiles/hosts/thegeneralist/dotfiles/i3/config
|
||||||
# alias rb = sudo nixos-rebuild switch --flake ~/dotfiles#thegeneralist
|
# alias rb = sudo nixos-rebuild switch --flake ~/dotfiles#thegeneralist
|
||||||
alias rb = nh os switch . -v -- --show-trace --verbose
|
alias rb = nh os switch . -v -- --show-trace --verbose
|
||||||
|
|
||||||
source ~/.zoxide.nu
|
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ in {
|
||||||
nushell
|
nushell
|
||||||
fish
|
fish
|
||||||
zoxide
|
zoxide
|
||||||
|
vivid
|
||||||
ripgrep
|
ripgrep
|
||||||
jq
|
jq
|
||||||
yq-go
|
yq-go
|
||||||
|
|
@ -45,12 +46,22 @@ in {
|
||||||
|
|
||||||
home-manager.sharedModules = [
|
home-manager.sharedModules = [
|
||||||
({
|
({
|
||||||
home.file.".zshrc" = let
|
home.file = {
|
||||||
configFile = ./config.nu;
|
".zshrc" = let
|
||||||
envFile = ./env.nu;
|
configFile = ./config.nu;
|
||||||
in {
|
envFile = ./env.nu;
|
||||||
text = "exec nu --env-config ${envFile} --config ${configFile}";
|
in {
|
||||||
force = true;
|
text = "exec nu --env-config ${envFile} --config ${configFile}";
|
||||||
|
force = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
".config/nushell/zoxide.nu".source = pkgs.runCommand "zoxide.nu" {} ''
|
||||||
|
${getExe pkgs.zoxide} init nushell --cmd cd > $out
|
||||||
|
'';
|
||||||
|
|
||||||
|
".config/nushell/ls_colors.txt".source = pkgs.runCommand "ls_colors.txt" {} ''
|
||||||
|
${getExe pkgs.vivid} generate gruvbox-dark-hard > $out
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
(homeArgs: {
|
(homeArgs: {
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,10 @@ $env.ENV_CONVERSIONS.PATH = {
|
||||||
$value | path expand --no-symlink | str join (char esep)
|
$value | path expand --no-symlink | str join (char esep)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$env.LS_COLORS = (open ~/.config/nushell/ls_colors.txt)
|
||||||
|
|
||||||
|
source ~/.config/nushell/zoxide.nu
|
||||||
# NVM
|
# NVM
|
||||||
# source ("/Users/thegeneralist/.nvm/" | path join "nvm.sh")
|
# source ("/Users/thegeneralist/.nvm/" | path join "nvm.sh")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue