zoukankan      html  css  js  c++  java
  • Vi配置文件--Vimrc

    set encoding=gb2312
    set guifont=Luxi/ Mono/9    " 设置字体,字体名称和字号
    settabstop=4                " 设置tab键的宽度
    setbackspace=2              " 设置退格键可用
    setnu                       " 显示行号
    setwrap                     " 自动换行
    "setnowrap                  " 不自动换行
    
    setlinebreak      " 整词换行
    setwhichwrap=b,s,<,>,[,]      " 光标从行首和行末时可以跳到另一行去
    
    "setlist                      " 显示制表符
    "set listchars=tab:>-,trail:- "将制表符显示为'>---',将行尾空格显示为'-'      (注意=两边没有空格否则会出错)
    set listchars=tab:./ ,trail:.   "将制表符显示为'.   '
    setautochdir                  " 自动设置目录为正在编辑的文件所在的目录
    sethidden                     " 没有保存的缓冲区可以自动被隐藏
    set scrolloff=5
    
    " 查找/替换相关的设置
    "--------------------------------------------------------------------------------
    sethlsearch       " 高亮显示搜索结果
    setincsearch      " 查询时非常方便,如要查找book单词,当输入到/b时,会自动找到
                       " 第一个b开头的单词,当输入到/bo时,会自动找到第一个bo开头的
                       " 单词,依次类推,进行查找时,使用此设置会快速找到答案,当你
                       " 找要匹配的单词时,别忘记回车
    setgdefault       " 替换时所有的行内匹配都被替换,而不是只有第一个 
    " 状态栏相关的设置
    "--------------------------------------------------------------------------------
    setstatusline=[%F]%y%r%m%*%=[Line:%l/%L,Column:%c][%p%%]
    setlaststatus=2   " always show the status line
    setruler          " 在编辑过程中,在右下角显示光标位置的状态行 
    "  鼠标相关设置
    "--------------------------------------------------------------------------------
    set mouse=v     “或a
    behave xterm
    " 编程相关的设置
    "--------------------------------------------------------------------------------
    setcompleteopt=longest,menu   " 关掉智能补全时的预览窗口
    filetype plugin indenton      " 加了这句才可以用智能补全
    nmap 9t :settags=/media/disk/resource/Qualcomm/76XXTSNCJNLYM4735/HY11-VR356-9_4.7.35/AMSS/tags
    nmap 11t :settags=/home/xie/qualcomm/a47354009/tags
    nmap 9c :cs add/media/disk/resource/Qualcomm/76XXTSNCJNLYM4735/HY11-VR356-9_4.7.35/AMSS/cscope.out/media/disk/resource/Qualcomm/76XXTSNCJNLYM4735/HY11-VR356-9_4.7.35/AMSS
    nmap 11c :cs add /home/xie/quallcomm/a47354009/cscope.out/home/xie/quallcomm/a47354009
    syntaxon          " 打开语法高亮
    setshowmatch      " 设置匹配模式,类似当输入一个左括号时会匹配相应的那个右括号
    setsmartindent    " 智能对齐方式
    setshiftwidth=4   " 换行时行间交错使用4个空格
    setautoindent     " 自动对齐
    setai!            " 设置自动缩进
    colorscheme softblue 
    " 代码折叠
    "--------------------------------------------------------------------------------
    "set foldmarker={,}
    "set foldmethod=marker
    set foldmethod=syntax
    setfoldlevel=100      " Don't autofold anything (but I can still foldmanually)
    "set foldopen-=search   " don'topen folds when you search into them
    "setfoldopen-=undo    " don't open folds when you undo stuff
    "set foldcolumn=4
    
    " 窗口操作的快捷键
    "--------------------------------------------------------------------------------
    nmapwv    v    " 垂直分割当前窗口
    nmapwc    c    " 关闭当前窗口
    nmapwh    s    " 水平分割当前窗口 
    
    "使用ctrl+j,k,i,l切换窗口
    noremap fm j
    noremap fj h
    noremap fl l
    noremap fk k
    
    "上下左右从新映射
    noremap j h
    noremap m j
    
    "调整窗口高度
    noremap hr 6+ 
    noremap lr 6-
    noremap wr 20>
    noremap sr 20<</span>
    noremap ht _
    noremap wt :vertical res 
    
    "滚屏
    noremap 2
    noremap 3
    
    "###############################################################################
    " The following is the Plugins' setting
    "############################################################################### 
    
    "--------------------------------------------------------------------------------
    " TagList :Tlist
    "--------------------------------------------------------------------------------
    let Tlist_Show_One_File=1
    let Tlist_Exit_OnlyWindow = 1
    let Tlist_Process_File_Always = 1
    let Tlist_Use_Right_Window=1 
    "let Tlist_Auto_Open = 1 "Taglist随vim自启动
    "let Tlist_WinHeight = 20
    let Tlist_WinWidth = 22
    
    "--------------------------------------------------------------------------------
    " netrw 文件浏览器 :e
    "--------------------------------------------------------------------------------
    "let g:netrw_winsize =30      " 浏览器宽度 
    
    "--------------------------------------------------------------------------------
    " QuickFix
    "--------------------------------------------------------------------------------
    nmap :cn   "切换到下一个结果
    nmap :cp   "切换到上一个结果
    
    "--------------------------------------------------------------------------------
    " WinManager :WMToggle
    "--------------------------------------------------------------------------------
    "letg:winManagerWindowLayout='FileExplorer,BufExploer|TagList'
    letg:winManagerWindowLayout='TagList,BufExplorer|FileExplorer'
    let g:persistentBehaviour=0  "所有文件关闭以后自动退出explorer
    let g:winManagerWidth = 30
    "let g:defaultExplorer = 0
    "nmap :BottomExplorerWindow " 切换到最下面一个窗格
    nmap :FirstExplorerWindow   "切换到最上面一个窗格
    nmap wm :WMToggle "是nomal模式的命令,不是Ex模式的 
    
    "--------------------------------------------------------------------------------
    " MiniBufExp
    "--------------------------------------------------------------------------------
    "let g:miniBufExplMapWindowNavVim =1         "使用切换窗口
    "let g:miniBufExplMapWindowNavArrows =1      "使用
    "let g:miniBufExplMapWindowNavArrows = 1
    let g:miniBufExplMapCTabSwitchBufs = 1
    "let g:miniBufExplModSelTarget =1 
    
    "--------------------------------------------------------------------------------
    " cscope
    "--------------------------------------------------------------------------------
    set cscopequickfix=s-,c-,d-,i-,t-,e-
    set cscopetag
    
    nmap ss :cs find s =expand("") :cw
    nmap sg :cs find g =expand("") :cw
    nmap sc :cs find c =expand(""):cw 
    nmap st :cs find t =expand("") :cw
    nmap se :cs find e =expand("") :cw
    nmap sf :cs find f =expand("")
    nmap si :cs find i =expand("") :cw
    nmap sd :cs find d =expand(""):cw 
    
    "--------------------------------------------------------------------------------
    " Grep
    "--------------------------------------------------------------------------------
    "直接按下键来查找光标所在的字符串
    nnoremap :Rgrep
    
    "--------------------------------------------------------------------------------
    " A
    "--------------------------------------------------------------------------------
    nnoremap :A 
    
    "--------------------------------------------------------------------------------
    " Conque Shell
    "--------------------------------------------------------------------------------
    nmap sl :ConqueTerm bash
    nmap slv :ConqueTermVSplit bash
    nmap slh :ConqueTermSplitbash  
    
    "--------------------------------------------------------------------------------
    " Translate it
    "-------------------------------------------------------------------------------
    nmap t :TranslateIt
    
    "--------------------------------------------------------------------------------
    " QuickFix
    "-------------------------------------------------------------------------------
    nmap 4 :botright cwindow
    "########################## End Of Vimrc##########################


  • 相关阅读:
    iOS 面试题搜集
    iOS 常用第三方类库、完整APP示例
    iOS 键盘遮挡输入 解决办法
    iOS UIColor RGB HEX
    iOS APP性能优化
    iOS Swift 数组 交换元素的两种方法
    iOS CoreData primitive accessor
    iOS Start developing ios apps (OC) pdf
    iOS 传值方式
    iOS IB_DESIGNABLE IBInspectable @IBDesignable @IBInspectable 加速UI开发
  • 原文地址:https://www.cnblogs.com/zcwsmile/p/4027836.html
Copyright © 2011-2022 走看看