Commits

firefly committed d8a967c

Changes!

  • Participants
  • Parent commits 4078b71

Comments (0)

Files changed (11)

 !urxvt.font: 7x13
 !urxvt.font: xft:DejaVu Sans Mono-7
 !urxvt.font: xft:DejaVu Sans Mono:size=7
-urxvt.font: xft:DejaVu Sans Mono:pixelsize=12
+!urxvt.font: xft:DejaVu Sans Mono:pixelsize=12
+urxvt.font: xft:DejaVu Sans Mono:size=9
 !urxvt.font: xft:inconsolata:pixelsize=14
 !urxvt.font: xft:mplus 1mn light:size=9
 urxvt.urgentOnBell:    true
 
 
 ! -- xft settings ---------------------------------------------------
-Xft.dpi:       124
+!Xft.dpi:       124
+Xft.dpi:       114
+!Xft.dpi:       96
 !Xft.autohint:  0
-Xft.lcdfilter: lcddefault
-Xft.hintstyle: hintfull
-Xft.hinting:   1
+!Xft.lcdfilter: lcddefault
+!Xft.hintstyle: hintfull
+!Xft.hinting:   1
 Xft.antialias: 1
 Xft.rgba:      rgb
 

File config/herbstluftwm/autostart

 
 # this is a simple config for herbstluftwm
 
+# Update the $PATH so that ~/.config/herbstluftwm and /etc/xdg/hebrstluftwm are
+# searched (in that order) too.  Useful for splitting the config file into
+# multiple scripts, and to include small utility scripts.
+PATH="$XDG_CONFIG_HOME/herbstluftwm:$XDG_CONFIG_PATH/herbstluftwm:$PATH"
+
 function hc() {
     herbstclient "$@"
 }
 hc keybind $Mod-Shift-r reload
 hc keybind $Mod-Shift-c close
 #hc keybind $Mod-Return spawn xterm
-hc keybind $Mod-Return spawn $Term
+hc keybind $Mod-Return spawn "$Term"
+hc keybind $Mod-r emit_hook toggle_runner
 
 # tags
 TAG_NAMES=( {1..9} )
 # cycle through tags
 hc keybind $Mod-period use_index +1 --skip-visible
 hc keybind $Mod-comma  use_index -1 --skip-visible
-hc keybind $Mod-Right use_index +1 --skip-visible
-hc keybind $Mod-Left  use_index -1 --skip-visible
+hc keybind $Mod-Right  use_index +1 --skip-visible
+hc keybind $Mod-Left   use_index -1 --skip-visible
 
 # layouting
 hc keybind $Mod-d remove
 hc set window_border_normal_color '#222222'
 hc set frame_bg_normal_color '#111111'
 
+hc set focus_follows_shift 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 smart_window_surroundings 1
 hc set smart_frame_surroundings 0
 
-
 # rules
 hc unrule -F
 #hc rule class=XTerm tag=3 # move all xterms to tag 3
 hc rule focus=off # normally do not focus new clients
 # give focus to most common terminals
 hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on
-hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' pseudotile=on
+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
 
 # unlock, just to be sure
 hc unlock
 
-herbstclient set tree_style '╾│ ├└╼─┐'
+#herbstclient set tree_style '╾│ ├└╼─┐'
+herbstclient set tree_style '⊙│ ├╰»─╮'
 
 # do multi monitor setup here, e.g.:
 # hc remove_monitor 1
 # hc move_monitor 0 1280x1024+0+0
 # hc add_monitor 1280x1024+1280+0
 
+# auto-detect connected monitors
+hc detect_monitors
+
 # find the panel
-panel=~/.config/herbstluftwm/panel.sh
-[ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh
+#panel=~/.config/herbstluftwm/panel.sh
+#[ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh
 for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do
     # start it on each monitor
-    $panel $monitor &
+    panel.sh $monitor &
 done
 
+# Prepare a (virtual) monitor + tag for floating windows (we do this after the
+# panel etc. have been added, because we don't want these for the
+# floating-windows monitor).
+hc lock
+
+hc tag float
+hc floating float on
+#hc remove_monitor 1
+hc add_monitor 1366x768+0+0 float 16
+
+hc unlock

File config/herbstluftwm/panel.sh

 #font="DejaVu Sans Mono:size=8"
 bgcolor=$(herbstclient get frame_border_normal_color)
 selbg=$(herbstclient get window_border_active_color)
-selfg='#101010'
+#selfg='#101010'
+selfg='#cccccc'
 
 ####
 # Try to find textwidth binary.
 herbstclient pad $monitor $panel_height
 {
     # events:
+    # TODO: Get this working properly, so that the panel is updated to reflect
+    # whether MPD is running.
   # (mpc idleloop player | sed 's/^/mpd_/') &
     (mpc idleloop player | cat) &
   # mpc idleloop player &
 
-    while true; do echo 'tick'; sleep 5; done &
+    # TODO: Replace tick with proper battry event checking.
+    while true; do echo 'tick'; sleep 20; done &
+    echo brightness # emit once to init
 
     while true ; do
         date +'date ^fg()%H^fg(#909090):^fg()%M^fg(#909090), %Y-%m-^fg()%d'
                 windowtitle="${cmd[@]:2}"
                 ;;
 
+            toggle_runner)
+                dmenu_run -fn "$font" -nb "$bgcolor" -nf "#efefef" \
+                          -sb "$selbg" -sf "$selfg"
+                ;;
+
             brightness)
-                brightstatus="$(printf '^fg()%d^fg(#909090)%%' $(brightness-alter.sh '?'))"
+                brightstatus="$(printf '^fg()%d^fg(#909090)%%' $(backlight.sh '?'))"
                 ;;
 
             tick)
                 batstatus="$( t='/sys/class/power_supply/BAT1/'
                               curr=$(cat $t/charge_now)
-                              full=$(cat $t/charge_full)
+                              full=$(cat $t/charge_full_design)
                               status=$(cat $t/status)
                               percent=$(printf '100 * %d / %d\n' $curr $full | bc)
 
 #  export TERM=rxvt-unicode-256color
 #fi
 
-export GREP_OPTIONS='-P --color=auto'
+export GREP_OPTIONS='--color=auto' # -P
 export GREP_COLORS='cx=37'
 
 # see termcap(5)
 # `less` is in my muscle memory...
 #alias less=$PAGER
 
-# aliases for programs relying on termcap/terminfo for detecting 256-color
-# support.
-alias tmux=TERM=xterm-256color\ tmux
+alias hc=herbstclient
 
 alias ..="cd .."
 alias ...="cd ../.."

File vim/screenshot.png

Old
Old image
New
New image

File vim/syntax/lecnote.vim

 " Vim syntax file
 " Language:     Lecture notes
-" Maintainer:   Jonas Höglund <firefly@firefly.nu>
+" Maintainer:   Jonas Höglund <fireflyfireflynu>
 " Filenames:    *.lecnote
-" Last Change:  2012-01-17
+" Last Change:  2012-09-16
 
 if exists("b:current_syntax")
   finish
 "runtime! syntax/markdown.vim
 "unlet! b:current_syntax
 
-syn sync minlines=4
+syn sync minlines=8
 
 
 """" 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   markdownHeading        "^.\+\n\s*=\+$"  contains=markdownHeadingRule
+syn match   markdownHeading        "^.\+\n\s*-\+$"  contains=markdownHeadingRule
 syn match   markdownHeadingRule    "^\s*[=-]\+$"   contained
 
-syn region  markdownHeading  start="^\s*#\+" end="#*\s*$"  oneline contained
+syn region  markdownHeading        matchgroup=markdownHeadingRule
+\           start="^\s*#\+" end="#*\s*$"  oneline
+
+hi def link markdownHeading          Title
+hi def link markdownHeadingRule      PreProc
 
 " 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\@="
+"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
+"""" Foreign-syntax blocks  """""""""""""""""""""""""""""""""""""""""
+" The general definition of a foreign-block
+syn region  lectureForeignBlock        matchgroup=Ignore  keepend
+\           start="{{{\?"              end="}}}\?"  contains=@lectureForeignBlocks
 
-"""" Logic proofs """""""""""""""""""""""""""""""""""""""""""""""""""
-syn include @logicImport           syntax/logic.vim
-syn region  lectureLogicBlock      concealends
-\           start="{{{\?\s*logic"     end="}}}\?"  contains=@logicImport
+" vim-modeline foreign block (de-emphasizes the modeline)
+syn region  lectureModelineBlock       keepend  matchgroup=Ignore
+\           start="{{{\?\s*vim:"      end="}}}\?"
+hi def link lectureModelineBlock       Ignore
 
+" Logic proofs
+syn include @logicImport               syntax/lecnote-sub/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
+" Linear algebra
+syn include @linalgImport              syntax/lecnote-sub/linalg.vim
+syn region  lectureLinalgBlock         keepend  matchgroup=Ignore
+\           start="{{{\?\s*linalg"     end="}}}\?"  contains=@linalgImport
 
-syn region  lectureUnderline       matchgroup=Conceal concealends oneline
-\           start="\S\@<=_\|_\S\@="        end="\S\@<=_\|_\S\@="
+
+"""" 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
+hi def link lectureListMarker      Function
 
 let b:current_syntax = "lecnote"
 

File vim/syntax/todo.vim

 """" Syntax rules """""""""""""""""""""""""""""""""""""""""""""""""""
 
 syn match    todoChecked         "\[[xo]\]"
-syn match    todoUnchecked       "\[ \]"     nextgroup=todoUncheckedTrail
+syn match    todoUnchecked       "\[ \]"         nextgroup=todoUncheckedTrail
+syn match    todoHalfway         "\[[-.1234]\]"  nextgroup=todoHalfwayTrail
 
 syn match    todoUncheckedTrail  ".*$"       contained
