feat: added take command and gi command to nushell configuration
This commit is contained in:
parent
ebd64dfc51
commit
e00edd5afc
1 changed files with 28 additions and 0 deletions
|
|
@ -23,3 +23,31 @@ starship init nu | save -f ($nu.data-dir | path join "vendor/autoload/starship.n
|
|||
source ~/.zoxide.nu
|
||||
|
||||
source ~/.cache/carapace/init.nu
|
||||
|
||||
# gitignore.io command
|
||||
def _gitignoreio_list [] {
|
||||
http get https://www.toptal.com/developers/gitignore/api/list
|
||||
| str replace -a "\n" ","
|
||||
| split row ","
|
||||
| str trim
|
||||
| where {|x| $x != ""}
|
||||
}
|
||||
|
||||
def "nu-complete gi" [] {
|
||||
_gitignoreio_list
|
||||
}
|
||||
|
||||
def gi [...args: string@"nu-complete gi"] {
|
||||
if ($args | length) > 0 and $args.0 == "list" {
|
||||
do { _gitignoreio_list }
|
||||
}
|
||||
|
||||
let joined = ($args | str join ",")
|
||||
http get $"https://www.toptal.com/developers/gitignore/api/($joined)"
|
||||
}
|
||||
|
||||
# take command
|
||||
def take [path: string] {
|
||||
mkdir $path
|
||||
cd $path
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue