linux vim 手册,Vim 用户手册阅读导览

学习Vim 时遇到了困难,所以想做点工作来减低一下门槛 ...

先一个例子来说明文档的表示结构和方法 ...

#vim

:help e117

内容如下:

:cal :call E107 E117

:[range]cal[l] {name}([arguments])

Call a function.  The name of the function and its arguments

are as specified with :function.  Up to 20 arguments can be

used.  The returned value is discarded.

Without a range and for functions that accept a range, the

function is called once.  When a range is given the cursor is

positioned at the start of the first line before executing the

function.

When a range is given and the function doesn't handle it

itself, the function is executed for each line in the range,

with the cursor in the first column of that line.  The cursor

is left at the last line (possibly moved by the last function

call).  The arguments are re-evaluated for each line.  Thus

this works:

function-range-example  >

:function Mynumber(arg)

:  echo line(".") . " " . a:arg

:endfunction

:1,5call Mynumber(getline("."))

<

The "a:firstline" and "a:lastline" are defined anyway, they

can be used to do something different at the start or end of

the range.

Example of a function that handles the range itself: >

:function Cont() range

:  execute (a:firstline + 1) . "," . a:lastline . 's/^/\t\\ '

:endfunction

:4,8call Cont()

<

This function inserts the continuation character "\" in front

of all the lines in the range, except the first one.

When the function returns a composite value it can be further

dereferenced, but the range will not be used then.  Example: >

:4,8call GetDict().method()

(包括前面的block(块))

命令详解::代表 命令模式

[range]代表范围,[]表示option(可选)。

cal 表示调用,固定且必备。

{name}代表所要调用的函数名,name 是一个非固定值且必备。

([arguments]) 表示参数 左右括号是必须的,[arguments] 是非固定的并且是可选的。

接下来开始对学习进行导航 :

在命令模式下:

:help user-manual

打开用户手册,这或者vim最好的教程吧,嘻嘻 ,把光标 hjkl 移动到usr_02.txt 等高亮标签上面去,按着 是跳转过去,是跳转回来(按键为Ctrl + o),是返回。

:help usr_02.txt 是一个quicktutor

接下来是如何产看现有的映射情况:

:map 是查看映射情况

:nmap 是查看normal模式下的映射情况

:vmap 是查看visual模式下的映射情况

:imap 是查看insert 模式下的映射情况

:set 则可以看到一些现有的设置,例如runtimepath

说起来英文真是半桶水,有些地方看来一知半解,所以还是要借助一下中文翻译。

http://vimcdoc.sourceforge.net/  (下载中文文档)

#tar zxvf vimcdoc-1.8.0.tar.gz

此时注意要用普通用户身份运行安装脚本.它会把文档拷贝到$HOME/.vim 下。

#cd vimcdoc-1.8.0

#./vimcdoc.sh -i

这样就ok 了 ,接下来就可以使用 :set helplang=en 和  :set helplang=cn进行切换了 。

而在线的中文用户手册可以在这里,可以查看手册的目录树,还有检索:

http://vimcdoc.sourceforge.net/doc/help.html

通过google 搜索来进行检索 例如 : “乌干达 site:vimcdoc.sourceforge.net”

而学习了部分基本操作之后,就需要进行配置和鼓捣插件了,这里有两个小技巧分享一下 .

1." 配置文件.vimrc更改后自动重新载入使设置生效,而不需要重新启动vim

autocmd! bufwritepost .vimrc source ~/.vimrc

2.同时用插件管理系统 vbundle , 来对插件进行更新和安装

配置方法也在这个页面里面有。0b1331709591d260c1c78e86d0c51c18.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值