Skip to content

Instantly share code, notes, and snippets.

@dvogel
Created April 29, 2021 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dvogel/8ebf7020d4ee8e709e6034f6aef5f024 to your computer and use it in GitHub Desktop.
Save dvogel/8ebf7020d4ee8e709e6034f6aef5f024 to your computer and use it in GitHub Desktop.
vim-commentary-empty-comment-confusion.tf
# vim: noexpandtab tabstop=2 shiftwidth=2 softtabstop=2 commentstring=#\ %s
# This is a repro case for the commentary plugin dealing with commenting visual
# blocks in which there is an existing "empty" comment. I am expecting to be
# able to comment all lines of the `resource` block.
# If I place my cursor on `resource` and pressing `VGgc` then
# there is no space between `resource` and the new comment hash at the
# beginning of the line.
# If I remove the "empty" comment on line 19 then the visual block commenting
# works as expected.
# start vim as: vim -Nu NONE
# then run packadd commentary
# place your cursor on the line below, then press VGgc -- you will have no space between the hash at the start of the line and `resource`
resource aws_subnet a-subnet {
# this is the first line of a comment
#
# this line is awesome:
cidr_block = "10.0.0.0/24"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment