Search & Replace
- uber search
<leader>ss
; select category and search
Search
basic VIM search
- file: forward(
/
) backward(?
) next(n
) prev(N
) - line: forward(
f
) backward(F
) next(;
) prev(,
) - files tree
\
Neovim
- buffers
<leader><leader>
- search command keys
<leader>k
- search neovim
<leader>sn
search in
- buffer
<leader>/
- files
<leader>sg
- files (open)
<leader>s/
)
search for
- files
<leader>sf
(current project)
Replace
Replace (edit)
Replace (regex)
When copying from logseq to vim, misforms the text.
After pasting the text look likes below.
The seconds from the beginning has been surrounded with ()
and space is deleted.
# origin
- {{youtube-timestamp(330)}} install plugin
- {{youtube-timestamp(564)}} `:checkhealth treesitter`
- {{youtube-timestamp(585)}} `:Inspect`
# needed format
- {{youtube-timestamp 330}} install plugin
- {{youtube-timestamp 564}} `:checkhealth treesitter`
- {{youtube-timestamp 585}} `:Inspect`
After running a substitution
on the selection
we got the wanted result.
Enter: :s/(\([0-9]*\))/ \1/g
Explaination:
: # start command
'<,'> # on current selection
s/PATTERN/REPLACEMENT/ # substitution with regex pattern
([0-9]*) # find a sequence of numbers between ( )
(\([0-9]*\)) # `\(` start capture group, '\)' end group
\1 # replacement a space and first capture group
Within the selection search for (111)
and replace it with ' 111'
.
Online testing with regex on regex101.com.
More info about regex here.