Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change comment character in notepad++

Tags:

notepad++

I am editing the .properties file in notepad++. I can toggle the block comment using Cntrl+K but it puts ";" instead of "#".

I modify langs.model.xml file and replaced ";" with "#". I restarted notepad but it is not working.

Does anyone know how can I change the control character in notepad++ for properties file?

like image 397
swd Avatar asked Nov 16 '11 06:11

swd


2 Answers

My issue was with VB, NotePad++ don't have the right symbol set (REM instead of ') I don't want to change the language, since the hilighting of keyword would be wrong I found this on mysysadmintips :

Luckily it's pretty easy to modify comment marks for various languages in Notepad++

Open Notepad++ language config file:
C:\Users\<user name>\AppData\Roaming\Notepad++\langs.xml
Scroll down to  <Language name="vb" ext="vb vbs" (or other depending on what language you want to modify)
Change commentLine="REM" to commentLine="'" 
Restart Notepad++
like image 93
Rafiki Avatar answered Sep 21 '22 15:09

Rafiki


You can get the behavior by using a different language. Perl, PowerShell, Python, Ruby, and Shell will use the # for comments.

Then simply select the block you want to comment on/off and press:

Ctrl+Q (which will toggle comments)

like image 28
Adam Hawkes Avatar answered Sep 23 '22 15:09

Adam Hawkes