Command line: VIM

VIM: sorting and removing duplicates

There is one very useful command in VIM that allows to do both sorting of lines in current buffer and removing duplicated lines.

Continue reading

Advertisements
Command line: VIM

VIM: Better grepping (in Windows)

Several times I noticed that grepping in VIM (finding in files) does not work very well comparing to Visual Studio or VSCode at least. I felt it pretty hard last time when I tried to search in a medium-size web project. It took over 23 seconds to search for files and another 55 seconds to render the list of results. I’ve never experienced something similar in any other editor.  Another think that bothered me was the quality of results which frequently showed binary files, multi-line records or everything else what I could call “rubbish” in the context of file search option:

Continue reading

Command line: VIM

Vim for .NET – Move type to another file

When I started my journey with VIM for .NET, I tried to find VIM alternatives of common shortcuts/refactorings that I used in Visual Studio. Surprisingly I noticed that most of them were already there (Searching, Go To Definition, Find usages, create class etc). The one I had a real problem with was “Move type to another file”. I really like the idea that I can create all the types in one file and then use some shortcut (with ReSharper: Alt + Enter) to distribute them to their own files. As I could not find any existing plugin (which is really strange) I took it as a good time to try myself in writing vimscript. It turned out that it was pretty easy exercise. Here you can find the script that you can append to _vimrc to enable the feature.

Continue reading