From 4d4d502035a9e7e853f2d1971e614b20d23ea235 Mon Sep 17 00:00:00 2001 From: Anthony Rose Date: Mon, 27 Jan 2025 15:21:35 +0000 Subject: [PATCH] Move colorcolumn into exec section --- vimrc | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/vimrc b/vimrc index 6ac3862..9d45ab4 100644 --- a/vimrc +++ b/vimrc @@ -67,19 +67,6 @@ map map 3 map 3 -" Text wrapping and margin settings. Setting tw=72 is ideal for emails or -" anything that will be read in a Terminal, while tw=100 is better for code or -" for general text that will be viewed in a GUI. If printing, an A4-sized page -" should fit 100 columns at 8pt or 80 columns at 10pt, in Courier or Liberation -" Mono fonts. -" -" You can highlight line-end columns with colorcolumn (cc), which should be one -" larger than the textwidth. E.g. to include a 'margin-bell' line also: -" set tw=80 cc=73,81 -" Clear the colorcolumn highlighting with cc=0. -set textwidth=80 " Suggestions: 72, 80, 100 -execute "set colorcolumn=" . (&textwidth + 1) - " All other settings. set autoindent set autoread @@ -147,6 +134,18 @@ if has('eval') let loaded_netrw=1 let loaded_netrwPlugin=1 + " Text wrapping and margin settings. Setting tw=72 is ideal for emails or + " anything that will be read in a Terminal, while tw=100 is better for code + " or for general text that will be viewed in a GUI. If printing, an A4-sized + " page should fit 100 columns at 8pt or 80 columns at 10pt, in Courier or + " Liberation Mono fonts. + " + " You can highlight line-end columns with colorcolumn (cc), which should be + " one larger than the textwidth. E.g. to include a 'margin-bell' line also: + " set tw=80 cc=73,81 Clear the colorcolumn highlighting with cc=0. + set textwidth=80 " Suggestions: 72, 80, 100 + execute "set colorcolumn=" . (&textwidth + 1) + function! ACPToggleMargins() execute "set textwidth=" . (&textwidth == "80" ? "72" : (&textwidth == "72" ? "100" : "80")) execute "set colorcolumn=" . (&textwidth + 1)