Displaying search status when searching with ack within Vim - search

Is there a way to display the search status, when searching with ack within vim? Maybe percentage?

I don't think there is something like that. Have you tried the plugin Ack.vim? It has a nice integration with Vim.

Related

Vim Ack search highlight

I'm using MacVim with the ack Plugin (https://github.com/mileszs/ack.vim). I've updated my Plugins and Vim itself, and now when I search for something, the highlight color of the search bar is in turquoise (see screenshot), and you can't really read the text.
I've already read through ack help and some threads, but I couldn't find a option where I can adjust the color.
How can I change it back to the old color?
I'm not sure this is the cause of your issue, but Vim added a new highlighting group in patch 8.0.0641, which is called QuickFixLine.
The default colors which were chosen seemed to make the current entry in the quickfix window difficult to read with several colorschemes. An issue was opened on the bug tracker of the Vim repository, and the highlighting group was linked to Search in patch 8.0.0653.
So, if your Vim version is between 8.0.0641 and 8.0.0652, you may need to update Vim again to a newer version.
If you can't update immediately, then maybe you could temporarily link QuickFixLine to Search:
:hi! link QuickFixLine Search

Make Vim highlight all search results while typing the search and turn off highlighting when I do anything else

I would like my Vim to highlight all search results as I am typing my search, i.e. not just the next search result (as in incsearch), but all of them (as in hlsearch but at the same time as I am typing). I would also like to turn off search highlighting as soon as I do anything else than search. Is this possible?
It sounds like you want haya14busa/incsearch.vim. The biggest thing it does is highlighting every result as you are searching, which you can see in this gif:
There are other things it does too. For example, it can be configured to turn of highlighting when you are done searching, and it can also provide useful mappings for other search related features, like
n
N
*
#
g*
g#
You can install it with Neobundle/Vundle/vim-plug by doing
NeoBundle 'haya14busa/incsearch.vim'
Plugin 'haya14busa/incsearch.vim'
Plug 'haya14busa/incsearch.vim'
or with pathogen by doing:
git clone https://github.com/haya14busa/incsearch.vim ~/.vim/bundle/incsearch.vim
You could try the vim-cool plugin, which was mentioned in a similar question:
Vim-cool disables search highlighting when you are done searching and
re-enables it when you search again.
Vim-cool re-enables search highlighting when the cursor is on a word
that matches the last search pattern.
Vim-cool is cool.

Vim cscope show results in split buffer

I am looking to show the results of cscope in a split window. This question is the closet thing I found to an answerbut it doesn't explain fully how to resolve the issue.
I also found this question where in the comments section they explain how to use the cscope to get a split window. But I just get an error No matches found for the global symbol
I thought I would make myself clear. I want to view the cscope results like this:
You can use the quickfix window for this. See :h cscopequickfix.
I wrote a small plugin around this that makes the experience slightly better. For example, it doesn't jump automatically to first result, it maintains the splits layouts etc.
https://github.com/ronakg/quickr-cscope.vim

Vim clears tags after failed omnicompletion

I am using Vim 7.3 with a great deal of plugins, mainly for PHP development. The omnicompletion works well, apart from a small glitch I've come across. I'm trying to work out whether this is a bug in Vim or a problem with my set up, so here's the situation:
I use set tags=<files> to specify the ctags files that I'm using.
:set tags=/home/jon/.vimtags.php,/home/jon/project/.vimtags.php
If I then print the contents of tags, I get what I expect to:
:set tags?
tags=/home/jon/.vimtags.php,/home/jon/project/.vimtags.php
I can also use omnicomplete as usual, with <C-x> <C-o>. This is, until I try and complete with something that doesn't exist (i.e. an unknown tag that returns no results). I get the "Pattern not found" error message and then, bizarrely, my tags file list is cleared. If I print the contents of tags straight after, I get:
:set tags?
tags=
I've done a great deal of grepping on the Vim plugins that I'm using but, as far as I can see, none of them are setting the tags files anywhere.
Can anyone tell me whether this is due to something in my set-up or a bug in Vim itself? Or even whether anyone else finds the same issue?
I can confirm that this isn't default Vim behaviour - it was being caused by the indexer plugin. For some reason, there was a function that reset tags when the omnicomplete failed. I'm going to contact the developer about this, and see if he can come up with a solution.

Cross buffer search result list for Vim?

After searching in Vim you can get a list of the search results with :g//# and with :bufdo g//# you can get list of matches in all buffers.
But using it with bufdo is not really realistic since it does not show the file where the match came from or give an option to jump to the match.
Is there a plugin that would allow that?
Note that I want this for the internal Vim search because I often use it via *, # and similar shortcuts. I know that LustyExplorer (LustyBufferGrep) allows to search from all buffers, but it uses its own search input... I want reuse the internal Vim search.
You can paste the contents of vim search register with CTRL-R+/. Other plug-ins that can do that include Buffersaurus.
It seems to be possible to integrate the internal Vim search to Buffersaurus like this:
map <Leader>b :Bsgrep <c-r>/<cr>
Hit Leader+b to open up the list.

Resources