0

When I am coding and using tab/auto completion one thing that slows down my flow is at the end of each line adding something like a semi-colon.

I am using the | (pipe) in my examples below to show my cursor location.

For example, lets say my completed line of code will be:

$myName = 'BitBug';

When I type the first single quote ' it will be paired with another ' for '' and my cursor is in-between the two single quotes like this:

$myName = '|'

I then type "BitBug" and now it looks like this:

$myName = 'BitBug|'

Now I want to add my semi-colon to end the line. But my cursor is right after the "g", not at the end of the line.

So either I have to arrow over the last single quote, or I have to hit the "end" key on my keyboard, then hit my semi-colon. Either way causes me to move a hand off my home row of keys and slows down my coding.

I am sure I could just add a new key binding to my Sublime Text 2 for this, however because so many programs and editors use tab/auto completion I figure this is a more universal issue and their may be a trick I am unaware of?

Is there a faster way to do this I am unaware of besides making a custom key-binding?

Thanks ahead of time!!

BitBug
  • 669
  • 2
  • 17
  • 35

1 Answers1

1

I think you might like the AutoSemiColon plugin.

But a shortcut to move to the end of line is useful in many cases, so i suggest you put it your keymap file anyway. To prevent you from looking it up, here's the line:

{ "keys": ["ctrl+e"], "command": "move_to", "args": {"to": "eol", "extend": false} },
Philipp Moers
  • 570
  • 3
  • 15
  • Great package suggestion. I really like it. And the key binding is great too! I'm going to leave this up a while longer because I still am looking for a more universal shortcut if available. Reason being this is great for Sublime Text which is what I code in 99% of the time, but sometimes I get into NetBeans and Eclipse. I don't want to have yet another keystroke I have to remember is okay to use here, but don't use it there if that makes sense. Probably not another solution, but... I'll check back on this often and will give you the credit for best answer if nothing comes up. Thanks! – BitBug Mar 25 '15 at 23:10
  • 1
    Glad you like it! The key binding is actually the default from emacs (just following conventions here). Most shells (including bash) support it, so it's good to remember this one anyway ;) – Philipp Moers Mar 26 '15 at 00:25