diff options
author | Luca Matei Pintilie <lucafulger@gmail.com> | 2021-12-21 20:26:50 +0000 |
---|---|---|
committer | Luca Matei Pintilie <lucafulger@gmail.com> | 2021-12-21 20:26:50 +0000 |
commit | f8acb4edc93d2570856381eb7fb6f75db3955cf6 (patch) | |
tree | d8db466f88799f7d796e0b93d6a2ad8394c599c9 /.config/fish | |
parent | 2169a4155362a7f1639e4ad78033abb193f2d565 (diff) | |
download | dotfiles-f8acb4edc93d2570856381eb7fb6f75db3955cf6.tar dotfiles-f8acb4edc93d2570856381eb7fb6f75db3955cf6.tar.gz dotfiles-f8acb4edc93d2570856381eb7fb6f75db3955cf6.tar.bz2 dotfiles-f8acb4edc93d2570856381eb7fb6f75db3955cf6.tar.lz dotfiles-f8acb4edc93d2570856381eb7fb6f75db3955cf6.tar.xz dotfiles-f8acb4edc93d2570856381eb7fb6f75db3955cf6.tar.zst dotfiles-f8acb4edc93d2570856381eb7fb6f75db3955cf6.zip |
Initial commit2
Diffstat (limited to '.config/fish')
-rw-r--r-- | .config/fish/completions/alacritty.fish | 74 | ||||
-rw-r--r-- | .config/fish/completions/pass.fish | 116 | ||||
-rw-r--r-- | .config/fish/conf.d/dracula.fish | 33 | ||||
-rw-r--r-- | .config/fish/config.fish | 24 | ||||
-rw-r--r-- | .config/fish/fish_plugins | 1 | ||||
-rw-r--r-- | .config/fish/fish_variables | 34 | ||||
l--------- | .config/fish/functions/br.fish | 1 | ||||
-rw-r--r-- | .config/fish/functions/fish_greeting.fish | 4 |
8 files changed, 287 insertions, 0 deletions
diff --git a/.config/fish/completions/alacritty.fish b/.config/fish/completions/alacritty.fish new file mode 100644 index 0000000..6f8da9b --- /dev/null +++ b/.config/fish/completions/alacritty.fish @@ -0,0 +1,74 @@ +# Meta +complete -c alacritty \ + -s "v" \ + -l "version" \ + -d "Prints version information" +complete -c alacritty \ + -s "h" \ + -l "help" \ + -d "Prints help information" + +# Config +complete -c alacritty \ + -f \ + -l "config-file" \ + -d "Specify an alternative config file" +complete -c alacritty \ + -s "t" \ + -l "title" \ + -d "Defines the window title" +complete -c alacritty \ + -l "class" \ + -d "Defines the window class" +complete -c alacritty \ + -l "embed" \ + -d "Defines the X11 window ID (as a decimal integer) to embed Alacritty within" +complete -c alacritty \ + -x \ + -a '(__fish_complete_directories (commandline -ct))' \ + -l "working-directory" \ + -d "Start shell in specified directory" +complete -c alacritty \ + -l "hold" \ + -d "Remain open after child process exits" +complete -c alacritty \ + -s "o" \ + -l "option" \ + -d "Override config file options" + +# Output +complete \ + -c alacritty \ + -l "print-events" \ + -d "Print all events to stdout" +complete \ + -c alacritty \ + -s "q" \ + -d "Reduces the level of verbosity (min is -qq)" +complete \ + -c alacritty \ + -s "qq" \ + -d "Reduces the level of verbosity" +complete \ + -c alacritty \ + -s "v" \ + -d "Increases the level of verbosity" +complete \ + -c alacritty \ + -s "vv" \ + -d "Increases the level of verbosity" +complete \ + -c alacritty \ + -s "vvv" \ + -d "Increases the level of verbosity" + +complete \ + -c alacritty \ + -l "ref-test" \ + -d "Generates ref test" + +complete \ + -c alacritty \ + -s "e" \ + -l "command" \ + -d "Execute command (must be last arg)" diff --git a/.config/fish/completions/pass.fish b/.config/fish/completions/pass.fish new file mode 100644 index 0000000..d70e33f --- /dev/null +++ b/.config/fish/completions/pass.fish @@ -0,0 +1,116 @@ +# Copyright (C) 2012-2014 Dmitry Medvinsky <me@dmedvinsky.name>. All Rights Reserved. +# This file is licensed under the GPLv2+. Please see COPYING for more information. + +set -l PROG 'pass' + +function __fish_pass_get_prefix + if set -q PASSWORD_STORE_DIR + realpath -- "$PASSWORD_STORE_DIR" + else + echo "$HOME/.password-store" + end +end + +function __fish_pass_needs_command + [ (count (commandline -opc)) -eq 1 ] +end + +function __fish_pass_uses_command + set -l cmd (commandline -opc) + if [ (count $cmd) -gt 1 ] + if [ $argv[1] = $cmd[2] ] + return 0 + end + end + return 1 +end + +function __fish_pass_print_gpg_keys + gpg2 --list-keys | grep uid | sed 's/.*<\(.*\)>/\1/' +end + +function __fish_pass_print + set -l ext $argv[1] + set -l strip $argv[2] + set -l prefix (__fish_pass_get_prefix) + set -l matches $prefix/**$ext + printf '%s\n' $matches | sed "s#$prefix/\(.*\)$strip#\1#" +end + +function __fish_pass_print_entry_dirs + __fish_pass_print "/" +end + +function __fish_pass_print_entries + __fish_pass_print ".gpg" ".gpg" +end + +function __fish_pass_print_entries_and_dirs + __fish_pass_print_entry_dirs + __fish_pass_print_entries +end + +function __fish_pass_git_complete + set -l prefix (__fish_pass_get_prefix) + set -l git_cmd (commandline -opc) (commandline -ct) + set -e git_cmd[1 2] # Drop "pass git". + complete -C"git -C $prefix $git_cmd" +end + +complete -c $PROG -f -n '__fish_pass_needs_command' -a help -d 'Command: show usage help' +complete -c $PROG -f -n '__fish_pass_needs_command' -a version -d 'Command: show program version' + +complete -c $PROG -f -n '__fish_pass_needs_command' -a init -d 'Command: initialize new password storage' +complete -c $PROG -f -n '__fish_pass_uses_command init' -s p -l path -d 'Assign gpg-id for specified sub folder of password store' + +complete -c $PROG -f -n '__fish_pass_needs_command' -a ls -d 'Command: list passwords' +complete -c $PROG -f -n '__fish_pass_uses_command ls' -a "(__fish_pass_print_entry_dirs)" + +complete -c $PROG -f -n '__fish_pass_needs_command' -a insert -d 'Command: insert new password' +complete -c $PROG -f -n '__fish_pass_uses_command insert' -s e -l echo -d 'Echo the password on console' +complete -c $PROG -f -n '__fish_pass_uses_command insert' -s m -l multiline -d 'Provide multiline password entry' +complete -c $PROG -f -n '__fish_pass_uses_command insert' -s f -l force -d 'Do not prompt before overwritting' +complete -c $PROG -f -n '__fish_pass_uses_command insert' -a "(__fish_pass_print_entry_dirs)" + +complete -c $PROG -f -n '__fish_pass_needs_command' -a generate -d 'Command: generate new password' +complete -c $PROG -f -n '__fish_pass_uses_command generate' -s n -l no-symbols -d 'Do not use special symbols' +complete -c $PROG -f -n '__fish_pass_uses_command generate' -s c -l clip -d 'Put the password in clipboard' +complete -c $PROG -f -n '__fish_pass_uses_command generate' -s f -l force -d 'Do not prompt before overwritting' +complete -c $PROG -f -n '__fish_pass_uses_command generate' -s i -l in-place -d 'Replace only the first line with the generated password' +complete -c $PROG -f -n '__fish_pass_uses_command generate' -a "(__fish_pass_print_entry_dirs)" + +complete -c $PROG -f -n '__fish_pass_needs_command' -a mv -d 'Command: rename existing password' +complete -c $PROG -f -n '__fish_pass_uses_command mv' -s f -l force -d 'Force rename' +complete -c $PROG -f -n '__fish_pass_uses_command mv' -a "(__fish_pass_print_entries_and_dirs)" + +complete -c $PROG -f -n '__fish_pass_needs_command' -a cp -d 'Command: copy existing password' +complete -c $PROG -f -n '__fish_pass_uses_command cp' -s f -l force -d 'Force copy' +complete -c $PROG -f -n '__fish_pass_uses_command cp' -a "(__fish_pass_print_entries_and_dirs)" + +complete -c $PROG -f -n '__fish_pass_needs_command' -a rm -d 'Command: remove existing password' +complete -c $PROG -f -n '__fish_pass_uses_command rm' -s r -l recursive -d 'Remove password groups recursively' +complete -c $PROG -f -n '__fish_pass_uses_command rm' -s f -l force -d 'Force removal' +complete -c $PROG -f -n '__fish_pass_uses_command rm' -a "(__fish_pass_print_entries_and_dirs)" + +complete -c $PROG -f -n '__fish_pass_needs_command' -a edit -d 'Command: edit password using text editor' +complete -c $PROG -f -n '__fish_pass_uses_command edit' -a "(__fish_pass_print_entries)" + +complete -c $PROG -f -n '__fish_pass_needs_command' -a show -d 'Command: show existing password' +complete -c $PROG -f -n '__fish_pass_uses_command show' -s c -l clip -d 'Put password in clipboard' +complete -c $PROG -f -n '__fish_pass_uses_command show' -a "(__fish_pass_print_entries)" +# When no command is given, `show` is defaulted. +complete -c $PROG -f -n '__fish_pass_needs_command' -s c -l clip -d 'Put password in clipboard' +complete -c $PROG -f -n '__fish_pass_needs_command' -a "(__fish_pass_print_entries)" +complete -c $PROG -f -n '__fish_pass_uses_command -c' -a "(__fish_pass_print_entries)" +complete -c $PROG -f -n '__fish_pass_uses_command --clip' -a "(__fish_pass_print_entries)" + +complete -c $PROG -f -n '__fish_pass_needs_command' -a git -d 'Command: execute a git command' +complete -c $PROG -f -n '__fish_pass_uses_command git' -a '(__fish_pass_git_complete)' +complete -c $PROG -f -n '__fish_pass_needs_command' -a find -d 'Command: find a password file or directory matching pattern' +complete -c $PROG -f -n '__fish_pass_needs_command' -a grep -d 'Command: search inside of decrypted password files for matching pattern' +complete -c $PROG -f -n '__fish_pass_uses_command grep' -a '(begin + set -l cmd (commandline -opc) (commandline -ct) + set -e cmd[1 2] # Drop "pass grep". + complete -C"grep $cmd" +end)' + diff --git a/.config/fish/conf.d/dracula.fish b/.config/fish/conf.d/dracula.fish new file mode 100644 index 0000000..e467e6d --- /dev/null +++ b/.config/fish/conf.d/dracula.fish @@ -0,0 +1,33 @@ +# Dracula Color Palette +set -l foreground f8f8f2 +set -l selection 44475a +set -l comment 6272a4 +set -l red ff5555 +set -l orange ffb86c +set -l yellow f1fa8c +set -l green 50fa7b +set -l purple bd93f9 +set -l cyan 8be9fd +set -l pink ff79c6 + +# Syntax Highlighting Colors +set -g fish_color_normal $foreground +set -g fish_color_command $cyan +set -g fish_color_keyword $pink +set -g fish_color_quote $yellow +set -g fish_color_redirection $foreground +set -g fish_color_end $orange +set -g fish_color_error $red +set -g fish_color_param $purple +set -g fish_color_comment $comment +set -g fish_color_selection --background=$selection +set -g fish_color_search_match --background=$selection +set -g fish_color_operator $green +set -g fish_color_escape $pink +set -g fish_color_autosuggestion $comment + +# Completion Pager Colors +set -g fish_pager_color_progress $comment +set -g fish_pager_color_prefix $cyan +set -g fish_pager_color_completion $foreground +set -g fish_pager_color_description $comment diff --git a/.config/fish/config.fish b/.config/fish/config.fish new file mode 100644 index 0000000..e113322 --- /dev/null +++ b/.config/fish/config.fish @@ -0,0 +1,24 @@ +#!/usr/bin/env fish +abbr -a cls clear +abbr -a ls lsd + +export DENO_INSTALL="/home/luca/.deno" +export PATH="/bin:$DENO_INSTALL/bin:/home/luca/.cargo/bin:/home/luca/.local/bin:$HOME/bin:$HOME/.dprint/bin:$PATH" +export EDITOR=nvim + +export MANPAGER="sh -c 'col -bx | bat -l man -p'" +alias cat='bat --paging=never -p' + +deno completions fish | source +arduino-cli completion fish | source +starship completions fish | source +starship init fish | source + + +function fish_greeting + #fastfetch + fortune -s | cowsay -f (ls /usr/share/cows/*.cow | shuf -n1) | lolcat -t -F 0.3 +end + +funcsave fish_greeting + diff --git a/.config/fish/fish_plugins b/.config/fish/fish_plugins new file mode 100644 index 0000000..fd0366e --- /dev/null +++ b/.config/fish/fish_plugins @@ -0,0 +1 @@ +dracula/fish diff --git a/.config/fish/fish_variables b/.config/fish/fish_variables new file mode 100644 index 0000000..25cfd4b --- /dev/null +++ b/.config/fish/fish_variables @@ -0,0 +1,34 @@ +# This file contains fish universal variable definitions. +# VERSION: 3.0 +SETUVAR __fish_initialized:3100 +SETUVAR _fish_abbr_cls:clear +SETUVAR _fish_abbr_ls:lsd +SETUVAR _fisher_dracula_2F_fish_files:/home/luca/\x2econfig/fish/conf\x2ed/dracula\x2efish +SETUVAR _fisher_plugins:dracula/fish +SETUVAR fish_color_autosuggestion:555\x1ebrblack +SETUVAR fish_color_cancel:\x2dr +SETUVAR fish_color_command:005fd7 +SETUVAR fish_color_comment:990000 +SETUVAR fish_color_cwd:green +SETUVAR fish_color_cwd_root:red +SETUVAR fish_color_end:009900 +SETUVAR fish_color_error:ff0000 +SETUVAR fish_color_escape:00a6b2 +SETUVAR fish_color_history_current:\x2d\x2dbold +SETUVAR fish_color_host:normal +SETUVAR fish_color_host_remote:yellow +SETUVAR fish_color_normal:normal +SETUVAR fish_color_operator:00a6b2 +SETUVAR fish_color_param:00afff +SETUVAR fish_color_quote:999900 +SETUVAR fish_color_redirection:00afff +SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack +SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack +SETUVAR fish_color_status:red +SETUVAR fish_color_user:brgreen +SETUVAR fish_color_valid_path:\x2d\x2dunderline +SETUVAR fish_key_bindings:fish_default_key_bindings +SETUVAR fish_pager_color_completion:\x1d +SETUVAR fish_pager_color_description:B3A06D\x1eyellow +SETUVAR fish_pager_color_prefix:white\x1e\x2d\x2dbold\x1e\x2d\x2dunderline +SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan diff --git a/.config/fish/functions/br.fish b/.config/fish/functions/br.fish new file mode 120000 index 0000000..f09fb22 --- /dev/null +++ b/.config/fish/functions/br.fish @@ -0,0 +1 @@ +/home/luca/.local/share/broot/launcher/fish/br.fish
\ No newline at end of file diff --git a/.config/fish/functions/fish_greeting.fish b/.config/fish/functions/fish_greeting.fish new file mode 100644 index 0000000..671c5a0 --- /dev/null +++ b/.config/fish/functions/fish_greeting.fish @@ -0,0 +1,4 @@ +function fish_greeting + #fastfetch + fortune -s | cowsay -f (ls /usr/share/cows/*.cow | shuf -n1) | lolcat -t -F 0.3 +end |