diff options
Diffstat (limited to '.config/fish')
-rw-r--r-- | .config/fish/completions/nvm.fish | 21 | ||||
-rw-r--r-- | .config/fish/config.fish | 15 | ||||
-rw-r--r-- | .config/fish/fish_plugins | 2 | ||||
-rw-r--r-- | .config/fish/fish_variables | 4 | ||||
-rw-r--r-- | .config/fish/functions/fish_right_prompt.fish | 7 | ||||
-rw-r--r-- | .config/fish/functions/fish_user_key_bindings.fish | 3 | ||||
-rw-r--r-- | .config/fish/functions/sessiontype.fish | 8 |
7 files changed, 52 insertions, 8 deletions
diff --git a/.config/fish/completions/nvm.fish b/.config/fish/completions/nvm.fish new file mode 100644 index 0000000..14be1b7 --- /dev/null +++ b/.config/fish/completions/nvm.fish | |||
@@ -0,0 +1,21 @@ | |||
1 | complete --command nvm --exclusive | ||
2 | complete --command nvm --exclusive --long version --description "Print version" | ||
3 | complete --command nvm --exclusive --long help --description "Print help" | ||
4 | complete --command nvm --long silent --description "Suppress standard output" | ||
5 | |||
6 | complete --command nvm --exclusive --condition __fish_use_subcommand --arguments install --description "Download and activate the specified Node version" | ||
7 | complete --command nvm --exclusive --condition __fish_use_subcommand --arguments use --description "Activate the specified Node version in the current shell" | ||
8 | complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list --description "List installed Node versions" | ||
9 | complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list-remote --description "List available Node versions to install" | ||
10 | complete --command nvm --exclusive --condition __fish_use_subcommand --arguments current --description "Print the currently-active Node version" | ||
11 | complete --command nvm --exclusive --condition "__fish_seen_subcommand_from install" --arguments "( | ||
12 | test -e $nvm_data && string split ' ' <$nvm_data/.index | ||
13 | )" | ||
14 | complete --command nvm --exclusive --condition "__fish_seen_subcommand_from use" --arguments "(_nvm_list | string split ' ')" | ||
15 | complete --command nvm --exclusive --condition __fish_use_subcommand --arguments uninstall --description "Uninstall the specified Node version" | ||
16 | complete --command nvm --exclusive --condition "__fish_seen_subcommand_from uninstall" --arguments "( | ||
17 | _nvm_list | string split ' ' | string replace system '' | ||
18 | )" | ||
19 | complete --command nvm --exclusive --condition "__fish_seen_subcommand_from use uninstall" --arguments "( | ||
20 | set --query nvm_default_version && echo default | ||
21 | )" | ||
diff --git a/.config/fish/config.fish b/.config/fish/config.fish index adcbe4a..4f7aab8 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish | |||
@@ -23,6 +23,7 @@ set --global --export WECHALLTOKEN "35624-0D38B-A2F16-A98B0-5963D-6DF19" | |||
23 | set --global --export RUST_SRC_PATH (rustc --print sysroot)/lib/rustlib/src/rust/library/ | 23 | set --global --export RUST_SRC_PATH (rustc --print sysroot)/lib/rustlib/src/rust/library/ |
24 | set --global --export NLTK_DATA "$HOME/.local/share/nltk_data" | 24 | set --global --export NLTK_DATA "$HOME/.local/share/nltk_data" |
25 | set --global --export VIRTUALFISH_HOME "$HOME/.local/share/venvs/" | 25 | set --global --export VIRTUALFISH_HOME "$HOME/.local/share/venvs/" |
26 | set --global --export STARDICT_DATA_DIR "$HOME/.local/share/dict/" | ||
26 | 27 | ||
27 | 28 | ||
28 | if status is-interactive | 29 | if status is-interactive |
@@ -31,21 +32,17 @@ if status is-interactive | |||
31 | abbr --add --global bc 'bc -l' | 32 | abbr --add --global bc 'bc -l' |
32 | abbr --add --global bo 'bukuopener' | 33 | abbr --add --global bo 'bukuopener' |
33 | abbr --add --global cp 'cp -i' | 34 | abbr --add --global cp 'cp -i' |
34 | abbr --add --global C 'xsel -b' # Copy to clipboard | ||
35 | abbr --add --global df 'df -h' | 35 | abbr --add --global df 'df -h' |
36 | abbr --add --global free 'free -m' | 36 | abbr --add --global free 'free -m' |
37 | abbr --add --global gst 'git status' | 37 | abbr --add --global gst 'git status' |
38 | abbr --add --global guno 'git status -uno' | 38 | abbr --add --global guno 'git status -uno' |
39 | abbr --add --global inc 'task +in +PENDING count' | 39 | abbr --add --global inc 'task +in +PENDING count' |
40 | abbr --add --global in 'task add +in' | 40 | abbr --add --global in 'task add +in' |
41 | abbr --add --global ledger "ledger -f ~/nextcloud/virtuals/ledger.ledger" | ||
42 | abbr --add --global lim 'nvim /home/yigit/nextcloud/virtuals/ledger.ledger' | ||
43 | abbr --add --global ls 'exa' | 41 | abbr --add --global ls 'exa' |
44 | abbr --add --global maybe 'task due:someday list' | 42 | abbr --add --global maybe 'task due:someday list' |
45 | abbr --add --global music 'mpv --no-vid' | 43 | abbr --add --global music 'mpv --no-vid' |
46 | abbr --add --global mv 'mv -i' | 44 | abbr --add --global mv 'mv -i' |
47 | abbr --add --global nt 'neomutt' | 45 | abbr --add --global nt 'neomutt' |
48 | abbr --add --global report "report -f ~/nextcloud/virtuals/ledger.ledger" | ||
49 | abbr --add --global re 'remi -gaad -@2' | 46 | abbr --add --global re 'remi -gaad -@2' |
50 | abbr --add --global rm 'rm -i' | 47 | abbr --add --global rm 'rm -i' |
51 | abbr --add --global s "du -hs * | sort -rh | head -5" | 48 | abbr --add --global s "du -hs * | sort -rh | head -5" |
@@ -60,9 +57,19 @@ if status is-interactive | |||
60 | abbr --add --global wim 'nvim /home/yigit/nextcloud/personal_wiki/text/index.wiki' | 57 | abbr --add --global wim 'nvim /home/yigit/nextcloud/personal_wiki/text/index.wiki' |
61 | abbr --add --global yst 'yadm status' | 58 | abbr --add --global yst 'yadm status' |
62 | abbr --add --global dr 'dragon-drop' | 59 | abbr --add --global dr 'dragon-drop' |
60 | abbr --add --global ddg 'surfraw duckduckgo -j' | ||
61 | abbr --add --global lu 'sdcv' | ||
62 | |||
63 | if test "$WAYLAND_DISPLAY" = "wayland-1" | ||
64 | abbr --add --global C 'wl-copy' # Wayland | ||
65 | else | ||
66 | abbr --add --global C 'xsel -b' # X11 | ||
67 | end | ||
63 | 68 | ||
64 | zoxide init fish | source | 69 | zoxide init fish | source |
65 | direnv hook fish | source | 70 | direnv hook fish | source |
71 | fzf --fish | source | ||
72 | atuin init fish --disable-up-arrow | source | ||
66 | 73 | ||
67 | fish_ssh_agent | 74 | fish_ssh_agent |
68 | end | 75 | end |
diff --git a/.config/fish/fish_plugins b/.config/fish/fish_plugins new file mode 100644 index 0000000..49bfe20 --- /dev/null +++ b/.config/fish/fish_plugins | |||
@@ -0,0 +1,2 @@ | |||
1 | jorgebucaran/nvm.fish | ||
2 | franciscolourenco/done | ||
diff --git a/.config/fish/fish_variables b/.config/fish/fish_variables index e8b58fb..b32dfe3 100644 --- a/.config/fish/fish_variables +++ b/.config/fish/fish_variables | |||
@@ -2,6 +2,10 @@ | |||
2 | # VERSION: 3.0 | 2 | # VERSION: 3.0 |
3 | SETUVAR __fish_initialized:3400 | 3 | SETUVAR __fish_initialized:3400 |
4 | SETUVAR _fish_abbr_dr:dragon\x2ddrop | 4 | SETUVAR _fish_abbr_dr:dragon\x2ddrop |
5 | SETUVAR _fisher_franciscolourenco_2F_done_files:\x7e/\x2econfig/fish/conf\x2ed/done\x2efish | ||
6 | SETUVAR _fisher_jorgebucaran_2F_nvm_2E_fish_files:\x7e/\x2econfig/fish/functions/_nvm_index_update\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_list\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_version_activate\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_version_deactivate\x2efish\x1e\x7e/\x2econfig/fish/functions/nvm\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/nvm\x2efish\x1e\x7e/\x2econfig/fish/completions/nvm\x2efish | ||
7 | SETUVAR _fisher_plugins:jorgebucaran/nvm\x2efish\x1efranciscolourenco/done | ||
8 | SETUVAR _fisher_upgraded_to_4_4:\x1d | ||
5 | SETUVAR fish_color_autosuggestion:6c7086 | 9 | SETUVAR fish_color_autosuggestion:6c7086 |
6 | SETUVAR fish_color_cancel:f38ba8 | 10 | SETUVAR fish_color_cancel:f38ba8 |
7 | SETUVAR fish_color_command:89b4fa | 11 | SETUVAR fish_color_command:89b4fa |
diff --git a/.config/fish/functions/fish_right_prompt.fish b/.config/fish/functions/fish_right_prompt.fish index 5963ed9..1e28dfc 100644 --- a/.config/fish/functions/fish_right_prompt.fish +++ b/.config/fish/functions/fish_right_prompt.fish | |||
@@ -76,6 +76,11 @@ function fish_right_prompt --description 'Write out the right prompt' | |||
76 | set virtualenv "$green 🐍 " (basename "$VIRTUAL_ENV") | 76 | set virtualenv "$green 🐍 " (basename "$VIRTUAL_ENV") |
77 | end | 77 | end |
78 | 78 | ||
79 | set -l node_version | ||
80 | if set -q nvm_current_version | ||
81 | set node_version "$red " "$nvm_current_version" | ||
82 | end | ||
83 | |||
79 | set hour $blue(date '+%R') | 84 | set hour $blue(date '+%R') |
80 | echo -n -s $virtualenv ' ' $repo_info ' ' $hour | 85 | echo -n -s $node_version ' ' $virtualenv ' ' $repo_info ' ' $hour |
81 | end | 86 | end |
diff --git a/.config/fish/functions/fish_user_key_bindings.fish b/.config/fish/functions/fish_user_key_bindings.fish deleted file mode 100644 index ff0d9f3..0000000 --- a/.config/fish/functions/fish_user_key_bindings.fish +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | function fish_user_key_bindings | ||
2 | fzf_key_bindings | ||
3 | end | ||
diff --git a/.config/fish/functions/sessiontype.fish b/.config/fish/functions/sessiontype.fish new file mode 100644 index 0000000..33830ca --- /dev/null +++ b/.config/fish/functions/sessiontype.fish | |||
@@ -0,0 +1,8 @@ | |||
1 | # https://unix.stackexchange.com/questions/202891/how-to-know-whether-wayland-or-x11-is-being-used/371164#comment573431_325972 | ||
2 | |||
3 | function sessiontype | ||
4 | # https://unix.stackexchange.com/questions/202891/how-to-know-whether-wayland-or-x11-is-being-used/371164#comment573431_325972 | ||
5 | # have to run it first? | ||
6 | loginctl > /dev/null | ||
7 | loginctl show-session (loginctl | awk '/tty/ {print $1}') -p Type | awk -F= '{print $2}' | ||
8 | end | ||