Commenting out a selection in YAML


One of my very commonly used shortcuts in DataGrip is Cmd + /  for commenting/uncommenting out a selection while I work.

I'm trying to figure out if I can get this to work with YAML.  I have the JetBrains YAML plugin but that doesn't seem to have added this functionality.

Is there a way to customize this in DataGrip so that I can have the # added to the front of the line with this shortcut / Code menu command?



It works as expected in 2022.1.5 version of DataGrip. I'm able to comment lines in YAML using Command+/ shortcut.

What version of DataGrip are you using (Help | Find Action | About)?

IDE logs would be helpful, you can collect them (Help | Collect Logs and Diagnostic Data), upload to and provide ID.


I'm likewise using 2022.1.5.  Specifically:  Build #DB-221.5787.39, built on June 6, 2022

The shortcut works fine in SQL files, but still no luck with YAML.  I checked that the YAML plugin is the latest.  The menu items for line & block comments are grayed out from the Code menu as well.

Logs are uploaded
Upload id: 2022_06_27_aHPUEoVgaBQg8Hi8rZdzwB (file:





Thanks. Could you please share a screenshot with the full IDE window and YAML file with disabled actions for adding/removing comments?


Please navigate to Preferences | Editor | File Types, find YAML and add *.yml as a file name pattern. Does it help?


Yes, that fixed it, thank you!


Please sign in to leave a comment.