firefly avatar firefly committed a5257a0

Small fixes in vim config files, and fancier zsh prompt.

Comments (0)

Files changed (8)

 
 #### Setup prompt ###################################################
 color() {
-	case $1 in
-		white   ) echo 30; return ;;
-		red     ) echo 31; return ;;
-		green   ) echo 32; return ;;
-		yellow  ) echo 33; return ;;
-		blue    ) echo 34; return ;;
-		magenta ) echo 35; return ;;
-		cyan    ) echo 36; return ;;
-		*       ) echo  1; return ;; # bold → "something's wrong"
-	esac
+  case $1 in
+    white   ) echo 30; return ;;
+    red     ) echo 31; return ;;
+    green   ) echo 32; return ;;
+    yellow  ) echo 33; return ;;
+    blue    ) echo 34; return ;;
+    magenta ) echo 35; return ;;
+    cyan    ) echo 36; return ;;
+    *       ) echo  1; return ;; # bold → "something's wrong"
+  esac
 }
 
 prompt_format="\e[`color $prompt_color`m"
 
-PS1="[\[$prompt_format\]\u@\h\[\e[m\] \w]\$ "
+PS1="\[$prompt_format\]\u@\h\[\e[m\] \w\n\$ "
 
 #### Setup autocompletion ###########################################
 man() {
-	env \
-		LESS_TERMCAP_mb=$(printf "\e[1;37m") \
-		LESS_TERMCAP_md=$(printf "\e[1;37m") \
-		LESS_TERMCAP_me=$(printf "\e[0m") \
-		LESS_TERMCAP_se=$(printf "\e[0m") \
-		LESS_TERMCAP_so=$(printf "\e[1;47;30m") \
-		LESS_TERMCAP_ue=$(printf "\e[0m") \
-		LESS_TERMCAP_us=$(printf "\e[0;36m") \
-			man "$@"
+  env \
+    LESS_TERMCAP_mb=$(printf "\e[1;37m") \
+    LESS_TERMCAP_md=$(printf "\e[1;37m") \
+    LESS_TERMCAP_me=$(printf "\e[0m") \
+    LESS_TERMCAP_se=$(printf "\e[0m") \
+    LESS_TERMCAP_so=$(printf "\e[1;47;30m") \
+    LESS_TERMCAP_ue=$(printf "\e[0m") \
+    LESS_TERMCAP_us=$(printf "\e[0;36m") \
+      man "$@"
 }
 
 complete -cf man

herbstluftwm/autostart

 hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' tag=float
 hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on
 hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK)' manage=off
-#hc rule class='Steam' pseudotile=on
 
 # unlock, just to be sure
 hc unlock
 export DEVKITARM="${DEVKITPRO}/devkitARM"
 
 export GOPATH="$HOME/prog/lang/go/site:$HOME/prog/lang/go:$GOPATH"
+export ABSROOT="$HOME/local/abs"
 
 if [ "$TERM" = "xterm" ]; then
   TERM="${TERM}-256color"

vim/syntax/note.vim

 
 syn region  noteHeading                   oneline  contains=noteHeadingSub
 \           start="^\s*#\+" end="#*\s*$"
+syn match   noteHeading  "^\%(\d\.\)\+\s.*"
 
 syn match   noteHeadingSub "#"                     contained conceal cchar=░
 
 syn region  noteMathBlock       matchgroup=Ignore  oneline
 \           start="^|" end="$"
 
-syn match   noteListMarker      "^\s*\zs\*\ze " conceal cchar=•
+syn match   noteListMarker      "^\s\+\zs\*\ze " conceal cchar=•
 \                               skipwhite nextgroup=noteDefnList
-syn match   noteListMarker      "^\s*\zs(\*)\ze " conceal cchar=⍟
+syn match   noteListMarker      "^\s\+\zs(\*)\ze " conceal cchar=⍟
 \                               skipwhite nextgroup=noteDefnList
-syn match   noteListMarker      "^\s*\zs+\ze "  conceal cchar=◦
+syn match   noteListMarker      "^\s\+\zs+\ze "  conceal cchar=◦
 \                               skipwhite nextgroup=noteDefnList
-syn match   noteListMarker      "^\s*\zs-\ze "  conceal cchar=‒
+syn match   noteListMarker      "^\s\+\zs-\ze "  conceal cchar=‒
 \                               skipwhite nextgroup=noteDefnList
-syn match   noteListMarker      "^\s*\zs\d\+\.\ze "
+syn match   noteListMarker      "^\s\+\zs\d\+\.\ze "
 
