Vim

2017-02-24  本文已影响0人  welkin594

比较常用的命令

命令 简介
[[,]],[],][,{} 跳到上,下,定义,空白处
0,gm 句子的前后
nH,nL 跳到屏幕的第n行(H从上算起,L反之)
M 屏幕中间
C+f,C+b,C+e,C+y,C+u,C+d 上下翻页,上下翻行,上下翻半页
ga 查看当前光标所在位置的字符的编码
:digraphs 或者 :h digraph-table 查看编码

Insert Mode

命令 简介
^A 插入上一次normal mode之前插入的数据
^@ 和^A一样,不过插入之后进入normal mode
^W 删除光标前的单词
^Kc1-c2 有趣,特殊字符输入如 ^K12 => ½
^R= 数学运算
D,T 左右缩进
XE,XY 在输入模式下滚动屏幕,光标不变

有趣的配置

个人觉得必须添加的是ESC键替换键,不然每次手都要跑到ESC那里去。

"This is awesome!! inoremap kj<Esc>
把上面这段放入 .vimrc都可以,简单有效,特别是在输入模式下快速执行命令时

1.安装插件管理器 PluginInstall
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
2.配置基本的要求

filetype off                  " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

3.添加(可以直接复制github上的名字),然后 source % 配置文件后 :PluginInstall安装
如: Plugin 'The-NERD-tree

我自己的配置

必备插件

  1. terryma/vim-multiple-cursors 多光标移动插件
    配置:
    " Default mapping
    let g:multi_cursor_next_key='<C-m>'
    let g:multi_cursor_prev_key='<C-l>'
    let g:multi_cursor_skip_key='<C-x>'
    let g:multi_cursor_quit_key='<Esc>'
上一篇 下一篇

猜你喜欢

热点阅读