Questions tagged [search]

Searching for text with / or search(). For find/replace operations, use tag [substitute] instead.

20 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
285 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
1answer
1k 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
50 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
74 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 ...
2
votes
0answers
79 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 ....
2
votes
0answers
618 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
1answer
415 views

Overriding highlighting style for one syntax

My colour scheme (morning) doesn't play nice with the quickfix window: I cannot read the selected item's location, because the foreground and background colours are the same. Because of this I want to ...
2
votes
0answers
140 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
26 views

How do I remap result navigation buttons after a search?

I search with /, press enter, and go a few results down using n. I realize that I have gone a few more results down than I meant to and want to go back a few. I press m because that is next to n just ...
1
vote
1answer
66 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
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
314 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
641 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
64 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
18 views

Can I use feedkeys() inside of a keyloop implemented by getchar()

I implemented a fuzzy filter, which accept a list argument, open a window with a scratch buffer whose content set to the list, then waiting for use input and do filtering. Here is why I ask this ...
0
votes
0answers
31 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
45 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
1answer
78 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 ...