vim

Vim 7.4 on Windows 8.1 Creates Program and Files Folders Every Time I Open a File

牧云@^-^@ 提交于 2020-01-05 07:31:13
问题 When I open a file from Windows Explorer using right-click -> Edit with Vim, Vim creates a "Program" folder on the root, and a "Files" folder in the directory of the file I've opened. The Files folder includes Vim/vimfiles/doc. There are no files anywhere, just the directory tree. This also happens when I run Vim without a file name as an argument. A DOS Box flashes just before Vim opens, but it goes away too fast for me to read what it's saying. I've used Vim for years and have never seen

Which error format should be used for Vim and Cppcheck?

时光毁灭记忆、已成空白 提交于 2020-01-05 07:28:11
问题 I use the following script to integrate Cppcheck with gVim: " vimcppcheck.vim " =================================================================== " Code Checking with cppcheck (1) " =================================================================== function! Cppcheck_1() set makeprg=cppcheck\ --enable=all\ % setlocal errorformat=[%f:%l]:%m let curr_dir = expand('%:h') if curr_dir == '' let curr_dir = '.' endif echo curr_dir execute 'lcd ' . curr_dir execute 'make' execute 'lcd -' exe "

Running command in existing shell from gvim

最后都变了- 提交于 2020-01-05 07:24:19
问题 It all starts from a shell. For example I am using urxvt with zsh . There I open some file with gvim . In this case it is a LaTeX file. Now I need to execute some command (for compiling the document, e.g. pdflatex ). How can I have the original shell, from where gvim was started, execute that command? It would also be acceptable if gvim had to open a new shell once and after that execute every future call of the designated command ( pdflatex ) in that shell, while I can still type in it

Multi-line regex in Vim: filtering out blocks of text in a file

旧城冷巷雨未停 提交于 2020-01-05 07:07:07
问题 What is the correct regex for filtering multiple-lined blocks of text that end with #tags ? My file looks like this: Text block 1: - something - something - something #tag1 #tag2 Text block 2: - somethingelse - somethingelse #tag2 Text block 3: - really interesting stuff - really interesting stuff #tag1 etc These great tips pointed me to using \_. . Hence, for filtering out both blocks containing #tag1 , I came up with this: \_.\{-}#tag1.* That, however, only gives me Text block 1. Instead of

MacVim, remapping Alt-key as Ctrl-key

你离开我真会死。 提交于 2020-01-05 06:54:31
问题 I am a MacVim user, and I would like to know if it's possible to make the Alt - Option key behave as a Ctrl key. Thanks for your time. 回答1: I couldn't find a way of doing it inside MacVim, but KeyRemap4Macbook did the trick. It is a FANTASTIC piece of software, the documentation is just excellent, I recommend it to everybody in difficult mapping situations. It allows you to customize mappings for each app, in an xml file that you can open from inside the app. It's absolutely poka-yoke. This

Vim 操作命令汇总(上)

杀马特。学长 韩版系。学妹 提交于 2020-01-05 02:29:43
把一些常用的和最近新学习的一些命令都列出来了,让我们的编程成为乐趣无穷的探险和享受! ======================================================== ''' 这一部分是入门级别的操作命令 ''' * 跳转到某一行 27gg 27G * 查找字符串(向下)  /string (*[]^%/?~$ 前面要加反斜杠) * 查找字符串(向上)  ?string * 查找下一个相同的字符串 n * * 查找整个字符串 /string\> * 查看以前搜索的内容 / 然后按上或下 * 删除一个word dw * [NOTE] d命令后面可以与任意一个位移命令结合,例如:d3j d18G等等 * 在一行中查找一个字符x  fx * 一行中反向查找字符x   Fx * 查找匹配的括号等 % * 光标定位到文件首 gg * 光标定位到文件尾 G * 光标定位到行首 ^ * 光标定位到行尾 $ * 向下另起一行 o * 向上另起一行 O * 改变文本明令 c * 回到刚才指针的位置 `` * 重复上一次执行的命令 . * 剪切文本[=删除文本] dd 或者 d3w等 * 复制文本 yy 或者 y3w,y27gg,y27G等 * 粘贴文本 p 或者用4p复制4次 * 文件令存为 :saveas another.cpp * 打开一个新窗口 :split

