Intellij Java/Scala: Delete to delimiter? (like Emacs Paredit) -


Emacs is one of the terrible characteristics of "paredit" mode that is Lisp-like as well as other languages ​​such as Java / X.

Scala has the ability to kill only Ctrl-K (kill), and it will manipulate the text until it is cleverly delimited, which can be a close quote mark or a closing brace / paren / square-bracket. While keeping your things in verbally valid, it is necessary to remove things as necessary, that means it will remove the correct number of correct closure feet / braces etc.

Is there any such action or keyboard shortcut in Intellij IDEA? Or how would I define a macro to do this?

I have a solution that works almost: Record Macro Sequence (Mac binding):

  • Maximize selection (alt above)
  • Maximize selection (Alt top)
  • Right with selection (Shift RightArrow)
  • Cut selection (CMD X)
  • Then I'm tapping this macro with Ctrl-K, it works great, eg. (The vertical bar is the state of the carat when it is applied):

    List ("first", "second", "third string", "fourth") => List ("first", "second", "third", "fourth")
    {100, 200, {300 |, 400, 500}, 20} = & gt; {100, 200, {300}, 20}

    A case I do not want to work in exactly the same way when I use brackets:

    (1, 2, (3, | 4, 5), 6, 7, 8) = & gt; (1, 2, (3, 6, 7, 8)

    Note that it removes the attached right-bracket, because it includes the brackets contained in the extension-selection If the expression is a string or a braces, then the extension-selection does not include right-handed quotation marks or brace.

    If I knew how to expand-bracket without expanding, So this would be perfect, but I can live with whatever I am now I.


    Comments

    Popular posts from this blog

    HTML/CSS - Automatically set height width from background image? -

    php - Mysql Show Process - Sleep Commands and what to do -

    c - What is the address of buf (the local variable in the main function)? -