1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-07-31 14:17:45 +00:00
Commit graph

229 commits

Author SHA1 Message Date
DualWu
5a74077d38
update zellij completions (#994) 2024-12-17 06:34:07 -06:00
Nguyễn Hồng Quân
8c21f6e5a6
Follow Include to extract more SSH hosts (#993)
Sometimes, we have so many SSH servers that divide to extra config files
and include in *~/.ssh/config*

This PR follow the `Include` directive to retrieve more hosts.

Example of such config:

```ssh_config
Include extra/agriconnect
Include "extra/Old servers"
```

This PR also fix an issue that orginal code grabs this:

```ssh_config
Host *
```
2024-12-14 06:49:27 -06:00
e2dk4r
ce89b5cf0b
custom-completions: scoop: improve code readablity (#989)
Break getting scoop directories multiple lines to improve code
readablity.
2024-12-07 07:27:01 -06:00
e2dk4r
6bd54bfab2
custom-completions: scoop: improve performance of getting scoop commands (#988)
Instead of calling scoop that calls powershell, use nushell's native
commands.

On Windows 11 virtual machine,
powershell takes `330ms 492µs 860ns` on **fastest** case,
with this commit takes `23ms 24µs 660ns` on **slowest**.

```nu
> use old-scoop-completions.nu *
> let oldTimes = (1..10 | each { timeit { scoopCommands } })
> $oldTimes | sort --reverse
╭───┬───────────────────╮
│ 0 │ 357ms 565µs 720ns │
│ 1 │  344ms 64µs 450ns │
│ 2 │ 343ms 264µs 680ns │
│ 3 │  342ms 686µs 10ns │
│ 4 │ 342ms 241µs 740ns │
│ 5 │ 338ms 365µs 910ns │
│ 6 │ 337ms 682µs 790ns │
│ 7 │ 335ms 473µs 290ns │
│ 8 │ 335ms 186µs 830ns │
│ 9 │ 330ms 492µs 860ns │
╰───┴───────────────────╯
> $oldTimes | math avg
340ms 702µs 428ns

> use scoop-completions.nu *
> let newTimes = (1..10 | each { timeit { scoopCommands } })
> $newTimes | sort --reverse
╭───┬──────────────────╮
│ 0 │  23ms 24µs 660ns │
│ 1 │  18ms 33µs 480ns │
│ 2 │ 15ms 597µs 650ns │
│ 3 │ 15ms 412µs 850ns │
│ 4 │  15ms 58µs 770ns │
│ 5 │  14ms 536µs 30ns │
│ 6 │  14ms 366µs 20ns │
│ 7 │ 14ms 175µs 270ns │
│ 8 │ 13ms 688µs 730ns │
│ 9 │ 13ms 378µs 590ns │
╰───┴──────────────────╯
> $newTimes | math avg
15ms 727µs 205ns
```
2024-12-07 07:13:00 -06:00
Ian Manske
dee0e7efcd
Fix typos (#982) 2024-11-21 23:51:05 -05:00
Jingchen Wang
1ed7ef9401
basic docker compose support: up down stop (#979) 2024-11-10 07:14:37 -06:00
Berge della Hirsch
c05790d2fc
Updated ani-cli completions (#969)
Updated, corrected, and added the rest of the completions needed for
`ani-cli`
2024-10-09 18:19:16 -05:00
Marc Schreiber
e10ffbaaa7
Fix git diff completions (#962)
Fixes #961
2024-09-26 11:18:04 -05:00
shelton louis
5ffdfca7e7
feat: add yadm completions to the repo (#960)
This is a request to add yadm completions to the repo.
These resemble the ones that are written for. The git one in your repo.
Yadm is a dotfiles manager that leverages `git` but uses your home
directory by default.

To see the tool go to <https://yadm.io/docs/overview>
2024-09-25 14:58:33 -05:00
Auca Coyan
33ae4c55c2
completions for bmc client (#932)
Hi! Some completions for a unknown CLI tool I use everyday 😇.

It's been a while since I don't make a PR here, hehe
2024-09-22 15:29:34 -05:00
Auca Coyan
da307d0864
🩹 fix git init --initial-branch string instead of bool (#959)
Just using the completions I realized that:

```nu
# Create a new git repository
export extern "git init" [
  --initial-branch(-b)                                # initial branch name
  #should be
  --initial-branch(-b): string                        # initial branch name
]
```

because initial branch takes a string, it not a boolean
2024-09-22 15:15:37 -05:00
Harrisonn
189bf3a706
fix: adequates to new rustup help page style (#958)
Rustup page style changed, this commits adequates all `nu-complete
rustup` commands to this new syntax
2024-09-20 06:39:30 -05:00
Harrisonn
d04eea634a
fix: cargo clippy linting flags need to accept strings (#947)
The linting flags `--warn`, `--deny`, `--allow` and `--forbid` have
`string` type rather than `bool`

Signed-off-by: OJarrisonn <j.h.m.t.v.10@gmail.com>
2024-09-11 17:51:33 -05:00
chtenb
430951c3b1
Use --no-color for git completions (#943)
Resolves https://github.com/nushell/nu_scripts/issues/942
2024-08-29 09:10:50 -05:00
Loïc Riegel
0f3d6e6edc
Add custom completions for pytest (#941)
Hi, small PR to add completions for the pytest framework, widely used in
the Python community
2024-08-28 17:14:44 -05:00
Jakub Grabarczuk
102c7d884b
Completions for dotnet (#938)
Just forwarding the work to "dotnet complete" command,
which has a disadvantage of not including any comments
2024-08-28 08:15:37 -05:00
Loïc Riegel
6abc543722
Add custom completions for pre-commit (#940)
# Added

Completions for pre-commit, plus README

# Fixed

Removed duplciate flag it git completionts
2024-08-25 18:27:18 -05:00
Ruan Comelli
7188d9ac03
Remove completions for pixi (#939)
Remove custom completions for pixi.

Closes #937.

---

> [!NOTE]
> This is my first contribution to this project. I saw #937 and thought
it was a good first issue to help with 🙂
2024-08-24 16:27:10 -05:00
Sylvain Desbureaux
149d9584c4
make op completion to work with latest nushell (#936)
with newest version of nushell, this completion is not accepted.
2024-08-19 12:32:02 +02:00
Auca Coyan
0cba7933f2
add worktree completions (#933)
you can now `git worktree remove <tab>` for autocompletions

![image](https://github.com/user-attachments/assets/2eac159c-fd86-42c4-9ecc-469b333dea52)

and show the branches _after_ the path in `git worktree add ./my-path
<tab>`

![image](https://github.com/user-attachments/assets/d5fadce3-8153-4d51-82e3-0a911ecdefb6)
2024-08-14 15:40:59 -05:00
Kira
7b2ec35cf2
Update scoop completions (#930)
made scoop completions a bit more reliable by converting the PsObject
from powershell to json instead of parsing lines from the `scoop help`
output

doesn't take any longer since scoop run in powershell either way

Co-authored-by: unknown <67888720+kira-nyx@users.noreply.github.com>
2024-08-14 06:16:37 -05:00
Christoph Blessing
1b5584a71d
Fix network option missing type (#929) 2024-08-12 12:00:26 -05:00
David
e0ccb8fecc
Add ttyper completions (#928)
Added ttyper completions. Ttyper is a little tool for speed typists
(readme included).
2024-08-10 15:31:02 -05:00
David
135373dc28
Add croc completions (#927)
Adds croc completions. Readme about tool included.
2024-08-10 15:30:38 -05:00
OJarrisonn_
54546c8bf2
Refactor of docker completions (#922)
Refactor docker custom completions to reorder `export extern`
declarations and make use of `export alias` to avoid repetition

Also fixes `docker run` needing a mandatory `network` argument which
doesn't exist
2024-07-27 15:55:40 -05:00
OJarrisonn_
0b487e8380
fix: use proper path type for path argument for bat (#921)
Use of `string` disable `~` expansion

Signed-off-by: OJarrisonn <j.h.m.t.v.10@gmail.com>
2024-07-27 14:05:48 -05:00
OJarrisonn_
6bbd75120d
fix: use proper path type for path argument for eza (#920)
Using `string` may disable `~` expansion in modern nushell (>= 0.95)

Signed-off-by: OJarrisonn <j.h.m.t.v.10@gmail.com>
2024-07-27 14:05:22 -05:00
Christoph Blessing
2321b5b29a
Fix incorrect docker commands (#917)
Fix "docker run" and "docker container run" custom commands incorrectly
expecting a "network" positional argument.
2024-07-25 10:40:50 -05:00
Elizabeth
eedcd10dbb
Fixed sys usage (#916)
Just as a heads up, I haven't really tested this since a lot of it is
stuff I don't use or know how to set up without some reading up. I have
tested the nu_conda_2 change since I have a python project that I use
that for, and I could look into testing more of it if needed.

I've tried finding (naively using `/sys\W/`) all the usage of the old
plain `sys` calls and replacing them with alternates as appropriate,
which mostly has been to swap a `(sys).host.name` call into a
`$nu.os-info.name` one, since it'll be tad faster and more consistent
across platforms with naming (especially as the value comes from the
[rust stdlib](https://doc.rust-lang.org/std/env/consts/constant.OS.html)
and is very predictable).

Fixes #897
2024-07-24 09:09:31 -05:00
Okdro
0906f7a15c
Feature/add git grep completions (#898)
Added completions for most of the flags for `git grep`. 

A few flags have been omitted for this PR due to Git expecting arguments
for those be passed without whitespaces. The arguments are optional, but
the flags would not work when passed arguments (see `--open-with-pager`
and `--color` flags in [this
commit](ffa9ceab73)
for how I tried to do it).

Ex. 

`--open-with-pager(-O)` expects the optional argument to be passed as
either `--open-with-pager=<pager>` or `-O<pager>`. Including it in the
completions list as I had implemented it breaks the flag when using the
optional parameter.

Feedback appreciated for how to handle that. I'm still new to the Nu
language, so I might have missed something obvious that could fix that.
2024-07-21 06:59:39 -05:00
OJarrisonn_
8d8a865b38
fix: nu-complete for git ref and git files-and-ref uses nu-complete git switch now (#906)
Git `nu-complete` defs where outdated, using a removed function
`nu-complete git switachable branches`, now using `nu-complete git
switch`

Already tested (except for tags)
2024-07-21 06:35:26 -05:00
Okdro
7471b4d966
Added Git completions for the restore subcommand (#895)
Added `git restore` to git completions, as I was missing tab completion
for that.

I've begun to use Nushell regularly, so I hope this addition will be
useful to others as it is to me.

Feedback is appreciated if there's any conventions I've missed, or
options that need better wording.
2024-07-16 12:20:00 -05:00
denny
1533149826
Fix: SSH config may not contain hostname (#893)
I am sorry. I assumed that an SSH host in the config file must contain a
hostname, but this assumption is not true.

If a user reads an SSH host that doesn't contain a hostname, it will
fail to parse.
2024-07-11 10:26:04 -05:00
denny
bfd2af7106
Add ssh completion (#891)
Read ssh config from `/etc/ssh/ssh_config` and `~/.ssh/config`.

Given: 
![螢幕擷取畫面 2024-07-09
232722](https://github.com/nushell/nu_scripts/assets/5771562/9294efd7-42c0-4a6c-9dac-06a6a87f67c5)

Will show:

![螢幕擷取畫面 2024-07-09
232640](https://github.com/nushell/nu_scripts/assets/5771562/a8e3844b-ac91-417b-a973-c31366ae1460)
2024-07-10 08:26:11 -05:00
1adept
1f3dc8b98d
just-completion: "export def" -> "export extern" (#860)
Changing "export def" to "export extern" to not shadow the original
command as it would disallow anything not defined in the re-definition

There seem to be similar cases in completions for (naive search with "rg
'export def'")
- mask
- winget (exports some defs and some externs. So i dont know if those
defs are actually additional functionality)
- pnpm (only exports some 'nu-complete' defs)
- pass (only exports some 'nu-complete' defs)

I don't feel comfortable changing those as i am not familiar with them.
2024-07-02 20:55:31 +03:00
laisnuto
c0b4853f5d
fix alert in kw completions (#878)
We update the code to add the alert function in the --alert subcommands
2024-06-13 09:13:24 -05:00
OJarrisonn_
5cc4e991ab
feat: added completions for kw (#877)
[`kw`](https://github.com/kworkflow/kworkflow) is a tool used by kernel
developers to help with the workflow

---------

Co-authored-by: Lais_Nuto_Rossman <laisnuto@gmail.com>
2024-06-13 08:43:18 -05:00
OJarrisonn_
de2829091f
feat: updated rustup completions to use the new rustup help page style (#871)
Rustup help page changed, so the commands that were based on the old
layout to get the completions were broken

Improved some completions to include a description like "default" or
"installed"

Also added completions for `rustup help`
2024-06-06 07:41:15 -05:00
OJarrisonn_
3bceafd6da
feat: add eza completions (#870)
Adds completions for the eza tool
2024-06-06 07:28:29 -05:00
Darren Schroeder
a1c3ace432
Revert "Revert "Add git coommit completions"" (#869)
Reverts nushell/nu_scripts#868

I found that this works, if you source these files like
```
use aliases/git/git-aliases.nu *
use custom-completions/git/git-completions.nu *
```
but if you source them like this, it doesn't work.
```
use custom-completions/git/git-completions.nu *
use aliases/git/git-aliases.nu *
```

This changed recently somewhere in nushell.
2024-06-05 07:41:42 -05:00
Darren Schroeder
5adf14dab9
Revert "Add git coommit completions" (#868)
Reverts nushell/nu_scripts#854

This PR broke the git aliases
https://github.com/nushell/nu_scripts/blob/main/aliases/git/git-aliases.nu
so I'm reverting it.
2024-06-05 07:21:14 -05:00
Thiago Duvanel
8a91aa8bf4
Added docker completions (#867)
This script provides completions for the docker command. It is based on
the official docker documentation.
2024-06-04 19:52:49 -05:00
laisnuto
95670ddfcb
Complete git pull (#866)
Create compleations for git pull
2024-06-04 19:47:38 -05:00
David Danier
e4dbec663b
Support whitespace before target name for make completions (#858)
TL;DR: The "simple" example from
https://www.gnu.org/software/make/manual/html_node/Simple-Makefile.html
is currently not compatible with the custom completion script found in
`custom-completions/make/make-completions.nu`. This PR tries to fix
that.

As I was working on `nur` (https://github.com/ddanier/nur) and the
`nurify` script to convert to `nur` from different task runners
(https://github.com/ddanier/nur/blob/main/scripts/nurify.nu) I wanted to
create a good way to convert from using `make`. So I thought the `make`
completion would for sure implement a good way to get a list of all
possible `make` targets. Hence I started looking at
`custom-completions/make/make-completions.nu`.

Then I searched for a good documentation for how `Makefile`s work, as
the last time I was using this myself is about 5 to 10 years ago. If you
for example look at the documentation on gnu.org you may find examples
of `Makefile`s not working with the current autocompletion. See
https://www.gnu.org/software/make/manual/html_node/Simple-Makefile.html
for example, the "simple" example they provide.

The reason for this not working is that the targets use some whitespace
after the target name. This is somehow allowed and thus valid. See
https://www.gnu.org/software/make/manual/html_node/Rule-Introduction.html
for a quick overview about how the `Makefile`s syntax works. I quickly
checked this to ensure `make` actually parses this correctly, it really
does.

This means that the current `make` completion does miss support for the
"simple" example provided my `make` itself. So I went on to fix this.

My suggested solution is:
* Filter all lines by regex `'^[\w\.-]+\s*:'` to ensure possible targets
  - start with some word (also allowing `.` and `-`)
  - may have some whitespaces after the word
  - has ":" after this
* Split by the ":"
* Use first column
* Trim the remaining target name to remove those nasty whitespaces
* Use result for completion

For me this did fix the issue with the "simple" `Makefile`, allowing me
to put this into my `nurify` script.

Would be nice to get this "backported" to nu scripts as well. Might help
others 😉
2024-05-30 14:37:43 -05:00
OJarrisonn_
f6ec482ea3
feat: git clone completions (#856)
Adds completions for the `git clone` command
2024-05-28 06:35:27 -05:00
OJarrisonn_
edb832840f
feat: add ./gradlew completions (#855)
Adds completions for when using a `./gradlew` script in Gradle projects

The script provides completions both for the script flags and for the
available tasks in the current project
2024-05-28 06:34:50 -05:00
laisnuto
5ce769ca2c
Add git coommit completions (#854)
Improve git commit completions for nushell
2024-05-28 06:33:48 -05:00
OJarrisonn_
407a313bbb
feat: add bend completions (#842)
Adds [Bend](https://github.com/HigherOrderCO/Bend) completions for
nushell
2024-05-22 12:41:01 -05:00
Tai Zeming
bb1fa35baa
feat(yarn): complete runnables(bin & scripts) (#841)
Allow custom-completions/yarn to complete scripts and bins by explicitly
listing existing commands and scripts & bins that loads from the current
path.
2024-05-22 06:30:50 -05:00
Matt Norton
8a77d51e93
Add more detailed poetry completions (#838) 2024-05-15 08:35:02 -05:00