-syn match   noteListMarker      "^\s*\zs\w\+)\ze "
+syn match   noteListMarker      "^\s\+\zs\w\+)\ze "
 
-syn match   noteDefnList        "^\s*\zs\w\+:\ze "
+syn match   noteDefnList        "^\s\+\zs\w\+:\ze "
 syn match   noteDefnList        ".*:"           contained contains=TOP
 
 

vim/syntax/rfc.vim

 " Highlight [sic] here so it won't be highlighted as rfcReference
 syn match rfcKeyword  "\(MUST\(\s*[ \n]\+\s*NOT\)*\|REQUIRED\|SHALL\(\s*[ \n]\+\s*NOT\)*\|SHOULD\(\s*[ \n]\+\s*NOT\)*\|RECOMMENDED\|MAY\|OPTIONAL\|\[sic\]\)"
 
+syn region rfcCodeBlock  contains=TOP
+\ start="^ \+---- Begin code block -\+"  end="^ \+---- End code block -\+"
+
 hi link rfcTitle	Title
 hi link rfcTheTitle	Type
 hi link rfcRFCTitle	PreProc
 hi link rfcContents	Tag
 hi link rfcKeyword	Keyword
 
+hi link rfcCodeBlock	markdownCode
+
 let b:current_syntax = "rfc"
 
 
 """" Formatting etc. """"""""""""""""""""""""""""""""""""""""""""""""
-set formatoptions+=ro           " Auto-continue comments on <CR>/o/O
+"set formatoptions+=ro           " Auto-continue comments on <CR>/o/O
 set formatoptions+=n            " Indent numbered lists in comments better
 set formatoptions+=l            " Don't wrap lines that were already long
 set formatoptions+=j            " Remove comment leaders when joining
 
 
 " Add a few custom filetypes
-au BufRead,BufNewFile {*.json}               setf javascript
 au BufRead,BufNewFile {/usr/share/X11/xkb/*} setf xkb
 au BufRead,BufNewFile {*.md}                 setf markdown
 
+au BufRead,BufNewFile {*.json}               setf json
 au BufRead,BufNewFile {*.note,*.lecnote}     setf note
 au BufRead,BufNewFile {*.selfml}             setf selfml
-au BufRead,BufNewFile {*.todo,todo}          setf todo
 au BufRead,BufNewFile {*.ijx}                setf j
 au BufRead,BufNewFile {*.om}                 setf om
 au BufRead            {*/xchatlogs/*.log}    setf irclog | set ro noma

xkb/firefly.symbols

     // .qjkxbmwvz    :QJKXBMWVZ    ·∴∈∋=  <>≈@   ˙∵∉∌≠≢≤≥≉@
 };
 
-// vim:syn=xkb
-
 //default partial hidden modifier_keys
 //xkb_symbols "firefly-tweaks" {
 //	// Rebind caps to escape
 //
 ////	key <MENU> { [ Control_R,   Control_R  ] }; // ctrl:menu_rctrl
 //};
+
+// vim:syn=xkb
   echo -n "$Title"
 }
 
+# Print a dynamic, extra pretty RPROMPT.
+function precmd {
+  local text length code=$?
+
+  if [ $code != 0 ]; then
+    text="${fg[yellow]} $code${fg[red]} ✖"
+    length=${#:-"$code ✖"}
+  else
+    text="${fg[green]} ✔"
+    length=1
+  fi
+
+  echo -ne "\e[999C\e[$[$length]D${text}$reset_color\r\n"
+}
+
 if [ $TERM != 'linux' ]; then
   function chpwd {
     pwd="$(pwd | sed s:$HOME:~:)"
 fi
 
 ### Setup prompt
-PROMPT="%{$fg[$high_color]%}╭╴%{$fg[$prompt_color]%}%n@%m%{$reset_color%} %~
-╰%{${fg[yellow]}%}%# %{$reset_color%}"
-RPROMPT="%{$up%}[%{$fg[yellow]%}%?%{$reset_color%}]%{$down%}"
+PROMPT="${up}%{$fg[$prompt_color]%}%n@%m%{$reset_color%} %~
+%{${fg[yellow]}%}%# %{$reset_color%}"
+PS2="${fg[yellow]}» $reset_color"
 
-PS2="%{${up}$reset_color%}│»
-╰%{${fg[yellow]}%}» %{$reset_color%}"
+# see also: `precmd` above (for pseudo-RPROMPT)
 
 # History
 export HISTSIZE=2000
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.