bairui

Asciidoc Vim settings

Aug 15th, 2011
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 0.96 KB | None | 0 0
  1. " asciidoc settings
  2.  
  3. setlocal foldmethod=marker
  4. setlocal spell spelllang=en_au
  5. setlocal ai et sts=2 sw=2 tw=70 wrap formatoptions=tn
  6.  
  7. nnoremap Q gq}
  8.  
  9. " headings
  10. nnoremap <leader>1 YpVr=o<ESC>
  11. nnoremap <leader>2 YpVr-o<ESC>
  12. nnoremap <leader>3 YpVr~o<ESC>
  13. nnoremap <leader>4 YpVr^o<ESC>
  14. nnoremap <leader>5 YpVr+o<ESC>
  15.  
  16. " title
  17. iabbr i_version <c-r>='v1.0, '.strftime('%B %d, %Y')<CR>
  18. iabbr i_name Barry Arthur
  19. map <leader>t O<C-r>=expand('%:t')<cr><Esc>:s/\..*//<CR>:s/_/ /eg<CR>:s/\<\(\w\)/\U\1/g<CR><leader>1ii_name<c-]><CR>i_version<c-]><CR><CR>
  20.  
  21. " lists
  22. function! MakeList(list_type)
  23.   let lineno = line(".")
  24.   call setline(lineno, a:list_type . " " . getline(lineno))
  25. endfunction
  26. map <leader>lb :call MakeList('*')<CR>j
  27. map <leader>ln :call MakeList('.')<CR>j
  28.  
  29. syn match asciidocListBullet /^\s*[-*+]\+\s/
  30.  
  31. " allow multi-depth list chars (--, ---, ----, .., ..., ...., etc)
  32. set formatlistpat=^\\s*\\(\\(\\d\\+\\.\\?\\)\\\|\\([.*-]\\+\\)\\)\\s\\+
Advertisement
Add Comment
Please, Sign In to add comment