vim

Execute vim substitute command that includes '/' characters

给你一囗甜甜゛ 提交于 2019-12-20 05:16:06
问题 I have a java file in which I wrote /t, instead of \t, the proper notation of the tab escape function. I want to use vim’s substitution feature (:s) but when I do something like this: :%s//t/\t/g I get the error message E488: Trailing characters How can I write the command such that I can execute the substitution? Thank you. 回答1: Use backslash to escape the characters. So: :%s/\/t/\\t\g You can also use a different delimiter like: :%s@/t@\\t@g 回答2: Use colons instead of a slash to avoid

After much reading, I still can't get Pathogen to load a plugin under Windows

五迷三道 提交于 2019-12-20 05:13:31
问题 For gVim 7.3.46 on Windows 7 64-bit fully updated (I run gVim 7.3.46 because it adds a reliable instance of "Edit with Vim" to the Windows context menu.) Despite having read an abundance of articles (many of them which repeat the others) I can't get Pathogen to load a vim plugin that already works fine if I don't use Pathogen. The problem seems to be the location of Pathogen's "bundle" folder as follows: · IF I place the mru.vim (Most Recently Used Files) plugin in "D:\Program Files (x86)\Vim

After much reading, I still can't get Pathogen to load a plugin under Windows

六眼飞鱼酱① 提交于 2019-12-20 05:13:19
问题 For gVim 7.3.46 on Windows 7 64-bit fully updated (I run gVim 7.3.46 because it adds a reliable instance of "Edit with Vim" to the Windows context menu.) Despite having read an abundance of articles (many of them which repeat the others) I can't get Pathogen to load a vim plugin that already works fine if I don't use Pathogen. The problem seems to be the location of Pathogen's "bundle" folder as follows: · IF I place the mru.vim (Most Recently Used Files) plugin in "D:\Program Files (x86)\Vim

LINUX操作系统VIM的安装和配置

怎甘沉沦 提交于 2019-12-20 05:06:27
VIM的安装 在命令行敲入“vi”后按"tab"键,可以看到目前系统中只安装了vi和vim.tiny。 vim是从VI发展而来的一个文本编辑器,功能更强大。而vim.tiny是vim的精简版,所以,安装vim势在必行。 ubuntu系统: 普通用户下输入命令:sudo apt-get install vim-gtk centos系统: 普通用户下输入命令:yum -y install vim* 图片以ubuntu为例 这里,输入“y”后,回车。 之后不需要任何操作,等待安装完成。 安装完成之后,在命令行敲入vi,按“tab”键。 可以看到,已经有vim命令的存在。 安装成功。 END VIM的配置 刚安装的VIM,可能界面并不是十分友好,这就需要我们去更改vim的配置文件,按照我们的需求去修改它。 在命令行下,输入命令:sudo vim /etc/vim/vimrc 必须加上sudo,否则你是没有权限编辑vimrc的。 在这个文件中,会有这么一句: syntax on 意思是语法高亮,如果您的被注释掉了,请“让它出来”。就像下图所示 下图为小编的VIM配置。 请在您的VIM的最后一行,输入他们,可以让您的VIM变得更漂亮、舒服。 set nu // 在左侧行号 set tabstop //tab 长度设置为 4 set nobackup //覆盖文件时不备份 set

vim hit “enter” on a specific letter

喜夏-厌秋 提交于 2019-12-20 04:13:42
问题 I want to hit enter on the arrow symbol in a file. Basically after hitting enter the arrow key collapses to show more text. I have so many such arrow keys. ▾ $wp_filter = (array [365]) \ ▸ $wp_filter['pre_term_name'] = (array [2]) After completely collapse ▾ $wp_filter = (array [365]) \ ▾ $wp_filter['pre_term_name'] = (array [2]) \ ▾ $wp_filter['pre_term_name'][10] = (array [2]) \ ▾ $wp_filter['pre_term_name'][10]['sanitize_text_field'] = (array [2]) \ ⬦ $wp_filter['pre_term_name'][10][

vim下的代码自动补全

浪子不回头ぞ 提交于 2019-12-20 04:11:24
下载安装ctags和OmniCppComplete 用 ctags -R --c++-kinds=+p --fields=+iaS --extra=+q /usr/include 命令,生成包括所有 struct/class/typedef/function 等内容的声明,存放在当前路径下名为的tags文件中 修改~/.vimrc配置文件,打开代码补全插件,并将该tags文件添加 set nocp filetype plugin on set tags+ =~/projects/tags/usr_inc_tags 另外vim默认的缩进为8个字符,非常郁闷,修改为4个: set softtabstop=4 set shiftwidth=4 set cindent set autoindent 来源: https://www.cnblogs.com/xjzccnu/archive/2011/04/25/2026832.html

Make vim keep mark when I delete the line the mark is on

北慕城南 提交于 2019-12-20 03:28:21
问题 How can I get vim to preserve marks when I delete the line the mark is on (i.e., automatically move the mark to the line immediately above or below the marked line) 回答1: Maybe the easiest way is to use capital letter marks when you don't want them deleted. If the line the mark is on is deleted, it gets moved to the next line. Another option is the lockmarks command. lockmarks takes a command to run and locks most marks at their current line number until the command completes. If you wanted to

How can I make git difftool to use gvim (gvimdiff)?

戏子无情 提交于 2019-12-20 03:28:09
问题 There seems to have been a change in git which makes it no longer work correctly with gvim as the diff tool. Specifically, I always used to use the gvim -geometry flag to maximize the window. Now, I end up with one of the windows blank (empty/zero line file). 回答1: OK, I found the answer. In order to work correctly, gvim must stay in the foreground and NOT fork a new process as usual. This is accomplished by using the "-f" or "--nofork" flag when starting gvim (or gvimdiff). I have now setup

centos上布置postfix邮件服务器

安稳与你 提交于 2019-12-20 03:15:44
系统自带的sandmail会和postfix冲突 第一步卸载sandmail,yum remove sandmail 第二步 : 安装postfix ,dovecot,cyrus-sasl,直接yum安装 yum -y install devecot yum -y install postfix yum -y install cyrus-sasl 三、修改postfix的配置文件 [root@ser ~]# vim /etc/postfix/main.cf myhostname = mail.eimam.com mydomain = eimam.com myorigin = eimam.com inet_interfaces =all mynetworks = 192.168.1.0/240 relay_domains = yjw.com, $mydomain mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, mail.$mydomain, www.$mydomain, ftp.$mydomain 重启 postfix 服务 [root@ser ~]# service postfix restart Shutting down postfix: [ OK ] Starting

Setting 2 fonts with different sizes in MacVim

南笙酒味 提交于 2019-12-20 03:12:47
问题 I'm using Vim in MacVim on Mac OS X. I have following config in .gvimrc: set guifont=Inconsolata:h15 But I'd like to set to different font and font size for non-ASCII symbols (because Inconsolata didn't have russian symbols). Problem is that Inconsolata id visually a lot smaller, than Monaco that I'd like to to use for russian characters. In iTerm 2 I have following preferences: Regular font: 15px Inconsolata Non-ASCII Font: 12pt Monaco I'd tried to use: set guifont=Inconsolata:h15,Monaco:h12