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.

config.fish 5.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. ##
  2. ## B I N D I N G S
  3. ##
  4. function hybrid_bindings --description "Vi-style bindings that inherit emacs-style bindings in all modes"
  5. for mode in default insert visual
  6. fish_default_key_bindings -M $mode
  7. end
  8. fish_vi_key_bindings --no-erase
  9. end
  10. set -g fish_key_bindings hybrid_bindings
  11. ##
  12. ## S E T T I N G S
  13. ##
  14. # Colors
  15. set -gx CLICOLOR 1
  16. set -gx TERM xterm-256color
  17. # Colored man pages
  18. set -x LESS_TERMCAP_mb (printf "\033[01;31m")
  19. set -x LESS_TERMCAP_md (printf "\033[01;31m")
  20. set -x LESS_TERMCAP_me (printf "\033[0m")
  21. set -x LESS_TERMCAP_se (printf "\033[0m")
  22. set -x LESS_TERMCAP_so (printf "\033[01;44;33m")
  23. set -x LESS_TERMCAP_ue (printf "\033[0m")
  24. set -x LESS_TERMCAP_us (printf "\033[01;32m")
  25. ##
  26. ## A L I A S E S
  27. ##
  28. # Misc
  29. alias :q 'exit'
  30. alias less 'less -R'
  31. alias grep 'grep --color=always'
  32. alias ed '/usr/bin/ed -p:'
  33. alias f 'fg'
  34. alias j 'jobs'
  35. # List directory contents
  36. alias lsa 'ls -lah --color'
  37. alias l 'ls --color'
  38. alias ll 'ls++'
  39. alias la 'ls -A --color'
  40. alias ls 'ls --color'
  41. # Push and pop directories on directory stack
  42. alias md 'mkdir -p'
  43. alias rd rmdir
  44. alias d 'dirs -v | head -10'
  45. # Emacs clients
  46. alias e 'emacs -nw'
  47. alias et 'emacsclient -t'
  48. alias ec 'emacsclient -c'
  49. alias magit 'ed -eval "(progn (magit-status)(delete-other-windows))"'
  50. ##
  51. ## P R O M P T
  52. ##
  53. function fish_prompt --description 'Write out the prompt'
  54. if not set -q __fish_git_prompt_show_informative_status
  55. set -g __fish_git_prompt_show_informative_status 1
  56. end
  57. if not set -q __fish_git_prompt_hide_untrackedfiles
  58. set -g __fish_git_prompt_hide_untrackedfiles 1
  59. end
  60. if not set -q __fish_git_prompt_color_branch
  61. set -g __fish_git_prompt_color_branch magenta --bold
  62. end
  63. if not set -q __fish_git_prompt_showupstream
  64. set -g __fish_git_prompt_showupstream "informative"
  65. end
  66. if not set -q __fish_git_prompt_char_upstream_ahead
  67. set -g __fish_git_prompt_char_upstream_ahead "↑"
  68. end
  69. if not set -q __fish_git_prompt_char_upstream_behind
  70. set -g __fish_git_prompt_char_upstream_behind "↓"
  71. end
  72. if not set -q __fish_git_prompt_char_upstream_prefix
  73. set -g __fish_git_prompt_char_upstream_prefix ""
  74. end
  75. if not set -q __fish_git_prompt_char_stagedstate
  76. set -g __fish_git_prompt_char_stagedstate "●"
  77. end
  78. if not set -q __fish_git_prompt_char_dirtystate
  79. set -g __fish_git_prompt_char_dirtystate "✚"
  80. end
  81. if not set -q __fish_git_prompt_char_untrackedfiles
  82. set -g __fish_git_prompt_char_untrackedfiles "…"
  83. end
  84. if not set -q __fish_git_prompt_char_conflictedstate
  85. set -g __fish_git_prompt_char_conflictedstate "✖"
  86. end
  87. if not set -q __fish_git_prompt_char_cleanstate
  88. set -g __fish_git_prompt_char_cleanstate "✔"
  89. end
  90. if not set -q __fish_git_prompt_color_dirtystate
  91. set -g __fish_git_prompt_color_dirtystate blue
  92. end
  93. if not set -q __fish_git_prompt_color_stagedstate
  94. set -g __fish_git_prompt_color_stagedstate yellow
  95. end
  96. if not set -q __fish_git_prompt_color_invalidstate
  97. set -g __fish_git_prompt_color_invalidstate red
  98. end
  99. if not set -q __fish_git_prompt_color_untrackedfiles
  100. set -g __fish_git_prompt_color_untrackedfiles $fish_color_normal
  101. end
  102. if not set -q __fish_git_prompt_color_cleanstate
  103. set -g __fish_git_prompt_color_cleanstate green --bold
  104. end
  105. set -l last_status $status
  106. if not set -q __fish_prompt_normal
  107. set -g __fish_prompt_normal (set_color normal)
  108. end
  109. set -l color_cwd
  110. set -l prefix
  111. switch $USER
  112. case root toor
  113. if set -q fish_color_cwd_root
  114. set color_cwd $fish_color_cwd_root
  115. else
  116. set color_cwd $fish_color_cwd
  117. end
  118. set suffix '#'
  119. case '*'
  120. set color_cwd $fish_color_cwd
  121. set suffix '$'
  122. end
  123. # PWD
  124. set_color --bold blue #$color_cwd
  125. echo -n (echo $PWD | sed -e "s|^$HOME|~|")
  126. set_color normal
  127. printf '%s ' (__fish_vcs_prompt)
  128. if not test $last_status -eq 0
  129. set_color $fish_color_error
  130. end
  131. echo -n "$suffix "
  132. set_color normal
  133. end
  134. function fish_right_prompt -d "Write out the right prompt"
  135. echo (jobs -c ^ /dev/null | head -1) "["(date +%H:%M:%S)"]"
  136. end