How to use Customize syntax highlighting on Mobaxterm - mobaxterm

in the Mobaxterm Configuration, I clicked on Customize in the Terminal -> Syntax highlighting section.
Then, i clicked on "Use regular expressions (experts only)" and added the following regex for "Cyan":
\[.* CEST\]
I expected this to make my timestamps in my log files in Cyan.
The timestamps are in this format:
[10/16/20 16:21:35:457 CEST]
However nothing happens. Can you help me to understand this feature?
Thank you

It's not a full regex, I based it off their built in reg
[^A-Za-z_&-]\[[0-9][0-9]?\/[0-9][0-9]?\/[0-9][0-9]? [0-9][0-9]?\:[0-9][0-9]?\:[0-9][0-9]?\:[0-9][0-9]?[0-9]? CEST\][^A-Za-z_&-]
I know its 4 month old question but if you need it, this might be helpful.

Related

How do I stop Notepad++ from showing autocomplete for all words in the file

I'm trying to use Notepad++ with the Progress programming language.
I have installed the language definition in %APPDATA%\Roaming\Notepad++ as userDefineLang.xml and syntax highlighting is working correctly.
I've put a file in the notepad++ Plugins\APIs directory named progress.xml, but the contents are not recognized by Notepad++.
I've also removed all the other language files from that directory and Notepad++ still shows the exact same autocomplete suggestions it did before I removed them.
Also, when typing in a program, it looks like every word in the file is an auto-complete suggestion, not just the keywords or function names.
Anyone know how to track this down?
Notepad++ provides 2 types of features:
Auto-completion that read the open file and provide suggestion of words and/or functions within the file
Suggestion with the arguments of functions (specific to the language)
Based on what you write, it seems what you want is auto-completion on function only + suggestion on arguments.
To do that, you just need to change a setting.
Go to Settings > Preferences... > Auto-completion
Check Enable Auto-completion on each input
Select Function completion and not Word completion
Check Function parameter hint on input (if you have this option)
On version 6.5.5 of Notepad++, I have this setting
Some documentation about auto-completion is available in Notepad++ Wiki.
The answer is to DISABLE "Enable auto-completion on each input". Tested and works perfectly.

Eclipse: Automatic line wrapping to specified width

I'd like for my lines, especially within comments, to be automatically managed so they don't get too long.
I remember once I had a configuration for vim which automatically moved the word I was typing to the next line once I reached 72 characters. It wasn't smart enough to rearrange the paragraph if I edit it, but it was a start.
Is there something that can manage these for me? I have a tendency to write really long comments in my code, and it helps to make them look neat by having consistent width, but it's always a pain to do this because oftentimes editing a sentence requires editing the entire rest of the paragraph.
I have just recently discovered the Ctrl+Shift+F feature. It is amazing and superior to Ctrl+I which is what I was using up till now, but I noticed that it does not do anything to clean up my comments.
Update: The answers are correct when working with Java in Eclipse. It seems like I have to wait for the CDT to incorporate this feature.
In "Windows -> Preferences", go to "Java -> Code style -> Formatter" to customize the formatter (called when you click Ctrl+Shift+F). In the tab "comment", you can set the maximum line width for comments (it can be different then the line width for code).
Tip: in the preferences, "Java -> Editor -> Save actions", you can make Eclipse to automatically format your file when you save it, so your code is always correctly indented !
The automatic formatting of Eclipse great no question.
If your comments are reformatted depends on what comment type and how you already have inserted line breaks.
Writing for example one very long line comment starting with // will be broken down by the formatter into multiple lines.
However you later edit the formatted lines - e.g. delete parts of it the formatter will leave them as they are. Only over-long lines will be changed.
Just in difference to block comments like this: /* comment */
Those comments will always be re-formatted in case the line is too short or too long.
If you want to format your header comment, you have to check Enable header comment formatting - that was the trick for me.
Obviously, to use this, you must create new formatter profile.

Unexpected 'INDENT' in CoffeeScript Example Code

