vim

Vim 7.3 on Ubuntu 12.10 doesn't have 'ftplugin' directory anywhere

霸气de小男生 提交于 2020-01-03 06:03:27
问题 Vim 7.3 on Ubuntu 12.10 I recently installed vim from the Ubuntu software center. So far, I've installed the following vim plugins: NERDTree, rails and ack. I'm taking a course on python and another one on Ruby on Rails. I was surprised that vim didn't recognize the languages as far as indenting goes. Checking various questions and answers on this forum, as well as checking vim help, I see that there should be a directory named 'ftplugin' in the $VIMRUNTIME directory. My $VIMRUNTIME is just

How to make a file with .pt extension, with xml syntax highlighting and vim's plugin snipmate load pt.snippets?

∥☆過路亽.° 提交于 2020-01-03 05:49:36
问题 I have the following in my .vimrc : au BufNewFile,BufRead *.pt set filetype=xml This is needed because although I'm editing a file with *.pt extension, it's indeed a valid xml file: setting the filetype like this I can have syntax highlighting. I'm using vim's snipmate plugin, and tried to create pt.snippets to specific needs since these files are Zope Page Templates (ZPT with TAL). Now, I have a problem: I don't want to create these snippets in xml.snippets, since they aren't really generic

在 Linux 打造属于自己的 Vim

雨燕双飞 提交于 2020-01-03 05:18:21
阅读目录 安装和配置 Vim 使用 Vundle 管理插件 怎么学习使用 Vim 使用 Vim 阅读 Linux 内核源代码   Linux 系统中很多东西都是以脚本代码、配置文件的形式存在,使用 Linux 系统时,需经常对这些文件进行编辑。很显然,如果没有文本编辑器,江湖之路寸步难行。   我的选择是 Vim。Vim 是 Linux 系统上的最著名的文本/代码编辑器,也是早年的 Vi 编辑器的加强版,被誉为文本/代码编辑器之中最为优秀经典的上古神器。 它之所以会获得如此美誉,我想主要有以下原因:1.它古老而神秘,学习曲线陡峭,难以驾驭,但是一旦学会则受益匪浅。如今被看作是高手、Geek 们专用的编辑器。所以尽管 Vim 已经是古董级的软件,但还是有无数新人迎着困难去学习使用。 2.轻便,无需多言,当仅仅只需要对某一文本文件(比如脚本代码、配置文件)进行简单的编辑的时候,所使用的工具当然是越轻便越好。Vim 同时也是阅读文本文件的利器。 3.经典巧妙的编辑方式及强大的功能。它全程使用键盘操作,用户必须记住一堆快捷键、按键组合以及各种命令才能开始使用,一旦使用熟练则编辑效率远超其余编辑器,而且具有各种插件、语法高亮、代码补全、配色方案等极其丰富的资源以及灵活的配置;   我主要在以下情况下使用 Vim: 1.用来修改服务器系统的配置文件; 很多时候, Linux

Double Quote not working in Vim in command mode

血红的双手。 提交于 2020-01-03 04:38:46
问题 I want to copy text from vim buffer to the system clipboard by using the command "*y but when I press the double quote sign in command mode, it doesn't seem to get fired at all as I don't see anything in the status bar (nothing gets copied also even if I blindly continue with the command). I can see all other commands in the status bar in vim. I'm using Ubuntu 12.04 and I have clipboard support enabled in my vim version. 回答1: You should press "+y in NORMAL (or VISUAL) mode. If you love to do

Linux ==> VIM 三个模式

元气小坏坏 提交于 2020-01-03 04:03:15
VIM 三个模式 一般指令模式:VIM 的默认模式,可以用于移动游标查看内容; 编辑模式:按下 "i"等按键之后进入,可以对文本进行编辑; 指令列模式:按下 “:” 按键之后进入,用于保存退出等操作。 在指令列模式下,有以下命令用于离开或者保存文件。 命令 作用 :w 写入磁盘 :w! 当文件为只读时,强制写入磁盘。到底能不能写入,与用户对该文件的权限有关 :q! 强制离开不保存 :q 离开 :wq 写入磁盘后离开 :wq! 强制写入磁盘后离开 来源: CSDN 作者: ღopenꦿ 链接: https://blog.csdn.net/o_o814222198/article/details/103799855

vim search replace including newline

陌路散爱 提交于 2020-01-03 04:01:29
问题 I've been googling for 3 hours now without success. I have a huge file which is a concatenation of many XML files. Thus I want to search replace all occurences of <?xml [whatever is between]<body> (including those words). And then same for </body>[whatever is between]</html> (including those words). The closest I came from is :%s/<?xml \(.*\n\)\{0,180\}\/head>//g FYI If I try this: :%s/<?xml \(\(.*\)\+\n\)\+\/head>\n//g I get a E363: pattern uses more memory than 'maxmempattern' . I've tried

Is there different between single quote and double quote in vim command mode?

笑着哭i 提交于 2020-01-02 15:45:49
问题 In my vim, I can use :%!sed "s/^/ /" , got the wrong output when I use :%!sed 's/^/ /' . sed: -e expression #1, char 0: no previous regular expression Is there differences between single quote and double quote in vim command mode? In my sed, single quote is the same as double quote. $ echo "wha012" | sed 's/w/haha/' hahaha012 $ echo "wha012" | sed "s/w/haha/" hahaha012 my system is xp+vim 7.3 for windows. In my system: [1] "c://cygwin/bin/ash.exe" [2] "c://cygwin/bin/bash.exe" [3] "c://cygwin

Remapping a key to Escape in Vim (German keyboard)

隐身守侯 提交于 2020-01-02 11:43:29
问题 Okay, so I've been trying out Vim (the standard console version; my OS is Linux Mint 13) and I'd like to get rid of having to use the Escape key to change modes. Preferably, I'd like to swap the Capslock and Escape keys, but as far as I've heard, that's not possible within Vim itself. Most "solutions" I've found involve changing the key on a global level (using xmodmap or whatever), but I don't really want that. If there's an easy way to swap Capslock and Escape only in Vim , please let me

Remapping a key to Escape in Vim (German keyboard)

五迷三道 提交于 2020-01-02 11:43:05
问题 Okay, so I've been trying out Vim (the standard console version; my OS is Linux Mint 13) and I'd like to get rid of having to use the Escape key to change modes. Preferably, I'd like to swap the Capslock and Escape keys, but as far as I've heard, that's not possible within Vim itself. Most "solutions" I've found involve changing the key on a global level (using xmodmap or whatever), but I don't really want that. If there's an easy way to swap Capslock and Escape only in Vim , please let me

Indent a block of code on the basis of a single character

微笑、不失礼 提交于 2020-01-02 08:56:18
问题 The question's title might sound a little vague, so I'll explain the situation here more clearly. I have these lines of code in a file which I want to align with respect to the character = . const service = require('./service'); const baseService = require('./baseService'); const config = require('../config'); const Promise = require('bluebird'); const errors = require('../errors'); I want the above lines to somehow look like this const service = require('./service'); const baseService =