Skip to content

How to quickly delete the entire method? #374

Answered by lippfi
yaoqiangpersonal asked this question in Q&A
Discussion options

You must be logged in to vote

You can create some clever vim mapping to do this.
e.g. if you place your caret at the first line of function definition nnoremap dm Va{%d would do the job for functions like this:

fun name(args): Int {
  ....
}

or even better nnoremap dk V/{<CR>%d would also work for functions where arguments occupy multiple lines:

fun name(arg1,
arg2) {
  ...
}

Replies: 4 comments 11 replies

Comment options

You must be logged in to vote
3 replies
@yaoqiangpersonal
Comment options

@Sebastian-Nielsen
Comment options

@lippfi
Comment options

Answer selected by yaoqiangpersonal
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
8 replies
@megawubs
Comment options

@magidc
Comment options

@lippfi
Comment options

@megawubs
Comment options

@magidc
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants