习近平接见新调整组建军级单位主官 对各单位发布训令
百度 两市呈现普涨现象,超3000只个股上涨,仅有111只个股下跌,上涨个股占交易个股总数的%。
Comments are programmer-readable annotations in source code which are ignored by the parser.
118 questions
1
vote
1
answer
123
views
Cannot get Neovim to comment all selected lines
I was trying to edit the .toml file for aerospace on a Mac, I have been unsuccessfully attempting to comment multiple lines at once with Neovim.
Using my terminal, this is the proceedure I have tried ...
0
votes
1
answer
32
views
No inline comments in if statements?
Apparently I get a syntax error in vimscript if I have an inline comment inside of if-statement. For example:
if x
return " we are done
endif
causes an error? wth? The question here is (1) ...
6
votes
2
answers
4k
views
How does VIM know to NOT interpret this .html file as html?
I've been working on an SGML/XML/HTML parser, and part of proof testing it is running through every last .html and .xml file on my system.
One file I came across was this:
vim "/var/lib/snapd/...
1
vote
0
answers
45
views
Possible to use the 'comments' option to check if a line is commented?
I am looking for a way to check if a line is commented or not. It should not be a filetype specific but should be commonly usable for a lot of filetypes. Note that there are single-line and multi-line ...
1
vote
0
answers
59
views
How to use different comment string for yaml blocks inside markdown files?
Many markdown implementations allow for a leading yaml configuration block like so:
---
title: "My title"
date: 2025-08-05
---
## Heading
Some markdown text
With the vim commentary plugin,...
5
votes
2
answers
120
views
Don't auto-extend c/c++ trailing comments
Edit this C++ excerpt:
// line 1
int xxxxxxxx = 0; // line 2
int yyyyyyyy = 0;
When the cursor is in line 1 and you hit o to insert a line below it, Vim conveniently starts the new line with another /...
2
votes
2
answers
2k
views
Conceal comments in Vim/Neovim
I am writing a lot of latex and would like to conceal comments.
There are often several lines of text that I comment but would like to keep/not delete.
Concealing comments explained: A comment is ...
9
votes
3
answers
40k
views
How to comment in Vim?
In VSCode I can comment my code with Ctrl+KCtrl+C and uncomment with Ctrl+KCtrl+U.
Is there any way to do the same in Vim?
0
votes
1
answer
30
views
How can add the comment lines when call function?
I want to add shebang when creating anew python file.
.vimrc:
autocmd BufNewFile *.py exec ":call SetTitle_py(0)"
func SetTitle_py(line_num)
let boilerplate = [
\"#!/usr/bin/...
0
votes
2
answers
41
views
Why the comment can't be set at the second line instead of first line?
I want to add some comment lines when to edit python file:
vim .vimrc
autocmd BufNewFile *.py exec ":call SetTitle_py()"
func SetTitle_py()
call append(line("."), "#...
2
votes
1
answer
51
views
:.w !bash a temporarily modified line and executing it in the shell
#!/usr/bin/env bash
# scp /tmp/abc.sh SERVER1:~/bin && ssh SERVER1 "~/bin/abc.sh"
echo "Hello Stack Exchange"
echo "thanks for the help
I would like to be able to use ...
0
votes
0
answers
416
views
block comments not automatically indented in Neovim
When inserting a block comment in a (TypeScript) buffer in Neovim, the line after the /**<Return> is not automatically indented. How can I achieve the expected behavior described below?
Neovim
...
1
vote
0
answers
64
views
Stop foldmarker inserting hash
I my folds are set with foldmarker={{{,}}}. When I create a fold it inserts a comment # char before the marker. So it inserts #{{{. How do I stop it doing this?
I have syntax highlighting (and it ...
2
votes
1
answer
47
views
A question about the comment for comment shell command
When I read the comment help file, I found
It is not possible to add a comment to a shell command ":!cmd" or to the
":map" command and a few others (mainly commands that expect ...
0
votes
1
answer
894
views
How do you disable all magic comment formatting in Neovim?
I recently switched to Neovim's new LSP setup instead of the old Vim-based language plugins and now I get this incredibly annoying comment "helper" behavior when I hit enter after a /** in e....