Vim freezes when using auto-complete with dictionary as well as current file

放肆的年华 提交于 2020-01-05 02:28:48
问题 As was discussed here: Vim auto complete, both with current file and dictionary, I am trying to use both dictionary and current file in determining suggestions during auto-complete. In my vimrc I have the following two lines for auto-complete: set complete=k,. set dictionary+=pathfile-to-dictionary But then when I press the auto-complete button I get error: match in file the-dictionary-pathfile And the system completely freezes with that error, i have to close the console and start over to

linux下vim命令汇总

天涯浪子 提交于 2020-01-05 02:27:49
一. 进入vi的命令   vi filename :     打开或新建文件,并将光标置于第一行首   vi +n filename :   打开文件,并将光标置于第n行首   vi + filename :   打开文件,并将光标置于最后一行首   vi +/xxx filename: 打开文件,并将光标置于第一个与xxx匹配的串处   vi -r filename :   在上次正用vi编辑时发生系统崩溃,恢复filename   vi filename....filename : 打开多个文件,依次进行编辑 二. 移动光标类命令   h :    光标左移一个字符   l :     光标右移一个字符   space:  光标右移一个字符   Backspace: 光标左移一个字符   k或Ctrl+p:光标上移一行   j或Ctrl+n :光标下移一行   Enter :  光标下移一行   w或W :  光标右移一个字至字首   b或B :  光标左移一个字至字首   e或E :  光标右移一个字至字尾   ) :光标移至句尾   ( :光标移至句首   }:光标移至段落开头   {:光标移至段落结尾   nG:光标移至第n行首   n+:光标下移n行   n-:光标上移n行   n$:光标移至第n行尾   H :光标移至屏幕顶行   M :光标移至屏幕中间行   L

Vim freezes when using auto-complete with dictionary as well as current file

本小妞迷上赌 提交于 2020-01-05 02:27:27
问题 As was discussed here: Vim auto complete, both with current file and dictionary, I am trying to use both dictionary and current file in determining suggestions during auto-complete. In my vimrc I have the following two lines for auto-complete: set complete=k,. set dictionary+=pathfile-to-dictionary But then when I press the auto-complete button I get error: match in file the-dictionary-pathfile And the system completely freezes with that error, i have to close the console and start over to

vim基本命令汇总

让人想犯罪 __ 提交于 2020-01-05 02:26:35
高级一些的编辑器,都会包含宏功能,vim当然不能缺少了,在vim中使用宏是非常方便的: qx 开始记录宏,并将结果存入寄存器x q 退出记录模式 @x 播放记录在x寄存器中的宏命令 稍微解释一下,当在normal模式下输入:qx后,你对文本的所有编辑动作将会被记录下来,再次输入q即退出了记录模 式,然后输入@x对刚才记录下来的命令进行重复,此命令后可跟数字,表示要重复多少次,比如@x20,可以重复20次。这个在文本的批处理中是非常有用的。 同时编辑多个文件 在vim众多的插件中,有一个叫minibuffer的插件,就是下面所说的标签页功能了,可以支持同时编辑多个文件。 标签命令 :tabe fn 在一个新的标签页中编辑文件fn gt 切换到下一个标签页 gT 切换到上一个标签页 :tabr 切换到第一个标签页 :tabl 切换到最后一个标签页 :tabm [N] 把当前tab移动到第N个tab之后 对,正如你所想象的那样,跟eclipse, ue等的标签页是一个意思! 窗口命令 ctrl+w s 水平分割窗口 ctrl+w w 切换窗口 ctrl+w q 退出当前窗口(由于同时有多个文件,此命令不会影响其他窗口) ctrl+w v 垂直分割窗口 其他 vim在保存之前不会对文件做实际的修改,只是加载到缓冲区中,对文件的编辑其实是对缓冲区的编辑,直到:w时才会存入物理文件。 :e