Auto-Comment Newline, SublimeText

Can someone tell me how to get SublimeText to insert comments in the continuation of double slashes when I enter a new line while inside the comment block?

// I have comments like this, and when I enter a '\n'
// it break out of comment-entering mode 
like this (drops slashes, cursor stays at leftmost column)

// and I want to have them automatically inserted after hiting '\n'
// like this

Perhaps I changed this in case of an accident when setting up the preferences file, and I do not know how to return it.

here is my user prefs :

{
"animation_enabled": false,
"auto_complete_commit_on_tab": true,
"auto_complete_delay": 200,
"auto_complete_size_limit": 2097152,
"auto_complete_triggers":
[
    {
        "characters": "<",
        "selector": "text.html"
    },
    {
        "characters": ".",
        "selector": "source.python"
    },
    {
        "characters": ".",
        "selector": "source.javascript"
    }
],
"bold_folder_labels": true,
"caret_extra_bottom": 1,
"caret_extra_top": 1,
"caret_extra_width": 0,
"caret_style": "solid",
"color_scheme": "Packages/User/base16-compact.dark (SL).tmTheme",
"copy_with_empty_selection": false,
"default_line_ending": "unix",
"drag_text": false,
"draw_white_space": "none",
"fade_fold_buttons": false,
"font_face": "Inconsolata",
"font_size": 10,
"highlight_modified_tabs": true,
"ignored_packages":
[
    "Vintage",
    "Diff",
    "DocBlockr",
    "Markdown",
    "Shell Command"
],
"indent_guide_options":
[
    "draw_normal"
],
"line_padding_bottom": 1,
"line_padding_top": 1,
"logging_level": "error",
"margin": 0,
"match_brackets_content": false,
"remember_open_files": false,
"scroll_past_end": true,
"scroll_speed": 0,
"shift_tab_unindent": true,
"show_encoding": true,
"show_line_endings": true,
"soda_classic_tabs": true,
"spell_check": false,
"tab_size": 2,
"theme": "Soda Dark.sublime-theme",
"translate_tabs_to_spaces": true,
"tree_animation_enabled": false,
"trim_automatic_white_space": false,
"use_tab_stops": true
}
+4
source share
2 answers

just enter this command:

CTRL + /

single comments single line, if you want to use a different line, use a comment multi-line.

/* */

before return your preferred :

{} CTRL + S, . .

0

DocBlockr . "ignored_packages", !

(nb. , , , , , DocBlockr, Sublime Text)

+7

Source: https://habr.com/ru/post/1541986/


All Articles