Skip to content

A simple Vim plugin to toggle boolean values in Python based on switch.vim

License

Notifications You must be signed in to change notification settings

gerazov/vim-toggle-bool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 

Repository files navigation

vim-toggle-bool

⚠ I've ported a leaner version of this to lua toggle-bool.nvim

This is a very simple Vim plugin built on top of switch.vim that can be used to toggle various boolean values. The following toggles are made:

  • True ←→ False
  • Yes ←→ No
  • On ←→ Off
  • 1 ←→ 0
  • Enable(d) ←→ Disable(d)
  • First ←→ Last
  • Before ←→ After
  • Persistent ←→ Ephemeral
  • Internal ←→ External
  • Ingress ←→ Egress
  • Allow ←→ Deny
  • All ←→ None

The toggle works for the first match on the current line and does not change the cursor position. Upper, lower and capitalised case are supported and retained.

Install

Install can be done via a plugin manager. Additionally switch.vim needs to be installed as well.

For vim-plug it's:

Plug 'AndrewRadev/switch.vim'
Plug 'gerazov/vim-toggle-bool'

Usage

The plugin creates a single command ToggleBool. An example keymapping is:

nnoremap <silent> <Leader>s :ToggleBool<CR>

Requirements

Toggling is done via switch.vim and is needed to be installed.

About

A simple Vim plugin to toggle boolean values in Python based on switch.vim

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published