New answers tagged

0 votes

Swap a 0 under the cursor with a 1 and vice versa

For a quick one-liner we can adapt my answer to the almost identical question on Stack Overflow. I'm reposting it here to milk it for rep gain because it's more relevant on this SE. :nnoremap <F6&...
Friedrich's user avatar
  • 1,877
0 votes

Swap a 0 under the cursor with a 1 and vice versa

You can increment and decrement numbers with C-a and C-x. The sequences r0 and r1 will also work.
D. Ben Knoble's user avatar
  • 26.2k
1 vote
Accepted

Swap a 0 under the cursor with a 1 and vice versa

function! One2Zero() let c = getline('.')[col('.')-1] if c == '1' return 'r0' elseif c == '0' return 'r1' else return "\<F6>" endif endfunction nnoremap <expr&...
Vivian De Smedt's user avatar
0 votes

Generate tag links of search pattern in Vimwiki

Looking at the VimWiki API you could do something like: function! GenerateTagLinksRegex(regex) let tags = vimwiki#tags#get_tags() echom '^' .. a:regex .. '$' call filter(tags, {i, tag -> (...
Vivian De Smedt's user avatar

Top 50 recent answers are included