with vim, I use object indent.

and frequently I use this

vii:!sort

for sort a block with same indent.
I try set this nnoremap

nn <leader>ss vii:!sort<cr>

but don't work, any suggestion?

ii is a vnoremap for object-indent, maybe this is the problem, with vpass to visual mode and nnoremap don't continue

link|improve this question

63% accept rate
feedback

1 Answer

up vote 0 down vote accepted

Use nmap:

nmap <leader>ss vii:!sort<cr>

Because the plugin maps ii to some function call too, if you use nnoremap the ii mapping the plugin set is not followed.

link|improve this answer
I added <cr> but this don't is the problem – juanpablo Jan 30 at 2:57
@juanpablo, yeah sorry I was too fast. Edited answer should work. – Rob Wouters Jan 30 at 3:02
yeah! this working, but I scary to nmap :P – juanpablo Jan 30 at 3:04
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.