From 472181c1990d924192115b498c203c0ea15c67a6 Mon Sep 17 00:00:00 2001 From: kiryph Date: Sun, 13 Sep 2020 17:00:38 +0200 Subject: [PATCH] Add toggle yoy for :syntax enable/off see also :h g:syntax_on --- doc/unimpaired.txt | 1 + plugin/unimpaired.vim | 3 +++ 2 files changed, 4 insertions(+) diff --git a/doc/unimpaired.txt b/doc/unimpaired.txt index c258f51..9c14d03 100644 --- a/doc/unimpaired.txt +++ b/doc/unimpaired.txt @@ -88,6 +88,7 @@ On Off Toggle Option *[ov* *]ov* *yov* 'virtualedit' *[ow* *]ow* *yow* 'wrap' *[ox* *]ox* *yox* 'cursorline' 'cursorcolumn' (x as in crosshairs) +*[oy* *]oy* *yoy* 'syntax' The mnemonic for y is that if you tilt it a bit it looks like a switch. diff --git a/plugin/unimpaired.vim b/plugin/unimpaired.vim index 41872fa..20d3aed 100644 --- a/plugin/unimpaired.vim +++ b/plugin/unimpaired.vim @@ -284,6 +284,9 @@ call s:map('n', 'yov', ':set =(&virtualedit =~# "all") ? "virtualedit-=all" call s:map('n', '[ox', ':set cursorline cursorcolumn') call s:map('n', ']ox', ':set nocursorline nocursorcolumn') call s:map('n', 'yox', ':set =cursor_options()') +call s:map('n', '[oy', ':set syntax=enable') +call s:map('n', ']oy', ':set syntax=off') +call s:map('n', 'yoy', ':if exists("g:syntax_on") syntax off else syntax enable endif') call s:map('n', '[o+', ':set cursorline cursorcolumn') call s:map('n', ']o+', ':set nocursorline nocursorcolumn') call s:map('n', 'yo+', ':set =cursor_options()')