简体   繁体   English

是否有类似于VIM的VSCode快捷方式或命令用于grepping行?

[英]Is there a VSCode shortcut or command similar to VIM for grepping lines?

Sometimes I need to look for lines that do not contain a string. 有时,我需要查找不包含字符串的行。 For example, on our Jenkins files, there's a lot of "Downloading $package". 例如,在我们的Jenkins文件中,有很多“下载$ package”。 I can copy the file into VIM and do a :g/Downloading/d and all lines that contain the word "Downloading" will be deleted. 我可以将文件复制到VIM并执行:g/Downloading/d ,所有包含“ Downloading”一词的行都会被删除。

Is there something like that in VSCode? VSCode中有类似的东西吗?

If you install the vscodevim and enable the Neovim setting(below), you will be able to use :g functionality. 如果安装vscodevim并启用Neovim设置(如下所示),则可以使用:g功能。

"vim.enableNeovim": true “ vim.enableNeovim”:是

VS Code supports regexp in find, and it even supports a kind of inverse matching. VS Code在查找中支持正则表达式,甚至还支持一种逆匹配。

In your case you can enable regexp in the "Find..." box (the button with the ".*" symbol) and use ^((?!Downloading).)*$ to match all lines that do not contain the string "Downloading". 在您的情况下,您可以在“查找...”框中启用正则表达式(带有“。*”符号的按钮),并使用^((?!Downloading).)*$来匹配所有不包含字符串的行“下载”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 VSCode对vim的ci的快捷命令是什么<!--?</div--><div id="text_translate"><p> VSCode 是否有办法在标签之间实现 select? 而且我的意思不仅仅是折叠和取消折叠,我的意思是 select 开始和结束标签之间的所有内容。</p></div> - What is VSCode's shortcut command for VIM's ci<? 在 VSCode 中使用多个命令的快捷方式 - Shortcut with multiple command in VSCode vscode的命令中心有快捷方式吗? - Is there a shortcut for vscode's command center? VScode 中是否有删除/添加多行空格的快捷方式? - is there a shortcut on deleting/adding space of multiple lines in VScode? vscode 定义选择 n 行快捷方式 - vscode define select n lines shortcut 使用打开文件夹命令启动的 VSCode Win 快捷方式 - VSCode Win Shortcut to Launch with Open Folder Command vscode:为“插入片段”命令分配键盘快捷键 - vscode: assign keyboard shortcut to "Insert snippet" command 是否有一个 VSCode 快捷方式可以告诉我下一个快捷方式运行什么命令? - Is there a VSCode shortcut which tells me what command the next shortcut runs? 有没有办法在 vscode 中只使用少数 vim 命令 - Is there is way to use only few of vim command in vscode vscode 如何添加用于暂存选定行的键盘快捷键 - vscode how to add keyboard shortcut for staging selected lines
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM