Commits

firefly committed a4dbbdf

Updates! Added a bunch of vim syntax files etc.

  • Participants
  • Parent commits b74df08

Comments (0)

Files changed (16)

File config/herbstluftwm/autostart

 
 hc emit_hook reload
 
-#xsetroot -solid '#5A8E3A'
 xsetroot -solid '#111111'
+#feh --bg-fill $HOME/annat/diverse/wallpapers/internet-nodes.jpg
 
 
 # remove all existing keybindings
 hc keybind $Mod-Shift-space cycle_layout -1
 hc keybind $Mod-minus split vertical 0.5
 hc keybind $Mod-v split horizontal 0.5
-hc keybind $Mod-f floating toggle
+
 hc keybind $Mod-m fullscreen toggle
+hc keybind $Mod-f floating   toggle
 hc keybind $Mod-p pseudotile toggle
 
 # resizing
 
 hc set focus_follows_shift 1
 
-#hc set frame_bg_transparent 1
+hc set frame_bg_transparent 1
 hc set frame_border_width 1
 hc set window_border_width 1
 hc set window_border_inner_width 0
-hc set always_show_frame 1
+#hc set always_show_frame 1
 hc set frame_gap 8
 # add overlapping window borders
 hc set window_gap -1
 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='Conky' manage=off
+#hc rule class='Steam' manage=off
+hc rule class='Steam' pseudotile=on
 
 # unlock, just to be sure
 hc unlock

File config/herbstluftwm/panel.sh

 panel_left_width=600
 panel_right_width=$((${geometry[2]} - $panel_left_width))
 
-font="-*-fixed-medium-*-*-*-10-*-*-*-*-*-*-*"
+#font="-*-fixed-medium-*-*-*-10-*-*-*-*-*-*-*"
+font="DejaVu Sans Mono:pixelsize=10"
 bgcolor=$(herbstclient get frame_border_normal_color)
 selbg=$(herbstclient get window_border_active_color)
 selfg='#CCC'
                         Full|Unknown)  printf '^fg(#909090)%s' $status ;;
                         *)  printf '^fg(#909090)%s: ^fg()%d%%' $status $percent ;;
                       esac )"
-                    # if [ $status == Full ]; then
-                    # else
-                    # fi )"
 
         thermstatus="$( t='/sys/class/thermal/thermal_zone0'
                         curr=$(cat $t/temp)

File other/symbols

 // $XKeyboardConfig$
 // $XFree86: xc/programs/xkbcomp/symbols/se,v 1.5 2003/01/26 02:01:48 dawes Exp $
 
+// % xkbcomp :0 - | vim -
+
 default partial alphanumeric_keys xkb_symbols "crazy" {
     name[Group1]="Sweden - Dvorak";
 
     key <AB09> { [         v,          V,           at,           at ] };
     key <AB10> { [         z,          Z,           at,           at ] };
 
-    replace key <CAPS>  { type="ONE_LEVEL", [ Control_L  ] };
-    replace key <LCTL>  { type="ONE_LEVEL", [ VoidSymbol ] };
+    // Map up <CAPS> to act as a <LCTL>, and add symbols for each special key on
+    // the key's third-level (altgr + key).
+    replace key <LCTL>  { type="ONE_LEVEL", [ VoidSymbol ] }; // TODO: this is necessary--why?
+
+    replace key <TAB>   { type="THREE_LEVEL", [       Tab, ISO_Left_Tab, U21B9 ] };
+    replace key <CAPS>  { type="THREE_LEVEL", [ Control_L,    Control_L, U2388 ] };
+    replace key <LWIN>  { type="THREE_LEVEL", [   Super_L,      Super_L, U2B25 ] };
+    replace key <LALT>  { type="THREE_LEVEL", [     Alt_L,       Meta_L, U2325 ] };
+    replace key <RTSH>  { type="THREE_LEVEL", [   Shift_L,      Shift_L, U21E7 ] };
+    replace key <DELE>  { type="THREE_LEVEL", [    Delete,       Delete, U2326 ] };
+    replace key <BKSP>  { type="THREE_LEVEL", [ BackSpace,    BackSpace, U232B ] };
+    replace key <RTRN>  { type="THREE_LEVEL", [    Return,       Return, U23CE ] };
+    replace key <SPCE>  { type="FOUR_LEVEL",  [ space,  space,  U2423,  nobreakspace ] };
+
+    // Let <INS> insert combining keycap characters.
+    replace key <INS>   { type="THREE_LEVEL", [    Insert,       Insert, U20E3 ] };
 
   //replace key <MENU>  { type="ONE_LEVEL", [ ISO_Level5_Shift ] };
 
 //};
 
 
+//// Special keys placement
+//
+// qwertyuiop  '"{}\yuiop
+// asdfghijkl  +=()/←↓↑→
+// zxcvbnm,.-  <>[]|nm,.-
+//
+
+
 //default partial alphanumeric_keys xkb_symbols "crazy" {
 partial alphanumeric_keys xkb_symbols "crazy" {
     name[Group1]="Sweden - Dvorak";
 }
 
 ## Environment variables
+export TERMINAL=pangoterm # since $TERM has a special (termcap-related) meaning
 export EDITOR=vim
 #export VISUAL=gvim
 export PAGER=less
 export BROWSER=luakit
 
-#if [ x$TERM != xlinux ]; then
-#  export TERM=xterm
-#  export TERM=rxvt-unicode-256color
-#fi
-
 export GREP_OPTIONS='--color=auto' # -P
 export GREP_COLORS='cx=37'
 
 export LESS_TERMCAP_se=$'\e[m'
 
 export PATH="$PATH:$HOME/bin:$HOME/node_modules/.bin:$HOME/.cabal/bin"
+export NODE_PATH=/usr/lib/jsctags:$NODE_PATH
 
 export DEVKITPRO="/opt/devkitpro"
 export DEVKITARM="${DEVKITPRO}/devkitARM"
 export QT_IM_MODULE=ibus
 
 
-### Utility variables
-export brightness="/sys/class/backlight/intel_backlight/brightness"
-
-
 ## Aliases
 try_alias  ls    ls --color=auto
 #try_alias  grep  grep -P --color=auto
 alias .....="cd ../../../.."
 
 alias ff_colours='for i in `seq 30 37`; do echo -e "\e[0;${i}m $i \e[1;${i}m $i \e[m"; done'
-alias make-luakit="make clean && USE_UNIQUE=1 USE_LUAJIT=1 CC=clang make -j4"
+#alias make-luakit="make clean && USE_UNIQUE=1 USE_LUAJIT=1 CC=clang make -j4"
+alias make-luakit="make clean && USE_UNIQUE=1 CC=clang make -j4"
+
+alias tray='stalonetray -bg "#333" --geometry "1x1-0+0" --grow-gravity E -i 16 --log-level info'
+
+function thumb {
+  convert -resize 250x250 "$1" "${1/\./_thumb.}"
+}
 
 function mkdircd {
   mkdir "$@"
-  cd "${@[$#]}"  # (last argument)
+  cd "${@[$#]}"  # (last parameter)
 }
 
 # allow vim's :h to work in the shell, and make it behave like less

File vim/after/syntax/javascript.vim

 " JavaScript syntax file amendments.
 
-"""" Fix mistakes """""""""""""""""""""""""""""""""""""""""""""""""""
-" Allow `/m` in regex literals.
-syn clear   javaScriptRegexpString
-syn region  javaScriptRegexpString     start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+
-\           end=+/[gim]\{0,3\}\s*$+    end=+/[gim]\{0,3\}\s*[;.,)\]}]+me=e-1
-\           contains=@htmlPreproc oneline
-
-
 """" Extra syntax """""""""""""""""""""""""""""""""""""""""""""""""""
-syn keyword javaScriptMember  require exports
+"syn keyword javaScriptMember  require exports
 
 
 """" Add conceals """""""""""""""""""""""""""""""""""""""""""""""""""
 " we need the conceal feature (vim ≥ 7.3)
 if !has('conceal')
-    finish
+  finish
 endif
 
-" Remove existing syntax.
-syn clear javaScriptFunction
-syn clear javaScriptOperator
-syn clear javaScriptIdentifier
-syn clear javaScriptType
-
 " Add concealing for stuff
 syn match   jsNiceIdentifier  /\.prototype\%(\.\|\>\)/  conceal cchar=#
-syn match   jsNiceKeyword     /\<function\>/            conceal cchar=λ
+"syn match   jsNiceKeyword     /\<function\>/            conceal cchar=λ
 syn match   jsNiceKeyword     /\<instanceof\>/          conceal cchar=ᐊ"⊲ ⍃
 "syn keyword jsNiceKeyword     return                    conceal cchar=◄"←⇐⤆⇐⤆↵
-"syn match   jsNiceKeyword     /\<return\>/
-"syn match   jsNiceKeyword     /\<return\(\s\*{\)\@!/    conceal cchar=◄"←⇐⤆⇐⤆↵
 
 " Provide two versions of `this`; only conceal if used with `.` or `[]`
 syn match   jsNiceKeyword     /\<this\>/
 
 syn match   jsNiceOperator    /||/                      conceal cchar=∨
 syn match   jsNiceOperator    /&&/                      conceal cchar=∧
-syn match   jsNiceOperator    /\^/                      conceal cchar=⊻"⨁
+"syn match  jsNiceOperator    /\^/                      conceal cchar=⊻"⨁
+
+
+"syn match  jsTestThing       /\.inherit/
+"hi jsTestThing ctermfg=red ctermbg=yellow
 
 syn match   jsNiceKeyword     /\<Math\.PI\>/            conceal cchar=π
 syn match   jsNiceOperator    /\<Infinity\>/            conceal cchar=∞
 
