![]() nargs=+ - alias must have arguments (any number) ) - function taking one named argument and array of Silent - skip "Press ENTER to continue" after running shellĭir /s/b/a:-d - get a raw list (/b) of files only (/a:-d)įindstr /v \.git\ - find lines that does not containing "\.git\" Here’s a quick list of tricks used in the snippet: execute - run vim command The idea behind the snippet is the following: get list of all the files in the working folder, remove the locations you want to exclude, and then pass the list of files to “findstr” command (/f switch allows to pass the list of input files). :command! -nargs=+ -complete=command Grep2 call FastGrep() Just add this snippet to your $VIMRC file: function! FastGrep(what. ![]() Nevertheless there is a way to achieve such behaviour. The default findstr (you can find more about it in my previous post) does not have such option. Unfortunately there is no easy way to tell VIM grepper to exclude locations from search (at least in Windows). And that’s the thing (at least looking at Visual Studio Code file search): The first guess is that alternative editors just skip files that are not source code. 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: I’ve never experienced something similar in any other editor. It took over 23 seconds to search for files and another 55 seconds to render the list of results. ![]() I felt it pretty hard last time when I tried to search in a medium-size web project. Several times I noticed that grepping in VIM (finding in files) does not work very well comparing to Visual Studio or VSCode at least.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |