Commit Graph

805 Commits

Author SHA1 Message Date
Antoine Stevan
ac1750246c
add the preview script (#501) 2023-05-17 13:15:04 -05:00
Antoine Stevan
792d8e37f6
FEATURE: allow to run themes/make script from anywhere (#499)
* fix the path

* ignore the `lemnos` base of themes
2023-05-17 13:10:43 -05:00
Antoine Stevan
fe93a6bac7
REFACTOR: make the indentation in the themes more consistent (#498)
* make the indentation consistent (4 spaces) in `themes/make.nu`

* regenerate the themes with `themes/make.nu`
2023-05-17 13:09:18 -05:00
fj0r
524f633531
merge ktpa into ktp(-a), rename ktn to ktno (#497)
* merge ktpa into ktp(-a), rename ktn to ktno

* Add a short description to `kgpw`

* kgp support `-a`

---------

Co-authored-by: agent <agent@nuc>
2023-05-17 06:12:48 -05:00
fj0r
08b7ccf84e
refactor git-v2#agree with input list (#496)
Co-authored-by: agent <agent@nuc>
2023-05-16 21:05:57 -05:00
fj0r
b6ecfe3680
Experimental multi-taskrunner support for jx (npm for example) (#492)
* Experimental multi-task runner support for `jx` (npm for example)

- Remove `nu-complete` export for debugging.
- Formatting `nu-complete just recipes`

* Use `jx` to override `j`.

Only for `just`, it only adds a prefix when completing, and does not break the original workflow

* `nu-complete just recipes` append empty string

When all the completions are `just xxx`, there is only `just` in the menu, press `C-w` to delete backwards to work.

* kgp takes `-o default` by default

move just to just/just.nu

* `gp` uses `git pull` instead of `git fetch` by default, and there is only one request when `push` is not needed

* add kgpw for `kubectl get pods --watch`

adjust `gm` to make it clearer

* remove just.nu

---------

Co-authored-by: agent <agent@nuc>
2023-05-16 20:07:08 -05:00
Emily Grace Seville
f86a060c10
Fix: remaining aliases (#495)
* fix(alias): exa

- reformat

* feat(alias): aws

- fix errors

* fix(aliases): clean-up

- create universal README
- remove redundant files
- rename modules

* fix(aliases): aws

- move to modules/
2023-05-16 08:56:31 -05:00
Tilen Gimpelj
d48ce0b6c1
Added typst completion script. (#494) 2023-05-16 07:28:44 -05:00
Amy
2c37b5f583
fix: just completions (#491) 2023-05-14 11:38:47 -05:00
Emily Grace Seville
d2f424e605
feat(module): add random-list (#488)
* feat(module): add random-list

* feat(module): use options more often

* feat(module): prettify errors
2023-05-14 08:01:22 -05:00
fj0r
194eb30dc7
gp: run git fetch before git push or git pull (#490)
* gp: run `git fetch` before `git push` or `git pull`

* remove useless else

---------

Co-authored-by: nash <nash@iffy.me>
2023-05-14 07:58:02 -05:00
fj0r
632a62f035
kubernetes completion of jsonpath (#487)
* nu-complete kube jsonpath

The behavior is correct, but the completion menu cannot be displayed

* jsonpath completion for list

* New nushell-style git.nu

Original renamed to git-classic.nu

See `git.md` for details

* rename git.md to README.md

* Move the helper function to the back

* revert power_kube ensure-cache

* A more precise description of `gp`

* description of behavior that both ahead and behind exist

* clean up redundant alias

git show can use gl <hash> instead (hash can be completed)

* add description of `gl`

* add description of gp, ga, gd's parameter

* typo: gpc to gcp

* description of `gp --override`

* rename git.nu to git-v2.nu and git_classic.nu to git.nu

* `git fetch` as fallback of `gp` and temporarily disable `gstat`

temporarily disable `gstat` in `power_git` because:

- `gstat` is not much faster than nushell's implementation of `git_status`
- Sometimes the information displayed is inaccurate, but `git_status` parses the output of `git`, which is more reliable
- No need to load additional plugins

---------

Co-authored-by: agent <agent@nuc>
Co-authored-by: nash <nash@iffy.me>
2023-05-13 10:59:30 -05:00
Emily Grace Seville
b3ae6f4af0
feat(aliases): reformat and use long options (#489)
* feat(aliases): reformat

* fix(aliases): broken aliases

* feat(aliases): use long options

* feat(aliases): inline defs
2023-05-13 08:07:57 -05:00
Maxim Uvarov
b2fadc0ea8
the function to display bars of given percentage from given width (#478)
* function to display bars of given percentage from given width

* adding --progress, moving width to options

thanks @amtoine

* typos of ESL studnet

* added examples and tests

* feat(nano): add completions (#479)

* feat(nano): add completions

* feat(nano): add readme

* removed escape symbols from tests, fixed fraction indexing

* fixed tests

Fixed tests, although they need escape sequences, as the bar function has the ability to change the colors of both the background and foreground and uses the default color by default.

* Rename bar_fn.nu to bar.nu

---------

Co-authored-by: Emily Grace Seville <EmilySeville7cfg@gmail.com>
2023-05-12 09:11:20 -05:00
fj0r
58a05e91da
clean up kubernetes.nu (#486)
* add the original kubectl command as description of abbreviation

* replace nu-complete kube pods, services, deployments with `res via name`

* kg support --jsonpath

* kgp, kgs, kgd support --jsonpath

* refactor kep, kdp, kgd, kdels

* kg support --selector

* kg support --wide

- remove kgpl
- kgp, kgd support --selector

* kg support --watch and rename wide to verbose

- remove kgpa (kg pod -A)
- remove kgpw (kg pod -w)

* add kind in output of `kg -v`

used with multiple types such as `kg pod,svc -v`

---------

Co-authored-by: agent <agent@nuc>
2023-05-12 06:16:07 -05:00
zsehanovic
967fdabe30
fix git aliases (#485)
* fix git aliases

* Update nu_alias_git.nu

semi-colons are not required

---------

Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
2023-05-11 15:22:41 -05:00
fj0r
2d6f32657a
improve kconf import (#481)
* improve kconf import

The order of fields loaded via `from yaml` is unstable, so use yq to
read it as json, and then load it by `from json`.

Aims to be `diff` friendly.

Remove the square brackets from the week field and use color to
distinguish it, taking up less space.

* kube_stat shows $ctx.NAME instead of complex combination of $ctx.AUTHINFO and $ctx.CLUSTER

- Improve the default theme of kube_stat.
- Clean up duplicate comments in `kubernetes.nu`.

* when power's DECORATOR mode is `power`, allows to dynamically change the background color

- components now needs to return two values in an array, the first value is the background color, and the second value is the original value.
- as an example, `atuin_stat` reveal its status with two different colors instead of showing or hiding

* allowing pass `config` when register or inject a component

The main difference between `config` and `theme` is: theme assumes you pass a color and will apply with `ansi -e {fg : $arg}`

And in most cases, you don't need to pass `config`

* added new function `power set`

time_segment allows format control via option `short`

* rename `nu-complete kube def` to `nu-complete kube kind`

- get all resources via `kubectl api-resources`
- enable cache

* use `from yaml` instead of `yq -o=json | from json` (for next version)

* nu-complete kube kind: add SHORTNAMES as description

* Fix the caching mechanism of `kube ctx` and `kube kind`

based on the number of file lines instead of modification time.

Because switching the context will change the content of the file, the time will be updated every time

* Added new command `kcache flush` to rebuild the cache.

Sometimes, such as manually editing the cluster address in the
configuration file, the number of lines has not changed, and the cache
does need to be refreshed

* use `path dirname` instead of `dirname`

* applying `ensure-cache-by-lines` in `kube_stat`

---------

Co-authored-by: agent <agent@nuc>
2023-05-11 06:37:39 -05:00
Emily Grace Seville
ee996ec169
fix(completions): clean-up (#484) 2023-05-11 06:08:36 -05:00
Dominik Schrempf
a3778622cd
ultimate_extractor: various fixes (#482)
- fix regex matching
  - . -> \.
  - use $ ot match end of file name
- fix naming of variables (exte -> handlers; command -> maybe_handler)
- combine suffixes with common extractors
- in case of no match, use a proper error
2023-05-10 06:17:46 -05:00
fj0r
3645bae992
rename registry list to registry show (#480)
* rename registry list to registry show

Extend its functionality, not just list tags, but also show catalog
and manifest, Depending on the number of parameters.

* date format by $theme.format

show day of the week
shortly time_segment

---------

Co-authored-by: agent <agent@nuc>
2023-05-08 06:32:14 -05:00
Emily Grace Seville
25c85042f1
feat(nano): add completions (#479)
* feat(nano): add completions

* feat(nano): add readme
2023-05-07 08:45:52 -05:00
Rick Cogley
f02f4dd0d0
Nupass par each threads 20230504 (#477)
* Update ReadMe.md

Added explanation of how to use new --threads switch to feed to the par-each loops

* Update nupass.nu

Added --threads flag to allow setting of same in par-each loops, for performance fine tuning
2023-05-04 08:00:38 -05:00
fj0r
5b6d20d0bd
Fix the problem that the KUBECONFIG file does not exist (#476)
Co-authored-by: agent <agent@nuc>
2023-05-03 06:57:42 -05:00
Hilmar Gústafsson
09647b77ee
fix(npm-completions): move extern down (#475)
Looks like nu has gotten stricter about the order in which things
must be declared.
2023-05-02 06:42:33 -05:00
Rick Cogley
afba27f304
Nupass performance 20230502 (#474)
* Use par-each in main list builders

Using par-each on the main list builders for random words, symbols and numbers results in a significant performance gain

* Add benchmarking section

Explain how par-each really can improve performance
2023-05-02 06:39:33 -05:00
Rick Cogley
112d8b2f7e
Nupass refactor 20230501 (#473)
* Refactor nupass.nu

Major refactor for more flexibility

To allow number of words to be specified, one solution is to add random 
words, symbols, & numbers to lists, then operate on the lists.
You can combine lists with the ++ operator, then use shuffle on them,
as well as various other methods.

* Update ReadMe.md

Updated to match latest version, adding some new sample commands

Last version `nupass 4` meant "generate password with 3 words of length <=4".
This version `nupass 4` means "generate password with 4 words".
Length can be specified with `-l`, so: `nupass 4 -l 8` means "generate password with 4 words of length <=8".

* Update ReadMe.md

Screenshot showing new version's output
2023-05-01 06:10:19 -05:00
Antoine Stevan
1099c9461e
REFACTOR: unify git modules and aliases (#472)
* add aliases from `modules/git/`

* remove `git` aliases from `modules/git/`

* move the `git_` tool commands to the alias file

This is the only place these commands are used.
2023-04-30 07:23:07 -05:00
fj0r
4e07d66d06
refactor powerline script (#471)
* refactor

- new decorator type `|>` for head of left
- more convenient analysis

* try to add anlysis on component level

- get_component
- when there is only one component in left, '>>' takes precedence
- use `reduce` instead of `each & filter` (improved performance significantly)

* fix component level benchmark

* optimize git_stat

---------

Co-authored-by: nash <nash@iffy.me>
2023-04-29 08:20:29 -05:00
fj0r
c1e798aad4
optimize kube_stat with ensure-cache (#470)
refactor ensure-index to ensure-cache in:
- kubernetes.nu
- ssh.nu

Co-authored-by: nash <nash@iffy.me>
2023-04-28 12:34:35 -05:00
fj0r
cfdc7b725c
refactor left_prompt decorator logic (#469)
- added instructions for measurements
    - change NU_POWER_MODE default to `power` (in fast mode, there is still a problem with hid
eable components on the left)
    - tweaked atuin_stat theme

Co-authored-by: nash <nash@iffy.me>
2023-04-28 12:05:06 -05:00
fj0r
17103049f5
atuin (#468)
- rename `default` to `power`($env.NU_POWER_MODE, avoid misleading)
- apply `ansi -e {fg: $arg}` to theme configuration of `register` and `inject`(consistent with how it is configured in NU_POWER_SCHEMA)
- added atuin_stat

Co-authored-by: agent <agent@nuc>
2023-04-28 06:54:40 -05:00
Chris Dawkins
724f89c330
fix navigation links (#467) 2023-04-26 18:38:06 -05:00
fj0r
c5865e0825
powerline : NU_POWER_MODE and NU_POWER_BENCHMARK (#464)
* powerline : NU_POWER_MODE and NU_POWER_BENCHMARK

* zoxide-menu

* direnv

* dynamic-load

* logtime

---------

Co-authored-by: agent <agent@nuc>
2023-04-26 13:36:55 -05:00
Hofer-Julian
80df447c83
Update CODEOWNERS after refactor (#466) 2023-04-26 07:51:03 -05:00
Yethal
0095fb2b1c
Update to-ini.nu (#465)
Fix for 0.79.0
2023-04-26 06:37:48 -05:00
Darren Schroeder
92b29131db
some cleanup (#463) 2023-04-25 18:01:27 -05:00
Mel Massadian
c47ccd42b8
refactor: (#418)
* refactor:  move in one commit

Eveything in modules should probably be changed to `exported` defs.
The idea is to move everything first to keep proper history.

* refactor: 📝 add modules readme (wip)

* refactor:  small move

* refactor: 📝 changed nestring, updated modules readme

* refactor: 📝 to document or not to document

* fix: 🐛 themes

replaced the template to use `main` and regenerated them
from lemnos themes.

* Revert "fix: 🐛 themes"

This reverts commit 4918d3633c.

* refactor:  introduce sourced

- Created a source `root` in which sourcable demos are stored.
  Some might get converted to modules later on.
- Moved some files to bin too.

* fix: 🐛 fehbg.nu

* fix: 🐛 modules/after.nu

* moved some other stuff around

---------

Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
2023-04-25 17:56:25 -05:00
Stefan Holderbach
382696cd21
Include nu-std in the release script (#462)
Only `nu` directly depends on it, so can be part of last wave.
2023-04-25 20:45:35 +02:00
fj0r
e8cda90b52
prompt powerline suppor color theme (#461)
* rename NU_MENU_MARKER to NU_POWER_MENU_MARKER

* PROMPT_INDICATOR fallback

* refactor _sep -> decorator

* support color theme

* source return `$nothing` for hiding

* '<<' not longer hide separator

* refactor

---------

Co-authored-by: nash <nash@iffy.me>
Co-authored-by: agent <agent@nuc>
2023-04-25 06:11:08 -05:00
fj0r
0403e8ebf3
refactor: unified configuration environment variables (#460)
* refactor: unified configuration environment variables

* upgrade README.md

---------

Co-authored-by: nash <nash@iffy.me>
2023-04-24 08:24:08 -05:00
fj0r
cb61fe50ec
prompt (#455)
* optimize git status parsing

* improve `-v` for dr(docker run), remove dx

* rename relative-to-pwd to host-path

* optimize git status branch's parsing

* typo

* git rerange glg -> gl, gl -> gpl, gp -> gps

* fix `env already a builtin variable`, revert #fb52413

* get git_status from gstat

* prompt: rerange formatter

* parsing git_status without gstat

* refactor `light_yellow pipe` to `sep`

* fix parsing when not in git repo

* refactor with Optional cell path members

* adjust `ansi reset` location

* typo

* tweak nvim config to be more generic

* prompt: powerline mode

* format

* rename prompt/git-k8s.nu to prompt/power.nu

* use `ansi -e {bg}` instead of string interpolation

* format

* power prompt: insert _sep at prompt generator

* tweaked powerline colorscheme

* update up_prompt

* add $env.NU_UPPROMPT

* tweak time_segment color

* add $env.NU_PROMPT_SCHEMA

* up_prompt fill length must greater than 0

* add fallback theme for NU_PROMPT_SCHEMA has many elements

* merge NU_POWERLINE_THEME into NU_PROMPT_SCHEMA

* helper: default_env

* typo

* try to optimize performance

* optimize performance

* add a space to PROMPT_INDICATO

* replace menus.marker

* modularized

* new dir `powerline` with README

* doc: define NU_PROMPT_SCHEMA

* hook env change

* more doc

* safely replace menus.marker

* avoid `power init` when hooks env_change

* update todo

* refactor export

* tweak MENU_MARKER_SCHEMA

* move to prompt/powerline

---------

Co-authored-by: agent <agent@nuc>
Co-authored-by: nash <nash@iffy.me>
2023-04-24 07:26:33 -05:00
Darkness9724
44de28100d
Fix wolframalpha.nu (#459)
Signed-off-by: Maxim Mikhailov <darkness9724@gmail.com>
2023-04-23 14:07:59 -05:00
Rick Cogley
bfa41311ea
Enhance by getting length of symbol string (#458)
The get-random-symbol function had a hard coded upper limit when using
"random integer". Switch to getting the length of the symbol string
automatically, so user does not have to physically count
2023-04-23 06:45:56 -05:00
Rick Cogley
822005fca6
Add nupass.nu password generator (#450) 2023-04-22 21:02:49 -05:00
Darren Schroeder
97fac19e33
update progress meter to work with latest nushell (#457) 2023-04-22 07:15:05 -05:00
Darren Schroeder
1330bdd865
update sg.nu to print again (#456) 2023-04-21 14:24:17 -05:00
nils-degroot
1d16a376b2
Added completions for pass (#454) 2023-04-20 08:12:48 -05:00
D3V1LC0D3R
4157914f71
Update nuschiit.nu (used deprecated fetch) (#453)
updated the script to no longer use fetch and properly trim strings
2023-04-19 11:38:41 -05:00
D3V1LC0D3R
a49b6c5f0e
Create anagram_unscramble_scrape (#452)
parse anagrams into table from unscramble.me
2023-04-19 10:09:35 -05:00
TuffenDuffen
e4784d44a3
fixed error in yarn completions (#451) 2023-04-18 07:02:04 -05:00