Delete lines in a block of code in vim
If you had this bit of code:
request.post('http://someurl', function(){
request.get('http://someurl', function(){
do.something;
});
});
And you wanted to delete the get request to get to here:
request.post('http://someurl', function(){
});
With the cursor on the end of the 2nd line (on the {
, just do:
-
<Ctrl+v>
Visual block mode -
%
to navigate to the matching}
-
d
to delete
Written by Duncan Wong
Related protips
1 Response
You can use simpler and faster di}
(assume you are inside the block).
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Vim
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#