+" Use lambda for 'function' keyword
+syn clear   javaScriptFunctionKeyword
+syn keyword javaScriptFunctionKeyword  function  skipwhite  conceal cchar=λ
+\           nextgroup=javaScriptReservedWord,javaScriptFunctionName,javaScriptFunctionParameters,javaScriptFunctionError
+
+" Add fancy .inherit( ... ) sugar as pseudo-operator
+"syn clear   javaScriptMemberDot
+"syn match   javaScriptMemberDot "\.\<" skipwhite nextgroup=@javaScriptIdentifier
+syn match   jsFancyInherits   /\.inherit/  conceal
+\                             nextgroup=jsFancyInheritsParens
+\                             contains=jsFancyInheritsPrefixLetter
+
+syn region  jsFancyInheritsParens  matchgroup=Conceal  concealends  contained
+\                                  start=/(/  end=/)/  contains=TOP
+
+syn match   jsFancyInheritsPrefixLetter /h/  contained  conceal cchar= 
+syn match   jsFancyInheritsPrefixLetter /e/  contained  conceal cchar=ᐊ
+syn match   jsFancyInheritsPrefixLetter /r/  contained  conceal cchar= 
+
+"syn region  jsFancyInherits   matchgroup=Conceal  concealends
+"\                             cchar=a start=/\.inherit(/
+"\                             cchar=b end=/)/
+"\                             contains=TOP
+
 "syn match   jsNiceOperator   /<|/                      conceal cchar=ᐊ"⊲
 
 " Link the new syntactic groups to more general ones.
-hi  link javaScriptConstant  Constant
-hi  link jsNiceIdentifier    Identifier
-hi  link jsNiceOperator      Operator
-hi  link jsNiceKeyword       Keyword
+hi link jsNiceIdentifier    Identifier
+hi link jsNiceOperator      Operator
+hi link jsNiceKeyword       Keyword
 
-" Add back the unmodified keywords/other stuff
-syn match   javaScriptType       /\<\%(Function\|Date\|RegExp\|Array\|String\|Number\|Object\|Boolean\)\>/
-syn match   javaScriptConstant   /\<\u[A-Z0-9_]\+\>/ display
 
-syn keyword javaScriptOperator   delete new
-syn keyword javaScriptIdentifier arguments var let
-"syn keyword javaScriptOperator instanceof
-syn keyword javaScriptOperator typeof
+"syn keyword javaScriptOperator   delete new
+"syn keyword javaScriptIdentifier arguments var let
+""syn keyword javaScriptOperator instanceof
+"syn keyword javaScriptOperator typeof
 
 "hi! link javaScriptIdentifier Keyword
 

File vim/syntax/haskell.vim

