Skip to content

Singularize <-> Pluralize

License

Notifications You must be signed in to change notification settings

kyohsuke/sinplu.vim

Repository files navigation

CI

sinplu.vim - Singularize <-> Pluralize

Based on Active Support

Installation

NeoBundle 'kyohsuke/sinplu.vim'

of course you can use Vundle, pathogen or any plug-in manager.

Configuration

keymap

" if you need mapping as you like, you can do like this.
let g:sinplu_no_mappings = 1
nmap <Leader>s <Plug>SingularizeWord
nmap <Leader>p <Plug>PluralizeWord
nmap <Leader>t <Plug>ToggleWord

Singularize and/or Pluralize

" you can add Singularize/Pluralize rule.
" syntax is same as substitute(<word>, <from>, <to>, <flag>) 
let g:sinplu_singular_override_wards = [
      \ ['from', 'to', 'flag']
      \ ]

" for example, here is override the 'index -> indices' rule to 'index -> indexes'
let g:sinplu_plural_override_wards = [
      \ ['(ind)ex$', '\1exes', 'i']
      \ ]

LICENSE

MIT