dotfiles icon indicating copy to clipboard operation
dotfiles copied to clipboard

Update vim prose / markdown settings

Open christoomey opened this issue 13 years ago • 0 comments

Prose

Quick Links

Want an in context way to run a Google search and create a Markdown link for the top result. Thinking that shelling out to a simple script, ala Brett Terpstra's script here could make sense. Alternately, the GIFL plugin uses inline ruby within the plugin to do the fetching. Likewise, this could be accomplished with webapi-vim

Switching Case

Would like map for switching case of words. Particularly useful to title case some words, but could be more generally useful. Vimtips has a related tip

Local Dictionary

Also need to figure out how to setup local dictionary (for adding new words) and thesaurus

From tpope's vimfiles

if exists("+spelllang")
  set spelllang=en_us
endif
set spellfile=~/.vim/spell/en.utf-8.add
setlocal spell spelllang=en_us
set spellfile=~/.vim/spellfile.add
set thesaurus+=/Users/sbrown/.vim/thesaurus/mthesaur.txt

Fan off formatoption+=a, but only while typing. Could I selectively enable it?

autocmd InsertEnter markdown call EnableWrapIfInParagraph()
autocmd InsertLeave markdown setlocal formatoptions-=a

function! EnableWrapIfInParagraph()
    " code that looks at current line and preceding / following line to
    " determine if currently in a 'paragraph'
    setlocal formatoptions+=a " Enable automatic line wrapping
function

Undo points during prose writing

https://github.com/nother/vim-prose/blob/master/plugin/vimprose.vim

" set an undo point at the ends of sentences since it's common
" to write a fair amount before leaving insert mode.
inoremap <buffer> . .<C-g>u
inoremap <buffer> ! !<C-g>u
inoremap <buffer> ? ?<C-g>u
inoremap <buffer> : :<C-g>u

vim-pencil seems to ship with this, plus some other fun.

Another option would be to define a custom formatexpr, or to use the fo+=t option which only updates while in insert mode.

Moving between wiki pages and tags

I want to be able to hit <tab> and <S-tab> to jump bewteen the previous and next link or tag in the document. I then want to be able to hit <cr> and either open the URL, or follow the wiki link. Currently having an issue with links that break across lines, ie>

this is a line with a [link that
spans lines](http://google.com)

Proofing

Incorporate checks for passive voice, weasel words, etc. Ref this words to avoid script, as well as this list of plugins for prose. Perhaps it could be expanded to highlight various aspects of a piece of writing like hemingwayapp using a technique similar to easytags dynamic highlighting Similar features were recently add to Draft. Consider using something like Vim marks to highlight words used multiple times.

Vim wordy is a plugin for hemingway like functionality in vim

christoomey avatar Nov 09 '12 18:11 christoomey