+syn match    todoHalfwayTrail    ".*$"       contained
 
 
 """" Highlighting """""""""""""""""""""""""""""""""""""""""""""""""""
 hi def link  todoChecked         Special
 hi def link  todoUnchecked       Todo
 hi def link  todoUncheckedTrail  Constant
+hi def link  todoHalfwayTrail    Function
 
 let b:current_syntax = "todo"
 cnoremap <C-j> <Down>
 cnoremap <C-k> <Up>
 
+" Fast shortcut for opening files
+nnoremap <C-e> :e 
+
 " Headerify current line
-nnoremap <Leader>== yypv$r=A==<ESC>kI <ESC>j
+nnoremap <Leader>== yypv$r=A==<ESC>kI <ESC>Vj:center<CR>
 "nnoremap <Leader>-- yypv$r-A--<ESC>kI <ESC>j
 
 " Shortcut for splitting
 \                        , '256ctermbg' : '234'  }
 \     , 'ColorColumn'  : { '256ctermbg' : '233'  }
 \     , 'LineNr'       : { '256ctermfg' : '238'  }
+\     , 'Folded'       : { '256ctermbg' : '234'  }
 \     , 'CursorLineNr' : { '256ctermfg' : '3'
 \                        , '256ctermbg' : '234'  }
 \     , 'Conceal'      : { '256ctermfg' : '14'
 set statusline+=[%2n]\          " 2-char bufno, space
 set statusline+=%-8.(%l,%c%V%)  " group of line# & col#
 set statusline+=\ %*            " --> highlight again (with space)
-set statusline+=\ %P            " space, percentage in file
+set statusline+=\ %P\           " space, percentage in file, space
 
 " Make the ruler also display the bufno
-set rulerformat=%2*[%2n]\ %-8.(%l,%c%V%)\ %P
+set rulerformat=%2*[%2n]\ %-8.(%l,%c%V%)\ %P\ 
 
 " Title string
+set titlestring="hello"
 set title
 
 
 let g:netrw_bufsettings = 'noma nomod nu nobl nowrap ro'
 
 
+""" Plugin keymappings """"""""""""""""
+noremap <Leader>a= :Tabularize /=<CR>
+noremap <Leader>a: :Tabularize /:<CR>
+noremap <Leader>a\| :Tabularize /\|<CR>
+
 nnoremap <Leader>, :source %<CR>
 
+
+"""" Scratchpad area """"""""""""""""""""""""""""""""""""""""""""""""
 """ temp
 "if !exists("*JumpToNotesWindow")
 "  fun JumpToNotesWindow()
 "  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>
 #"xbacklight - 12"
-"brightness-alter.sh - 5"
+"backlight.sh - 1"
     m:0x0 + c:232
     XF86MonBrightnessDown
 
 #"xbacklight + 30"
-"brightness-alter.sh + 5"
+"backlight.sh + 1"
     m:0x0 + c:233
     XF86MonBrightnessUp
 
 #exec xterm
 #exec openbox-session
 #exec twm
-#exec awesome
-exec herbstluftwm
+ exec awesome
+#exec herbstluftwm
 ### Variables
 
 ### Setup prompt
-#PROMPT="%{$fg[$prompt_color]%}%n@%m%{$reset_color%} %~ %# "
-#RPROMPT="[%{$fg[yellow]%}%?%{$reset_color%}]"
-PS2="» "
+#echo -e '\e]0;zsh\007'
 
 esc="$(echo -e '\e')"
 up="${esc}[A"
 down="${esc}[B"
+title_set="${esc}]0"
+title_stop="$(echo -e '\007')"
+
+#PROMPT="%{$fg[$prompt_color]%}%n@%m%{$reset_color%} %~ %# "
+#RPROMPT="[%{$fg[yellow]%}%?%{$reset_color%}]"
 
 ### Setup prompt
+# Only set terminal emulator title in $RPROMPT if we're likely to be running
+# from a graphical terminal.
+if [ $TERM = 'linux' ]; then
+  Title=
+else
+  Title="$title_set;%n@%m %~$title_stop"
+fi
+
 PROMPT="%{$fg[$prompt_color]%}%n@%m%{$reset_color%} %~
 %# "
-RPROMPT="%{$up%}[%{$fg[yellow]%}%?%{$reset_color%}%{]$down%}"
+RPROMPT="%{$up%}[%{$fg[yellow]%}%?%{$reset_color%}]%{$down%}%{$Title%}"
+PS2="» "
 
 ### Alternative prompt (two-line prompt)
 #PROMPT="%{$fg[grey]%}╭╴%{$fg[$prompt_color]%}%n@%m%{$reset_color%} %~
 setopt hist_ignore_all_dups
 
 
+#### Aliases ########################################################
+# (zsh specific--also see .shellrc)
+alias -g G='| grep -P'
+alias -g L='| less'
+
+
 #### Fix key bindings ###############################################
 #bindkey -e # emacs-like bindings
 bindkey -v # vim-like bindings