Skip to content

Instantly share code, notes, and snippets.

@nerflad
Last active February 7, 2017 01:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nerflad/5f63b83e39672933d1e48722d4879a9b to your computer and use it in GitHub Desktop.
Save nerflad/5f63b83e39672933d1e48722d4879a9b to your computer and use it in GitHub Desktop.
Swap boolean truthiness keywords using increment/decrement keys
function ProvideAlternativeFacts()
if expand('<cword>') == "True"
execute "normal! ciwFalse"
elseif expand('<cword>') == "False"
execute "normal! ciwTrue"
endif
endfunction
nnoremap <c-a> :call ProvideAlternativeFacts()<CR><C-a>
nnoremap <c-x> :call ProvideAlternativeFacts()<CR><C-x>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment