flexwiki.vim 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. " Vim filetype plugin file
  2. " Language: FlexWiki, http://www.flexwiki.com/
  3. " Maintainer: George V. Reilly <george@reilly.org>
  4. " Home: http://www.georgevreilly.com/vim/flexwiki/
  5. " Other Home: http://www.vim.org/scripts/script.php?script_id=1529
  6. " Author: George V. Reilly
  7. " Filenames: *.wiki
  8. " Last Change: Wed Apr 26 11:00 PM 2006 P
  9. " Version: 0.3
  10. if exists("b:did_ftplugin")
  11. finish
  12. endif
  13. let b:did_ftplugin = 1 " Don't load another plugin for this buffer
  14. " Reset the following options to undo this plugin.
  15. let b:undo_ftplugin = "setl tw< wrap< lbr< et< ts< fenc< bomb< ff<"
  16. " Allow lines of unlimited length. Do NOT want automatic linebreaks,
  17. " as a newline starts a new paragraph in FlexWiki.
  18. setlocal textwidth=0
  19. " Wrap long lines, rather than using horizontal scrolling.
  20. setlocal wrap
  21. " Wrap at a character in 'breakat' rather than at last char on screen
  22. setlocal linebreak
  23. " Don't transform <TAB> characters into spaces, as they are significant
  24. " at the beginning of the line for numbered and bulleted lists.
  25. setlocal noexpandtab
  26. " 4-char tabstops, per flexwiki.el
  27. setlocal tabstop=4
  28. " Save *.wiki files in UTF-8
  29. setlocal fileencoding=utf-8
  30. " Add the UTF-8 Byte Order Mark to the beginning of the file
  31. setlocal bomb
  32. " Save <EOL>s as \n, not \r\n
  33. setlocal fileformat=unix
  34. if exists("g:flexwiki_maps")
  35. " Move up and down by display lines, to account for screen wrapping
  36. " of very long lines
  37. nmap <buffer> <Up> gk
  38. nmap <buffer> k gk
  39. vmap <buffer> <Up> gk
  40. vmap <buffer> k gk
  41. nmap <buffer> <Down> gj
  42. nmap <buffer> j gj
  43. vmap <buffer> <Down> gj
  44. vmap <buffer> j gj
  45. " for earlier versions - for when 'wrap' is set
  46. imap <buffer> <S-Down> <C-o>gj
  47. imap <buffer> <S-Up> <C-o>gk
  48. if v:version >= 700
  49. imap <buffer> <Down> <C-o>gj
  50. imap <buffer> <Up> <C-o>gk
  51. endif
  52. endif