vim

Problem with Vim's Ruby plugin

家住魔仙堡 提交于 2020-01-01 04:35:08
问题 I have just installed Vim and when ever I go to open in ruby file I get these errors: Error detected while processing C:\Program files (x86)\Vim\vimfiles\ftplugin\ruby.vim line: 76 Encoding::ConverterNotFoundError: code converter not found (UTF-16LE to ASCII-8bit) line: 93 E121 :Undefined varaible: s:ruby_path E15: Invalid expression: s:ruby_path line: 76 NameError: uninitialized constant Gem::Quickloader line: 93 I have Ruby 192 installed and I get this error even if I update ruby vim files.

Disable omnicomplete or ftplugin or something in vim

好久不见. 提交于 2020-01-01 04:29:09
问题 I am trying to disable (auto-/omni-/whichever-) completion in sql. It is a problem for me because I used <C-c> for escape and when the file end in .sql it seems to initiate some search with a frustrating 2 second pause. In particular, typing k during the pause is causing a collision that inserts unwanted sql keywords. .vimrc has filetype plugin off set omnifunc= and :filetype returns filetype detection:ON plugin:OFF indent:ON but in insert mode <C-c>k still prints -- Omni completion (^O^N^P)

Is there a good Vi(m) command for transposing arguments in a function call? Bonus points for Emacs

柔情痞子 提交于 2020-01-01 04:28:06
问题 For example if I have some code like: foo = bar("abc", "def", true, callback); Is there a nice command to move true to the 1st or 2nd position leaving the commas intact? P.S as a bonus my friend want to know if this works in Emacs too. 回答1: In Vim if you place the cursor at the start of the first word and do dWWP then it will have the desired effect. Here is a breakdown: dW delete the current word, including the comma and the following whitespace W move to the start of the next word P insert

What is Vim's feature name for this: # vim:sw=4:ts=4:et:

不羁岁月 提交于 2020-01-01 04:25:08
问题 It does not work for me and I would like to review my configuration. Maybe I turned it off globally. But I don't know what actually to google for :-) Thanks. # vim:sw=4:ts=4:et: 回答1: It's called modeline :he modeline If you start editing a new file, and the 'modeline' option is on, a number of lines at the beginning and end of the file are checked for modelines. There are two forms of modelines. The first form: [text]{white}{vi:|vim:|ex:}[white]{options} [text] any text or empty {white} at

Vundle for VIM is not working on Ubuntu

元气小坏坏 提交于 2020-01-01 04:20:07
问题 I installed Vundle via the instructions given at this blog http://web.archive.org/web/20120731003342/http://www.charlietanksley.net/philtex/sane-vim-plugin-management but when trying to run :BundleInstall I get a VIM error E492: Not an editor command: BundleInstall Here is my tree ~/.vim /home/max/.vim └── bundle └── vundle ├── autoload │ ├── vundle │ │ ├── config.vim │ │ ├── installer.vim │ │ └── scripts.vim │ └── vundle.vim ├── doc │ └── vundle.txt ├── LICENSE-MIT.txt ├── README.md └── test

Insert predefined text on keyboard shortcut

烂漫一生 提交于 2020-01-01 04:02:33
问题 I often insert binding.pry to my ruby files when I debug them. As I use Vim I'd love to automate it to avoid retyping it every time. How could I do it? The exact sequence I'd like to map is: Insert new line. Insert binding.pry to the newly created line. Return to normal mode. EDIT: binding.pry is text I want to paste, not a file. Before insert: a = 1 b = 2 After insert: a = 1 binding.pry b = 2 回答1: Record a macro (untested) qq " record macro to register q o " insert empty line below cursor

How do I get git to display the changes in vim as hg does with the hgeditor script?

笑着哭i 提交于 2020-01-01 03:24:07
问题 An interesting feature in mercurial is the ability to view the changes that will be committed in a vim split (see DiffsInCommitMessageInVIM). Any hint on how to do so with git ? 回答1: Assuming you've got syntax enabled, Vim detects git commit messages as a filetype. This should be obvious from highlighting. The much less obvious part is that it also has a filetype plugin for git commits (and other git things). Make sure you have those enabled ( filetype plugin on ), and then there will be a

Effects of IDE/Text-Editor Color Settings on our Eyes [closed]

Deadly 提交于 2020-01-01 03:24:07
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . Today, we've several IDE/Editor for programming: visual studios, vim, gvim, emacs, eclipse and so on. Whatever we use, we've some color preferences for background and foreground. While most of us are satisfied with the default settings, some do customize the IDE/Editor, choose colors of their taste for various

轻快的VIM(二):插入

非 Y 不嫁゛ 提交于 2020-01-01 03:18:26
上一节我们讲到了VIM中的移动,既然已经能够在屏幕和光标间游刃有余了 那么,现在就来谈谈插入命令 不知道有多少VIM新手和我当年(去年)一样,信誓旦旦的以为只有i可以插入 唉,现在想想都觉得可笑,都是Windows下的编辑器用多了的结果 鼠标一点,妈妈再也不用担心我的文本插入了……悲剧! 好了,让我们抛弃过去吧,从现在起奋斗,也许不算太晚 这是俺写的《轻快的VIM系列》第二节,每一节都会不断更新,加入更多技巧在里面 VIM新手们加油,咱一起总结,一起努力练习…… 基础 字符位置插入 i 在光标之前插入 a 在光标之后追加 你看,其实刚开始用这两个就足够了,这就是最基础的 为什么这么说呢?因为你可以依靠上一节中的移动命令来达到任意位置,然后再大力插入 不要忘了,VIM中最重要的技巧之一就是命令间的配合使用 进阶 行位置插入 A 在一行的结尾处追加 I 在一行的开头处插入 o 在光标所在位置的下一行打开新行插入 O 在光标所在位置的上一行打开新行插入 当然,如果你认为先移动光标然后插入或追加慢了,那么就应该用上面这种方法 它们是以行做单位 在这里我还是需要提醒一下,命令前加数字代表执行次数 tips1: 10I*<Esc>先输入10,然后输入i,接着输入*号,最后按<Esc>     这样就可以在一行开头输入十个*      tips2: 同样,5o###<Esc>先输入5,然后输入o

轻快的VIM(三):删除

风格不统一 提交于 2020-01-01 03:17:47
这一节我们来看看删除,删除命令比较简单,不过要使删除更有效率 你需要配合我们第一节中讲的各种移动命令 字符删除 x 删除光标所在处字符 X 删除光标所在前字符 这里没有什么可注意的地方,但需要说明一下的是 通常情况下,新手一旦着急便会按着x不动,从而达到删除一大块文本的目的 如果是头几天使用还好说,但从长久考虑,你还需要学习下面的删除命令 单词删除 dw 删除到下一个单词开头 de 删除到本单词末尾 dE 删除到本单词末尾包括标点在内 db 删除到前一个单词 dB 删除到前一个单词包括标点在内 很明显,d是delete的缩写,而上面的x则是老式的清除意思 这里e表示往前删除一个单词,b表示往后删除一个单词,第一节中移动写的很清楚 要注意的是e b会忽略标点,如don't,它们会把这当做三个单词don、‘ 和 t 来删除 而大写的E B则不会 行删除 dd 删除一整行 D d$ 删除光标位置到本行结尾 d0 删除光标位置到本行开头 这三种用法是最好理解的 我一开始便说过,删除命令需要配合移动命令才能发挥更多作用 你可以看看第一节内容,然后自己尝试着删除一节或一段内容等 tips: 3dd代表删除三行,聪明的你一定早就知道了 来源: https://www.cnblogs.com/nerxious/archive/2012/12/21/2828520.html