+" Vim syntax file
+"
+" Modification of vims Haskell syntax file:
+"   - match types using regular expression
+"   - highlight toplevel functions
+"   - use "syntax keyword" instead of "syntax match" where appropriate
+"   - functions and types in import and module declarations are matched
+"   - removed hs_highlight_more_types (just not needed anymore)
+"   - enable spell checking in comments and strings only
+"   - FFI highlighting
+"   - QuasiQuotation
+"   - top level Template Haskell slices
+"   - PackageImport
+"
+" TODO: find out which vim versions are still supported
+"
+" From Original file:
+" ===================
+"
+" Language:		    Haskell
+" Maintainer:		Haskell Cafe mailinglist <haskell-cafe@haskell.org>
+" Last Change:		2010 Feb 21
+" Original Author:	John Williams <jrw@pobox.com>
+"
+" Thanks to Ryan Crumley for suggestions and John Meacham for
+" pointing out bugs. Also thanks to Ian Lynagh and Donald Bruce Stewart
+" for providing the inspiration for the inclusion of the handling
+" of C preprocessor directives, and for pointing out a bug in the
+" end-of-line comment handling.
+"
+" Options-assign a value to these variables to turn the option on:
+"
+" hs_highlight_delimiters - Highlight delimiter characters--users
+"			    with a light-colored background will
+"			    probably want to turn this on.
+" hs_highlight_boolean - Treat True and False as keywords.
+" hs_highlight_types - Treat names of primitive types as keywords.
+" hs_highlight_debug - Highlight names of debugging functions.
+" hs_allow_hash_operator - Don't highlight seemingly incorrect C
+"			   preprocessor directives but assume them to be
+"			   operators
+" 
+" 
+
+if version < 600
+  syn clear
+elseif exists("b:current_syntax")
+  finish
+endif
+
+"syntax sync fromstart "mmhhhh.... is this really ok to do so?
+syntax sync linebreaks=15 minlines=50 maxlines=500
+
+syn match  hsSpecialChar	contained "\\\([0-9]\+\|o[0-7]\+\|x[0-9a-fA-F]\+\|[\"\\'&\\abfnrtv]\|^[A-Z^_\[\\\]]\)"
+syn match  hsSpecialChar	contained "\\\(NUL\|SOH\|STX\|ETX\|EOT\|ENQ\|ACK\|BEL\|BS\|HT\|LF\|VT\|FF\|CR\|SO\|SI\|DLE\|DC1\|DC2\|DC3\|DC4\|NAK\|SYN\|ETB\|CAN\|EM\|SUB\|ESC\|FS\|GS\|RS\|US\|SP\|DEL\)"
+syn match  hsSpecialCharError	contained "\\&\|'''\+"
+sy region  hsString		start=+"+  skip=+\\\\\|\\"+  end=+"+  contains=hsSpecialChar,@Spell
+sy match   hsCharacter		"[^a-zA-Z0-9_']'\([^\\]\|\\[^']\+\|\\'\)'"lc=1 contains=hsSpecialChar,hsSpecialCharError
+sy match   hsCharacter		"^'\([^\\]\|\\[^']\+\|\\'\)'" contains=hsSpecialChar,hsSpecialCharError
+
+" (Qualified) identifiers (no default highlighting)
+syn match ConId "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=\<[A-Z][a-zA-Z0-9_']*\>"
+syn match VarId "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=\<[a-z][a-zA-Z0-9_']*\>"
+
+" Infix operators--most punctuation characters and any (qualified) identifier
+" enclosed in `backquotes`. An operator starting with : is a constructor,
+" others are variables (e.g. functions).
+syn match hsVarSym "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[-!#$%&\*\+/<=>\?@\\^|~.][-!#$%&\*\+/<=>\?@\\^|~:.]*"
+syn match hsConSym "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=:[-!#$%&\*\+./<=>\?@\\^|~:]*"
+syn match hsVarSym "`\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[a-z][a-zA-Z0-9_']*`"
+syn match hsConSym "`\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[A-Z][a-zA-Z0-9_']*`"
+
+" Toplevel Template Haskell support
+"sy match hsTHTopLevel "^[a-z]\(\(.\&[^=]\)\|\(\n[^a-zA-Z0-9]\)\)*"
+sy match hsTHIDTopLevel "^[a-z]\S*" 
+sy match hsTHTopLevel "^\$(\?" nextgroup=hsTHTopLevelName 
+sy match hsTHTopLevelName "[a-z]\S*" contained
+
+" Reserved symbols--cannot be overloaded.
+syn match hsDelimiter  "(\|)\|\[\|\]\|,\|;\|_\|{\|}"
+
+sy region hsInnerParen start="(" end=")" contained contains=hsInnerParen,hsConSym,hsType,hsVarSym
+sy region hs_InfixOpFunctionName start="^(" end=")\s*[^:`]\(\W\&\S\&[^'\"`()[\]{}@]\)\+"re=s
+    \ contained keepend contains=hsInnerParen,hs_HlInfixOp
+
+sy match hs_hlFunctionName "[a-z_]\(\S\&[^,\(\)\[\]]\)*" contained 
+sy match hs_FunctionName "^[a-z_]\(\S\&[^,\(\)\[\]]\)*" contained contains=hs_hlFunctionName
+sy match hs_HighliteInfixFunctionName "`[a-z_][^`]*`" contained
+sy match hs_InfixFunctionName "^\S[^=]*`[a-z_][^`]*`"me=e-1 contained contains=hs_HighliteInfixFunctionName,hsType,hsConSym,hsVarSym,hsString,hsCharacter
+sy match hs_HlInfixOp "\(\W\&\S\&[^`(){}'[\]]\)\+" contained contains=hsString
+sy match hs_InfixOpFunctionName "^\(\(\w\|[[\]{}]\)\+\|\(\".*\"\)\|\('.*'\)\)\s*[^:]=*\(\W\&\S\&[^='\"`()[\]{}@]\)\+"
+    \ contained contains=hs_HlInfixOp,hsCharacter
+
+sy match hs_OpFunctionName        "(\(\W\&[^(),\"]\)\+)" contained
+"sy region hs_Function start="^["'a-z_([{]" end="=\(\s\|\n\|\w\|[([]\)" keepend extend
+sy region hs_Function start="^["'a-zA-Z_([{]\(\(.\&[^=]\)\|\(\n\s\)\)*=" end="\(\s\|\n\|\w\|[([]\)" 
+        \ contains=hs_OpFunctionName,hs_InfixOpFunctionName,hs_InfixFunctionName,hs_FunctionName,hsType,hsConSym,hsVarSym,hsString,hsCharacter
+
+sy match hs_DeclareFunction "^[a-z_(]\S*\(\s\|\n\)*::" contains=hs_FunctionName,hs_OpFunctionName
+
+" hi hs_InfixOpFunctionName guibg=bg
+" hi hs_Function guibg=green
+" hi hs_InfixFunctionName guibg=red
+" hi hs_DeclareFunction guibg=red
+
+sy keyword hsStructure data family class where instance default deriving
+sy keyword hsTypedef type newtype
+
+sy keyword hsInfix infix infixl infixr
+sy keyword hsStatement  do case of let in
+sy keyword hsConditional if then else
+
+"if exists("hs_highlight_types")
+  " Primitive types from the standard prelude and libraries.
+  sy match hsType "\<[A-Z]\(\S\&[^,.]\)*\>"
+  sy match hsType "()"
+"endif
+
+" Not real keywords, but close.
+if exists("hs_highlight_boolean")
+  " Boolean constants from the standard prelude.
+  syn keyword hsBoolean True False
+endif
+
+syn region	hsPackageString	start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial contained
+sy match   hsModuleName  excludenl "\([A-Z]\w*\.\?\)*" contained 
+
+sy match hsImport "\<import\>\s\+\(qualified\s\+\)\?\(\<\(\w\|\.\)*\>\)" 
+    \ contains=hsModuleName,hsImportLabel
+    \ nextgroup=hsImportParams,hsImportIllegal skipwhite
+sy keyword hsImportLabel import qualified contained
+
+sy match hsImportIllegal "\w\+" contained
+
+sy keyword hsAsLabel as contained
+sy keyword hsHidingLabel hiding contained
+
+sy match hsImportParams "as\s\+\(\w\+\)" contained
+    \ contains=hsModuleName,hsAsLabel
+    \ nextgroup=hsImportParams,hsImportIllegal skipwhite
+sy match hsImportParams "hiding" contained
+    \ contains=hsHidingLabel
+    \ nextgroup=hsImportParams,hsImportIllegal skipwhite 
+sy region hsImportParams start="(" end=")" contained
+    \ contains=hsBlockComment,hsLineComment, hsType,hsDelimTypeExport,hs_hlFunctionName,hs_OpFunctionName
+    \ nextgroup=hsImportIllegal skipwhite
+
+" hi hsImport guibg=red
+"hi hsImportParams guibg=bg
+"hi hsImportIllegal guibg=bg
+"hi hsModuleName guibg=bg
+
+"sy match hsImport		"\<import\>\(.\|[^(]\)*\((.*)\)\?" 
+"         \ contains=hsPackageString,hsImportLabel,hsImportMod,hsModuleName,hsImportList
+"sy keyword hsImportLabel import contained
+"sy keyword hsImportMod		as qualified hiding contained
+"sy region hsImportListInner start="(" end=")" contained keepend extend contains=hs_OpFunctionName
+"sy region  hsImportList matchgroup=hsImportListParens start="("rs=s+1 end=")"re=e-1
+"        \ contained 
+"        \ keepend extend
+"        \ contains=hsType,hsLineComment,hsBlockComment,hs_hlFunctionName,hsImportListInner
+
+
+
+" new module highlighting
+syn region hsDelimTypeExport start="\<[A-Z]\(\S\&[^,.]\)*\>(" end=")" contained
+   \ contains=hsType
+
+sy keyword hsExportModuleLabel module contained
+sy match hsExportModule "\<module\>\(\s\|\t\|\n\)*\([A-Z]\w*\.\?\)*" contained contains=hsExportModuleLabel,hsModuleName
+
+sy keyword hsModuleStartLabel module contained
+sy keyword hsModuleWhereLabel where contained
+
+syn match hsModuleStart "^module\(\s\|\n\)*\(\<\(\w\|\.\)*\>\)\(\s\|\n\)*" 
+  \ contains=hsModuleStartLabel,hsModuleName
+  \ nextgroup=hsModuleCommentA,hsModuleExports,hsModuleWhereLabel
+
+syn region hsModuleCommentA start="{-" end="-}"
+  \ contains=hsModuleCommentA,hsCommentTodo,@Spell contained
+  \ nextgroup=hsModuleCommentA,hsModuleExports,hsModuleWhereLabel skipwhite skipnl
+
+syn match hsModuleCommentA "--.*\n"
+  \ contains=hsCommentTodo,@Spell contained
+  \ nextgroup=hsModuleCommentA,hsModuleExports,hsModuleWhereLabel skipwhite skipnl
+
+syn region hsModuleExports start="(" end=")" contained
+   \ nextgroup=hsModuleCommentB,hsModuleWhereLabel skipwhite skipnl
+   \ contains=hsBlockComment,hsLineComment,hsType,hsDelimTypeExport,hs_hlFunctionName,hs_OpFunctionName,hsExportModule
+
+syn match hsModuleCommentB "--.*\n"
+  \ contains=hsCommentTodo,@Spell contained
+  \ nextgroup=hsModuleCommentB,hsModuleWhereLabel skipwhite skipnl
+
+syn region hsModuleCommentB start="{-" end="-}"
+   \ contains=hsModuleCommentB,hsCommentTodo,@Spell contained
+   \ nextgroup=hsModuleCommentB,hsModuleWhereLabel skipwhite skipnl
+" end module highlighting
+
+" FFI support
+sy keyword hsFFIForeign foreign contained
+"sy keyword hsFFIImportExport import export contained
+sy keyword hsFFIImportExport export contained
+sy keyword hsFFICallConvention ccall stdcall contained
+sy keyword hsFFISafety safe unsafe contained
+sy region  hsFFIString		start=+"+  skip=+\\\\\|\\"+  end=+"+  contained contains=hsSpecialChar
+sy match hsFFI excludenl "\<foreign\>\(.\&[^\"]\)*\"\(.\)*\"\(\s\|\n\)*\(.\)*::"
+  \ keepend
+  \ contains=hsFFIForeign,hsFFIImportExport,hsFFICallConvention,hsFFISafety,hsFFIString,hs_OpFunctionName,hs_hlFunctionName
+
+
+sy match   hsNumber		"\<[0-9]\+\>\|\<0[xX][0-9a-fA-F]\+\>\|\<0[oO][0-7]\+\>"
+sy match   hsFloat		"\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>"
+
+" Comments
+sy keyword hsCommentTodo    TODO FIXME XXX TBD contained
+sy match   hsLineComment      "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$" contains=hsCommentTodo,@Spell
+sy region  hsBlockComment     start="{-"  end="-}" contains=hsBlockComment,hsCommentTodo,@Spell
+sy region  hsPragma	       start="{-#" end="#-}"
+
+" QuasiQuotation
+sy region hsQQ start="\[\$" end="|\]"me=e-2 keepend contains=hsQQVarID,hsQQContent nextgroup=hsQQEnd
+sy region hsQQNew start="\[\(.\&[^|]\&\S\)*|" end="|\]"me=e-2 keepend contains=hsQQVarIDNew,hsQQContent nextgroup=hsQQEnd
+sy match hsQQContent ".*" contained
+sy match hsQQEnd "|\]" contained
+sy match hsQQVarID "\[\$\(.\&[^|]\)*|" contained
+sy match hsQQVarIDNew "\[\(.\&[^|]\)*|" contained
+
+if exists("hs_highlight_debug")
+  " Debugging functions from the standard prelude.
+  syn keyword hsDebug undefined error trace
+endif
+
+
+" C Preprocessor directives. Shamelessly ripped from c.vim and trimmed
+" First, see whether to flag directive-like lines or not
+if (!exists("hs_allow_hash_operator"))
+    syn match	cError		display "^\s*\(%:\|#\).*$"
+endif
+" Accept %: for # (C99)
+syn region	cPreCondit	start="^\s*\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" end="//"me=s-1 contains=cComment,cCppString,cCommentError
+syn match	cPreCondit	display "^\s*\(%:\|#\)\s*\(else\|endif\)\>"
+syn region	cCppOut		start="^\s*\(%:\|#\)\s*if\s\+0\+\>" end=".\@=\|$" contains=cCppOut2
+syn region	cCppOut2	contained start="0" end="^\s*\(%:\|#\)\s*\(endif\>\|else\>\|elif\>\)" contains=cCppSkip
+syn region	cCppSkip	contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cCppSkip
+syn region	cIncluded	display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
+syn match	cIncluded	display contained "<[^>]*>"
+syn match	cInclude	display "^\s*\(%:\|#\)\s*include\>\s*["<]" contains=cIncluded
+syn cluster	cPreProcGroup	contains=cPreCondit,cIncluded,cInclude,cDefine,cCppOut,cCppOut2,cCppSkip,cCommentStartError
+syn region	cDefine		matchgroup=cPreCondit start="^\s*\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$"
+syn region	cPreProc	matchgroup=cPreCondit start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend
+
+syn region	cComment	matchgroup=cCommentStart start="/\*" end="\*/" contains=cCommentStartError,cSpaceError contained
+syntax match	cCommentError	display "\*/" contained
+syntax match	cCommentStartError display "/\*"me=e-1 contained
+syn region	cCppString	start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial contained
+
+
+if version >= 508 || !exists("did_hs_syntax_inits")
+  if version < 508
+    let did_hs_syntax_inits = 1
+    command -nargs=+ HiLink hi link <args>
+  else
+    command -nargs=+ HiLink hi def link <args>
+  endif
+
+  HiLink hs_hlFunctionName    Function
+  HiLink hs_HighliteInfixFunctionName Function
+  HiLink hs_HlInfixOp       Function
+  HiLink hs_OpFunctionName  Function
+  HiLink hsTypedef          Typedef
+  HiLink hsVarSym           hsOperator
+  HiLink hsConSym           hsOperator
+  if exists("hs_highlight_delimiters")
+    " Some people find this highlighting distracting.
+	HiLink hsDelimiter        Delimiter
+  endif
+
+  HiLink hsModuleStartLabel Structure
+  HiLink hsExportModuleLabel Keyword
+  HiLink hsModuleWhereLabel Structure
+  HiLink hsModuleName       Normal
+  
+  HiLink hsImportIllegal    Error
+  HiLink hsAsLabel          hsImportLabel
+  HiLink hsHidingLabel      hsImportLabel
+  HiLink hsImportLabel      Include
+  HiLink hsImportMod        Include
+  HiLink hsPackageString    hsString
+
+  HiLink hsOperator         Operator
+
+  HiLink hsInfix            Keyword
+  HiLink hsStructure        Structure
+  HiLink hsStatement        Statement
+  HiLink hsConditional      Conditional
+
+  HiLink hsSpecialCharError Error
+  HiLink hsSpecialChar      SpecialChar
+  HiLink hsString           String
+  HiLink hsFFIString        String
+  HiLink hsCharacter        Character
+  HiLink hsNumber           Number
+  HiLink hsFloat            Float
+
+  HiLink hsLiterateComment		  hsComment
+  HiLink hsBlockComment     hsComment
+  HiLink hsLineComment      hsComment
+  HiLink hsModuleCommentA   hsComment
+  HiLink hsModuleCommentB   hsComment
+  HiLink hsComment          Comment
+  HiLink hsCommentTodo      Todo
+  HiLink hsPragma           SpecialComment
+  HiLink hsBoolean			  Boolean
+
+  if exists("hs_highlight_types")
+      HiLink hsDelimTypeExport  hsType
+      HiLink hsType             Type
+  endif
+
+  HiLink hsDebug            Debug
+
+  HiLink cCppString         hsString
+  HiLink cCommentStart      hsComment
+  HiLink cCommentError      hsError
+  HiLink cCommentStartError hsError
+  HiLink cInclude           Include
+  HiLink cPreProc           PreProc
+  HiLink cDefine            Macro
+  HiLink cIncluded          hsString
+  HiLink cError             Error
+  HiLink cPreCondit         PreCondit
+  HiLink cComment           Comment
+  HiLink cCppSkip           cCppOut
+  HiLink cCppOut2           cCppOut
+  HiLink cCppOut            Comment
+
+  HiLink hsFFIForeign       Keyword
+  HiLink hsFFIImportExport  Structure
+  HiLink hsFFICallConvention Keyword
+  HiLink hsFFISafety         Keyword
+
+  HiLink hsTHIDTopLevel   Macro
+  HiLink hsTHTopLevelName Macro
+
+  HiLink hsQQVarID Keyword
+  HiLink hsQQVarIDNew Keyword
+  HiLink hsQQEnd   Keyword
+  HiLink hsQQContent String
+
+  delcommand HiLink
+endif
+
+let b:current_syntax = "haskell"
+

File vim/syntax/j.vim

+" Vim syntax file
+" Language: J
+" Maintainer: Bill Lam<bbill.lam@gmail.com>
+" Last Change:
+"   2008 Apr 04  Initial commit
+"   2009 Feb 13  UPload to jwiki
+
+" It is by no means complete.
+" Send comments, suggestions and requests to the maintainer.
+
+if exists("b:current_syntax")
+  finish
+endif
+
+if exists("j_minlines")
+  let b:j_minlines = j_minlines
+else
+  let b:j_minlines = 15
+endif
+exec "syn sync linebreaks=1 minlines=" . b:j_minlines
+
+" jVerb
+" = < <. <: > >. >: _: + +. +: * *. *: - -. -: % %. %: ^ ^. $ $. $: ~. ~: | |. |:
+" , ,. ,: ; ;: # #. #: ! /: \: [ [: ] { {. {: {:: }. }: ". ": ? ?.
+" A. c. C. e. E. i. i: I. j. L. o. p. p: q: r. s: u: x:
+" _9: _8: _7: _6: _5: _4: _3: _2: _1: 0: 1: 2: 3: 4: 5: 6: 7: 8: 9:
+" jNoun
+" a. a: _. _:
+" jConjuction
+" ^: . .. .: :  :. :: ;. !. !: " ` `: @ @. @: & &. &: &.: d. D. D: H. L: S: T.
+" jAdverb
+" ~ / \ /. \. } b. f. M. t. t:
+
+syn match jName          "\a\w*"
+syn match jArgument      "\<[xymnuv]\.\=\>" contained
+syn match jNumber        "[_0-9][_0-9\.a-zA-Z]*"
+
+syn match jConjunction   "\."
+syn match jConjunction   ":"
+
+syn match jVerb          "[-!#$%\*+,;<=>\?[\]^{|]"
+syn match jConjunction   "[\"&@`]"
+syn match jAdverb        "[/\\}~]"
+
+syn match jVerb          "[-\"#\$%\*+,<>\?^{|}~]\."
+syn match jConjunction   "[!&@;:\.]\."
+syn match jAdverb        "[/\\]\."
+syn match jVerb          "p\.\."
+
+syn match jVerb          "[-\"#\$%\*+,;<>\?\[{|}~/\\]:"
+syn match jConjunction   "[!&@^\.:]:"
+syn match jConjunction   "&\.:"
+syn match jVerb          "{::"
+syn match jVerb          "_\=\d:"
+
+syn match jVerb          "[AcCeEiIjLopr]\."
+syn match jConjunction   "[dDHT]\."
+syn match jAdverb        "[bfMt]\."
+
+syn match jVerb          "[ipqsux]:"
+syn match jConjunction   "[DLS]:"
+syn match jAdverb        "t:"
+
+syn match jNoun          "[a_][\.:]"
+syn match jCopula        "=[\.:]"
+syn match jParenthesis   "[()]"
+
+syn match jControl       "\<assert\."           contained
+syn match jControl       "\<break\."            contained
+syn match jControl       "\<case\."             contained
+syn match jControl       "\<catch\."            contained
+syn match jControl       "\<catchd\."           contained
+syn match jControl       "\<catcht\."           contained
+syn match jControl       "\<continue\."         contained
+syn match jControl       "\<do\."               contained
+syn match jControl       "\<else\."             contained
+syn match jControl       "\<elseif\."           contained
+syn match jControl       "\<end\."              contained
+syn match jControl       "\<fcase\."            contained
+syn match jControl       "\<for_\%(\a\w*\)\=\." contained
+syn match jControl       "\<goto_\%(\a\w*\)\."  contained
+syn match jControl       "\<if\."               contained
+syn match jControl       "\<label_\%(\a\w*\)\." contained
+syn match jControl       "\<return\."           contained
+syn match jControl       "\<select\."           contained
+syn match jControl       "\<throw\."            contained
+syn match jControl       "\<try\."              contained
+syn match jControl       "\<while\."            contained
+syn match jControl       "\<whilst\."           contained
+
+syn match jError         "\%('.*'\)*'"
+
+" String and Character contstants
+syn region jString oneline start="'" skip="''"  end="'"
+syn keyword jTodo    FIXME   contained
+syn keyword jTodo    TODO    contained
+syn keyword jTodo    XXX     contained
+syn region jComment oneline start="NB\." end="$"  contains=jTodo
+
+" enable syntax folding with
+setlocal foldmethod=syntax
+setlocal nofoldenable
+
+syntax region jDef start="\<\%([1-4]\|13\)\s\+:\s*0\>" end="^)\s*$" contains=ALLBUT,jTodo transparent keepend fold
+syntax region jDef start="\<adverb\s\+define\>" end="^)\s*$" contains=ALLBUT,jTodo transparent keepend fold
+syntax region jDef start="\<conjunction\s\+define\>" end="^)\s*$" contains=ALLBUT,jTodo transparent keepend fold
+syntax region jDef start="\<verb\s\+define\>" end="^)\s*$" contains=ALLBUT,jTodo transparent keepend fold
+syntax region jDef start="\<monad\s\+define\>" end="^)\s*$" contains=ALLBUT,jTodo transparent keepend fold
+syntax region jDef start="\<dyad\s\+define\>" end="^)\s*$" contains=ALLBUT,jTodo transparent keepend fold
+" syntax region jBlock start="\<\%(if\|select\|try\|\%(for_\%(\a\w*\)\=\)\|while\|whilst\)\." end="\<end\." contained contains=ALLBUT,jDef,jNounDef,jTodo transparent fold
+
+syntax region jNounDef start="\<0\s\+:\s*0\s*$" end="^)\s*$" keepend fold
+syntax region jNounDef start="\<noun\s\+define\s*$" end="^)\s*$" keepend fold
+
+" Define the default highlighting.
+if !exists("did_j_syntax_inits")
+  hi link jAdverb       Type
+  hi link jArgument     Operator
+  hi link jComment      Comment
+  hi link jConjunction  Macro
+  hi link jControl      Keyword
+  hi link jCopula       Special
+  hi link jError        Error
+  hi link jName         Identifier
+  hi link jNoun         String
+  hi link jNounDef      Define
+  hi link jNumber       Number
+  hi link jParenthesis  Delimiter
+  hi link jString       String
+  hi link jTodo         Todo
+  hi link jVerb         Operator
+endif
+
+let b:current_syntax = "j"

File vim/syntax/javascript.vim

+" FireFly's JavaScript vim syntax file.
+
+" Check that a syntax file hasn't been loaded already.
+if exists("b:current_syntax")
+  finish
+endif
+
+syn sync minlines=100
+
+
+"""" Syntax Definitions """""""""""""""""""""""""""""""""""""""""""""
+""" Various
+syn match   javaScriptMatchingError "[})\]]"
+
+syn region  javaScriptBlockComment start="/\*" end="\*/" contains=javaScriptTodo
+syn match   javaScriptLineComment  "//.*"                contains=javaScriptTodo
+syn keyword javaScriptTodo  TODO FIXME NOTE XXX
+
+""" Literals
+syn region  javaScriptString  start='"' end='"' skip='\\\\\|\\"'
+syn region  javaScriptString  start="'" end="'" skip="\\\\\|\\'"
+
+syn keyword javaScriptBoolean  true false
+syn keyword javaScriptConstant null undefined
+
+" (borrowed from default syntax/javascript.vim (vim73))
+syn region  javaScriptRegExp
+\           start="/[^/*]"me=e-1     skip="\\\\\|\\/"
+\           end="/[gim]\{0,3\}\s*$"  end="/[gim]\{0,3\}\s*[;.,)\]}]"me=e-1
+\           contains=@htmlPreproc oneline
+
+syn match   javaScriptDecNumber    "\.\@<!\<\%([1-9]\d*\|0\)\%(\.\d*\|\.\|\)\%(\>\|[eE][-+]\?\d\+\|\.\@<=\)"
+syn match   javaScriptDecNumber    "\d\@<!\.\d\+\%(\>\|[eE][-+]\?\d\+\)"
+syn match   javaScriptOldOctNumber "\<0[0-7]+\>"
+syn match   javaScriptHexNumber    "\<0[xX][0-9a-fA-F]\+\>"
+
+""" Identifiers & variants thereof
+let identifierPat = '\%(\$\|\<[A-Za-z_]\)[A-Za-z0-9_$]*\%(\>\|\$\@<=\)'
+let suffixes = { "Object":     '\_s*[\.\[]\@=',
+               \ "Function":   '\_s*(\@=',
+               \ "LabelOrKey": '\_s*:\@=' }
+
+exe "syn match javaScriptIdentifier /" . identifierPat . "/"
+\ . "          nextgroup=javaScriptBadIdentifier"
+for [name, pat] in items(suffixes)
+  exe "syn match javaScript" . name . "Identifier /" . identifierPat . pat . "/"
+endfor
+
+syn cluster  javaScriptIdentifier
+\   contains=javaScriptObjectIdentifier,javaScriptFunctionIdentifier,javaScriptIdentifier
+
+
+""" Keywords & Reserved words (from ES5.1 spec)
+syn keyword javaScriptStatement     case catch continue debugger default do
+\                                   else finally for if return switch throw try
+\                                   var while with
+syn keyword javaScriptOperator      delete in instanceof new this typeof void
+
+syn keyword javaScriptReservedWord  class enum export extends import super
+\                                   implements interface let package private
+\                                   protected public static yield const
+
+
+""" Functions (declarations & expressions)
+syn keyword javaScriptFunctionKeyword  function  skipwhite
+\           nextgroup=javaScriptReservedWord,javaScriptFunctionName,javaScriptFunctionParameters,javaScriptFunctionError
+
+syn match   javaScriptFunctionError  "\S.\+"  contained
+
+exe "syn match javaScriptFunctionName /" . identifierPat . "/ contained skipwhite"
+\ . "          nextgroup=javaScriptFunctionParameters,javaScriptFunctionError"
+
+syn region  javaScriptFunctionParameters         contained skipwhite
+\           matchgroup=javaScriptFunctionParens  start="(" end=")"
+\           nextgroup=javaScriptFunctionBody,javaScriptFunctionError
+\           contains=javaScriptIdentifier,@javaScriptComment
+
+syn region  javaScriptFunctionBody               contained skipwhite
+\           matchgroup=javaScriptFunctionBrace   start="{" end="}"
+\           contains=TOP
+
+syn cluster javaScriptComment
+\           contains=javaScriptBlockComment,javaScriptLineComment
+
+
+""" Matching {([ ])}'s & various operators
+syn region  javaScriptBraceBlock  matchgroup=javaScriptBraces  transparent
+\           start="{"  end="}"   contains=TOP
+syn region  javaScriptParenBlock  matchgroup=javaScriptParens  transparent
+\           start="("  end=")"   contains=TOP
+syn region  javaScriptSquareBlock matchgroup=javaScriptSquares transparent
+\           start="\[" end="\]"  contains=TOP
+
+syn match   javaScriptMemberDot "\.\<" skipwhite nextgroup=@javaScriptIdentifier
+
+
+""" ES6 additions
+" of? (it is still a valid identifier)
+syn keyword javaScriptStatement let const
+
+" Number literals--add new ones and discourage old-style octal ones.
+syn match   javaScriptOctNumber    /\<0o[0-7]\+\>/
+syn match   javaScriptBinNumber    /\<0b[01]\+\>/
+
+hi     link javaScriptBinNumber        javaScriptNumber
+"hi     link javaScriptOldOctNumber     javaScriptWarning
+
+" Templates (quasiliterals)
+syn region  javaScriptTemplate  start="`" end="`"
+\           contains=javaScriptTemplateSubstitution
+syn match   javaScriptTemplateSubstitution  "\$"
+\           nextgroup=javaScriptIdentifier,javaScriptBraceBlock
+
+hi     link javaScriptTemplate         javaScriptString
+hi def link javaScriptTemplateSubstitution rubyInterpolationDelimiter
+" TODO: Get `${1 + 2}` to apply Normal highlighting to the `+`
+
+
+"""" Highlight Linking """"""""""""""""""""""""""""""""""""""""""""""
+" "Internal" links
+hi     link javaScriptBlockComment     javaScriptComment
+hi     link javaScriptLineComment      javaScriptComment
+hi     link javaScriptDecNumber        javaScriptNumber
+hi     link javaScriptHexNumber        javaScriptNumber
+hi     link javaScriptOctNumber        javaScriptNumber
+hi     link javaScriptFunctionError    javaScriptError
+hi     link javaScriptMatchingError    javaScriptError
+hi     link javaScriptReservedWord     javaScriptError
+
+hi     link javaScriptParens           javaScriptBrackets
+hi     link javaScriptSquares          javaScriptBrackets
+hi     link javaScriptFunctionParens   javaScriptBrackets
+
+" Default links
+hi def link javaScriptString           String
+hi def link javaScriptRegExp           rubyRegexp
+hi def link javaScriptNumber           Number
+hi def link javaScriptBoolean          Boolean
+hi def link javaScriptConstant         StorageClass
+
+hi def link javaScriptIdentifier       Identifier
+hi def link javaScriptObjectIdentifier     Structure
+hi def link javaScriptFunctionIdentifier   Function
+hi def link javaScriptLabelOrKeyIdentifier Structure
+
+hi def link javaScriptFunctionKeyword  Type
+hi def link javaScriptFunctionName     Function
+hi def link javaScriptFunctionBrace    Special
+
+hi def link javaScriptStatement        Statement
+hi def link javaScriptOperator         Operator
+hi def link javaScriptBracket          Conditional
+hi def link javaScriptBrace            Structure
+
+hi def link javaScriptComment          Comment
+hi def link javaScriptTodo             Todo
+hi def link javaScriptError            Error
+
+
+let b:current_syntax = "javascript"

File vim/syntax/lecnote-sub/linalg.vim

+" Vim syntax file
+" Language:     Linear algebra lecture notes
+" Maintainer:   Jonas Höglund <firefly@firefly.nu>
+" Last Change:  2012-09-16
+
+
+"""" Other general-purpose formatting """""""""""""""""""""""""""""""
+"syn match   lectureMathMode        ".*"  contained
+"\           contains=@lectureMathMode
+
+"syn region  lectureMathMode        matchgroup=Conceal concealends oneline
+"\           start="\$" end="\$"    contains=@lectureMathMode
+
+"syn cluster lectureMathMode        contains=@lectureMathOperator
+"syn cluster lectureMathOperator
+"\           contains=lectureMathMacroOperator,lectureMathMatrixTranspose
+
+syn match   lectureMathMatrixTranspose "\^T" contained conceal cchar=ᵀ
+
+"syn match   lectureMathVector      "_[A-Za-z0]"
+"\           contains=lectureMathVectorSubsts contained
+
+"syn match   lectureMathMacroOperator  "<=\+>\|<=\+\|=\+>"  contains=lectureMathArrowPart
+"syn match   lectureMathMacroOperator  "<-\+>\|<-\+\|-\+>"  contains=lectureMathArrowPart
+
+"syn match   lectureMathArrowPart   "-"  contained conceal cchar=―
+"syn match   lectureMathArrowPart   "="  contained conceal cchar=═
+"syn match   lectureMathArrowPart   ">"  contained conceal cchar=❭
+"syn match   lectureMathArrowPart   "<"  contained conceal cchar=❬
+
+"syn match   lectureHorizontalBrace   "`-\+ [-+*/^A-Za-z0-9.]\+ -\+´"
+"syn match   lectureHorizontalBrace   "`- [-+*/^A-Za-z0-9.] -´"
+
+syn match   lectureHorizontalBrace   "`-"
+\           contains=lectureHoriontalBracePart
+syn match   lectureHorizontalBracePart  "`"  contained conceal cchar=⌎
+syn match   lectureHorizontalBracePart  "´"  contained conceal cchar=⌏
+syn match   lectureHorizontalBracePart  "-"  contained conceal cchar=―
+
+
+"""" Matrices """""""""""""""""""""""""""""""""""""""""""""""""""""""
+syn match   lectureParenTopLeft    "/"  contained conceal cchar=⎛"⎡
+syn match   lectureParenTopRight   "\\" contained conceal cchar=⎞"⎤
+syn match   lectureParenBtmLeft    "\\" contained conceal cchar=⎝"⎣
+syn match   lectureParenBtmRight   "/"  contained conceal cchar=⎠"⎦
+
+syn match   lectureParenBar        "|"  contained conceal cchar=⎪
+syn match   lectureParenEdgeLeft   "\%(| \+[-().a-z0-9]\+ [-() .a-z0-9]*\)\@<!|"
+\           contained conceal cchar=⎜
+syn match   lectureParenEdgeRight  "\%(| \+[-().a-z0-9]\+ [-() .a-z0-9]*\)\@!|"
+\           contained conceal cchar=⎟
+
+syn match   lectureParenTop        "/ [-+*/() .a-z0-9]\+ \%(| \+[-+*/() .a-z0-9]\+ \+\)*\\"
+\           contains=lectureParenTopLeft,lectureParenTopRight,lectureParenBar
+
+"syn match   lectureParenMiddle    "| [-+*/() .a-z0-9]\+ \%(| \+[-+*/().a-z0-9]\+ \+\)*|"
+syn match   lectureParenMiddle     "\%(|\%( \+[-().a-z0-9]\+\)\+ \+\)\+|"
+\           contains=lectureParenEdgeLeft,lectureParenEdgeRight,lectureParenBar
+
+syn match   lectureParenBtm        "\\ [-+*/() .a-z0-9]\+ \%(| \+[-+*/() .a-z0-9]\+ \+\)*/"
+\           contains=lectureParenBtmLeft,lectureParenBtmRight,lectureParenBar
+
+
+"""" Equation systems """""""""""""""""""""""""""""""""""""""""""""""
+syn match  lectureEqSysTopChar    "/"  contained conceal cchar=⎧
+syn match  lectureEqSysBtmChar    "\\" contained conceal cchar=⎩
+syn match  lectureEqSysMiddleChar "{"  contained conceal cchar=⎨
+syn match  lectureEqSysBarChar    "|"  contained conceal cchar=⎪
+
+syn match  lectureEqSysTop        "/ \+\%([-+*/() a-z0-9]\+ = \+[-a-z0-9]\+\|--\)"
+\          contains=lectureEqSysTopChar
+syn match  lectureEqSysBtm        "\\ \+\%([-+*/() a-z0-9]\+ = \+[-a-z0-9]\+\|--\)"
+\          contains=lectureEqSysBtmChar
+syn match  lectureEqSysMiddle     "{ \+\%([-+*/() a-z0-9]\+ = \+[-a-z0-9]\+\|--\)"
+\          contains=lectureEqSysMiddleChar
+syn match  lectureEqSysBar        "| \+\%([-+*/() a-z0-9]\+ = \+[-a-z0-9]\+\|--\)"
+\          contains=lectureEqSysBarChar
+
+
+"""" Highlighting """""""""""""""""""""""""""""""""""""""""""""""""""
+"hi           markdownHeading           cterm=bold
+"hi           markdownItalic            cterm=italic
+"hi           markdownBold              cterm=bold
+"hi           lectureListMarker         cterm=bold    ctermfg=yellow
+
+"hi def link  markdownHeadingRule       PreProc
+"hi def link  lectureUnderline          Underlined
+"hi def link  lectureListMarker         Character
+"hi def link  lectureProperty           Statement
+
+"hi def link  lectureMathMode           Identifier
+"hi def link  lectureMathMacroOperator  Operator
+

File vim/syntax/lecnote-sub/logic.vim

+
+"""" Logic expressions """"""""""""""""""""""""""""""""""""""""""""""
+" Operators
+syn match  logicAnd          "\*"   contained conceal cchar=∧
+syn match  logicOr           "+"    contained conceal cchar=∨
+syn match  logicNot          "\~"   contained conceal cchar=¬
+syn match  logicImplies      "->"   contained contains=logicImpliesPart
+syn match  logicImpliesPart  "-"    contained conceal cchar=─
+syn match  logicImpliesPart  ">"    contained conceal cchar=›"⦒>⋗
+"syn match  logicImplies      "->"   contained conceal cchar=→
+syn match  logicEquivalent   "<->"  contained conceal cchar=↔
+"syn match  logicTurnstile    "|-"   contained conceal cchar=⊢
+"syn match  logicDblTurnstile "|="   contained conceal cchar=⊨
+syn match  logicTurnstile    "|[-=]" contained contains=logicTurnstilePart
+syn match  logicTurnstilePart "|"   contained conceal cchar= 
+syn match  logicTurnstilePart "-"   contained conceal cchar=⊢
+syn match  logicTurnstilePart "="   contained conceal cchar=⊨
+"syn match  logicBottom       "_|_"  contained conceal cchar=⊥
+syn match  logicBottom       "_|_"  contained contains=logicBottomPart
+syn match  logicBottomPart   "_"    contained conceal cchar= 
+syn match  logicBottomPart   "|"    contained conceal cchar=⊥
+
+" Subscripts (special, for logic)
+syn match  logicSubscript  "[ie]\@<=1"  contained conceal cchar=₁
+syn match  logicSubscript  "[ie]\@<=2"  contained conceal cchar=₂
+
+" Subscripts (digits)
+syn match  logicSubscript  "_0"   contained conceal cchar=₀
+syn match  logicSubscript  "_1"   contained conceal cchar=₁
+syn match  logicSubscript  "_2"   contained conceal cchar=₂
+syn match  logicSubscript  "_3"   contained conceal cchar=₃
+syn match  logicSubscript  "_4"   contained conceal cchar=₄
+syn match  logicSubscript  "_5"   contained conceal cchar=₅
+syn match  logicSubscript  "_6"   contained conceal cchar=₆
+syn match  logicSubscript  "_7"   contained conceal cchar=₇
+syn match  logicSubscript  "_8"   contained conceal cchar=₈
+syn match  logicSubscript  "_9"   contained conceal cchar=₉
+
+" Subscripts (characters)
+syn match  logicSubscript  "_a"   contained conceal cchar=ₐ
+syn match  logicSubscript  "_e"   contained conceal cchar=ₑ
+syn match  logicSubscript  "_o"   contained conceal cchar=ₒ
+syn match  logicSubscript  "_x"   contained conceal cchar=ₓ
+syn match  logicSubscript  "_h"   contained conceal cchar=ₕ
+syn match  logicSubscript  "_k"   contained conceal cchar=ₖ
+syn match  logicSubscript  "_l"   contained conceal cchar=ₗ
+syn match  logicSubscript  "_m"   contained conceal cchar=ₘ
+syn match  logicSubscript  "_n"   contained conceal cchar=ₙ
+syn match  logicSubscript  "_p"   contained conceal cchar=ₚ
+syn match  logicSubscript  "_s"   contained conceal cchar=ₛ
+syn match  logicSubscript  "_t"   contained conceal cchar=ₜ
+
+" Cluster
+syn cluster logicExpression
+\ contains=logicAnd,logicOr,logicNot,logicImplies,logicEquivalent,logicTurnstile,logicBottom,logicSubscript
+
+" a logic expression may not contain two adjacent whitespace characters
+"syn match  logicExpressionFiller "\%(\S\|\s\s\@!\)\+"  contained contains=@logicExpression
+syn match  logicExpressionFiller ".*"  contained contains=@logicExpression,logicKeyword,logicDeductionNumber
+
+" Inline expression syntax
+syn region  logicInlineExpression  concealends  matchgroup=Conceal  oneline
+\           start="\$" end="\$"    contains=@logicExpression
+
+
+"""" Logic natural deduction proofs
+syn match  logicDeductionSeparator  "^\s*-\+$" contains=logicDeductionSeparatorChar
+syn match  logicDeductionSeparatorChar "-"  contained conceal cchar=─
+
+syn match  logicDeductionBoxLine    "^\s*\(|*\)\([|'.+]\)-\+\2\1"
+\          contains=logicDeductionBoxMarkerChar,logicDeductionBoxMarkerVert
+syn region logicDeductionBoxLine   start="|" skip="|[-=]" end="|"  oneline
+\          contains=logicKeyword,@logicExpression,logicDeductionBoxMarkerVert,logicDeductionNumber
+
+syn match  logicDeductionBoxMarkerChar "-"       contained conceal cchar=─
+syn match  logicDeductionBoxMarkerVert "|"       contained conceal cchar=│
+
+syn match  logicDeductionBoxMarkerChar "'-\@="   contained conceal cchar=└
+syn match  logicDeductionBoxMarkerChar "-\@<='"  contained conceal cchar=┘
+syn match  logicDeductionBoxMarkerChar "\.-\@="  contained conceal cchar=┌
+syn match  logicDeductionBoxMarkerChar "-\@<=\." contained conceal cchar=┐
+syn match  logicDeductionBoxMarkerChar "+-\@="   contained conceal cchar=├
+syn match  logicDeductionBoxMarkerChar "-\@<=+"  contained conceal cchar=┤
+
+"syn match  logicDeductionNumber "^\s*\d\+\s*" nextgroup=logicDeductionBoxLine,logicExpressionFiller
+syn match  logicDeductionLeadingNumber "^\s*\d\+\s*"
+\          nextgroup=logicDeductionBoxLine,logicExpressionFiller
+
+syn match  logicDeductionNumber        "\<\d\+\>"
+
+syn keyword logicKeyword  assumption premise
+
+
+"""" Highlighting """""""""""""""""""""""""""""""""""""""""""""""""""
+hi link     logicDeductionLeadingNumber logicDeductionNumber
+"hi link logicHeading markdownHeading
+hi def link logicInlineExpression      Identifier
+hi def link logicKeyword               Statement
+hi def link logicDeductionNumber       Number

File vim/syntax/lecnote-very-old.vim

+" Vim syntax file
+" Language:     Lecture notes
+" Maintainer:   Jonas Höglund <firefly@firefly.nu>
+" Filenames:    *.lecnote
+" Last Change:  2012-01-17
+
+if exists("b:current_syntax")
+  finish
+endif
+
+"runtime! syntax/markdown.vim
+"unlet! b:current_syntax
+
+syn sync minlines=4
+
+
+"""" Borrow stuff from markdown... """"""""""""""""""""""""""""""""""
+syn match   markdownLineStart      "^[<@]\@!" nextgroup=@markdownBlock
+
+syn cluster markdownBlock contains=markdownHeading
+
+" Altered: allow leading whitespace.
+syn match   markdownHeading        ".\+\n\s*=\+$"  contained contains=markdownHeadingRule
+syn match   markdownHeading        ".\+\n\s*-\+$"  contained contains=markdownHeadingRule
+syn match   markdownHeadingRule    "^\s*[=-]\+$"   contained
+
+syn region  markdownHeading  start="^\s*#\+" end="#*\s*$"  oneline contained
+
+" Altered: +oneline, concealends
+syn region  markdownItalic         matchgroup=Conceal concealends oneline
+\           start="\S\@<=\*\|\*\S\@="      end="\S\@<=\*\|\*\S\@="
+syn region  markdownBold           matchgroup=Conceal concealends oneline
+\           start="\S\@<=\*\*\|\*\*\S\@="  end="\S\@<=\*\*\|\*\*\S\@="
+
+
+"""" General """"""""""""""""""""""""""""""""""""""""""""""""""""""""
+syn region  lectureForeignBlock    concealends  keepend
+\           start="{{{\?"             end="}}}\?"  contains=@lectureForeignBlocks
+
+"""" Logic proofs """""""""""""""""""""""""""""""""""""""""""""""""""
+syn include @logicImport           syntax/logic.vim
+syn region  lectureLogicBlock      keepend  matchgroup=Ignore
+\           start="{{{\?\s*logic"  end="}}}\?"  contains=@logicImport
+
+
+"""" Other general-purpose formatting """""""""""""""""""""""""""""""
+syn match   lectureProperty        "^\s*[A-ZÅÄÖa-zåäö0-9_*]\+: "
+\           contains=markdownItalic,markdownBold
+
+syn region  lectureUnderline       matchgroup=Conceal concealends oneline
+\           start="\S\@<=_\|_\S\@="        end="\S\@<=_\|_\S\@="
+
+syn match   lectureListMarker      "^\s*[-+*]\+ \@="
+syn match   lectureListMarker      "^\s*\%([a-z]\|[0-9.]\+\)\+[).:] \@="
+
+syn match   lectureMathMode        ".*"  contained
+\           contains=@lectureMathMode
+
+syn region  lectureMathMode        matchgroup=Conceal concealends oneline
+\           start="\$" end="\$"    contains=@lectureMathMode
+
+syn cluster lectureMathMode        contains=@lectureMathOperator
+syn cluster lectureMathOperator
+\           contains=lectureMathMacroOperator,lectureMathMatrixTranspose
+
+syn match   lectureMathVectorSubsts "_u" conceal cchar=a
+"syn match   lectureMathVectorSubsts "_u" conceal cchar=u̅
+"syn match   lectureMathVectorSubsts "_v" conceal cchar=v̅
+"syn match   lectureMathVectorSubsts "_w" conceal cchar=w̅
+
+syn match   lectureMathMatrixTranspose "\^T" contained conceal cchar=ᵀ
+
+syn match   lectureMathVector      "_[A-Za-z0]"
+\           contains=lectureMathVectorSubsts contained
+
+syn match   lectureMathMacroOperator  "<=\+>\|<=\+\|=\+>"  contains=lectureMathArrowPart
+syn match   lectureMathMacroOperator  "<-\+>\|<-\+\|-\+>"  contains=lectureMathArrowPart
+
+syn match   lectureMathArrowPart   "-"  contained conceal cchar=―
+syn match   lectureMathArrowPart   "="  contained conceal cchar=═
+syn match   lectureMathArrowPart   ">"  contained conceal cchar=❭
+syn match   lectureMathArrowPart   "<"  contained conceal cchar=❬
+
+"syn match   lectureHorizontalBrace   "`-\+ [-+*/^A-Za-z0-9.]\+ -\+´"
+"syn match   lectureHorizontalBrace   "`- [-+*/^A-Za-z0-9.] -´"
+
+syn match   lectureHorizontalBrace   "`-"
+\           contains=lectureHoriontalBracePart
+syn match   lectureHorizontalBracePart  "`"  contained conceal cchar=⌎
+syn match   lectureHorizontalBracePart  "´"  contained conceal cchar=⌏
+syn match   lectureHorizontalBracePart  "-"  contained conceal cchar=―
+
+
+"""" Matrices """""""""""""""""""""""""""""""""""""""""""""""""""""""
+syn match   lectureParenTopLeft    "/"  contained conceal cchar=⎛"⎡
+syn match   lectureParenTopRight   "\\" contained conceal cchar=⎞"⎤
+syn match   lectureParenBtmLeft    "\\" contained conceal cchar=⎝"⎣
+syn match   lectureParenBtmRight   "/"  contained conceal cchar=⎠"⎦
+
+syn match   lectureParenBar        "|"  contained conceal cchar=⎪
+syn match   lectureParenEdgeLeft   "\%(| \+[-().a-z0-9]\+ [-() .a-z0-9]*\)\@<!|"
+\           contained conceal cchar=⎜
+syn match   lectureParenEdgeRight  "\%(| \+[-().a-z0-9]\+ [-() .a-z0-9]*\)\@!|"
+\           contained conceal cchar=⎟
+
+syn match   lectureParenTop        "/ [-+*/() .a-z0-9]\+ \%(| \+[-+*/() .a-z0-9]\+ \+\)*\\"
+\           contains=lectureParenTopLeft,lectureParenTopRight,lectureParenBar
+
+"syn match   lectureParenMiddle    "| [-+*/() .a-z0-9]\+ \%(| \+[-+*/().a-z0-9]\+ \+\)*|"
+syn match   lectureParenMiddle     "\%(|\%( \+[-().a-z0-9]\+\)\+ \+\)\+|"
+\           contains=lectureParenEdgeLeft,lectureParenEdgeRight,lectureParenBar
+
+syn match   lectureParenBtm        "\\ [-+*/() .a-z0-9]\+ \%(| \+[-+*/() .a-z0-9]\+ \+\)*/"
+\           contains=lectureParenBtmLeft,lectureParenBtmRight,lectureParenBar
+
+
+"""" Equation systems """""""""""""""""""""""""""""""""""""""""""""""
+syn match  lectureEqSysTopChar    "/"  contained conceal cchar=⎧
+syn match  lectureEqSysBtmChar    "\\" contained conceal cchar=⎩
+syn match  lectureEqSysMiddleChar "{"  contained conceal cchar=⎨
+syn match  lectureEqSysBarChar    "|"  contained conceal cchar=⎪
+
+syn match  lectureEqSysTop        "/ \+\%([-+*/() a-z0-9]\+ = \+[-a-z0-9]\+\|--\)"
+\          contains=lectureEqSysTopChar
+syn match  lectureEqSysBtm        "\\ \+\%([-+*/() a-z0-9]\+ = \+[-a-z0-9]\+\|--\)"
+\          contains=lectureEqSysBtmChar
+syn match  lectureEqSysMiddle     "{ \+\%([-+*/() a-z0-9]\+ = \+[-a-z0-9]\+\|--\)"
+\          contains=lectureEqSysMiddleChar
+syn match  lectureEqSysBar        "| \+\%([-+*/() a-z0-9]\+ = \+[-a-z0-9]\+\|--\)"
+\          contains=lectureEqSysBarChar
+
+
+"""" Highlighting """""""""""""""""""""""""""""""""""""""""""""""""""
+"hi lectureProperty    ctermfg=red
+"hi lectureListMarker  ctermfg=yellow  cterm=bold
+
+hi           markdownHeading           cterm=bold
+hi           markdownItalic            cterm=italic
+hi           markdownBold              cterm=bold
+hi           lectureListMarker         cterm=bold    ctermfg=yellow
+
+hi def link  markdownHeadingRule       PreProc
+hi def link  lectureUnderline          Underlined
+hi def link  lectureListMarker         Character
+hi def link  lectureProperty           Statement
+
+hi def link  lectureMathMode           Identifier
+hi def link  lectureMathMacroOperator  Operator
+
+let b:current_syntax = "lecnote"
+

File vim/syntax/prolog.vim

+" Vim syntax file
+" Language:     Prolog
+" Maintainer:   Jonas Höglund <firefly@firefly․nu>
+" Filenames:    *.pro
+" Last Change:  2012-10-05
+
+if exists("b:current_syntax")
+  finish
+endif
+
+syn clear
+syn case match
+
+syn sync minlines=8
+
+
+"""" Syntactic rules """"""""""""""""""""""""""""""""""""""""""""""""
+""" Clauses
+syn match   prologClauseHead  ".*\ze:-"     nextgroup=prologClauseBody
+\           contains=prologClauseDef
+syn match   prologClauseHead  "\l\%(\%(:-\)\@!\_[^.]\)*\ze\."
+\           contains=prologClauseDef
+
+syn match   prologClauseDef   "^\l\w*\>"                   contained
+\           nextGroup=prologClauseDefExpr
+syn match   prologClauseDefExpr "\_.\{-}\ze\%(:-\|\.\)"    contained
+\           contains=prologInterpunction,@prologExpr
+
+syn region  prologClauseBody  matchgroup=prologClauseDef   contained
+\           start=":-" skip="%.*" end="\."
+\           contains=TOP,prologClauseHead
+
+""" Expressions
+syn match   prologNumber     "\<\d\+\%(\.\d\+\)\?\>"
+syn match   prologVariable   "\<_\?\u\w*\>"
+syn keyword prologCaseless   _
+syn match   prologStructure  "\<\l\w*\>"                   contained
+syn region  prologList       start="\[" end="\]"
+\                            contains=@prologExpr,prologComment
+
+syn cluster prologExpr contains=prologList,prologVariable,prologStructure
+\                      add=prologCaseless,prologNumber
+
+""" Et cetera
+syn region  prologComment    start="/\*" end="\*/"
+syn match   prologComment    "%.*"
+
+syn match   prologInterpunction "[(),]"
+
+""" Built-ins
+syn match   prologCut        "!"
+" http://en.wikibooks.org/wiki/Prolog/Built-in_predicates
+syn keyword prologBuiltin
+\      unify_with_occurs_check
+\      var atom integer float atomic compound nonvar number
+\      functor arg copy_term
+\      is
+\      clause current_predicate asserta assertz retract abolish
+\      findall bagof setof
+\      current_input current_output set_input set_output open close
+\      stream_property at_end_of_stream set_stream_position write_canonical
+\      get_char get_code peek_char peek_code put_char put_code nl
+\      get_byte peek_byte put_byte read_term read write_term write writeq
+\      op current_op
+\      char_conversion current_char_conversion
+\      once repeat
+\      atom_length atom_concat sub_atom atom_chars atom_codes char_code
+\      number_chars number_codes
+\      set_prolog_flag current_prolog_flag halt
+\      fail
+
+
+"""" Highlighting """""""""""""""""""""""""""""""""""""""""""""""""""
+hi def link  prologComment        Comment
+hi def link  prologInterpunction  Operator
+
+hi def link  prologNumber         Number
+hi def link  prologVariable       Identifier
+hi def link  prologStructure      Constant
+hi def link  prologList           Structure
+hi def link  prologCaseless       Statement
+
+hi def link  prologClauseDef      Function
+
+hi def link  prologCut            Special
+hi def link  prologBuiltin        Keyword
+
+
+let b:current_syntax = "prolog"

File vim/syntax/rfc.vim

+" Vim syntax file
+" Filetype:	RFC
+" Author:	lilydjwg <lilydjwg@gmail.com>
+" Version:	1.0
+
+syntax clear
+syntax case match
+
+syn match rfcTitle	/^\v(
+" syn match rfcTheTitle	/^\v\s{7,40}\S.*$/
+" Find and highlight the Title
+for i in range(1, 30)
+  exe 'syn match rfcTheTitle /^\v%'.i.'l\s{4,40}\S.*$/'
+endfor
+unlet i
+syn match rfcRFCTitle	/^\v(
+" RFC xxxx or ANSI X3.4-1986 like.
+" FIXME I really don't know what will follow ANSI so there may be mistakes
+syn match rfcRFC	/\v.@<=RFC\s+[0-9]+|ANSI\s+[0-9A-Z-.]+/ containedin=ALL
+syn match rfcReference	/^\@<!\[\w\+\]/
+syn match rfcComment	/^\S.*\ze\n
+syn match rfcDots	/\v\.\.+\ze\d+$/ contained
+syn match rfcContents	/^\v\s+(([A-Z]\.)?([0-9]+\.?)+|Appendix|Full Copyright Statement).*(\n.*)?(\s|\.)\d+$/ contains=rfcDots
+syn keyword rfcNote	NOTE note: Note: NOTE: Notes Notes:
+" 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\]\)"
+
+hi link rfcTitle	Title
+hi link rfcTheTitle	Type
+hi link rfcRFCTitle	PreProc
+hi link rfcNote		Todo
+hi link rfcRFC		Number
+hi link rfcComment	Comment
+hi link rfcReference	Number
+hi link rfcDots		Comment
+hi link rfcContents	Tag
+hi link rfcKeyword	Keyword
+
+let b:current_syntax = "rfc"
 set nocompatible                " IMprove the editor
 set encoding=utf-8              " (we're not in the eighties anymore)
 
+set shortmess+=I                " Skip intro message
+set lazyredraw                  " Slight speedup by not redrawing as often
+
 set incsearch
 set spelllang=sv
 set hidden                      " Abandoning a buffer makes it hidden instead of
 set showcmd                     " Show keys pressed in normal mode in last line
 set splitright                  " :vsplit splits to right
 
+set history=500                 " Long ex-command & search history is nice.
+set cpoptions+=M                " Makes % not skip over \( and \)
+
+set tildeop
+
 " Use persistent undo if available
 if version >= 703
   set undodir=~/.vim/undodir
 
 """" Mappings """""""""""""""""""""""""""""""""""""""""""""""""""""""
 "let mapleader = ","
-let mapleader = " "
+"let mapleader = " "
+let mapleader = "-"
+
+noremap ä :
 
 " Bind C-h to fully dedent (clear all leading whitespace)
 noremap  <C-h> :s/^\s*//<CR>
 cnoremap <C-k> <Up>
 
 " Fast shortcut for opening files
-nnoremap <C-e> :e 
+nnoremap <C-a> :e 
 
 " Headerify current line
 nnoremap <Leader>== yypv$r=A==<ESC>kI <ESC>Vj:center<CR>
 \ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR>
 
 
-"""" Buffer management mappings """""""""""""""""
+"""" Buffer management mappings """""""
 " Switch to last (alternate) buffer with <Leader><Leader>, and reload current
 " file with <Leader>e.
 nnoremap <Leader><Leader> <C-^>
 inoremap <Tab> <C-v><Tab>
 
 
-"""" Formatting, aesthetics """""""""""""""""""""""""""""""""""""""""
+"""" Formatting etc. """"""""""""""""""""""""""""""""""""""""""""""""
+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
+
+
+"""" Visuals, aesthetics """"""""""""""""""""""""""""""""""""""""""""
 "set number                      " Use line numbering
 set ruler                       " Show scroll percentage in statusline
 set cursorline                  " Highlight cursor's line
                                 " exceeding screen size.
 set scrolloff=5                 " Keep 5 lines visible vertically
 
-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
-
 " Use pretty characters for vim's rendering of things.
 " (fillchar/stlnc doesn't support multibyte chars.. :<)
 set list listchars=tab:»\ ,trail:·,nbsp:␣,extends:$,precedes:^
 set foldmethod=marker
 
 if version >= 703
-  set colorcolumn=+1            " Highlight column after the `textwidth`th one
+  set colorcolumn=+0            " Highlight 'textwidth'th column
 end
 syntax on                       " Use syntax highlighting
 
+" In case I end up in the GUI, make it behave more like shell vim.
+set go-=mT gcr+=a:blinkon0
+
 
 " Add a few custom filetypes
 au BufRead,BufNewFile {*.json}               setf javascript
 au FileType lua  setlocal comments=:--
 
 
-"""" Colour scheme """"""""""""""""""""""""""""""""""""""""""""""""""
+"""" Colour scheme """"""""""""""""""""
 if $TERM == "xterm"
   " assume 256-colour terminal
   set t_Co=256
 \                        , '256ctermbg' : 'NONE' }
 \     , 'ModeMsg'      : { 'attr'       : 'bold'
 \                        , '256ctermfg' : '2'    }
+\
 \     , 'Operator'     : { '256ctermfg' : '73'   }
+\     , 'markdownCode' : { '256ctermfg' : '175'  }
+\     , 'markdownCodeBlock' : { '256ctermfg' : '175'  }
 \     }
 "\                          '256ctermfg' : '253'
 color jellybeans
 "hi Conceal ctermfg=cyan ctermbg=none
 
 
-"""" Status line """"""""""""""""""""""""""""""""""""""""""""""""""""
+"""" Status line """"""""""""""""""""""
 "set laststatus=1                " Only display status line if >1 window
 set laststatus=2                " Never mind.  Always display status line.
 
 
 "NERDTree
 let g:NERDTreeMinimalUI=1
-noremap <F10> :<C-u>NERDTreeToggle<CR>
+nnoremap <F10> :<C-u>NERDTreeToggle<CR>
+
+" gundo
+nnoremap <F9> :GundoToggle<CR>
 
 "netrw
 let g:netrw_bufsettings = 'noma nomod nu nobl nowrap ro'
 "  noremap <C-x>  :call JumpToNotesWindow()<CR>
 "endif
 
-au Syntax vim  let b:comment_prefix='"'
-au Syntax lua  let b:comment_prefix='--'
-noremap <Leader>gc :exe 's:^ \?:' . b:comment_prefix . ':'<CR>
-noremap <Leader>gC :exe 's:^' . b:comment_prefix . '\( \?\):\1\1:'<CR>
+"au Syntax vim  let b:comment_prefix='"'
+"au Syntax lua  let b:comment_prefix='--'
+"noremap <Leader>gc :exe 's:^ \?:' . b:comment_prefix . ':'<CR>
+"noremap <Leader>gC :exe 's:^' . b:comment_prefix . '\( \?\):\1\1:'<CR>
+
+let s:syntaxStackBufferId = -1
+
+fun! UpdateSyntaxStack()
+  if s:syntaxStackBufferId == -1
+    return
+  endif
+
+  let l:synstack = synstack(line('.'), col('.'))
+  let l:column   = col('.')
+
+  " FIXME: Make this this not mess up what the `#` buffer refers to.
+
+  exe 'buffer ' . s:syntaxStackBufferId
+  normal ggdG
+
+  for id in l:synstack
+    exe 'normal a' . synIDattr(id, 'name') . "\n"
+  endfor
+
+  buffer #
+  exe 'normal ' . l:column . '|'
+endfun
+
+fun! ToggleSyntaxStackWindow()
+  if s:syntaxStackBufferId == -1
+    " Prepare window & buffer
+    topleft vertical new
+    enew
+    vertical resize 20
+    setlocal nonu stl=Syntax\ stack
+    set buftype=nofile
+   "normal <C-w>p
+
+    " Save buffer number
+    let s:syntaxStackBufferId = bufnr('%')
+
+  else
+    " Maybe this should be :bwipeout instead...
+    exe 'bdelete ' . s:syntaxStackBufferId
+    let s:syntaxStackBufferId = -1
+  endif
+endfun
+
+nnoremap <F12> :call ToggleSyntaxStackWindow()<CR>
+
+augroup syntaxStack
+  au!
+  au CursorMoved * :call UpdateSyntaxStack()
+augroup end
+
 
 xbacklight = 0
 
-(sleep 5 &&
+(sleep 2 &&
   setxkbmap se-ff
   xbindkeys
   xcape
+
+  mpd
+# mpdscribble
 ) &
 
 #(sleep 10 && kmail) &
   Title="$title_set;%n@%m %~$title_stop"
 fi
 
-PROMPT="%{$fg[$prompt_color]%}%n@%m%{$reset_color%} %~
-%# "
-RPROMPT="%{$up%}[%{$fg[yellow]%}%?%{$reset_color%}]%{$down%}%{$Title%}"
-PS2="» "
+#PROMPT="%{$fg[$prompt_color]%}%n@%m%{$reset_color%} %~
+#%# "
+#RPROMPT="%{$up%}[%{$fg[yellow]%}%?%{$reset_color%}]%{$down%}%{$Title%}"
+#PS2="» "
 
 ### Alternative prompt (two-line prompt)
-#PROMPT="%{$fg[grey]%}╭╴%{$fg[$prompt_color]%}%n@%m%{$reset_color%} %~
-#%{$fg[grey]%}╰▶ %{$reset_color%}"
-#up_1="$(echo -e '\e[A')"
-##∘
-#PS2="%{${up_1}$fg[grey]%}│%{$reset_color%}│
-#%{$fg[grey]%}╰▶ %{$reset_color%}"
+#PROMPT="%{$fg[$prompt_color]%}%n@%m%{$reset_color%} %~
+#%# "
+#RPROMPT="%{$up%}[%{$fg[yellow]%}%?%{$reset_color%}]%{$down%}%{$Title%}"
+
+PROMPT="%{$fg[$high_color]%}╭╴%{$fg[$prompt_color]%}%n@%m%{$reset_color%} %~
+╰%{${fg[yellow]}%}%# %{$reset_color%}"
+RPROMPT="%{$up%}[%{$fg[yellow]%}%?%{$reset_color%}]%{$down%}%{$Title%}"
+
+PS2="%{${up}$reset_color%}│»
+╰%{${fg[yellow]}%}» %{$reset_color%}"
+##∘▶
 
 # History
 export HISTSIZE=2000