Home » Questions » Computers [ Ask a new question ]

Shortcut to remove first character of multiple lines in gedit

Shortcut to remove first character of multiple lines in gedit

I want to be able to remove the first character of a line when I highlight multiple lines in gedit.

Asked by: Guest | Views: 58
Total answers/comments: 1
Guest [Entry]

"There's a really simple way to do this in gedit.

At the terminal:
sudo apt-get install gedit-plugins

Open gedit, then go to Edit -> Preferences -> Plugins tab.

Tick Code comment.

(NB You only have to do the previous 3 steps the first time, to get the plugin set up.)

Open up your file. Assuming it's e.g. bash, latex, then hopefully gedit will auto-detect the filetype and apply syntax rules. If you're not sure, look at the bottom margin of the window - there's a drop down language selector.

Now just highlight a few lines and hit Ctrl + M to comment, or Ctrl + Shift + M to uncomment.

HTH."