As I was playing around for the first time with CoffeeScript, I ran in to a problem. In order to debug my problem, I tried replacing my whole file with one of the example bits of code from the coffee script site:
kids =
brother:
name: "Max"
age: 11
sister:
name: "Ida"
age: 9
However, when I try to compile that code, I get:
Error: In coffee/main.coffee, Parse error on line 3: Unexpected 'INDENT'
at Object.parseError (/usr/lib/coffeescript/parser.js:501:11)
at Object.parse (/usr/lib/coffeescript/parser.js:573:32)
at Object.compile (/usr/lib/coffeescript/coffee-script.js:23:22)
at /usr/lib/coffeescript/command.js:99:27
at /usr/lib/coffeescript/command.js:72:28
at fs:84:13
at node.js:773:9
In coffee/main.coffee, Parse error on line 3: Unexpected 'INDENT'
Since this is code from the CoffeeScript site, I assume the code itself isn't the problem. However, the compiler also seems to be working properly; if I compile:
a = 2
it generates a file with:
(function(){
var a;
a = 2;
})();
as expected. So in other words, the code is good, the compiler is good, and yet somehow I'm getting this Unexpected 'IDENT' error ... can anyone help me understand what is going on?
I am pretty sure this is a tabs-vs-spaces issue. Tell your editor not to convert spaces to tabs if it does that. Also, go through your code with the cursor and make sure it doesn't jump over blank areas.
The issue is that while normal editors see a tab as equivalent to two or four spaces, coffeescript sees it as one space, so the indentation gets messed up.
If this all doesn't help, make sure you have a recent coffeescript version, e.g. 1.1.0 or newer.
If you are using a JetBrains IDE (IntelliJ, PHPStorm, etc) the change of setting that worked for me is:
File > Settings > Project Settings > Code Style > CoffeeScript > Tabs
and Indents
Tick "Use tab character" & "Smart tabs"
Code is fine. Make sure you haven't messed up the whitespace (strange control chars showing as blanks, tabs or similar).
If you have the same problem, but your indentation is okay,
then you must be suffering from bug 2868.
Basically, the error is misleading. Check for indentation
errors in the required files.
When in Atom you can automatically convert tabs to spaces:
Packages > Whitespace > Convert Tabs to Spaces
You can resolve this two ways
1. IF using webstorm File->Default Settings as said above
2. Other workaround, is to use a different editor like Sublime, there u can press enter on earlier line and it will auto tab it for you with spaces

Eclipse Code formatter: keep complete function signature in one line

how is it done? cant find the option?
why is it anyways, that so many people format their code that way?
i really dont like it...
int
foo(int); //dont like
int foo(int); //like
By default, Eclipse shouldn't be reformatting your code unless you have it do so through the Format command.
However, if you're working with other people's codes and want to format it to your liking it is possible to have Eclipse apply formatting.
You can adjust how this works by locating the Code Style section under the language you are using under the Preferences menu.
Start with the Window->Preferences menu. I like to type "code" into the search box to limit the options. Then follow the steps in the image ** You can format almost everything.
I can't answer why some people would like the return value on a line by itself; I've never met anyone that did.

Remove blank line in Eclipse

How can I remove lines that only contain spaces when using Eclipse Find/Replace prompt. I checked the "Regular Expression" check box, and tried the following, neither of which worked.
^[:space:]*$
and
^\s*$
Find: ^\s*\n
Replace with: (empty)
sry this might be an different answer but you can set the number of blank lines you wish to have after fields, methods and blocks in the formatting dialog of the eclipse preferences. then you can hit ctrl-shift-f to automatically format your code depending on your custom definitions.
have fun!
I was suprised that for XML files edited with Eclipse there is a good solution:
Select the checkbox value named 'Clear all blank lines' in Formatting panel
Window->Preferences->XML->XML Files-> Editor
Save and use the "Ctrl+Shift+F' shortcut
The blank lines will dissappear!
for the find/replace operation, "\n\r\s" regex will work on windows, for unix based system, "\n\s" can be used
as already suggested, you can format your code by Ctl+Shift+F
for manual work, locate a blank line and press Ctl+D (Cmd+D on Mac) <- gives u satisfaction of killing the line with your own bare hands :)
cheer!
This one worked for me for years:
Replace this: [\t ]+$
With nothing
Hope this helps!
Many thanks to lamamac.
In genereal, when you want to do search replace with regular expressions in eclipse the $ sign doesn't work as it should.
Use '\s*\n' instead of '$'
As already suggested, regular expression and replacement is the solution, but such response would have been saving some minutes to me:
click on ctrl+f
use this replacement: