vim

VIM search for pattern into quickfix

我的未来我决定 提交于 2020-12-28 07:46:14
问题 Basically I need to create a quickfix buffer listing all lines that match a regex. What is the best way? The global command may not be the best, but I think it should be usable. The output of the global command is perfect, but I need it to hyperlink the matching lines. 回答1: Use caddexpr:- g/<pattern>/caddexpr expand("%") . ":" . line(".") . ":" . getline(".") 回答2: You can also not use the global command and stick with what is built-in. Use the vimgrep command as below: :vimgrep /pattern/ %

VIM search for pattern into quickfix

二次信任 提交于 2020-12-28 07:45:06
问题 Basically I need to create a quickfix buffer listing all lines that match a regex. What is the best way? The global command may not be the best, but I think it should be usable. The output of the global command is perfect, but I need it to hyperlink the matching lines. 回答1: Use caddexpr:- g/<pattern>/caddexpr expand("%") . ":" . line(".") . ":" . getline(".") 回答2: You can also not use the global command and stick with what is built-in. Use the vimgrep command as below: :vimgrep /pattern/ %

VIM search for pattern into quickfix

陌路散爱 提交于 2020-12-28 07:43:28
问题 Basically I need to create a quickfix buffer listing all lines that match a regex. What is the best way? The global command may not be the best, but I think it should be usable. The output of the global command is perfect, but I need it to hyperlink the matching lines. 回答1: Use caddexpr:- g/<pattern>/caddexpr expand("%") . ":" . line(".") . ":" . getline(".") 回答2: You can also not use the global command and stick with what is built-in. Use the vimgrep command as below: :vimgrep /pattern/ %

YCM error. The ycmd server SHUT DOWN (restart wit…the instructions in the documentation

℡╲_俬逩灬. 提交于 2020-12-28 06:39:22
问题 I installed YCM with vim plug, but I may have shut down before process finished. Now when I start vim I get this error "The ycmd server SHUT DOWN (restart wit...the instructions in the documentation." I've googled but can not find workable solution. I don't see anything in the documentation that helps. But I am new to vim and coding in general so may be missing something. :YcmDebugInfo comes back with "Server errored, no debug info from server". I have tried :YcmRestartServer, but to no

YCM error. The ycmd server SHUT DOWN (restart wit…the instructions in the documentation

浪尽此生 提交于 2020-12-28 06:37:50
问题 I installed YCM with vim plug, but I may have shut down before process finished. Now when I start vim I get this error "The ycmd server SHUT DOWN (restart wit...the instructions in the documentation." I've googled but can not find workable solution. I don't see anything in the documentation that helps. But I am new to vim and coding in general so may be missing something. :YcmDebugInfo comes back with "Server errored, no debug info from server". I have tried :YcmRestartServer, but to no

YCM error. The ycmd server SHUT DOWN (restart wit…the instructions in the documentation

耗尽温柔 提交于 2020-12-28 06:36:45
问题 I installed YCM with vim plug, but I may have shut down before process finished. Now when I start vim I get this error "The ycmd server SHUT DOWN (restart wit...the instructions in the documentation." I've googled but can not find workable solution. I don't see anything in the documentation that helps. But I am new to vim and coding in general so may be missing something. :YcmDebugInfo comes back with "Server errored, no debug info from server". I have tried :YcmRestartServer, but to no

Vim Syntax Highlighting does not work

本小妞迷上赌 提交于 2020-12-27 08:20:12
问题 I've installed a fresh Arch Linux system on my laptop and downloaded the vim package. I haven't altered the .vimrc file, but the syntax highlighting doesn't seem to work with any of the languages I tried (Python, Ruby, CSharp, C...). Auto formatting (gg, =, G) also fails. Until now when playing with vim (because I can't really say I've extensively used it) in other OSs (Ubuntu, Fedora), the syntax highlighting came on automatically. Is there something I am missing here? 回答1: You need to have

Vim Syntax Highlighting does not work

被刻印的时光 ゝ 提交于 2020-12-27 08:19:59
问题 I've installed a fresh Arch Linux system on my laptop and downloaded the vim package. I haven't altered the .vimrc file, but the syntax highlighting doesn't seem to work with any of the languages I tried (Python, Ruby, CSharp, C...). Auto formatting (gg, =, G) also fails. Until now when playing with vim (because I can't really say I've extensively used it) in other OSs (Ubuntu, Fedora), the syntax highlighting came on automatically. Is there something I am missing here? 回答1: You need to have

Vim Syntax Highlighting does not work

心已入冬 提交于 2020-12-27 08:18:48
问题 I've installed a fresh Arch Linux system on my laptop and downloaded the vim package. I haven't altered the .vimrc file, but the syntax highlighting doesn't seem to work with any of the languages I tried (Python, Ruby, CSharp, C...). Auto formatting (gg, =, G) also fails. Until now when playing with vim (because I can't really say I've extensively used it) in other OSs (Ubuntu, Fedora), the syntax highlighting came on automatically. Is there something I am missing here? 回答1: You need to have

How to compile a cpp file directly from vim editor in Windows?

99封情书 提交于 2020-12-27 05:30:16
问题 I've recently installed a vim editor in my Windows operating system. I only know the conventional procedure i.e, creating the source file in the editor and running it from the command line. But, I don't quite understand how to compile a CPP program directly from the vim editor. when I run the command :!g++ hello.cpp -o hello from the vim command line, I get the following message C:\WINDOWS\system32\cmd.exe /c (g++ hello.cpp -o hello) Hit any key to close this window... 回答1: I assume your