vim

Is there an interactive way to learn Vim? [closed]

百般思念 提交于 2019-12-20 08:18:50
问题 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 2 years ago . Years ago I was looking for a way to learn Vim that didn't involve a wall of text, or scrolling through vimtutor without knowing the commands to do so. I wondered if anything else existed for such a purpose. 回答1: Interactive tutorial: http://www.openvim.com/ HJKL-learning game: http://www.vim.org/scripts/script

Favorite minimalistic .vimrc configuration

流过昼夜 提交于 2019-12-20 08:07:16
问题 There are .vimrc related questions found here and here. This question wants to deal with a minimalistic .vimrc file. If you are on a new machine with no .vimrc file what are some 'must turn on' commands you use before doing any typing? 回答1: There is never a need for a minimalistic configuration. This solves everything: wget -O ~/.vimrc http://github.com/lucasoman/Conf/raw/master/.vimrc 回答2: Here's my minimal settings with comments: set backspace=2 " backspace in insert mode works like normal

How to specify a editor to open crontab file? “export EDITOR=vi” does not work

随声附和 提交于 2019-12-20 08:06:05
问题 I'm using Red Hat Enterprise Linux 5, and I want to set the vim editor to edit the crontab file. If I run echo $EDITOR , I get vim. But when I run crontab -e , I get different editor. 回答1: Very probable that your VISUAL environment variable is set to something else. Try: export VISUAL=vi 回答2: To quote the man: The -e option is used to edit the current crontab using the editor specified by the VISUAL or EDITOR environment variables Most often if you run crontab -e from X, you have VISUAL set;

How can I delete the current file in vim?

久未见 提交于 2019-12-20 08:06:05
问题 How can I delete from the disk the current open file from within vim? Would be nice to also close the buffer. I see you can use NERDTree for that, but I don't use this plugin. 回答1: Using an external tool such as rm (1) is fine, but Vim also has its own delete() function for deleting files. This has the advantage of being portable. :call delete(expand('%')) An alternative way of expressing this is :call delete(@%) , which uses the % (current file) register (tip by @accolade). To completely

vim + COPY + mac over SSH

人盡茶涼 提交于 2019-12-20 08:04:00
问题 I access a sever over ssh on which I run vim for editing files. When I try to yank text from vim into an editor locally on my mac (lion) either with y OR "+y it does not work. I end up with the text I copied last locally. It does work if I just use p within vim alright. 回答1: To expand on Ray's answer… When you are using Vim on a remote server via SSH, everything you do in Vim is done on the remote server. The remote server and the remote Vim that you are running on it have zero practical

vim + COPY + mac over SSH

吃可爱长大的小学妹 提交于 2019-12-20 08:03:01
问题 I access a sever over ssh on which I run vim for editing files. When I try to yank text from vim into an editor locally on my mac (lion) either with y OR "+y it does not work. I end up with the text I copied last locally. It does work if I just use p within vim alright. 回答1: To expand on Ray's answer… When you are using Vim on a remote server via SSH, everything you do in Vim is done on the remote server. The remote server and the remote Vim that you are running on it have zero practical

How do I insert ERB-tags with Vim?

烂漫一生 提交于 2019-12-20 08:02:47
问题 How do I insert <% %> in Vim? I have rails.vim. 回答1: I've been using the surround.vim plugin for a long time, but not the rails.vim plugin. Turns out that the rails.vim plugin is adding functionality to surround.vim, or is piggy-backing on it. Either way, I got it working this-a way: Install the rails.vim plugin if it isn't already, and open an ERB document. Vim should recognize it as a eruby filetype. If it doesn't use :set filetype=eruby Return to make Vim see things your way. Visually

Could not execute editor

瘦欲@ 提交于 2019-12-20 08:00:08
问题 I don't often have to modify multiple commit messages, but it has happened once or twice and I don't ever remember seeing this. I hope someone else has. When I git rebase -i HEAD~7 , the expected list opens in vi exactly as expected. I change the pick values to edit where appropriate and then :wq . Result: Could not execute editor The core.editor setting in my global .gitconfig is vi (I've also changed it to vim in a wildly desperate move). I tried using mate , but that didn't even open the

Vim's autocomplete is excruciatingly slow

二次信任 提交于 2019-12-20 07:59:12
问题 Most of the time the autocomplete feature in Vim works nicely for me, but sometimes it seems to be scanning files which the current file references, and then it becomes painfully slow, sometimes taking several seconds to release focus back to me. Sometimes Vim tells me simply that it is "Scanning" other times, it's saying "Scanning tags" I've only this happen in Ruby files, and it happens mostly when there is a require in the file. My guess would be that this is some kind of feature which

How can I set up Vim for Android development?

僤鯓⒐⒋嵵緔 提交于 2019-12-20 07:58:10
问题 Can anyone describe a good Vim setup for Android Development? I'm using Eclipse for now but I would really like to use Vim because it's faster and I like it better. I'm not interested in Eclim for example. I'm interested in what Vim plugins are used (for Java, autocomplete etc.), how the .vimrc looks like and how the whole process of building/running applications works (as efficiently as possible). 回答1: I've once had to do some Android development on a netbook, and set up a nice Vim setup for