我的vim配置文件.vimrc

map <silent> <F10> :TlistToggle<cr>
map <silent> <F8> :TMiniBufExplorer<cr>
map <silent> <F9> :WMToggle<cr>
map <silent> <F4> :bp<cr>
map <silent> <F5> :bn<cr>
"map <C-f> :q<cr>
"map <C-i> :w<cr>
"map <C-a> :x<cr>
nnoremap <silent> <F12> :A<CR>
nnoremap <silent> <F3> :Grep<CR>
"taglist
let g:Tlist_Show_One_File=1
let g:Tlist_Exit_OnlyWindow=1
"let g:Tlist_File_Fold_Auto_Close=1

let g:AutoOpenWinManager = 1
let g:winManagerWindowLayout='FileExplorer|TagList'
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:SuperTabDefaultCompletionType="context"
let g:SuperTabRetainCompletionType=2
let g:SuperTabDefaultCompletionType="<C-X><C-O>"
let g:bufExplorerMaxHeight=30

let OmniCpp_MayCompleteDot = 1   " 输入 .  后自动补全
let OmniCpp_MayCompleteArrow = 1 " 输入 -> 后自动补全
let OmniCpp_MayCompleteScope = 1

"let g:miniBufExplorerMoreThanOne=0

let g:winManagerWidth = 25
set nocp
filetype plugin on
set completeopt=longest,menu
syntax enable
syntax on
colorscheme default
"colorscheme desert
set cscopequickfix=s-,c-,d-,i-,t-,e-

nmap <C-_>s :cs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>g :cs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>c :cs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>t :cs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>e :cs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <C-_>i :cs find i ^<C-R>=expand("<cfile>")<CR><CR>
nmap <C-_>d :cs find d <C-R>=expand("<cword>")<CR><CR>
"cscope快捷方式

