是的,你就在那里。如果要在
我想打开一个文件,一旦打开文件,nvim就会自动进入搜索模式。
我需要找到要使用的正确命令,可能是nvim-cCommand
file.txt
为了澄清,我想启动nvim,并能够通过键入搜索字符串开始搜索,而无需先按"/"进入搜索模式。
运行nvim-c'/searchString'会立即执行搜索,这不是我想要的
我的用例是使用nvim作为kitty的滚动寻呼机。
# kitty passes text to nvim via stdinput which i write to a tmp file in /tmp/kitty_scrollback_buffer
# I then open this file with the nvim terminal by catting the file
# is there anyway to then automatically enter command search mode so that nvim is ready to search when i enter a search string (I do not want to type /, i want to be able to search immediately)
exec nvim
-u NONE
-c "silent! write! /tmp/kitty_scrollback_buffer | terminal cat /tmp/kitty_scrollback_buffer - "
file.txt
中搜索foo
,请运行以下命令:
nvim -c "/foo" file.txt