每当我从Chrome复制到Vim中的文本时,我就会得到一个级联缩进,而不是一个一致的缩进,因此:
def fn(x):
"""Takes x as an input and returns y
if x:
return y
变成:
def fn(x):
"""Takes x as an input and returns y
我有几个使用Vim的系统,其中一个系统无法查看/编辑压缩文件。我相信我有正确的插件,因为我的Vim 7.0的另一个系统可以与相同的插件正常工作。
我得到一个错误:
$ vi admin.war
~
...
~
***error*** (zip#Browse) unzip not available on your system
我的机器:
$ uname -srmo
Linux 2.6.35.4-rscloud x86_64 GNU/Linux
$ vim --v
VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Sep 28 2010 11:05:08
很久以前,在另一台机器上,当我用VIM编写C代码时,我启用了一些功能,所以当我开始使用/*进行注释并在输入*/之前点击enter时,VIM会放置一个*并将其很好地空间。那是什么,我怎样才能把它拿回来?我想让它自动地这样做:
/* some comments
* <-- VIM put this " * " here */
一般建议,使VIM更酷的欢迎。
我在用vim写Markdown。当我输入这个:
1. test
2. test
Vim很烦人,并将其格式化如下:
1. test 2. test
我的formatoptions (tqlna)确实包括n。文件类型是markdown。formatlistpat如下:
setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^[-*+]\\s\\+
它的部分功能似乎是有效的,因为Vim明白它不应该重新格式化以-、*或+开头的列表。
我怎么才能解决这个问题?
我正在使用linux,并试图在.vim文件(特别是jcommenter.vim )中查找^M字符。我想找到并替换^M字符,但无法这样做。我试过了
%s/^V^M//g
和
%s/\r/\r/g
不幸的是,两者都找不到^M,我已经读过,当vim读取一个文件时,它将不包括^M,这是真的吗?我怎样才能找到并摆脱^M?
编辑:这是我收到的错误示例:
line 21:
E492: Not an editor command: ^M
line 31:
E492: Not an editor command: ^M
这发生在任何地方都有空白行。
编辑:!!我找到线索了!
/usr/share/vim
我在使用以下命令时遇到了问题:
autocmd FileType go autocmd BufWritePre <buffer> Fmt
它假定通过将代码放在.vimrc文件的末尾来自动格式化代码。
下面是我的.vimrc文件的外观:
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.
我觉得在Vim保存文件和Karma重新运行我的茉莉花单元测试之间,我遇到了一种竞争状态。下面是四个测试运行的序列,它演示了症状(我截断了错误日志中非常长的路径):
$ karma start karma.conf.js --auto-watch
[... snip a lot of coding and test running ...]
PhantomJS 1.6 (Linux) LOG: 'Running tests at 2013-08-14T08:19:57.252Z'
PhantomJS 1.6 (Linux): Executed 4 of 4 SUCCESS (0.
我在x86_64 GNU/Linux上运行IBAMR模型(一组用于解决沉浸式边界问题的代码)。启动配置文件名为input2d。当我用vi打开它时,我发现:
"input2d“插头251L,11689C
如果我编译IBAMR模型而不保存input2d,它将编译并运行良好。但是,如果我保存input2d,编译器就会崩溃,并说:
Warning in input2d at line 251 column 5 : Illegal character token in input
显然,这与unix在文件末尾添加换行符有关。这是我的问题:在unix系统上,如何在vi中以dos格式保存此文件,并且