set mouse=a    "设置可以鼠标操作
set nu
set tabstop=4     "设置制表符宽度为4
set softtabstop=4 "设置(软)制表符宽度为4
set shiftwidth=4  "设置缩进的空格数为4
set autoindent    "设置自动缩进:即每行的缩进值与上一行相等;使用 noautoindent 取消设置
set cindent       "设置 使用 C/C++ 语言的自动缩进方式
set cinoptions={0,1s,t0,n-2,p2s,(03s,=.5s,>1s,=1s,:1s  "设置C/C++语言的具体缩进方式(以我的windows风格为例)
let &termencoding=&encoding
set fileencodings=utf-8,gbk,cp936,big5,ucs-bom   "设置语言编码支持

"set tags=./tags,~/.vim/tags/linux/ctags/tags,../deps/libzs/tags   "设置tags文件路径

set fdm=syntax  "设置折叠方式
set foldcolumn=0 " 设置折叠区域的宽度
"set foldclose=all " 设置为自动关闭折叠
setlocal foldlevel=1 " 设置折叠层数为
set foldlevelstart=99 "打开文件默认不折叠
nnoremap <space> @=((foldclosed(line('.')) < 0) ? 'zC' : 'zO')<CR>
"用空格键来开关折叠

hi Comment ctermfg =darkcyan
"设置注释字体颜色

set clipboard+=unnamed
" 与windows共享剪贴板

hi Folded guibg=black guifg=grey40 ctermfg=grey ctermbg=darkgrey
hi FoldColumn guibg=black guifg=grey20 ctermfg=4 ctermbg=7
"设置折叠颜色

au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif
"vim打开时在上次光标的位置

set wildmenu
"命令窗口列表

"Smart way to move btw. window
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l

"F11生成/更新tags文件
set tags=tags;
set autochdir
function! UpdateTagsFile()
    silent !ctags -R --fields=+ianS --extra=+q
    endfunction
nmap <F11> :call UpdateTagsFile()<CR>
    
"Ctrl + F12删除tags文件
function! DeleteTagsFile()
   "Linux下的删除方法
   silent !rm tags
   "Windows下的删除方法
   silent !del /F /Q tags
endfunction
nmap <C-F11> :call DeleteTagsFile()<CR>
"退出VIM之前删除tags文件
"au VimLeavePre * call DeleteTagsFile()

我的vim配置文件.vimrc的更多相关文章

  1. 自定义vim配置文件vimrc,用于c/c++编程

    vim作为Linux下广受赞誉的代码编辑器,其独特的纯命令行操作模式可以很大程度上方便编程工作,通过自定义vim配置文件可以实现对vim功能的个性化设置. vim配置文件一般有两份,属于root的/e ...

  2. vim配置文件 .vimrc 重要参数

    vim配置文件的路径为  ~/.vimrc 重要参数如下: set mouse=a  //激活鼠标可用 syntax enable  //开启语法 set cursorline  //开启当前行光标线 ...

  3. vim 配置文件.vimrc,高亮+自动缩进+行号+折叠+优化

    将一下代码copy到 用户目录下 新建文件为  .vimrc保存即可生效: 如果想所有用户生效 请修改 /etc/vimrc (建议先cp一份)"====================== ...

  4. vim配置文件.vimrc

    20171127备份 syntax on "自动语法高亮 set number "显示行号 set autoindent "回车后自动缩进 set tabstop=4 & ...

  5. Vim 配置文件===/etc/vimrc

    1.替换方法 替换对应的vimrc文件,定制自己的vimrc /etc/vimrc              替换此文件: /home/lmy/.vimrc     只对当前用户有效: Ubuntu9 ...

  6. Vim配置文件-详解(.vimrc)

    Vim配置文件的作用 Vim启动时,会根据配置文件(.vimrc)来设置 Vim,因此我们可以通过此文件来定制适合自己的 Vim Vim分类 系统Vim配置文件/etc/vimrc 所有系统用户在启动 ...

  7. Vim配置文件

    转载 原文网址:http://www.cnblogs.com/ma6174/archive/2011/12/10/2283393.html 花了很长时间整理的,感觉用起来很方便,共享一下. 我的vim ...

  8. 转载~vim配置文件

    转载自:小码哥的博客 花了很长时间整理的,感觉用起来很方便,共享一下. 我的vim配置主要有以下优点: 1.按F5可以直接编译并执行C.C++.java代码以及执行shell脚本,按“F8”可进行C. ...

  9. 【转】强大的vim配置文件,让编程更随意

    原文地址:http://www.cnblogs.com/ma6174/archive/2011/12/10/2283393.html 花了很长时间整理的,感觉用起来很方便,共享一下. 我的vim配置主 ...

随机推荐

  1. LeetCode126:Word Ladder

    题目: Given two words (start and end), and a dictionary, find the length of shortest transformation se ...

  2. 并发式IO的解决方案:多路非阻塞式IO、多路复用、异步IO

    在Linux应用编程中的并发式IO的三种解决方案是: (1) 多路非阻塞式IO (2) 多路复用 (3) 异步IO 以下代码将以操作鼠标和键盘为实例来演示. 1. 多路非阻塞式IO 多路非阻塞式IO访 ...

  3. android 学习资料

    Fragment 事件分发机制 事件分发机制2 NDK JNI ndk { moduleName "mymodule" ldLibs "log" stl &qu ...

  4. 线段树或树状数组---Flowers

    题目网址:http://acm.hdu.edu.cn/showproblem.php?pid=4325 Description As is known to all, the blooming tim ...

  5. 媲美oracle awr/statspack的mysql awr第一版发布

    现发布alpha版mysql awr,其提供的特性类似于oracle awr或statspack+集中式监控.对于原来从事oracle dba或者相关运维的人原来说,这会是个不错的选择. 至于我为什么 ...

  6. storm学习途径

    作者: xumingming | 网址: http://xumingming.sinaapp.com/category/storm/  作者:量子恒道 | 网址:http://blog.linezin ...

  7. RecyclerView解析--onViewDetachedFromWindow()/onViewAttachedToWindow()

    先看这段源码介绍: /** * Called when a view created by this adapter has been detached from its window. * * &l ...

  8. IOS NSThread

    任何一个 iOS 应用程序都是由一个或者多个线程构成的.无论你是否使用了多线程编程技术,至少有 1 个 线程被创建.多线程就是为了提高引用程序的工作效率!避免阻塞主线程!当我们没有用任何多线程技术的话 ...

  9. 真机测试时的错误:No matching provisioning profiles found

    1.出现错误的原因是这样的---- 公司开始做项目,原来做真机测试的时候,用的是公司申请的苹果开发者账号.现在项目结束了,准备上线,但客户要求使用客户自己的苹果开发者是账号上线,于是就用客户的账号测试 ...

  10. 3、IOS开发--iPad之仿制QQ空间 (为HomeViewController添加交互逻辑 并 为导航条内容添加UISegmentedControl)

    1. 为bottomMenu添加点击效果 思路描述:        需求:        点击BottomButton的三个item,然后对应响应的是HomeViewController弹出对应的业务 ...