" 映射非数字/字母键, 如:ctrl,shift, alt, home,end,功能键F1~F12, 要把这些键用尖括号括起来!如:

map <F3> :NERDTree<CR>

(pending 悬而未决的, 搁起的, 甩起的... the case/matter is still pending in court)

vim的operator pending操作符待决/悬挂 模式, 是指在操作符如dw的d, 和其操作的对象 按键w 之间存在的短暂时间.

vim的map有多种状态下的映射(共5种):nmap, vmap, omap, imap, cmap. 注意每种命令所对应的模式,

Command
命令
Normal
  常规模式  
Visual
可视化模式
Operator Pending
运算符模式
Insert Only
插入模式
Command Line
命令行模式
:map y y y    
:nmap y        
:vmap   y      
:omap     y    
:map!       y y
:imap       y  
:cmap         y

注意,map作用的是normal, visual,operator这三种模式, 其中 map! 作用的是插入insert和commandline命令行模式.

winpos 50 50 其中的winpos是一个命令, 不是参数,不要用set.

要实现某个插件的切换功能, 试试:   :????Toggle<cr> 就是看有没有自动的切换那个功能?

------------------------------   /etc/vimrc  ---------------------------------------

if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
   set fileencodings=ucs-bom,utf-8,latin1
   "这个是自定义将文件写入存储介质时的字符集这里设为gb2312
   " fileencodings=gb2312,gbk
endif

set nocompatible

set guioptions-=T
"set guioptions-=m
set guifont=Monospace\ 12
colorscheme murphy

set shiftwidth=4
set softtabstop=4

set lines=40 columns=110
winpos 230 40

set nobackup
set noswapfile

" 设置文件修改时自动载入, 自动保存
set autoread
set autowrite

set cursorline
set magic
set syntax=on
set incsearch
set hlsearch
"搜索时,忽略大小写
set ignorecase

"按F3实现NERDTree的自动切换
map <F3> :NERDTreeToggle<CR>
map <C-A> ggvGy

" vi中的所有字符都没有特殊含义!vim要与vi兼容, 但是在表示vim中一些特殊含义的时候, 就得
" 要把这些特殊符合,从兼容集cpoptions中去掉!
set cpoptions-=<
" 从cpoptions中去掉C, 启用行继续符 \, 解决“E10:..."问题
set cpoptions-=C
set cpoptions-=u    "去掉和vi兼容的撤销undo u命令?

"统一的,用一个命令来解决vim和vi的兼容性问题
"那就是, 不要让vim去兼容,去管vi的, 完全使用vim的操作方式, 不管vi的,
"也就不用一个一个地来设置cpoptions了
"set nocompatible

"在insert mode下也可以 快速移动到行尾和行首"
inoremap <c-h> <esc>I
inoremap <c-l> <esc>A
inoremap  jk <esc>
inoremap jj <esc>ji
inoremap kk <esc>ki
inoremap hh <esc>ha
inoremap ll <esc>la
inoremap nn <esc>ji
set nu

