Vim - Highlight too many closed brackets in Perl code - perl

I'm trying to configure Vim so that it highlights extra closed brackets in Perl, for example ()). For unclosed brackets this works correctly the extra ( is highlighted red. But the extra closed brackets are not highlighted.
This issue is only present when syntax=perl. When I use syntax=c or syntax=vim the unmatched closed brackets are correctly highlighted.
Here is an example with syntax=perl. The first row is fine but in the second row the extra ) is not red. :(
Do you know any tricks or plugins that could solve this?
I've found some (very) old vim plugins like Highlight-UnMatched-Brackets but they didn't solve this issue for me.

It's possible that this is a bug in the syntax highlight for Perl. The project that keeps track of all the Perl-specific files that get fed back to the vim project is here: https://github.com/vim-perl/vim-perl (I'm one of the maintainers) If you think it's a bug in the syntax highlighting, then go ahead and submit an issue on GitHub.
You might also try using the syntax files in the vim-perl project in your local vim. I don't know what version of vim you're running, but it's possible newer support files will solve your problem.

Related

How to fix newline indentation in recent version of vscode

I've been using VSCode (vscode) with the amVim extension for approximately 2+ years. I use vscode almost every day, and update it immediately every time it notifies me of a new version, which it checks for on startup. In the current and previous version I've had a new problem with indentation when I add a line to a source file. I've experienced this problem when editing *.go, *.vue, and *.css files, but mostly I've been working in Go files since the last two releases, so I've mostly seen it there. I did not notice this issue prior to the last two vscode releases.
When I add a newline with ENTER or SHIFT+o or any other means I've tried, it often adds the line with too little indentation. Whether this happens appears to depend on context, like how I recently moved the cursor, or where was the cursor when I added the newline, but I haven't figured out clear rules for when it will get the indentation right. I'd say it happens about half the time.
I haven't found a consistent workaround, so now when I add a newline I often have to hit tab until I reach the correct indentation. I can't predict whether this will happen, so when I add a newline I have to pause and look at the result instead of continuing to type. Alternatively, I write code at the wrong indentation and then hit save or auto-indent once it's syntactically complete to correct the indentation, but the code is harder to read and review until the indentation is right.
My current vscode version is 1.75.1, and amVim version is v1.34.0. I'm on Fedora 37 x64 (Linux). (My vscode Go extension is v0.37.1.)
I tried searching and browsing issues in both vscode and amVim Github repos and didn't see anything matching my issue, and I tried searching here as well without finding a match.

Phantom line display in Visual Studio Code IDE

In VS Code I have a tab with a plain text file I use for scratch while working during the day. I place all kinds code, questions, TODO lists, etc in this file and will reference it from time to time. It's helpful for history purposes.
At any rate, this file has ballooned up to well over 46,000 lines over the years and I'm now seeing this odd phantom line being injected at my cursor. I am unable to select it or remove it. I thought it was being displayed as VS Codes way of letting me know that a software update was available but when checking that was not the case. This is what it phantom line looks like, it seems to contain a history of CSS classes used over the years which is odd.
If I restart VS Code it goes away for a little while but then reappears. I have a feeling it might be because of the number of lines or perhaps memory but can't say for certain.
Has anyone else seen this behavior? I've probably enabled some setting by mistake and have no idea how to disable it.
Any suggestions would be greatly appreciated. Thank you!
Turns out it was the HTML End Tag Labels plugin that was trying to auto complete some HTML that was somewhere within the 46k lines.
I would have thought by identifying the file as type Plain Text, the plug-in would ignore trying to close HTML tags (since its not an HTML file) but alas that's not the case.
Thank you Mark Ahrens for the tip!

Indentation for files that don't have a registered formatter

It seems that I am getting this problem since version 1.18, honestly I don't remember.
With VSCodeVim installed I used to press the = key to get my code (Elixir, embedded elixir, ...) indented properly.
Am I missing something, like a configuration, that would allow me to re-indent my files without having a nagging "Formatter for file x not installed".
This is honestly the only things that nags me with VSCode so far, love the speed, the capabilities and the UI...
Just posting my comment as an answer
Try using the reindent lines command. This command should work for many languages even if you don't have a formatting extension for that language installed
Select the contents of file.Bottom right corner shows spaces/tabs: 2/4. You can click on that and indent the whole file.

Eclipse vrapper undo

I use Eclipse for programming in almost any language. I also like the vim shortcuts for quick editing so I installed vrapper.
The problem is when I write a lot of code, and I just want to undo some little things. It undos a lot of chunks of code back, instead of 2 or 3 little things.
I've found some threads which seem to resolve my issue by using "set noati", but it does nothing. It doesn't matter if I use "Ctrl+Z" or "u" from vim command mode.
Can someone please help me to resolve this issue ?
The set noati seems to be the solution for that (at least was for me and other people in vrapper forums)... simply to update to the latest version of vrapper then you either specific the set noati (no ":" here!) in the ".vrapperrc" (this config file should be placed in your home directory) or you simply run the :set noati command from Eclipse vrapper.
HTH.
Here are two things that might help you.
1) Stay out of insert mode.
The way undo works is in terms of vim commands. So if you change to insert mode and type a hundred words, that counts as a single command. On the other hand, if you press escape every once in a while to get out of insert mode, undo will behave much more pleasantly.
Once you get more familiar with vim, you will want to do less and less in a single insert. So the undo problem will likely be reduced as well.
2) Temporarily disable vrapper via the toolbar icon.
This is an alternative if you absolutely need the default undo behaviour of Eclipse.

Macro not working as expected in Notepad++

I just installed notepad++ and i am having some problems with macros in it.
i have a simple text file below:
hi
i am here
this is the third line
i kept the cursor at the first line before "hi".Now i selected start recording macro in the menu.i typed 'hi' before 'hi'(the actual word in the line) like below and pressed [Home] key in the keyboard and then pressed down arrow.Now i selected stop recording macro from the menu
hihi
i am here
this is the third line
but when i run the macro i am getting the following output
hihi
hˆi«i am here
hˆi«this is the third line
Could anybody please tell me where is the problem?
Upgrade to, at least, version 5.8.2 where that problem was fixed. I was experiencing the same problem, upgraded to version 5.8.5 and the problem is gone.
http://notepad-plus-plus.org/release/5.8.2
Fix macro recording bug for the non-ASCII characters.
same here as for Matt. For language, I was in normal text.
As mentioned in my comment at top, I have also been experiencing this same issue. Strange characters inserted when playing back a macro. This worked OK with previous versions, but appears to have been a bug introduced with version 5.7
It does appear to be an encoding issue. I have been able to workaround this issue by switching to UTF-8 encoding whilst recording the macro - as mentioned in the comment of this bug report.
This has been reported as a bug several times recently. Many are still open, however, one is reported as fixed. And is reported as fixed in the current release (5.8.2) - which also introduces several new features as regards macros. However, nothing later than v5.7 is yet available from the auto-updater within Notepad++ itself. However, you can manually download the latest installer from SourceForge.net.
I turned off the auto complete feature and this fixed the issue for me.
How do I stop Notepad++ from showing autocomplete for all words in the file
I had a problem, I typed in some code and it came out wrong in macro.
Then I neglected the advice to type the code and not paste it, and so I copy/pasted the code I needed and it worked fine.
So my advice: write it somewhere else and copy/paste when you start macro.