Skip to content

Commit d17563c

Browse files
committed
feat: Add commands for virtualenv, ollama, and keybindings
- Add command to create virtual environments. - Add command to update ollama. - Add command to show used keybindings. - Change URL encoding in translate command.
1 parent 4b9268d commit d17563c

File tree

4 files changed

+31
-1
lines changed

4 files changed

+31
-1
lines changed

apis.nu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export def trans [
5656
path: "/get",
5757
params: {
5858
q: $to_translate,
59-
langpair: ($from + "%7C" + $to),
59+
langpair: ($from + "|" + $to),
6060
of: "json",
6161
key: $apikey,
6262
de: $user

python.nu

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#create virtual env
2+
export def create-virtualenv [dir_name:string = "venv"] {
3+
python3 -m virtualenv $dir_name
4+
}
5+
16
export def activate [] {
27
print ("'overlay use venv/bin/activate.nu' copied to clipboard!")
38
"overlay use venv/bin/activate.nu" | xsel --input --clipboard

system.nu

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,4 +619,24 @@ export def "ps parents" [pid?: int] {
619619
}
620620

621621
get-parents $all_processes $current_process
622+
}
623+
624+
#current used keybindinds
625+
export def get-used-keybindings [] {
626+
let $keybindings = $env.config.keybindings | update modifier {split row '_' | sort | str join '_'}
627+
628+
let $modifiers = $keybindings | get modifier | uniq --count | sort-by count -r | update count null | transpose -idr
629+
630+
$keybindings
631+
| select keycode modifier
632+
| group-by keycode --to-table
633+
| update items {|i|
634+
$i.items.modifier
635+
| reduce -f $modifiers {|value acc|
636+
update $value ''
637+
}
638+
}
639+
| flatten
640+
| sort-by group
641+
| table --abbreviated 1000
622642
}

update_apps.nu

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,4 +974,9 @@ export def "apps-update rustc" [] {
974974
rustup override set stable-x86_64-unknown-linux-gnu
975975
rustup update
976976
# rustup self uninstall
977+
}
978+
979+
#update ollama
980+
export def "apps-update ollama" [] {
981+
curl -fsSL https://ollama.com/install.sh | sh
977982
}

0 commit comments

Comments
 (0)