aboutsummaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-08 20:37:44 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-08 20:37:44 +1200
commitf05ec42405eb8bb6a6d92e85f3bdc4f81a1cc746 (patch)
tree35bcaeb68977bfbb5a51ab6e1659b74d3be30d95 /vim
parentSeparate 'directory' slashes into its own string (diff)
downloaddotfiles-f05ec42405eb8bb6a6d92e85f3bdc4f81a1cc746.tar.gz
dotfiles-f05ec42405eb8bb6a6d92e85f3bdc4f81a1cc746.zip
Document 'formatoptions' l and 1 flags
Diffstat (limited to 'vim')
-rw-r--r--vim/vimrc21
1 files changed, 18 insertions, 3 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 55ff8cea..8f06d787 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -276,9 +276,24 @@ set foldmethod=indent
"
set foldlevelstart=99
-" Automatic formatting options
-set formatoptions+=l " Don't break a long line in insert mode
-set formatoptions+=1 " Avoid breaking lines after one-letter words
+" Automatic text wrapping options using flags in the 'formatoptions' option
+" begin here. I allow filetypes to set 't' and 'c' to configure whether text
+" or comments should be wrapped, and don't mess with it here.
+"
+" If a line is already longer than 'textwidth' would otherwise limit when
+" editing of that line begins in insert mode, don't suddenly automatically
+" wrap it.
+"
+set formatoptions+=l
+
+" Don't wrap a line in such a way that a single-letter word like "I" or "a" is
+" at the end of it. Typographically, as far as I can tell, this seems to be
+" a stylistic preference rather than a rule like avoiding "widow" and "orphan"
+" lines in typesetting. I think it generally looks better to have the short
+" word start the line.
+"
+set formatoptions+=1
+
if vimrc#Version('7.3.541')
set formatoptions+=j " Delete comment leaders when joining lines
endif