Questions tagged [search]

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

26 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
313 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 ...
2
votes
0answers
188 views

Can't search for strings within hidden files with fzf's Rg command in vim

I just installed fzf for my bash terminal and the fzf.vim plugin for vim. I've placed the following code at the bottom of my .bashrc script: export FZF_DEFAULT_COMMAND='rg --files --hidden --no-ignore-...
2
votes
0answers
48 views

How to search the output of vim command line commands like `:ls`, `:browse oldfiles`

Back from emacs recently, in emacs I can list all the existing buffers in a emacs buffer, where I can do search, delete or jumping etc. In Vim, if I type :browse oldfiles, a long list may be returned ...
2
votes
0answers
78 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
81 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
86 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
78 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 ...
2
votes
0answers
782 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
143 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?
2
votes
1answer
2k 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 ...
1
vote
1answer
44 views

How to add a certain word before the names of methods in Javascript?

I am working with react. First I had a component with state I created methods and all that. Now I want to convert it into stateless component. I have add the word function before each method name. ...
1
vote
0answers
29 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
0answers
44 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
32 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
365 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
717 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 ...
0
votes
0answers
12 views

How to not jump back on mismatch with incremental search

With incremental search (incsearch), we jump to matches and they are highlighted as they are found. But if we hit a character that makes the search not match anything, we’re thrown back to where we ...
0
votes
0answers
60 views

Restore “search hit BOTTOM, continuing at TOP” when search navigation wraps aound end of file

I've recently switched to Neovim, and some days in, I realized that there was no search hit BOTTOM, continuing at TOP message when jumping from the last to the first search result (or vice versa), ...
0
votes
0answers
24 views

Numpad forward slash to search without numpad?

In Vim I use the forward slash on my numpad a lot for searching. Thinking of getting a TKL keyboard I was wondering how that works without a numpad. I tried the forward slash on the regular keys, but ...
0
votes
0answers
35 views

How to reload vim buffer

I built a cpp environment with YCM, EasyGrep and some other plugins. With YCM, I can jump to declaration/definition, with EasyGrep, I can grep a keyword easily. But I found something weird: Saying ...
0
votes
2answers
54 views

Searching between two words

I have this string : content htp://ww.mySite.com/image/123kw9ykjm-065n/640/568/25452583.suite />meta property="twitter:suite and I want to get the link to add it in a list; Here is my function : ...
0
votes
0answers
43 views

Match (Search, Letters)

I Have this function : function! Test1() let myWord = "accroche-coeur" let cont1 = "-" if match(myWord,cont1)>=0 " if myWord contains cont1 echo "Ok" else ...
0
votes
1answer
56 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
34 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
62 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 = ...
-1
votes
1answer
31 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 ...