Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Nice! I recently started using Vim for prose and was mentally writing (in preparation for actually writing) a plugin that would do just this. I couldn't think of any better way to do it either, other than what you've done, setting up splits to the left and right. You've added some stuff that I hadn't thought of that makes it even nicer.

This is something else I use:

  function TextEdit()
    set spell
    set formatoptions=1
    set linebreak
    set wrap
    set nolist
    nnoremap j gj
    nnoremap k gk
    vnoremap j gj
    vnoremap k gk
    set guifont=Monaco:h16
  endfunction
  
  if has('autocmd')
    au BufRead,BufNewFile *.txt call TextEdit()
    au BufRead,BufNewFile *.markdown call TextEdit()
  endif
It gets paragraphs wrapping at words and and lets you move up and down by visual lines rather than actual lines. The last bit applies the settings automatically when opening a .txt or .markdown file. It looks like your plugin already does this, but maybe it would be useful for someone who wants a partial solution.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: