elzr / vim-json

A better JSON for Vim: distinct highlighting of keywords vs values, JSON-specific (non-JS) warnings, quote concealing. Pathogen-friendly.
Other
1.23k stars 111 forks source link

Feature suggestion: Shortcuts for changing keys and values #60

Open toupeira opened 9 years ago

toupeira commented 9 years ago

Just stumbled over this plugin, thanks for maintaining it! Immediately after starting to use it I had the following seemingly brilliant idea:

" change the JSON key on the current line
nnoremap ck ^ci"

" change the JSON value on the current line
nnoremap cv $F"ci"

I think adding maps like this (maybe using <Leader> instead) would make a great addition to the plugin, and you could expand the idea further to maybe create text objects for JSON keys and values, and add shortcuts for other common operations (add new keys, change value type between string/array/object, etc.)