feat: add useful nushell scripts - auto-completion

This commit is contained in:
Ryan Yin
2023-07-29 20:36:19 +08:00
parent 189a3a4689
commit c472654934
5 changed files with 42 additions and 2 deletions

17
flake.lock generated
View File

@@ -588,6 +588,22 @@
"type": "github"
}
},
"nushell-scripts": {
"flake": false,
"locked": {
"lastModified": 1690554155,
"narHash": "sha256-gJAnMY1HtRhRyRKOi0ifbuDVaImMmQeo4yY3jxY6N6c=",
"owner": "nushell",
"repo": "nu_scripts",
"rev": "f4f765a9462a4d06a1e1a8eab0dc2ee4c7421fe5",
"type": "github"
},
"original": {
"owner": "nushell",
"repo": "nu_scripts",
"type": "github"
}
},
"root": {
"inputs": {
"agenix": "agenix",
@@ -609,6 +625,7 @@
"nixpkgs-darwin": "nixpkgs-darwin",
"nixpkgs-unstable": "nixpkgs-unstable",
"nixpkgs-wayland": "nixpkgs-wayland",
"nushell-scripts": "nushell-scripts",
"wallpapers": "wallpapers"
}
},

View File

@@ -207,6 +207,12 @@
flake = false;
};
# useful nushell scripts, such as auto_completion
nushell-scripts = {
url = "github:nushell/nu_scripts";
flake = false;
};
# my private secrets, it's a private repository, you need to replace it with your own.
# use ssh protocol to authenticate via ssh-agent/ssh-key, and shallow clone to save time
mysecrets = {

View File

@@ -17,6 +17,16 @@
# Toggle visual mode: `v`
# Toggle visual block mode: `<Ctrl> + v` (select a block(vertically) of text)
#
# Add at the end of Multiple line: `:normal A<text>`
# Note that `:normal` execute `A<text>` on each line.
# `A` means append text at the end of the line.
# You need to select the lines via visual mode first.
#
# Add at the end of the visual block: `:A<text>`
# You need to select the block via visual block mode first.
# And then this command will append text at the end of the block on each line.
# If the position exceeds the end of the line, neovim will automatically add spaces
#
# Commands & shortcuts in AstroNvim
# Learn Neovim's Basics: `:Tutor`
# Opening file explorer: `<Space> + e`

View File

@@ -1,4 +1,4 @@
{...}: {
{ nushell-scripts, ...}: {
programs.bash = {
# load the alias file for work
bashrcExtra = ''
@@ -19,6 +19,13 @@
# https://github.com/nushell/nushell/issues/8214
extraConfig = ''
source /etc/agenix/alias-for-work.nushell
use ${nushell-scripts}/custom-completions/git/git-completions.nu *
use ${nushell-scripts}/custom-completions/glow/glow-completions.nu *
use ${nushell-scripts}/custom-completions/make/make-completions.nu *
use ${nushell-scripts}/custom-completions/nix/nix-completions.nu *
use ${nushell-scripts}/custom-completions/man/man-completions.nu *
use ${nushell-scripts}/custom-completions/cargo/cargo-completions.nu *
use ${nushell-scripts}/custom-completions/zellij/zellij-completions.nu *
'';
};
}

View File

@@ -1,4 +1,4 @@
{config, ...}: let
{config, nushell-scripts, ...}: let
d = config.xdg.dataHome;
c = config.xdg.configHome;
cache = config.xdg.cacheHome;