diff --git a/README.markdown b/README.markdown index 91b93f9..9d97a9d 100644 --- a/README.markdown +++ b/README.markdown @@ -133,7 +133,7 @@ NeoBundle 'reedes/vim-pencil' Run the following in a terminal: -```vim +```bash cd ~/.vim/bundle git clone https://github.com/reedes/vim-pencil ``` diff --git a/autoload/pencil.vim b/autoload/pencil.vim index 3131a93..f93bcca 100644 --- a/autoload/pencil.vim +++ b/autoload/pencil.vim @@ -276,7 +276,7 @@ fun! pencil#init(...) abort " TODO how to separate quote from apostrophe use? if b:pencil_wrap_mode aug pencil_iskeyword - au BufEnter setl isk& | setl isk-=_ | setl isk+=$,%,&,#,-,' + au BufEnter setl isk& | setl isk-=_ | setl isk+=$,%,&,#,-,',+ aug END el sil! au! pencil_iskeyword * @@ -287,24 +287,28 @@ fun! pencil#init(...) abort setl nolist setl wrapmargin=0 setl autoindent " needed by formatoptions=n - + setl indentexpr= if has('smartindent') setl nosmartindent " avoid c-style indents in prose en + if has('cindent') + setl nocindent " avoid c-style indents in prose + en setl formatoptions+=n " recognize numbered lists setl formatoptions+=1 " don't break line before 1 letter word setl formatoptions+=t " autoformat of text (vim default) - setl formatoptions+=2 " preserve indent based on 2nd line for rest of paragraph + "setl formatoptions+=2 " preserve indent based on 2nd line for rest of paragraph " clean out stuff we likely don't want setl formatoptions-=v " only break line at blank entered during insert setl formatoptions-=w " avoid erratic behavior if mixed spaces setl formatoptions-=a " autoformat will turn on with Insert in HardPencil mode - setl formatoptions-=o " don't insert comment leader + setl formatoptions-=2 " doesn't work with with fo+=n, says docs " plasticboy/vim-markdown sets these to handle bullet points " as comments. Not changing for now. + "setl formatoptions-=o " don't insert comment leader "setl formatoptions-=c " no autoformat of comments "setl formatoptions+=r " don't insert comment leader @@ -318,11 +322,15 @@ fun! pencil#init(...) abort if has('smartindent') setl smartindent< nosmartindent< en + if has('cindent') + setl cindent< nocindent< + en if has('conceal') setl conceallevel< setl concealcursor< en + setl indentexpr< setl autoindent< noautoindent< setl list< nolist< setl wrapmargin<