" 自动匹配括号, 引号
inoremap ( ()<ESC>i
inoremap [ []<ESC>i
inoremap { {}<ESC>i
inoremap ' ''<ESC>i

" allow backspacing over everything in insert mode
set bs=indent,eol,start        
" always set autoindenting on
set ai            
set viminfo='20,\"50    " read/write a .viminfo file, don't store more
            " than 50 lines of registers
set history=100
set ruler

" Only do this part when compiled with support for autocommands
if has("autocmd")
  augroup redhat
  autocmd!
  " In text files, always limit the width of text to 78 characters
  autocmd BufRead *.txt set tw=78
  " When editing a file, always jump to the last cursor position
  autocmd BufReadPost *
  \ if line("'\"") > 0 && line ("'\"") <= line("$") |
  \   exe "normal! g'\"" |
  \ endif
  " don't write swapfile on most commonly used directories for NFS mounts or USB sticks
  autocmd BufNewFile,BufReadPre /media/*,/mnt/* set directory=~/tmp,/var/tmp,/tmp
  " start with spec file template
  autocmd BufNewFile *.spec 0r /usr/share/vim/vimfiles/template.spec
  augroup END
endif

if has("cscope") && filereadable("/usr/bin/cscope")
   set csprg=/usr/bin/cscope
   set csto=0
   set cst
   set nocsverb
   " add any database in current directory
   if filereadable("cscope.out")
      cs add cscope.out
   " else add database pointed to by environment
   elseif $CSCOPE_DB != ""
      cs add $CSCOPE_DB
   endif
   set csverb
endif

" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
  syntax on
  set hlsearch
endif

filetype plugin on

if &term=="xterm"
     set t_Co=8
     set t_Sb=[4%dm
     set t_Sf=[3%dm
endif

" Don't wake up system with blinking cursor:
" http://www.linuxpowertop.org/known.php
let &guicursor = &guicursor . ",a:blinkon0"

" 设置不生成备份和交换文件,这个要放在最后
" 同样的设置,后面的设置(可能从$runtime/...中引入其他配置)会覆盖前面的设置
" 如这里,当后面设置set backup, 将会覆盖前面的set nobackup
" 从而一直找不到生成backup文件的原因!!

" 将系统剪切板设置为默认的 “未命名”寄存器,便于粘贴
set clipboard=unnamed
cd ~

" 如果需要想对特定的文件类型使用特定的字体,则可以将下面的语句加入到vimrc文件中去:
" autocmd BufEnter  *. txt set guifont = Arial \ 12
set mouse=a

let g:winManagerWindowLayout='FileExplorer|TagList'
map wm  :WMToggle<CR>

--------------------------- ~/.vimrc  实现Vundle的自动化管理----------------------------

set nocompatible
filetype off

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'

Plugin 'taglist.vim'
Plugin 'OmniCppComplete'
Plugin 'AutoComplPop'
Plugin 'c.vim'
Plugin 'supertab'
Plugin 'scrooloose/nerdtree'
Plugin 'winmanager'
Plugin 'minibufexplorerpp'
Plugin 'snipMate'
Plugin 'Lokaltog/vim-powerline'

call vundle#end()
filetype plugin indent on

我用的/etc/vimrc的更多相关文章

  1. 如何设置Vimrc

    .title { text-align: center } .todo { font-family: monospace; color: red } .done { color: green } .t ...

  2. vimrc

    我的vimrc https://github.com/juandx/vimrc 当然得装vundle git clone https://github.com/VundleVim/Vundle.vim ...

  3. Linux上 .vimrc文件

    在Linux上面对VIM编辑器的格式的设置通常可以提升工作效率,下面对工作机器上的.vimrc文件的内容进行一总结,以备后续的查询 set smarttab set tabstop=4 set shi ...

  4. ubuntu 配置vim(vimrc)

    打开终端:ctrl+alt+t 进入vim文件:cd /etc/vim 打开vimrc文件:sudo gedit vimrc 然后在行末if语句前加上下面的内容,"  这个符号为注释,后面内 ...

  5. vi/vim使用进阶: vimrc初步

    本节所用命令的帮助入口: :help compatible :help mapleader :help map :help autocmd 当vim在启动时,如果没有找到vimrc或gvimrc,它缺 ...

  6. 我的vim配置文件.vimrc

    我的vim配置文件.vimrc map <silent> <F10> :TlistToggle<cr>map <silent> <F8> : ...

  7. .vimrc文件配置及航意

    1.  vimrc文件常见语句释义 设定 tab 的位置          :set tabstop=4 输入 tab 时自动将其转化为空格          :set expandtab       ...

  8. Linux: .vimrc

    set nuset autoindentset cindent"set tabstop=2"set shiftwidth=2set cursorlineset hlsearch&q ...

  9. vimrc配置文件_version1.0_+pathogen, taglist, wordcomplete插件说明

    为了表示对Ruchee的感谢,首先这是Ruchee的个人网站:http://www.ruchee.com/index.html,他的以前很多的代码都放到Git里面了,里面有链接. 看了整整一天,刚开始 ...

随机推荐

  1. [CareerCup] 13.5 Volatile Keyword 关键字volatile

    13.5 What is the significance of the keyword "volatile" in C 这道题考察我们对于关键字volatile的理解,顾名思义, ...

  2. Maven实战之antrun插件

    在 Maven实际使用过程中,有时候在对一些旧有的项目的做从Makefile和ant到Maven迁移时需要对一些步骤做特殊处理,比如说编译JNI代 码,虽然Maven有个native插件可以用,但需要 ...

  3. 【JS笔记】私有变量

    1.任何函数中定义的变量都可以认为是私有变量.函数内部可以访问,外部不能访问. 可以通过闭包创建特权方法访问私有变量. function Foo(){ var n=10; this.returnN=f ...

  4. Object C学习笔记16-委托(delegate)

    在.NET中都知道委托(delegate),通俗点的解释就是可以将方法作为一个参数传到另外一个方法中使用. 委托是一种引用方法的类型.一旦为委托分配了方法,委托将与该方法具有完全相同的行为.委托方法的 ...

  5. nth-child() 选择器

    给tabel tb1 td添加样式 #tb1 tr td:nth-child(2n+1) {/*奇数行样式*/ } #tb1 tr td:nth-child(2n) {/*偶数行样式*/ }

  6. CNN 手写数字识别

    1. 知识点准备 在了解 CNN 网络神经之前有两个概念要理解,第一是二维图像上卷积的概念,第二是 pooling 的概念. a. 卷积 关于卷积的概念和细节可以参考这里,卷积运算有两个非常重要特性, ...

  7. Java算法-归并排序

    归并排序采用的是递归来实现,属于“分而治之”,将目标数组从中间一分为二,之后分别对这两个数组进行排序,排序完毕之后再将排好序的两个数组“归并”到一起,归并排序最重要的也就是这个“归并”的过程,归并的过 ...

  8. 【CodeForces 626C】Block Towers

    题意 给你n,m,如果 n个2的倍数和m个3的倍数,这n+m个数各不相同,那么求最大的数的最小值. 分析 方法1:枚举最大值为i,直到 i/2+i/3-i/6(不重复的2或3的倍数)≥n+m,并且要i ...

  9. python 变量命名规范

    python源码和其他一些书籍,命名各种个性,没有一个比较统一的命名规范.于是总结了一些,供参考. 模块名: 模块应该使用尽可能短的.全小写命名,可以在模块命名时使用下划线以增强可读性.同样包的命名也 ...

  10. 洛谷P1417 烹调方案

    题目背景 由于你的帮助,火星只遭受了最小的损失.但gw懒得重建家园了,就造了一艘飞船飞向遥远的earth星.不过飞船飞到一半,gw发现了一个很严重的问题:肚子饿了~ gw还是会做饭的,于是拿出了储藏的 ...