~/.vimrc config
runtime! debian.vim
"设置编码
set encoding=utf-
set fencs=utf-,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936
set fileencodings=utf-,ucs-bom,chinese "语言设置
set langmenu=zh_CN.UTF- "设置语法高亮
syntax enable
syntax on "设置配色方案
colorscheme torte "可以在buffer的任何地方使用鼠标
set mouse=a
set selection=exclusive
set selectmode=mouse,key "高亮显示匹配的括号
set showmatch "去掉vi一致性
set nocompatible "设置缩进
set tabstop=
set softtabstop=
set shiftwidth=
set autoindent
set cindent
if &term=="xterm"
set t_Co=
set t_Sb=^[[%dm
set t_Sf=^[[%dm
endif "打开文件类型自动检测功能
filetype on "设置taglist
let Tlist_Show_One_File= "显示多个文件的tags
let Tlist_File_Fold_Auto_Close= "非当前文件,函数列表折叠隐藏
let Tlist_Exit_OnlyWindow= "在taglist是最后一个窗口时退出vim
let Tlist_Use_SingleClick= "单击时跳转
let Tlist_GainFocus_On_ToggleOpen= "打开taglist时获得输入焦点
let Tlist_Process_File_Always= "不管taglist窗口是否打开,始终解析文件中的tag "设置WinManager插件
let g:winManagerWindowLayout='FileExplorer|TagList'
nmap wm :WMToggle<cr>
map <silent> <F9> :WMToggle<cr> "将F9绑定至WinManager,即打开WimManager "设置CSCOPE
set cscopequickfix=s-,c-,d-,i-,t-,e- "设定是否使用quickfix窗口显示cscope结果 "设置Grep插件
nnoremap <silent> <F3> :Grep<CR> "设置一键编译
map <F6> :make<CR> "设置自动补全
filetype plugin indent on "打开文件类型检测
set completeopt=longest,menu "关掉智能补全时的预览窗口 "启动vim时如果存在tags则自动加载
if exists("tags")
set tags=./tags
endif "设置按F12就更新tags的方法
map <F12> :call Do_CsTag()<CR>
nmap <C-@>s :cs find s <C-R>=expand("<cword>")<CR><CR>:copen<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>:copen<CR>
nmap <C-@>t :cs find t <C-R>=expand("<cword>")<CR><CR>:copen<CR>
nmap <C-@>e :cs find e <C-R>=expand("<cword>")<CR><CR>:copen<CR>
nmap <C-@>f :cs find f <C-R>=expand("<cfile>")<CR><CR>:copen<CR>
nmap <C-@>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>:copen<CR>
nmap <C-@>d :cs find d <C-R>=expand("<cword>")<CR><CR>:copen<CR>
function Do_CsTag()
let dir = getcwd()
if filereadable("tags")
if(g:iswindows==)
let tagsdeleted=delete(dir."\\"."tags")
else
let tagsdeleted=delete("./"."tags")
endif
if(tagsdeleted!=)
echohl WarningMsg | echo "Fail to do tags! I cannot delete the tags" | echohl None
return
endif
endif if has("cscope")
silent! execute "cs kill -1"
endif if filereadable("cscope.files")
if(g:iswindows==)
let csfilesdeleted=delete(dir."\\"."cscope.files")
else
let csfilesdeleted=delete("./"."cscope.files")
endif
if(csfilesdeleted!=)
echohl WarningMsg | echo "Fail to do cscope! I cannot delete the cscope.files" | echohl None
return
endif
endif if filereadable("cscope.out")
if(g:iswindows==)
let csoutdeleted=delete(dir."\\"."cscope.out")
else
let csoutdeleted=delete("./"."cscope.out")
endif
if(csoutdeleted!=)
echohl WarningMsg | echo "Fail to do cscope! I cannot delete the cscope.out" | echohl None
return
endif
endif if(executable('ctags'))
"silent! execute "!ctags -R --c-types=+p --fields=+S *"
silent! execute "!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q ."
endif if(executable('cscope') && has("cscope") )
if(g:iswindows!=)
silent! execute "!find . -name '*.h' -o -name '*.c' -o -name '*.cpp' -o -name '*.java' -o -name '*.cs' > cscope.files"
else
silent! execute "!dir /s/b *.c,*.cpp,*.h,*.java,*.cs >> cscope.files"
endif
silent! execute "!cscope -b"
execute "normal :" if filereadable("cscope.out")
execute "cs add cscope.out"
endif
endif
endfunction "设置默认shell
set shell=bash "设置VIM记录的历史数
set history= "设置当文件被外部改变的时侯自动读入文件
if exists("&autoread")
set autoread
endif "设置ambiwidth
set ambiwidth=double "设置文件类型
set ffs=unix,dos,mac "设置增量搜索模式
set incsearch "设置静音模式
set noerrorbells
set novisualbell
set t_vb= "不要备份文件
set nobackup
set nowb
~/.vimrc config的更多相关文章
- vimrc config and NERDTree
nmap <C-N> :tabnext<CR> 下载和配置 NERDTree插件的官方地址如下,可以从这里获取最新的版本 https://github.com/scrooloo ...
- 大神的vim配置
大神的vim配置,O(∩_∩)O spf13-vim : Steve Francia's Vim Distribution __ _ _____ _ ___ _ __ / _/ |___ / __ _ ...
- neovim的新体验
A. 缘由 vim下的CtrlP插件好用,但是当文件较多时,不能很快检索,时有卡死的情况发生.听说neovim引入了很多新的功能,例如异步处理,job管理等. B. 安装neovim1. Ubunt ...
- neovim初次安装使用
github下载neovim代码 按readme中安装,中间可能 要安装一些库 将vim的配置关联到nvim,发现和vim是一样的 ln -s ~/.vim ~/.config/nvim ln -s ...
- 如何设置Vimrc
.title { text-align: center } .todo { font-family: monospace; color: red } .done { color: green } .t ...
- linux vim taglist config
"vim config .vimrc "taglist map <silent> <F10> :TlistToggle let tlist_php_sett ...
- 编写一份好的 Vimrc
编写一份好的 Vimrc 目录 如何 Vimrc 色彩 空白字符与制表符 UI 配置 搜索 折叠 移动 用户自定义的前缀快捷按键 插件CtrlP 启动配置 终端Tmux 自动命令及其分组 备份 自定义 ...
- vim 配置.vimrc文件
下面这个.vimrc文件是根据公司里的一个前辈配置的,这里记录下,方便以后使用.它的功能,其实跟网上很多.vimrc配置的相比,还是小儿科.我记录下来,主要还是因为自己已经习惯了这个工作环境跟快捷键. ...
- 我的.vimrc配置
termux平台下,通过pkg update && pkg upgrade && pkg install vim来获得vim.可是,当我配置.vimrc时发现如果我每在 ...
随机推荐
- android点滴之标准SD卡状态变化事件广播接收者的注冊
眼下最完整的,须要注冊的动作匹配例如以下: IntentFilter intentFilter = new IntentFilter(Intent.ACTION_MEDIA_MOUNTED); int ...
- 两个select级联操作实例(教师职称类型与职称)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <hea ...
- Linux多线程的一个小例子
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <pthread.h& ...
- MySQL B+树索引和哈希索引的区别
导读 在MySQL里常用的索引数据结构有B+树索引和哈希索引两种,我们来看下这两种索引数据结构的区别及其不同的应用建议. 二者区别 备注:先说下,在MySQL文档里,实际上是把B+树索引写成了BT ...
- dmesg 程序崩溃调试
[root@localhost log]# cat -n /root/xx.c #include <stdio.h> void func(char *p) { *p = 'p'; } in ...
- 【转】Hibernate映射机制之XXX.hbm.xml
http://blog.csdn.net/a9529lty/article/details/6454924[注意多对一中“多”和“一”各自的java文件.xml文件的书写格式] 另外两篇总结:http ...
- How to let gedit of linux display "space"
gedit--> preference --> check "draw spaces" . Then gedit will display spaces
- TextView使用的方式
第一种改变TextView的方式 // TextView tv=new TextView(this); // tv.setText("Hello,Android&quo ...
- C++ notes for beginners(2)
作者:马 岩(Furzoom) (http://www.cnblogs.com/furzoom/)版权声明:本文的版权归作者与博客园共同所有.转载时请在明显地方注明本文的详细链接,未经作者同意请不要删 ...
- 处理 eclipse 导入报错 Invalid project description,问题
有时候在添加工程时,会出现如图所示的错误信息, ,提示显示将要添加的工程已经存在,但是在工作空间里却找不到,这个时候,要做就是, 在导入的时候选择General->Existing Projec ...