aboutsummaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-05-07 09:47:00 +1200
committerTom Ryder <tom@sanctum.geek.nz>2013-05-07 09:47:00 +1200
commit23d41f8c71f272a736906fbeb8d46441aa38dd66 (patch)
treec73e17a7d7500f65752496ff46fb3ee22b373915 /vim
parent6c58f01c8c5efedea7a7f551a3902e00d940ab8e (diff)
downloaddotfiles-23d41f8c71f272a736906fbeb8d46441aa38dd66.tar.gz
dotfiles-23d41f8c71f272a736906fbeb8d46441aa38dd66.zip
formatoptions should not be set in vimrc
I have learned my lesson
Diffstat (limited to 'vim')
-rw-r--r--vim/after/ftplugin/mail.vim7
-rw-r--r--vim/after/ftplugin/markdown.vim3
-rw-r--r--vim/vimrc12
3 files changed, 8 insertions, 14 deletions
diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim
index 2d623e67..a7e4daa8 100644
--- a/vim/after/ftplugin/mail.vim
+++ b/vim/after/ftplugin/mail.vim
@@ -1,3 +1,6 @@
-" Make emails slightly less of a pain to type
-setlocal formatoptions+=aw
+" Auto-format within textwidth
+setlocal formatoptions+=a
+
+" Use trailing whitespace to denote continued paragraph
+setlocal formatoptions+=w
diff --git a/vim/after/ftplugin/markdown.vim b/vim/after/ftplugin/markdown.vim
new file mode 100644
index 00000000..8366275b
--- /dev/null
+++ b/vim/after/ftplugin/markdown.vim
@@ -0,0 +1,3 @@
+" Auto-format within textwidth
+setlocal formatoptions+=a
+
diff --git a/vim/vimrc b/vim/vimrc
index 0c8a3538..bbe90f98 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -78,8 +78,6 @@ endif
" Formatting
set expandtab
-set formatoptions=croqn1
-silent! set formatoptions+=j
set smarttab
set nojoinspaces
set shiftround
@@ -87,16 +85,6 @@ set shiftwidth=4
set softtabstop=4
set tabstop=4
nnoremap J mzJ`z
-if has('eval')
- function! ToggleFormatFlag(flag)
- let l:operation = (&formatoptions =~ a:flag) ? '-=' : '+='
- silent! exec 'setlocal formatoptions' . l:operation . a:flag
- setlocal formatoptions?
- endfunction
- nnoremap <silent> <leader>a :<C-U>call ToggleFormatFlag('a')<CR>
- nnoremap <silent> <leader>c :<C-U>call ToggleFormatFlag('c')<CR>
- nnoremap <silent> <leader>t :<C-U>call ToggleFormatFlag('t')<CR>
-endif
" History
set history=1000