diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-10-30 23:47:33 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-10-30 23:49:45 +1300 |
commit | 92f2c78524d1e446aa2ab08b12b54a56dfbbbd26 (patch) | |
tree | 57d0aee3424ef87e5794168cab341c9be6fc34a3 /vim/config/wrap.vim | |
parent | Toggle Vim 'hlsearch' and 'incsearch' locally (diff) | |
download | dotfiles-92f2c78524d1e446aa2ab08b12b54a56dfbbbd26.tar.gz dotfiles-92f2c78524d1e446aa2ab08b12b54a56dfbbbd26.zip |
Show Vim option values after leader-key toggle
Using the very weird syntax:
:setlocal option! option?
We can toggle the option and print its new value in the same line. For
the line breaking options, we only show the value of the 'linebreak'
option, because otherwise we print three lines of messages, which
requires an <Enter> press, even if we put all three `option?` calls on
one :setlocal line.
Diffstat (limited to 'vim/config/wrap.vim')
-rw-r--r-- | vim/config/wrap.vim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/vim/config/wrap.vim b/vim/config/wrap.vim index cad3ec1a..831cd907 100644 --- a/vim/config/wrap.vim +++ b/vim/config/wrap.vim @@ -1,6 +1,6 @@ " Don't wrap by default, but use \w to toggle it on or off quickly set nowrap -nnoremap <leader>w :setlocal wrap!<CR> +nnoremap <leader>w :setlocal wrap! wrap?<CR> " When wrapping text, if a line is so long that not all of it can be shown on " the screen, show as much as possible anyway; by default Vim fills the left @@ -40,7 +40,7 @@ if has('linebreak') " If linebreak is on, turn it off if &l:linebreak - setlocal nolinebreak + setlocal nolinebreak linebreak? setlocal showbreak= if s:breakindent setlocal nobreakindent @@ -48,7 +48,7 @@ if has('linebreak') " If it's off, turn it on else - setlocal linebreak + setlocal linebreak linebreak? setlocal showbreak=... if s:breakindent setlocal breakindent |