- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
我最近才开始使用 VIM 作为我的主编辑器。到目前为止,我在发现它提供的所有不错的小功能时玩得很开心。我一直在寻找几天来从编辑器中运行我的 cucumber 测试(如果它可以运行特定场景,这是一个奖励)。我尝试过像 vim-cucumber 和 vim-vroom 这样的插件,但我似乎无法正常工作。注意:我在 env.rb 中做一些事情,比如运行“Rake”命令,这可能是插件不工作的原因。只是想知道是否有人在同一条船上并且有解决方案,我们将不胜感激任何帮助。
谢谢亚历克斯
最佳答案
当我键入 ,t
时,我设置了映射,我的光标下的 rspec 或 cucumber 测试运行,当我键入 ,T
时,整个文件我' m 在运行。如果我在不在 rspec 或 cucumber 文件中时键入 ,t
,那么我运行的最后一个测试将重新运行。这是我的 vimrc 的相关部分。
" Set the leader
let mapleader = ","
" Run tests
autocmd FileType ruby,eruby,yaml,haml,scss,cucumber nmap <leader>t :call RunTestCommand(line('.'))<CR>
autocmd FileType ruby,eruby,yaml,haml,scss,cucumber nmap <leader>T :call RunTestCommand()<CR>
function! GetTestCommand()
if expand('%:r') =~ '_spec$'
return 'bundle exec rspec'
elseif expand('%') =~ '\.feature$'
return 'bundle exec cucumber'
else
return '0'
endif
endfunction
function! RunTestCommand(...)
let cmd = GetTestCommand()
" if there's a command update the test command register (t)
if cmd != '0'
let @t = ':!' . cmd . ' ' . expand('%') . (a:0 == 1 ? ':'.line('.') : '')
endif
" if the test command register isn't empty, excecute it.
if strlen(@t) > 0
execute @t
elseif
echoerr "No test command to run"
end
endfunction
关于ruby - 在 vim 或 macvim 中运行 cucumber 测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19336301/
如何将 MacVim 设置为以扩展显示器的全高(减去菜单栏)和宽度(非全 View )的窗口启动? 如果这在启动时不可能,我该如何手动更改它(不是通过拖动窗口,而是使用命令)? 最佳答案 您可以设置
我已经开始使用 macvim,现在对导航相当满意(在单个文件上),现在我需要使用 mvim 编写整个项目(比如 rails)。 在textmate,你有mate project_dir它在侧抽屉中打开
我已经安装了 MacVim 和 Janus。 我最近添加了 set rnu到我的 .vimrc.after 以启用相对行编号,并发现我在打开新窗口时只有 rnu 工作。我的意思是,当我在现有窗口中打开
我最近将 macvim 升级到 7.3,我无法再在打开 macvim 的目录中打开 nerdtree 或 netw,它总是在我的主目录中打开。 例如, 如果我在/users/me/test/proje
我希望 vim 指向 macvim :) 可能是通过别名。 vim 在这里:whereis vim /usr/bin/vim macvim 我找不到,例如whereis macvim什么都不返回 最佳
我正在使用带有 Mountain Lion 的 Mac OSX 并且我正在运行 MacVim 7.3 快照 66,我刚刚安装了它 brew install macvim但它不是从它的工具栏开始,我真的
当我使用 vim newfilename打开一个文件但该文件不退出,vim将创建一个名为 newfilename 的新文件. 然而,MacVim不能以这种方式工作 --- 即 mvim newfile
我正在尝试使用 command-t fuzzy finder plugin对于 MacVim。 我按照说明操作,但我的 MacVim 不再工作;没有窗口显示,但它看起来仍然像启动一样,因为应用程序图标
大约 6 个月前,我的所有开发工作都从 TextMate 切换到 MacVim,主要包括使用 Ruby、Ruby on Rails 和 JavaScript 进行编码。 使用 TextMate,每当我
每当我聚焦我的 MacVim 窗口时,它都会卡住几秒钟。这似乎是由于 NERDTree 刷新了它的根节点(它打印 NERDTree: Refreshing root node. This could
我正在学习配置macvim。 现在,我的制表符缩进是4个字符,我想将其更改为2个字符。我应该在macvim配置文件中添加什么? 我有什么初学者指南来学习配置mac vim吗? 最佳答案 在MacVim
我正在尝试编写一个作用于任何文件类型的函数(因此不是特定的 ftplugin),它根据文件类型具有不同的行为。例如 if (filetype=='objc') "do something
在 macvim 中,是否可以使选项卡名称全长(即不缩短?) 例如,如果我打开 a-very-really-quite-long-file-name.txt,它在选项卡中的名称将缩短为 a-very-
如何让 mvim 在启动时自动垂直拆分窗口? 最佳答案 我没有 mvim,但它可能是 ~/.vimrc ,因此,尝试将此行添加到您的 ~/.vimrc文件: vsplit 关于vim - MacVim
我正在阅读 Django 教程 http://docs.djangoproject.com/en/1.2/intro/tutorial01/#activating-models ,它通过 python
如何为 MacVim 添加西类牙语拼写检查器? 我读到这是一个有用的 link ,但显然它不起作用......我该怎么办? 最佳答案 我不知道 MacVim,但是我只是在 Windows 7 上的 v
我从 Vim 外部复制文本。 ⌘V 在其他应用程序中粘贴文本没有问题。在 MacVim 中,它不起作用。 在插入模式下,什么都不显示。在普通模式下,我得到 E353: Nothing in regis
我已经从 /Applications/ 中删除了 MacVim目录,但当我输入 vim 时在终端中显示错误:no such file or directory: /Applications/MacVi
对于 MacVim,我使用大小为 10 的 Monaco 字体,在标准 MacVim 配置下,它没有抗锯齿。当我在 MacVim 首选项(高级选项卡)中打开高级渲染时,Monaco 10pt 现在是抗
如何在 MacVim 中使用命令键?例如,我希望能够按 Cmdt 来打开 CtrlP 或 Cmdn 来打开 NerdTree。 最佳答案 见 :help 映射到⌘-T; 然而 , ⌘-T 已经映射到
我是一名优秀的程序员,十分优秀!