Skip to content

Instantly share code, notes, and snippets.

@violetyk
Created April 26, 2012 02:08
Show Gist options
  • Save violetyk/2495195 to your computer and use it in GitHub Desktop.
Save violetyk/2495195 to your computer and use it in GitHub Desktop.
[vim]qfixhowm
"----------------------------------------------------
" QFixHowm
" Bundle 'fuenor/qfixhowm'
"----------------------------------------------------
let howm_dir = $HOME . '/howm'
let howm_fileencoding = 'utf-8'
let howm_fileformat = 'unix'
let QfixHown_UserSwActionLock = ['[]', '[cakephp]', '[vim]', '[linux]']
nnoremap <silent> g,. :<C-u>call HatenaSuperPreHighlight()<CR>
"Hatena super pre highlight
function! HatenaSuperPreHighlight()
let ft = expand('%:e')
if ft == 'howm'
let ft = 'howm_memo'
endif
if &filetype != ft
exec 'setlocal filetype='.ft
return
endif
let sl = search('^>|.\+|$', 'ncbW')
if sl == 0
let sl = search('^>|.\+|$', 'ncW')
endif
if sl != 0
let ft = getline(sl)
let ft = substitute(ft, '[>|]', '', 'g')
exec 'setlocal filetype='.ft
return
endif
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment