Notepad++: block comment not working - editor

I am running Notepad++ 5.8.5 on Windows 7, editing Perl programs.
I would like to comment out a block of text lines (and later, perhaps, uncomment it).
None of the following works:
CTRL+K, CTRL+Q, CTRL+shift+K, CTRL+shift+Q,
selecting the block of lines and going to the menu: edit-> Comment/Uncomment -> Block Comment
none of the above has any effect.
What to do?

Is NP++ interpreting your file as Perl or plain text?
If NP++ is treating your file as plain text, then language specific things like that won't work.
You may want to double-check that as described here.

Why not try updating to a newer version? That's horribly out of date (a year old).

Define your own language to match to the file extension, in your case it is: txt
and then define any comment style you want. Then close and open NP++ again. Enjoy!
Path: Language--->Define your Language --> Comments & Number tab
Hank Wei

Related

Geany custom folding for custom filetype

Company i work develops a new programming language which will ease job of engineer. My job is to supply this language with a nice editor which is also involves code folding. I need to have custom code folding which is not include "{" and "}". I am working with Geany filetypes. I add new filetype. I want to fold some structure like below.
if %condition% then for each %element% in %range% do
%statement% %statement%
else if %condition% then end for
%statement%
else
end if
I know my language far from c type , however add such line to my code for enabling syntax coloring.
[settings]
lexer_filetype=C
Any kind of help will be appreciated.
I dont know exact answer but i know how i can dig it up. As far there is no an answer i am going to write how can the answer can be appeared. Using scintilla and its lexers can take us to solution of this problem. Both Geany and Scintilla documentations mention about support of that feature.
Under Debian :
cp /usr/share/geany/filetypes.c ~/.config/geany/filedefs/
chown myUser:myGroup ~/.config/geany/filedefs/filetypes.c
Edit the file. Under the section [lexer_properties] add the line:
fold.cpp.comment.explicit=1
Save the file.
Open geany. You are now able to put userfoldings using the default //{ and //} delimiters in c and in cpp. These do not influence your code because to c and cpp it are comments.

Sublime Text 2: How to set up consistent syntax highlighting for Guardfile?

While it is easy enough to set the language for a given (open) file in Sublime Text, I'm wondering if there is any way that I can tell the editor in advance that anything called "Guardfile" should be highlighted like it's Ruby code. Does anyone know how to do this?
The plugins recommended in the comments by Brian both do the job nicely:
ApplySyntax
SyntaxFromFileName
Update:
I couldn't get SyntaxFromFileName to match any of my regex for some reason. On the other hand, DetectSyntax comes with syntax highlight for the Guardfile built in.
Update2:
DetectSyntax has been renamed to ApplySyntax
Putting the following at the top of said file also works
#!/usr/bin/env ruby

Notepad++ like editor with with macrosed text replacements for faster coding

Is there any editor or add-on/plugin which replaces some keywords with prepared snippets in place of written keyword.
For example i'm typing key1 and it's instantly or after a space is replaced with snippet that is assigned to this keyword.
I saw some tutorial from Jeffrey Way long ago, but can't find it now. :s
Thanks ;)
FingerText for Notepad++ pretty much does what you want.
Just use Tab after typing in the keyword you set up for the snippet, and it'll replace it with the snippet.
The Zeus editor has a template feature that does exactly this. A template is a keyword with an associated code snippet and typing in a keyword followed by the space key results in the keyword being replaced by the associated code snippet.
Try installing AutoHotkey version 1.1.19.03 or greater.
One thing it can do is look for sequences of keyboard characters and replace them with other sequences on the fly. As soon as it sees a sequence it will replace it. No activating character is required.
To set up the replacement definitions:
Right click on the Desktop
New
AutoHotkey Script
This will create a template for
your script with the name New AutoHotkey Script.ahk
Edit New AutoHotkey Script.ahk with Notepad++
Put your key snippet lines at
the end, like so:
:*:key1::snippet for key1
:*:key2::snippet this time for key2
Save As My Snippet definitions.ahk
To invoke it: Double click My Snippet definitions.ahk
You can control AutoHotkey by right clicking on its icon on the taskbar.

Is there a shortcut in Textmate to wrap selection with multiline comment?=begin and =end

I want a shortcut in Textmate to wrap the selected text with a ruby multiline comment -- '=begin' and '=end'.
It doesn't look like there is an existing one. Anyone know how to make one?
Finally figure it out, mostly by luck. I still wish I could find where the shortcut was defined.
However, it's ⌥⌘/
My bundle always uses the single-line comments, even when I select multiple lines. I'm sure your answer lies somewhere in Bundles > Bundle Editor > Ruby > Comments.

Pretty Print for (Informix-)4gl code

i'm searching for a pretty print program (script, code, whatever) for Informix-4GL sources.
Do you know any ? Than you, Peter.
Have you looked at the IIUG (International Informix User Group) software archive? There are two pretty printers there (of indeterminate quality).
The other place to look would be the Aubit4GL site - an open source variant of I4GL. Again, I'm not sure that they have a pretty-printer, but it might be something they have (though a casual check doesn't show one).
I don't know if anyone is reading this post anymore, but the easiest way to get some kind of nice "pretty print" of 4gl code is to view it in the Openedge Developer Studio, then use ctrl-I to set indention. You can adjust indention in the editor settings by saying the length of "tabs". (default is 4, I use 3)
Then do a ctrl-shift-f to make all command words uppercase.
Next, you can condense the code a few lines by moving all the "DO:" statements up a line next to the "THEN" statement with this regular expression search and replace.
ctrl-f:
search "\s*\n\s*DO[:]"
replace " DO:"
make sure you click the checkbox marked regular expressions.
At this point the code is nice and tidy.
Do a ctrl-a and ctrl-c to copy it to the clipboard.
paste it in Outlook as an email without sending. Print it in color.

Resources