Sublime Text 2 move cursor out of parenthesis, quotes, or brackets

后端 未结 12 714
囚心锁ツ
囚心锁ツ 2020-12-22 20:10

I need a fast way to make the cursor jump outside the auto wrap qoutes or other syntax elements. I don\'t want to have to reach down to my arrow keys each time, and definit

相关标签:
12条回答
  • 2020-12-22 20:36

    Following Riccardo Marotti's post;

    If you would like to bypass the bracket on the next line, you can replace "characters" with "lines" in the args section.

    { "keys": ["shift+space"], "command": "move", "args": {"by": "lines", "forward": true} }
    
    0 讨论(0)
  • 2020-12-22 20:38

    You can use a shortcut (shift+space, or whatever you like) to move the cursor.

    In your Key Bindings - User:

    { "keys": ["shift+space"], "command": "move", "args": {"by": "characters", "forward": true} }
    
    0 讨论(0)
  • 2020-12-22 20:43

    on a Dell XPS, Ctrl Enter does the trick for me

    0 讨论(0)
  • 2020-12-22 20:45

    I made a few key bindings out of macros as well.

    You must make a macro for these, unless you want to spend more time building them, but it's really easy. Just go to Sublime Text, Tools > Record Macro, or hit ctrl Q. Save the file in Packages/User/ and then hit , to open up your User Settings. Paste the settings below in there and boom. ( The | below represents my cursor )

    enter image description here

    Here are the one's I chose:


    Function auto-bracketizer

    When the cursour is here:

    totallyAwesomeness(|) 
    

    Use the option + tilda shortcut.

    ⌥ ~

    This prefills the function with brackets and the text ' # code... ' highlighted. It only works when inside the parenthesis.

    Sublime User Settings

    {
    "keys": ["option+`"], "command": "run_macro_file", "args": {"file": "Packages/User/superBracketizeFunction.sublime-macro"}
    },
    

    Download Macro


    Auto-End Line With Semicolon

    When the cursour is here:

    echo 'say what!!??|'
    

    Use the command + semicolon shortcut.

    ⌘ ;

    This adds a closing ; at the end of current line and moves you to the line below it. It actually works wherever you are on the line.

    Sublime User Settings

    {
    "keys": ["super+;"], "command": "run_macro_file", "args": {"file":  "Packages/User/superEndLineWiSemiColin.sublime-macro"}
    },
    

    Download Macro


    Exit Argument & Exit Function

    When your cursor is anywhere inside the function it will end up here:

    public function totallyAwesomeness()
        {
            echo 'say what!!??';
        } |
        echo 'yep... that just happened';
    

    Use the command + enter shortcut.

    ⌘ Enter

    This will let you jump outside the argument and a space to the right as well as anywhere from within the function it will jump you out of it just being the closing bracket.

    Sublime User Settings

    {
    "keys": ["option+enter"], "command": "run_macro_file", "args": {"file": "Packages/User/superExitFunctionArg.sublime-macro"}
    },
    

    Download Macro


    Just in case you don't know what the path is to your User folder is, it is shown below.

    /Users/alexcory/Library/Application Support/Sublime Text 3/Packages/User/
    

    Also the Library folder is usually hidden, so you can download a program called Revealer that will allow you to toggle those hidden files.

    If you want to know how I made these just hit me up and I'll show you! :D

    0 讨论(0)
  • 2020-12-22 20:45
    Ctrl + PgUp Cycle up through tabs
    
    Ctrl + PgDn Cycle down through tabs
    

    This can go to the end of brackets

    0 讨论(0)
  • 2020-12-22 20:46

    Ctrl + M is the default one that I have on windows machine. Just do it

    0 讨论(0)
提交回复
热议问题