Guest User

Untitled

a guest
Jan 22nd, 2018
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. if !exists('g:inflect_pluralize_cmd')
  2. let g:inflect_pluralize_cmd = "perl -MLingua::EN::Inflect=PL -E 'print PL(\"%s\")'"
  3. endif
  4.  
  5. function! s:inflect_pluralize(word)
  6. return system(substitute(g:inflect_pluralize_cmd, "%s", a:word, "g"))
  7. endfunction
  8.  
  9. function! s:insert_(v)
  10. execute "normal i" . a:v ."\<Esc>"
  11. echo a:v
  12. endfunction
  13.  
  14. command! -nargs=1 PL echo s:inflect_pluralize(<q-args>)
  15. command! -nargs=1 PLI call s:insert_(s:inflect_pluralize(<q-args>))
Add Comment
Please, Sign In to add comment