vim

轻快的VIM(一):移动

旧街凉风 提交于 2020-01-01 03:17:12
断断续续的使用VIM也一年了,会的始终都是那么几个命令,效率极低 前几个星期把Windows换成了Linux Mint,基本上也稳定了下来 就今晚,我已经下定决心开始新的VIM之旅,顺便写一系列的笔记和总结 还是那句话,我只是个新人,代码也没写过多少行,但我一直在默默努力自学着 所以,还请老鸟们看看笑笑就行了,不要鄙视我,我很脆弱…… 这是俺写的《轻快的VIM系列》第一节,每一节都会不断更新,加入更多技巧在里面 VIM新手们加油,咱一起总结,一起努力练习…… 基础 字符移动 k 上移 k h 左移 h l l 右移 j j 下移 你也可以使用键盘上的方向键来移动,但这么做h j k l的存在就失去了意义 之所以使用h j k l来控制方向,其主要目的是让你的手不离开键盘中心,从而提高效率 tips :在命令前加上数字代表命令执行次数,如:5k,表示上移5行 单词移动 W w 移动到下一个单词开头 E e 移动到下一个单词结尾 B b 倒退到上一个单词开头 需要注意的是,E会忽略标点符号,如:I‘m,e会当成两个单词,E则不会 同样,在命令前加上数字代表执行次数,如:2w,表示往下移动2个单词 开头我也许会多说几遍,因为这个技巧很重要 整行移动 0 移动到行首 $ 移动到行末 + 移动到下一行开头 - 移动到上一行开头 这里需要注意的是+ -和上面的j k有什么不同之处 j

How to use ctags for autocomplete in vim

本小妞迷上赌 提交于 2020-01-01 02:27:22
问题 I try to develop android project in vim.But find it a bit of boring to look up in ctags for one method.Is there a way to show up a auto-complete list in vim using ctags? thanks it's my ctags's version below: Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert Compiled: Mar 21 2011, 10:34:51 Addresses: <dhiebert@users.sourceforge.net>, http://ctags.sourceforge.net Optional compiled features: +wildcards, +regex and vim's version: Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren

How can I find out why vim keeps changing my expandtab setting

╄→гoц情女王★ 提交于 2020-01-01 02:17:27
问题 I use vim. Specifically I am using Janus. I have expandtab set. However, during the course of using vim, for some reason, my expandtab setting gets set to noexpandtab, and my files start to gain hard tabs. I have tried typing :verbose set expandtab? but this does not show me anything (specifically, it shows me that noexpandtab is set, but it doesn't show a file that is responsible for setting it). So I would like to find out: Why my expandtab setting might be changing How I can track down the

In Vim, how to keep characters concealed even when cursor enters that line

这一生的挚爱 提交于 2020-01-01 02:11:16
问题 I may have a unique situation here. I want gVim (gui version, in Linux) to keep concealed characters concealed no matter what, even when the cursor is on that line or that character gets selected. (It should be as close to if the characters never existed as possible.) Currently the concealed characters show themselves when the cursor enters that line, which causes text to jump around when scrolling and when selecting text. We are using gView (read-only gVim) to view logs, so as to take

Command key in MacVim

◇◆丶佛笑我妖孽 提交于 2020-01-01 01:53:52
问题 How do I use the command key in MacVim? For example I would like to be able to press Cmd t to open CtrlP or Cmd n to open NerdTree. 回答1: See :help <D- . Use <D-t> to map to ⌘-T ; however , ⌘-T is already mapped to "New Tab" within MacVim's menu. You'll have to remove that to be able to use it in a Vim map. Some keys are OS-bound and you just can't access them, but ⌘-T can be made available and is actually the example they use in the help file (see :help Actions.plist and scroll up a few lines

vim-surround not working for me. s key deletes instead of surrounds

梦想与她 提交于 2020-01-01 01:12:08
问题 Just installed the surround plugin. New buffer, type Hello World. Say I want to surround that with quotes. In normal mode, V to get into visual mode, s to get into surround Except it doesn't, s deletes the entire line. 回答1: The default visual mode mapping of surround.vim is Shift - S , not lowercase s. You can check whether it's defined with :verbose vmap S . Do the other surround.vim mappings ( ys , cs , ...) work? If not, check :scriptnames and :set runtimepath? for troubleshooting. 回答2:

Editing multiple files simultaneously with Vim

﹥>﹥吖頭↗ 提交于 2019-12-31 22:41:16
问题 I need to add several lines all at the same location to multiple files. I was wondering if I could possibly open all files with Vim, and only make the changes in one file for which the changes will be made in all files simultaneously. I really want to avoid opening X number of files, copying this, pasting, then repeating for each file of X files...There's gotta be a better way to do this, hopefully with vim... Thanks! Amit 回答1: You could record macro and execute it on other files. See http:/

Using Vim with light or white background color scheme [closed]

风流意气都作罢 提交于 2019-12-31 20:32:09
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . When using Vim with on a terminal with a light or white background, most color schemes are subtly broken. How can I fix this? Is it

Using Vim with light or white background color scheme [closed]

隐身守侯 提交于 2019-12-31 20:30:05
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . When using Vim with on a terminal with a light or white background, most color schemes are subtly broken. How can I fix this? Is it

Exuberant Ctags on Mac

廉价感情. 提交于 2019-12-31 17:37:56
问题 I'm currently using vim for my PHP development. A few weeks ago I bought myself a mac, and wanted to re-generate my tags for a new Zend Framework version. I used the following script in the past (linux machine) to generate the tags: #!/bin/bash cd ~/www/ZF/ ctags-exuberant -f ~/.vim/tags/zend \ -h ".php" -R \ --exclude="\.svn" \ --totals=yes \ --tag-relative=yes \ --PHP-kinds=+cf \ --regex-PHP='/abstract class ([^ ]*)/\1/c/' \ --regex-PHP='/interface ([^ ]*)/\1/c/' \ --regex-PHP='/(public