My personal dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

155 lines
5.3 KiB

##
## B I N D I N G S
##
function hybrid_bindings --description "Vi-style bindings that inherit emacs-style bindings in all modes"
for mode in default insert visual
fish_default_key_bindings -M $mode
end
fish_vi_key_bindings --no-erase
end
set -g fish_key_bindings hybrid_bindings
##
## S E T T I N G S
##
# Colors
set -gx CLICOLOR 1
set -gx TERM xterm-256color
# Colored man pages
set -x LESS_TERMCAP_mb (printf "\033[01;31m")
set -x LESS_TERMCAP_md (printf "\033[01;31m")
set -x LESS_TERMCAP_me (printf "\033[0m")
set -x LESS_TERMCAP_se (printf "\033[0m")
set -x LESS_TERMCAP_so (printf "\033[01;44;33m")
set -x LESS_TERMCAP_ue (printf "\033[0m")
set -x LESS_TERMCAP_us (printf "\033[01;32m")
##
## A L I A S E S
##
# Misc
alias :q 'exit'
alias less 'less -R'
alias grep 'grep --color=always'
6 years ago
alias ed '/usr/bin/ed -p:'
alias f 'fg'
alias j 'jobs'
# List directory contents
alias lsa 'ls -lah --color'
alias l 'ls --color'
6 years ago
alias ll 'ls++'
alias la 'ls -A --color'
alias ls 'ls --color'
# Push and pop directories on directory stack
alias md 'mkdir -p'
alias rd rmdir
alias d 'dirs -v | head -10'
# Emacs clients
6 years ago
alias e 'emacs -nw'
alias et 'emacsclient -t'
alias ec 'emacsclient -c'
alias magit 'ed -eval "(progn (magit-status)(delete-other-windows))"'
##
## P R O M P T
##
function fish_prompt --description 'Write out the prompt'
if not set -q __fish_git_prompt_show_informative_status
set -g __fish_git_prompt_show_informative_status 1
end
if not set -q __fish_git_prompt_hide_untrackedfiles
set -g __fish_git_prompt_hide_untrackedfiles 1
end
if not set -q __fish_git_prompt_color_branch
set -g __fish_git_prompt_color_branch magenta --bold
end
if not set -q __fish_git_prompt_showupstream
set -g __fish_git_prompt_showupstream "informative"
end
if not set -q __fish_git_prompt_char_upstream_ahead
set -g __fish_git_prompt_char_upstream_ahead "↑"
end
if not set -q __fish_git_prompt_char_upstream_behind
set -g __fish_git_prompt_char_upstream_behind "↓"
end
if not set -q __fish_git_prompt_char_upstream_prefix
set -g __fish_git_prompt_char_upstream_prefix ""
end
if not set -q __fish_git_prompt_char_stagedstate
set -g __fish_git_prompt_char_stagedstate "●"
end
if not set -q __fish_git_prompt_char_dirtystate
set -g __fish_git_prompt_char_dirtystate "✚"
end
if not set -q __fish_git_prompt_char_untrackedfiles
set -g __fish_git_prompt_char_untrackedfiles "…"
end
if not set -q __fish_git_prompt_char_conflictedstate
set -g __fish_git_prompt_char_conflictedstate "✖"
end
if not set -q __fish_git_prompt_char_cleanstate
set -g __fish_git_prompt_char_cleanstate "✔"
end
if not set -q __fish_git_prompt_color_dirtystate
set -g __fish_git_prompt_color_dirtystate blue
end
if not set -q __fish_git_prompt_color_stagedstate
set -g __fish_git_prompt_color_stagedstate yellow
end
if not set -q __fish_git_prompt_color_invalidstate
set -g __fish_git_prompt_color_invalidstate red
end
if not set -q __fish_git_prompt_color_untrackedfiles
set -g __fish_git_prompt_color_untrackedfiles $fish_color_normal
end
if not set -q __fish_git_prompt_color_cleanstate
set -g __fish_git_prompt_color_cleanstate green --bold
end
set -l last_status $status
if not set -q __fish_prompt_normal
set -g __fish_prompt_normal (set_color normal)
end
set -l color_cwd
set -l prefix
switch $USER
case root toor
if set -q fish_color_cwd_root
set color_cwd $fish_color_cwd_root
else
set color_cwd $fish_color_cwd
end
set suffix '#'
case '*'
set color_cwd $fish_color_cwd
set suffix '$'
end
# PWD
set_color --bold blue #$color_cwd
echo -n (echo $PWD | sed -e "s|^$HOME|~|")
set_color normal
printf '%s ' (__fish_vcs_prompt)
if not test $last_status -eq 0
set_color $fish_color_error
end
echo -n "$suffix "
set_color normal
end
function fish_right_prompt -d "Write out the right prompt"
6 years ago
echo (jobs -c ^ /dev/null | head -1) "["(date +%H:%M:%S)"]"
end