Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Smart Enter in line comments in Sublime Text 2/3
branch: master

Add comments_aware_join_lines command

It's bound to default join_lines keys when in line comments.
latest commit 7461ddf1ae
Alexander Schepanovski authored
Failed to load latest commit information.
.gitignore Made that
Default (Linux).sublime-keymap
Default (OSX).sublime-keymap Add comments_aware_join_lines command
Default (Windows).sublime-keymap
LICENSE Added LICENSE
README.md Add comments_aware_join_lines command
comments_aware_enter.py Add comments_aware_join_lines command

README.md

Comments Aware Enter and Join Lines for Sublime Text 2/3

Hitting Enter in line comments will insert a proper indented comment marker for you. In its turn Ctrl+J (Cmd+J on OS X) joins comment lines removing comment markers and extraneous whitespace.

This plugin is for line comments only, so it doesn't work with block ones.

Thats cool, but can I use smth + Enter instead?

Sure, just add one of the following lines to your User Preferences:

{
    ...
    "linecomments_ctrl_enter": true,
    "linecomments_alt_enter": true,
    "linecomments_shift_enter": true,
    "linecomments_super_enter": true, // Stands for Cmd on Mac OS X
    ...
}

If any one of this options is used then plain Enter won't be captured, modified shortcut will be.

Bugs

  • don't work if cursor is at very end of a file (A bug in Sublime Text 2 and 3)
Something went wrong with that request. Please try again.