Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Set environment
- set TERM "xterm-256color"
- set EDITOR "micro"
- set VISUAL "kate"
- set fish_greeting
- ## Source .profile to apply its values
- source ~/.profile
- ## Lambda theme https://github.com/hasanozgan/theme-lambda
- function fish_prompt
- # Cache exit status
- set -l last_status $status
- # Just calculate these once, to save a few cycles when displaying the prompt
- if not set -q __fish_prompt_hostname
- set -g __fish_prompt_hostname (hostname|cut -d . -f 1)
- end
- if not set -q __fish_prompt_char
- switch (id -u)
- case 0
- set -g __fish_prompt_char '#'
- case '*'
- set -g __fish_prompt_char (set_color F00; echo λ)
- end
- end
- # Setup colors
- #use extended color pallete if available
- #if [[ $terminfo[colors] -ge 256 ]]; then
- # turquoise="%F{81}"
- # orange="%F{166}"
- # purple="%F{135}"
- # hotpink="%F{161}"
- # limegreen="%F{118}"
- #else
- # turquoise="%F{cyan}"
- # orange="%F{yellow}"
- # purple="%F{magenta}"
- # hotpink="%F{red}"
- # limegreen="%F{green}"
- #fi
- set -l normal (set_color normal)
- set -l white (set_color FFFFFF)
- set -l turquoise (set_color 5fdfff)
- set -l orange (set_color df5f00)
- set -l hotpink (set_color df005f)
- set -l blue (set_color blue)
- set -l limegreen (set_color 87ff00)
- set -l purple (set_color af5fff)
- # Configure __fish_git_prompt
- set -g __fish_git_prompt_char_stateseparator ' '
- set -g __fish_git_prompt_color 5fdfff
- set -g __fish_git_prompt_color_flags df5f00
- set -g __fish_git_prompt_color_prefix white
- set -g __fish_git_prompt_color_suffix white
- set -g __fish_git_prompt_showdirtystate true
- set -g __fish_git_prompt_showuntrackedfiles true
- set -g __fish_git_prompt_showstashstate true
- set -g __fish_git_prompt_show_informative_status true
- set -l current_user (whoami)
- # Line 1
- echo -n $white'╭─'$hotpink$current_user$white' at '$orange$__fish_prompt_hostname$white' in '$limegreen(pwd|sed "s=$HOME=⌁=")$turquoise
- __fish_git_prompt " (%s)"
- echo
- # Line 2
- echo -n $white'╰'
- # support for virtual env name
- if set -q VIRTUAL_ENV
- echo -n "($turquoise"(basename "$VIRTUAL_ENV")"$white)"
- end
- echo -n $white'─'$__fish_prompt_char $normal
- end
- # Functions needed for !! and !$ https://github.com/oh-my-fish/plugin-bang-bang
- function __history_previous_command
- switch (commandline -t)
- case "!"
- commandline -t $history[1]; commandline -f repaint
- case "*"
- commandline -i !
- end
- end
- function __history_previous_command_arguments
- switch (commandline -t)
- case "!"
- commandline -t ""
- commandline -f history-token-search-backward
- case "*"
- commandline -i '$'
- end
- end
- if [ $fish_key_bindings = fish_vi_key_bindings ];
- bind -Minsert ! __history_previous_command
- bind -Minsert '$' __history_previous_command_arguments
- else
- bind ! __history_previous_command
- bind '$' __history_previous_command_arguments
- end
- ## Fish command history
- function history
- builtin history --show-time='%F %T '
- end
- function backup --argument filename
- cp $filename $filename.bak
- end
- ## Copy DIR1 DIR2
- function copy
- set count (count $argv | tr -d \n)
- if test "$count" = 2; and test -d "$argv[1]"
- set from (echo $argv[1] | trim-right /)
- set to (echo $argv[2])
- command cp -r $from $to
- else
- command cp $argv
- end
- end
- ## Useful aliases
- alias ls='exa -al --color=always --group-directories-first' # preferred listing
- alias la='exa -a --color=always --group-directories-first' # all files and dirs
- alias ll='exa -l --color=always --group-directories-first' # long format
- alias lt='exa -aT --color=always --group-directories-first' # tree listing
- alias l.="exa -a | egrep '^\.'"
- alias aup="pamac upgrade --aur"
- alias grubup="sudo update-grub"
- alias fixpacman="sudo rm /var/lib/pacman/db.lck"
- alias tarnow='tar -acf '
- alias untar='tar -zxvf '
- alias wget='wget -c '
- alias psmem='ps auxf | sort -nr -k 4'
- alias psmem10='ps auxf | sort -nr -k 4 | head -10'
- alias upd='sudo reflector --latest 5 --age 2 --fastest 5 --protocol https --sort rate --save /etc/pacman.d/mirrorlist && cat /etc/pacman.d/mirrorlist && sudo pacman -Syu && fish_update_completions'
- alias ..='cd ..'
- alias ...='cd ../..'
- alias ....='cd ../../..'
- alias .....='cd ../../../..'
- alias ......='cd ../../../../..'
- alias dir='dir --color=auto'
- alias vdir='vdir --color=auto'
- alias grep='grep --color=auto'
- alias fgrep='fgrep --color=auto'
- alias egrep='egrep --color=auto'
- alias hw='hwinfo --short' #Hardware Info
- alias big="expac -H M '%m\t%n' | sort -h | nl" #Sort installed packages according to size in MB (expac must be installed)
- #get fastest mirrors
- alias mirror="sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist"
- alias mirrord="sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist"
- alias mirrors="sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist"
- alias mirrora="sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist"
- ## Import colorscheme from 'wal' asynchronously
- if type "wal" >> /dev/null 2>&1
- cat ~/.cache/wal/sequences
- end
- ## Run paleofetch if session is interactive
- if status --is-interactive
- paleofetch
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement