Chinaunix首页 | 论坛 | 博客
  • 博客访问: 840542
  • 博文数量: 150
  • 博客积分: 5123
  • 博客等级: 大校
  • 技术积分: 1478
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-06 10:03
文章分类

全部博文(150)

文章存档

2011年(2)

2010年(139)

2009年(9)

分类: LINUX

2010-07-23 21:41:27

VIM 插件

1. Javascript Indentation : Indentation for Javascript 缩进插件,比较好用,正在使用中。


2. JavaScript syntax : Better JavaScrirpt syntax support 语法高亮插件


手把手教你把Vim改装成一个IDE编程环境(图文):

http://blog.csdn.net/wooin/archive/2007/10/31/1858917.aspx



ctrl + ]到函数的定义处


安装ctags,然后ctags -R之后再进入源代码后就可以使用ctrl + ]了。

再按ctrl+t 然后又回来了。


:Tlist



let g:winManagerWindowLayout='FileExplorer|TagList'

nmap wm :WMToggle


插件拷贝到:

/var/lib/vim/addons/plugin

或~/.vim/plugin


a.vim : Alternate Files quickly (.c --> .h etc) 

:A switches to the header file corresponding to the current file being edited (or vise versa) 

:AS splits and switches 

:AV vertical splits and switches 

:AT new tab and switches 

:AN cycles through matches 

:IH switches to file under cursor 

:IHS splits and switches 

:IHV vertical splits and switches 

:IHT new tab and switches 

:IHN cycles through matches 

ih switches to file under cursor 

is switches to the alternate file of file under cursor (e.g. on   switches to foo.cpp) 

ihn cycles through matches 



% 跳转到配对的括号去

[[ 跳转到代码块的开头去(但要求代码块中'{'必须单独占一行)

gD 跳转到局部变量的定义处

'' 跳转到光标上次停靠的地方, 是两个', 而不是一个"

mx 设置书签,x只能是a-z的26个字母

`x 跳转到书签处("`"是1左边的键)

:> 增加缩进,"x>"表示增加以下x行的缩进

:< 减少缩进,"x<"表示减少以下x行的缩进



把下一行合并上来:

:j


另存为:

:w /tmp/b.txt

:20,59 w /tmp/b.txt



:set paste


对消自动对齐

:set noautoindent

:set shiftwidth=4   设置自动缩进 4 个空格, 当然要设自动缩进先.

:set sts=4          即设置 softtabstop 为 4. 输入 tab 后就跳了 4 格.

:set tabstop=4      实际的 tab 即为 4 个空格, 而不是缺省的 8 个.

:set expandtab      在输入 tab 后, vim 用恰当的空格来填充这个 tab.

:set 或 :se    會顯示所有經過修改的部份,就是和預設值不一樣的部份。

:set all       顯示目前所有設定值內容。

:scriptnames   顯示各種設定檔的所在路徑及其檔名。

:set option?   顯示 option 這設定的目前值。

:option        直接線上設定,有些設定需加 = 後加上設定值內容。

:set nooption  取消該設定。:set 後面是可以多重設定的。例如

:set autoindent noconfirm autowrite,這樣三種設定就會同時重設。

cindent

set noautoindent 

vim列模式:

1.用选定 一列 

2.输入I, 此时光标会 

3.输入"2, " 然后按 ESC 

阅读(712) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~