Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto comment continuation also happens with shebangs #12423

Open
schrottkatze opened this issue Jan 6, 2025 · 4 comments
Open

Auto comment continuation also happens with shebangs #12423

schrottkatze opened this issue Jan 6, 2025 · 4 comments
Labels
C-enhancement Category: Improvements

Comments

@schrottkatze
Copy link

When writing stuff like a shell script, you usually write a shebang at the start.

The shebang, however, looks like a comment in many shell languages because they use # as comment syntax.

Also, maybe adding a way to not extend the comment (idk... shift-enter?) would be cool :)

Thanks!

@schrottkatze schrottkatze added the C-enhancement Category: Improvements label Jan 6, 2025
@sibouras
Copy link

sibouras commented Jan 6, 2025

you can ]<space> to add newline below, or go down a line and O

or if u want a mapping ["add_newline_below", "move_visual_line_down", "insert_mode"]

@nik-rev
Copy link
Contributor

nik-rev commented Jan 7, 2025

Really like your idea to have a keymap for adding newline without continuing the comment. See linked PR above ^^

@uncenter
Copy link
Contributor

uncenter commented Jan 7, 2025

I feel like even some sort of naive detection would work, something like: if the comment character is "#", the first character following the start character is a "!", and the cursor is on the first line of the file - don't continue the "comment".

@TornaxO7
Copy link
Contributor

TornaxO7 commented Jan 7, 2025

You can also just press <C-w> to remove a word in front of your cursor (it's also a keybinding in the terminal and pretty useful in my opinion).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Improvements
Projects
None yet
Development

No branches or pull requests

5 participants