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 [find]

The tag has no usage guidance.

1
vote
1answer
35 views

How to search for any repeating character, X number of times

Let's say a buffer has a certain characters I know will be repeated seven (7) times. How can I search for any character repeated seven times? I know I can search for .., but those to characters won'...
1
vote
1answer
31 views

Find and replace in XML file in vi

I have an .xml file which contains many times the following web beacon <span lang="EN" class="multilang">ANY TEXT TOTO</span> I would like to make a "Find&Replace": each web beacon ...
0
votes
1answer
57 views

regex find and replace all with capture groups throws E488: Trailing characters

My text file looks like this Lastname, Firstname Doe, John I'm trying to get it to end like this using find replace regex Firstname Lastname John Doe This regex throws the error, although using ...
-1
votes
1answer
297 views

How can I pass extra flags to FZF/ripgrep commands with the leader key?

Current functionality When I use <C-P> and <C-Å> I can respectively search file names and contents. Everything works great. Target functionality When prepending either with <leader&...
4
votes
2answers
74 views

How to do a find with a regex and jump to a specific position within the match

For example: I have several lines starting with :q:, which I want to jump to: :q: regex syntax (...) :q: regex examples (...) Now I want to jump to the start of regex syntax or regex example with a ...
0
votes
2answers
139 views

How to make f{char} case insensitive?

Regarding this command: f{char} To [count]'th occurrence of {char} to the right. The cursor is placed on {char} |inclusive|. {char} ...
1
vote
2answers
68 views

How to change f{char} to search left if no char was found searching right?

Regarding this command: f{char} To [count]'th occurrence of {char} to the right. The cursor is placed on {char} |inclusive|. {char} ...
0
votes
1answer
796 views

E488: Trailing characters error in VI with find and replace command

I am trying a simple find and replace function in VI Editor to change a profile path but the / is getting in my way and I need a simple and clever solution. I tried using: %s/profile: "/fldr0/local/...
2
votes
1answer
206 views

Fuzzy find within buffer

Can I change / command to execute a fuzzy search instead of a regex based one? It would be useful to still be able to access the classic / functionality at certain times.
1
vote
2answers
227 views

Find and replace string with slash in it and retain the slash in the new string

I am having a tough time finding and replacing a string using vi. Source String: &DB2_PORT;/&DB2_DATA; New String after replace: &DB2_PORT;/&DB2_DATA;:tcp=true I can find &...
3
votes
1answer
41 views

How to check if a pattern is contained in a register's content?

I'm writing a new plugin and as part of a function, I need to check that a register contains a particular pattern. I checked the official documentation but couldn't manage to use any of the search() ...
1
vote
2answers
139 views

User command with modified 'path' completion?

I'm trying to write a wrapper command around :edit or :find specifically to open either my vimrc or a subpath of ~/.vim/ (e.g. ~.vim/autoloads/foo.vim). If I run the command with no arguments, it ...
2
votes
1answer
108 views

Exclude some paths from :find path

I'm working on a large scale project with a lot of files, and :find is extremely (several seconds) slow, much slower than :lgrep backed by ag, which skips directories mentioned in .gitignore, e.g. tmp,...
1
vote
0answers
62 views

Why is filetype not set after :find from autocmd?

Objective I want vi file to act like :find file if file doesn't exist. That is, I want to be able to edit a file by name, without giving a path to the file, from the command line: mkdir -p a/b/c ...
4
votes
1answer
129 views

How to jump to a next or previous specific character ignoring linebreaks and not destroying highlight or overwriting my registry?

I have not found much use for ()[]{}, and so I want to map them so it does a find command, jumping to the previous instance of that particular character. Thus, ) will jump forward to the next ), ...
2
votes
3answers
84 views

How to “find” or “till” a bigram?

I have to do a lot of hopping in lines. Often times I want to hop to a t in a line, and promptly press ft, only to discover that I have to do it 7 times before I can actually make it to my ...
4
votes
2answers
152 views

Keystroke to move cursor to the last character of a highlight?

In Visual Mode, you can do this using the o keystroke. However with search highlighting, ie ? or / -- I have a whole selection, but I want to move specifically to the last character of the highlight....
5
votes
1answer
1k views

Ignore folders when performing :find command

I'm using the :find command as my "fuzzy file searcher" in Vim. My setup: set path=,,** nnoremap <leader>f :find * However, I'm having trouble ignoring folders. Huge folders that contain ...
22
votes
3answers
56k views

Find and replace using regular expressions

I have a file with a bunch of user defaults in. I want to change some of the text, but I'm struggling coming up with a matcher and replacer. Using the following example: ##############################...