Add fish.

This commit is contained in:
raute 2023-11-29 17:36:43 +01:00
parent f80321ea86
commit f5fa6382c7
3 changed files with 224 additions and 0 deletions

64
fish/abbr.fish Normal file
View File

@ -0,0 +1,64 @@
abbr -a -- ak add_key
abbr -a -- bc ~/.programme/Bridge_Constructor/start.sh
abbr -a -- c 'cal -yw'
abbr -a -- cd. 'cd .'
abbr -a -- cd.. 'cd ..'
abbr -a -- cp 'cp -i'
abbr -a -- cs sshconf
abbr -a -- d diesel
abbr -a -- df 'df -h'
abbr -a -- docs ~/scripts/docs/doc.sh
abbr -a -- du 'du -hs'
abbr -a -- e eva
abbr -a -- f filemanager
abbr -a -- gl 'git log'
abbr -a -- gp 'git pull'
abbr -a -- gs 'git status'
abbr -a -- ht htop
abbr -a -- ik ikhal
abbr -a -- ipa 'ip a'
abbr -a -- k 'khal calendar'
abbr -a -- labtuer 'ssh lltuer'
abbr -a -- la 'ls -lah'
abbr -a -- lcd last_cd
abbr -a -- le 'less -iS'
abbr -a -- les 'less -iS'
abbr -a -- ll 'ls -lah'
abbr -a -- llp llplenum
abbr -a -- l ls
abbr -a -- lt 'ls -laht | head'
abbr -a -- mpc mpv
abbr -a -- mv 'mv -i'
abbr -a -- nb newsboat
abbr -a -- ncdu 'ncdu --si'
abbr -a -- nm notmuch
abbr -a -- n 'nvim ~/Sync/Pixel/Documents/markor/QuickNote.md'
abbr -a -- off 'sudo sys poweroff'
abbr -a -- ö ls
abbr -a -- oneko 'i3-msg move container to workspace 10 && oneko -speed 35 -dog && exit'
abbr -a -- o open
abbr -a -- ös ls
abbr -a -- pb podboat
abbr -a -- pig 'ping 8.8.8.8'
abbr -a -- ps 'ps -fe | rg'
abbr -a -- py python3
abbr -a -- reboot 'sudo sys reboot'
abbr -a -- rm 'rm -i'
abbr -a -- sido sudo
abbr -a -- sp 'sudo pkg'
abbr -a -- srv 'sudo srv'
abbr -a -- s ssh
abbr -a -- sys 'sudo sys'
abbr -a -- tdb 'wine ~/.wine/drive_c/Program Files/dataweb/TurboDB Studio 5/Bin/TurboDBStudio5.exe'
abbr -a -- td 'nvim ~/Sync/Pixel/Documents/markor/todo.txt'
abbr -a -- tor '~/.programme/tor-browser_en-US/Browser/start-tor-browser && exit'
abbr -a -- t trash
abbr -a -- udo sudo
abbr -a -- vd vidir
abbr -a -- vim nvim
abbr -a -- v nvim
abbr -a -- wc 'wc -l'
abbr -a -- wow 'i3-msg move container to workspace 10 && start_wow && exit'
abbr -a -- wpw 'i3-msg move container to workspace 10 && start_wow && exit'
abbr -a -- y 'shadowplay && exit'
abbr -a -- z zathura

159
fish/config.fish Normal file
View File

@ -0,0 +1,159 @@
set -x EDITOR /usr/bin/nvim
set -x VISUAL /usr/bin/nvim
alias ls eza
functions --copy cd __fish_cd
function cd
if [ "$argv[1]" = "" ]
set dir (fd -t d | fzf)
else
set dir "$argv[1]"
end
if [ "$dir" != "" ]
__fish_cd "$dir" && pwd > /tmp/last_cd
end
end
function cl
cd $argv[1] && ls
end
function last_cd
__fish_cd (cat /tmp/last_cd)
end
function fish_greeting
end
function fish_prompt
end
function custom_vi_bindings
fish_vi_key_bindings
bind -M insert -m default jj backward-char force-repaint
#bind -M insert -m default kk backward-char force-repaint
end
set -g fish_key_bindings custom_vi_bindings
function mkcd
mkdir -p $argv[1]
cd $argv[1]
end
function fzf_search
set p (fzf)
if [ $status = 0 ]
if not string match "* " (commandline)
commandline -a " "
end
commandline -a $p
end
end
bind -M insert \cf fzf_search
source ~/scripts/ssh-agent.fish 2>/dev/null
source ~/.config/fish/config.local 2>/dev/null
source ~/.config/fish/abbr.fish 2>/dev/null
set -x PATH "$HOME/scripts" /opt/uif $PATH
set -x PYTHONPATH "$HOME/scripts" $PYTHONPATH
set -x PATH "$HOME/.cargo/bin" $PATH
set -x SVDIR "$HOME/.service"
# Start flavours
set base00 282936
set base01 3a3c4e
set base02 4d4f68
set base03 626483
set base04 62d6e8
set base05 e9e9f4
set base06 f1f2f8
set base07 f7f7fb
set base08 ea51b2
set base09 b45bcf
set base0A 00f769
set base0B ebff87
set base0C a1efe4
set base0D 62d6e8
set base0E b45bcf
set base0F 00f769
# End flavours
set -x LS_COLORS (cat ~/.config/fish/ls_colors)
set fish_color_autosuggestion $base03 $base00
set fish_color_cancel -r
set fish_color_command $base04
set fish_color_comment $base03
# set fish_color_cwd green
# set fish_color_cwd_root red
# set fish_color_end green
# set fish_color_error brred
# set fish_color_escape brcyan
# set fish_color_history_current --bold
# set fish_color_host normal
# set fish_color_host_remote yellow
# set fish_color_normal normal
# set fish_color_operator brcyan
# set fish_color_param cyan
# set fish_color_quote yellow
# set fish_color_redirection 'cyan' '--bold'
# set fish_color_search_match --background=111
# set fish_color_selection 'white' '--bold' '--background=brblack'
# set fish_color_status red
# set fish_color_user brgreen
# set fish_color_valid_path --underline
# set fish_pager_color_completion normal
# set fish_pager_color_description 'B3A06D' 'yellow' '-i'
# set fish_pager_color_prefix 'cyan' '--bold' '--underline'
# set fish_pager_color_progress 'brwhite' '--background=cyan'
# set fish_pager_color_selected_background -r
function fish_mode_prompt
set last_status $status
if [ "$fish_key_bindings" = "fish_vi_key_bindings" ]
switch $fish_bind_mode
case default
set mode_indicator " N "
set indicator_colour $base04
case insert
set mode_indicator " I "
set indicator_colour $base0A
case replace_one
set mode_indicator " R "
set indicator_colour $base08
case visual
set mode_indicator " V "
set indicator_colour $base0E
end
end
set_color -b $indicator_colour black
echo -n "$mode_indicator"
if [ "$last_status" != "0" ]
set_color -b $base08 $base05
echo -n " $last_status "
end
set_color -b $base02 $base05
echo -n " $USER "
set_color -b $base01 $base05
echo -n " "
echo -n (pwd | sd "/home/$USER" "~") # | sed -E "s!/(.).*/!/\1/!g")
echo -n " "
set_color normal
set_color $base01
echo -n "┃ "
set_color normal
if [ $CMD_DURATION -gt 3000 ]
echo -ne '\007'
end
end

1
fish/ls_colors Normal file

File diff suppressed because one or more lines are too long