" 映射非数字/字母键, 如: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配置文件

    我现在的vimrc配置文件 runtime! debian.vim "设置编码 set encoding=utf-8 set fencs=utf-8,ucs-bom,shift-jis,gb ...

  2. 【好用的.vimrc】支持vim语法高亮,保留上一次编辑内容,记住位置等配置

    2019独角兽企业重金招聘Python工程师标准>>> 以下内容,保存到 ~/.vimrc 文件即可,以作备份. "ctags set tags=tags;/set wra ...

  3. vim学习第2篇:配置自己的vimrc

    为什么80%的码农都做不了架构师?>>>    拷贝自带的vimrc_example.vim # cp /usr/share/vim/vim72/vimrc_example.vim ...

  4. Vim的行号、语法显示等设置(.vimrc文件的配置)以及乱码解决

    在终端下使用vim进行编辑时,默认情况下,编辑的界面上是没有显示行号.语法高亮度显示.智能缩进 等功能的.为了更好的在vim下进行工作,需要手动设置一个配置文件:.vimrc. 在启动vim时,当前用 ...

  5. 定制.vimrc配置文件

    文件下载点,如有如需要请点击(不需要积分)http://download.csdn.net/detail/iamonlyme/3902685 " vimrc by lewiyon@hotma ...

  6. .vimrc文件中的leader是什么?

    我在很多.vimrc文件中看到<leader> ,我想知道它是什么意思? 它是干什么用的? 只是对目的和用法的一般概述将是伟大的. #1楼 "领导者密钥"是一种通过使用 ...

  7. vimrc 配置 史上最牛

    http://amix.dk/vim/vimrc.html  我了个去 真强大 另附一个vimrc " vim:shiftwidth=2:tabstop=8:expandtabif has( ...

  8. 【译】史上最强的vimrc文件

    史上最强的vimrc文件http://amix.dk/vim/vimrc.html, 据说有800行,还是作者精简后的结果. """"""& ...

  9. vi/vim使用入门: vimrc在哪儿?

    看到有人用"vimrc在哪儿?"来搜索我的博客.觉得有必要讨论一下这个话题. vimrc究竟在哪儿呢?这个问题对一个vim的已入门用户来说,可能实在不是个问题,你可能回答:&quo ...

最新文章

  1. ping ip 端口_学生会私房菜【20200305期】——Ping命令及其常用参数详解
  2. 使用缓冲流有什么好处_使用PVC石笼网有什么好处?
  3. __construct()和__initialize()
  4. React中添加注释
  5. atoi函数_每日干货丨C语言中的字符串处理库函数介绍与实现
  6. pcl如何设置colorbar_突然加更 | 子图、colorbar和标题
  7. 500个爆文标题_美食爆文大放送 | 烹饪技巧从细节着手,夏日消暑美食最为应时...
  8. 微信:情人节女性收520红包的数量是男性的3.9倍,有用户收到200多个
  9. getResourceAsStream的3种路径配置
  10. SpringCloud实战(一)基于nacos实现订单+视频服务的调用
  11. 网页版office服务器,Office 网页版服务说明
  12. 大商创x源码|大商创x全套源码|大商创小程序源码|大商创APP源码
  13. Java简单聊天室Socket服务器客户程序
  14. C++17尝鲜:fold expression(折叠表达式)
  15. ubuntu 解包和压包.img文件
  16. 自己动手实现远程执行功能
  17. gdb 调试+子进程+线程
  18. 计算机专业php项目,有论文,有代码
  19. 北京大学CMA—让CMA考试更简单
  20. postman中常用的tests模板以及对应的手写断言

热门文章

  1. WPF MultiSelect模式下ListBox 实现多个ListBoxItem拖拽
  2. python 多级菜单_python多级菜单
  3. 1.简单认识PHP和环境搭建
  4. 【错误记录】解压 Linux 内核报错 ( Can not create symbolic link : 客户端没有所需的特权 | Windows 中配置 7z 命令行执行解压操作 )
  5. 【C 语言】二级指针作为输出 ( 指针输入 | 指针输出 | 二级指针 作为 函数形参 使用示例 )
  6. 【Android 系统开发】Android框架 与 源码结构
  7. luogu P3378 【模板】堆
  8. 指针数组 与 数组指针 的分析
  9. java多线程基础篇第二篇-volidate关键字
  10. git push error. ! [rejected] master - master (non-fast-forward)