2013-01-01 wcdj
新年第一天,和lydia一起去了仙湖植物园,在弘法寺许了新年心愿,祝福爱我的人和我爱的人,新的一年梦想成真。
下文是对MacVim的使用总结,特别推荐一个印度男孩(Swaroop C H)写的《byte of vim》的manual,正在阅读中。
一些参考:
http://code.google.com/p/macvim/
https://github.com/b4winckler/macvim/wiki
https://github.com/b4winckler/macvim/wiki/FAQ
http://www.vim.org/docs.php
http://www.swaroopch.com/notes/Vim_en-Table_of_Contents/
http://www.swaroopch.com/notes/Vim/
http://files.swaroopch.com/vim/byte_of_vim_v051.pdf
http://www.truth.sk/vim/vimbook-OPL.pdf
https://www.packtpub.com/sites/default/files/0509-chapter-2-personalizing-vim.pdf
http://www.douban.com/group/vim/
http://www.vimer.cn
http://lilydjwg.is-programmer.com
https://groups.google.com/forum/?fromgroups#!forum/vim_mac (vim_mac常见问题)
0 什么是MacVim?
MacVim is the text editor Vim for Mac OS X. MacVim brings you the full power of Vim 7.3 to Mac OS X.
Mac OS X,Vim Installation
If you use Mac OS X, then you already have the terminal version of Vim installed. Run the menu command Finder -> Applications -> Utilities -> Terminal. In the terminal, run the command vim and press enter, you should now see the Vim welcome screen.
![](https://img-my.csdn.net/uploads/201301/11/1357915442_9451.png)
If you want to use a graphical version of Vim, download the latest version of the Cocoa-based MacVim project(http://code.google.com/p/macvim/). Double-click the file, it will be unarchived and a directory called MacVimxxx will be created. Open the directory, and copy the MacVim app to your Applications directory.
For more details MacVim differences, including how to run MacVim form the terminal see the macvim reference:
1. Click on Finder -> Applications -> MacVIm
2. Type :help macvim and press the Enter key.
在Mac上配置MacVim为后续写代码做准备。
首先需要将系统默认的Vi/Vim替换为我们下载的MacVim,方法如下:
1,在home目录下,创建.bashrc文件并添加如下内容;
![](https://img-my.csdn.net/uploads/201301/01/1357050003_6899.jpg)
2,然后使.bashrc文件生效,在终端type命令,source .bashrc即可;
之后我们就可以使用最新版本的MacVim了。
![](https://img-my.csdn.net/uploads/201301/01/1357050040_7267.jpg)
1 Vim的三种模式
There are three basic modes in Vim - normal, insert and visual.
[1] Normal mode is where you can run commands. This is the default mode in which Vim starts up.
[2] Insert mode is where you insert i.e. write the text.
[3] Visual mode is where you visually select a bunch of text so that you can run a command/operation only on that part of the text.
Command Action
i insert text just before the cursor
I insert tex