Vim whole word search "pattern not found" - visual-studio-code

I've been trying to do a whole word search in VS Code's Vim extension. The cursor is at the top of the file, and I try looking for the word "category" with /\<category\>. I've also tried /\v<category> but that doesn't work either. What am I doing wrong?

All you need to do is type /category, I don't think there is a need for '<' or '>'.

The /\<category\> option does work for me in vscode so it must have been fixed. Hopefully your issue is gone

Related

VSCode, Asciidoc, how to disable syntax hint?

Using
VSCode v1.54.4
asciidoctor.asciidoctor-vscode extension v2.8.8
Ubuntu 20.04.2
Whenever I type a colon : in the body text, there is an intellisense popup which comes up. As I rarely use attributes, I must dismiss that syntax hint by ESC. But from time to time, I accidentally insert the syntax hint and had to manually delete all the inserted characters.
Is there anyway to disable this syntax hint and ONLY for Asciidoc documents (*.adoc)
This answer is for Markdown documents, but describes the suggestion options that are available.
Based on your question, you might consider adjusting the "editor.acceptSuggestionOnEnter" item, so that accidental insertions of suggestions happens less frequently.

Visual Studio Code: \n in regex file search not supported?

I'm trying a simple regex search with "\n" to find a line feed and some String(s) around. In a single file search it´s working fine (see screenshot on the right), but in a folder search I get the error "Literal '\n' not allowed" (see screen shot on the left). Any idea?
Screenshot
Cheers Daniel
I believe this error is coming from ripgrep, which VSCode uses by default for this search function. I found this comment by the owner, referencing \n in particular.
Fortunately, you can tell VSCode not to use ripgrep in your settings.json:
"search.useRipgrep": false
With ripgrep disabled, \n should work as expected.

How to remove a specific suggestion from Atom Editor autocomplete

I deleted an attribute attribute1 from a class.
Atom autocomplete keeps suggesting the text "attribute1" when I type "attribute", which leads to syntax errors.
How do I remove "attribute1" from the possible suggestions?
If the suggestion is not a default suggestion, make sure you do not have the typo anywhere else in your currently open project, and then restart atom.
Atom's autocompletion package reads words from opened files into runtime TextBuffer, futher uses it when autocompletion wanted.
To remove wrong suggestion from autompletion just remove it from files you have opened.

How to count found strings in Visual Studio Code

When you search for a string in Visual Studio Code with Ctrl-F it doesn't display number of occurrences.
Is it possible to find out somehow?
On the other hand it displays a number of hits next to a filename when you search all files with Ctrl-Shift-F.
Once you have the search bar pulled up with Ctrl-F, click the triangle on the left side of the search bar. The occurrence count of your search term will be displayed.
Happy coding!
I had the same problem as csonuryilmaz mentioned in the comment to this answer, I needed the exact count of the string, even if it is 19999+. I ended up opening the file in Notepad++, there you can count all occurences when searching for a string.
Maybe not the best solution if you want/have to use only Visual Studio Code, but for my problem this was a good enough workaround.
On Windows, you can count string occurrences with the command FIND /C "string you're searching" filename.txt
So on VSCode, you can open the console (ctrl + ') and type the command. It's one workaround to count string on large files without have to install any new extensions.
click the down faced triangle and then choose 'find all'
and then the matched string number should be visible on the bottom left:

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: