Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [search]

Searching for text with / or search()

1
vote
1answer
53 views

How do I make this vimscript function (taken from another question here) 'forget' about a previous search term?

Based on the accepted answer to this previous question, I put the code below in my .vimrc, which changes the color of my statusline depending on whether my search (started with / or ?) yields results ...
1
vote
1answer
366 views

vimgrep can not find a pattern in specified directory

I have encountered very strange problem using vimgrep command. I try to find a match in all the files in all subdirs of a specified directory: :vimgrep /word_I_search/ path\to\my\dir\**\* (there are ...
0
votes
1answer
55 views

Remap / to a another search function?

I there a way to remap / that trigger builtin search function of vim to another search fuzzy function and how to achieve that?
-1
votes
1answer
29 views

search one word containing # with *

I would like to search the word under my prompt on vim. For this, i tried to press touch *. But, if the word i want to search is #foo, as an exemple, vim only searches word foo (without hashtag), so ...
3
votes
0answers
69 views

why does cpo-=c cause perceptual “lag?”

I'm using a CursorMoved autocommand with searchpos to do highlighting of special words. I've been using set cpo-=c to handle possible overlapping matches, and I restore it afterwards. This set seems ...
3
votes
0answers
74 views

vim-latex suit forward search

First, sorry for the cross-posting. I have posted it in https://tex.stackexchange.com/q/345060 as well. I am trying to enable forward search in vim-latex. Since it is not working, I tried a vanilla ....
3
votes
0answers
227 views

Is there a way in vim to determine if something is highlighted after search?

What I want to do is make CursorMoved autocmd that would check if there is a search highlight is on and if it is it would start a timer that would deactivate it. PS I know about all available ...
3
votes
0answers
901 views

How to have forward search using Zathura PDF viewer and LaTeX-Box plugin?

I just started using Zathura to view pdfs while editing tex files. I am trying to have forward searching capability in Zathura. Using the LaTeX-Box plugin in Vim, I have added the following in my ...
2
votes
0answers
34 views

Is it possible to call searchpair or searchpairpos on string instead of current buffer?

searchpair or searchpairpos works only on current buffer. Are there similar functions work on string instead of buffer?
2
votes
0answers
523 views

multiple highlight with multiple color

When we search for a word, it gets highlighted. I want to search for another word keeping the previous one highlighted (with a different color probably). Please let me know if it's doable.
2
votes
0answers
133 views

Search within syntax group?

Is there a way to take advantage of syntax highlighting for searches? For example, can a search be limited to comments or non-comments, if they are correctly marked by syntax highlighting?
1
vote
0answers
19 views

How do I keep the spacevim search results window open after opening a file?

How can I keep the search results location list window open after opening a file in a new buffer?
1
vote
0answers
42 views

change ofWord to of Word, and ignore offer, office, off etc

I OCRed a document but has this problem: some spaces between "of" and the word after are gone and I need to add a space between "of" and "word". Is there any way to do it? And also to avoid adding ...
1
vote
0answers
31 views

substitute a join for a character that ends a line

when pasting from a pdf document, words in the original document are being split up, and replaced by a - and a line break. For example: alternative specifications. In con- clusion, these findings ...
1
vote
0answers
271 views

Set highlighted token to blink during search and replace

When I do a global search and replace with confirm (e.g., :s/t/s/gc) I have a lot of trouble seeing which of many occurrences is currently under the cursor. I've tried the usual tricks, e.g., hi ...
1
vote
0answers
547 views

Enter insert to insert mode from function

I want to create function that search for selection and then automatically replace selection with given text. Something like *Ncgn but with custom movement (not exactly word only). My current ...
1
vote
0answers
62 views

Is there a way to highlight searches done with grepprg?

I'm using vim-grepper plugin, but I guess it doesn't really matter. What I want is when I'm searching for something inside my project via vim-grepper or some grepprg if there are matches inside opened ...
0
votes
0answers
29 views

Find location of matched pattern

I am using matchadd() to match some text in a line. Using Vim script, how can I jump to the matched text? Or, instead, how can I get the column number of the start of the match? Motivation: I have ...
0
votes
0answers
30 views

How to get the same message and error behavior as normal `n` when calling `normal n` in function

I wrote a vimscript function that prevents the cursor from changing its location on the screen when I press n: function! my_n() let l:start=line("w0") let end = line("w$") let cursor = ...
0
votes
0answers
95 views

Highlighting a search capture group

By :set hl, the search result of a / expression is highlighted, for example: And if one wants to replace one substring distinguished by its surrounding, one can do so elegantly using regex capture ...