Skip to main content
added 2 characters in body
Source Link
VanLaser
  • 9.9k
  • 2
  • 26
  • 37

This is a simple one, you can add more delimiters in the [ ] group, but it won't check for the "inside" of anything:

inoremap <C-x><C-x> <Esc>/[\])}"]/e<CR>a,

It just searchsearches for the 1st delimiter in the list, goes after it and appends a comma. So it roughly goes out of the "most inner" delimited group. If I'd use such a map, I'd skip the comma addition and add some more delimiters, to keep it more generic, and repeatable - say I hit <C-x><C-x> and I don't like where I landed, I just repeat the combo and go "out" after the next delimiter.

This is a simple one, you can add more delimiters in the [ ] group, but it won't check for the "inside" of anything:

inoremap <C-x><C-x> <Esc>/[\])}"]/e<CR>a,

It just search for the 1st delimiter in the list, goes after it and appends a comma. So it roughly goes out of the "most inner" delimited group.

This is a simple one, you can add more delimiters in the [ ] group, but it won't check for the "inside" of anything:

inoremap <C-x><C-x> <Esc>/[\])}"]/e<CR>a,

It just searches for the 1st delimiter in the list, goes after it and appends a comma. So it roughly goes out of the "most inner" delimited group. If I'd use such a map, I'd skip the comma addition and add some more delimiters, to keep it more generic, and repeatable - say I hit <C-x><C-x> and I don't like where I landed, I just repeat the combo and go "out" after the next delimiter.

Source Link
VanLaser
  • 9.9k
  • 2
  • 26
  • 37

This is a simple one, you can add more delimiters in the [ ] group, but it won't check for the "inside" of anything:

inoremap <C-x><C-x> <Esc>/[\])}"]/e<CR>a,

It just search for the 1st delimiter in the list, goes after it and appends a comma. So it roughly goes out of the "most inner" delimited group.