win10/win7下不通过winmanager整合NERDTree和Tagbar的gVim8.0配置
本文版权归作者所有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

注:图片来自作者公众号——“iKM_2018”,亦即“丫丫的iKM基地”。
" Startup {{{
filetype indent plugin on
" vim 文件折叠方式为 marker
augroup ft_vim
au!
au FileType vim setlocal foldmethod=marker
augroup END
"光标遇到折叠,折叠就打开,否则输入zo
set foldopen=all
"移开折叠时自动关闭折叠,否则输入zc
set foldclose=all
" }}}
" gvimrc_example {{{
" An example for a gvimrc file.
" The commands in this are executed when the GUI is started, after the vimrc
" has been executed.
"
" Maintainer: Bram Moolenaar Bram@vim.org
" Last change: 2016 Apr 05
"
" To use it, copy it to
" for Unix and OS/2: ~/.gvimrc
" for Amiga: s:.gvimrc
" for MS-DOS and Win32: $VIM_gvimrc
" for OpenVMS: sys$login:.gvimrc
" Make external commands work through a pipe instead of a pseudo-tty
"set noguipty
" set the X11 font to use
" set guifont=-misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1
set ch=2 " Make command line two lines high
set mousehide " Hide the mouse when typing text
" Make shift-insert work like in Xterm
map <S-Insert> <MiddleMouse>
map! <S-Insert> <MiddleMouse>
" Only do this for Vim version 5.0 and later.
if version >= 500
" Switch on syntax highlighting if it wasn't on yet.
if !exists("syntax_on")
syntax on
endif
" For Win32 version, have "K" lookup the keyword in a help file
"if has("win32")
" let winhelpfile='windows.hlp'
" map K :execute "!start winhlp32 -k <cword> " . winhelpfile <CR>
"endif
" Set nice colors
" background for normal text is light grey
" Text below the last line is darker grey
" Cursor is green, Cyan when ":lmap" mappings are active
" Constants are not underlined but have a slightly lighter background
highlight Normal guibg=grey90
highlight Cursor guibg=Green guifg=NONE
highlight lCursor guibg=Cyan guifg=NONE
highlight NonText guibg=grey80
highlight Constant gui=NONE guibg=grey95
highlight Special gui=NONE guibg=grey95
endif
" }}}
" General {{{
" 语法高亮
syntax enable
syntax on
" 配色设置:http://ethanschoonover.com/solarized
if has('gui_running')
set background=dark
else
set background=light
endif
let g:solarized_termcolors=256
let g:solarized_termtrans=1
colorschem solarized
" 其他配置
set nocompatible " 关闭 vi 兼容模式
set guifont=Inconsolata:h12:cANSI " 设置字体
set number " 显示行号
set cursorline " 突出显示当前行
set ruler " 打开状态栏标尺,即打开光标的行列位置显示功能
set tabstop=4 " 设定 tab 长度为 4
set nobackup " 覆盖文件时不备份
set autochdir " 自动切换当前目录为当前文件所在的目录
set ignorecase smartcase " 搜索时忽略大小写,但在有一个或以上大写字母时仍保持对大小写敏感
set incsearch " 输入搜索内容时就显示搜索结果
set hlsearch " 搜索时高亮显示被找到的文本
" set guioptions-=T " 隐藏工具栏
" set guioptions-=m " 隐藏菜单栏
set smartindent " 开启新行时使用智能自动缩进
set laststatus=2 " 显示状态栏 (默认值为 1, 无法显示状态栏)
set ambiwidth=double " 显示中文引号
set cursorline " 行高亮
set cursorcolumn " 列高亮,与函数列表有冲突
nnoremap <F2> :g/^\s*$/d<CR>
set clipboard+=unnamed
"解决菜单乱码
set encoding=utf-8
"fileencodings需要注意顺序,前面的字符集应该比后面的字符集大
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
set langmenu=zh_CN.utf-8
set imcmdline
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
"解决consle输出乱码
language messages zh_CN.utf-8
" }}}
" plugins {{{
" miniBufExpl
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1
let g:miniBufExplMoreThanOne=0
" #######################################################################################################
" F3,F4,F4,F3,F3,打开后按此顺序连续反复几次,即可让Tagbar和NERDTree上下排列在左边窗口
" 打开非Tagbar自动打开的文件(如_vimrc)后光标在Tree窗口,单按F3有时也可达到上述效果
" 两者都自动打开时,按此顺序:F4,F4,F3,F3(即先关掉NERDTree—F4,再打开NERDTree—F4,最后连续按两次F3)
" #######################################################################################################
" Tagbar
map <F3> :TagbarToggle<CR>
let g:tagbar_left = 1
let g:tagbar_vertical = 30
let g:tagbar_sort = 0 "close the sort
autocmd BufReadPost .cpp,.c,.h,.hpp,.cc,.py call tagbar#autoopen()
" NERDTree
map <F4> :NERDTreeToggle<CR>
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") &&b:NERDTreeType == "primary") | q | endif
autocmd vimenter * NERDTree
" ctrlp
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
" 自动补全插件 jedi-vim
let g:SuperTabDefaultCompletionType = "context"
let g:jedi#popup_on_dot = 0
" python 语法检测之ale
let g:ale_linters = {'python': ['flake8'], 'reStructuredText': ['rstcheck']}
let g:ale_fixers = {'python': ['remove_trailing_lines', 'trim_whitespace', 'autopep8']}
" }}}
" python {{{
"Pydiction
" ------------------------------------------------------------------------
let g:pydiction_location = 'D:\gVim\vim\vim80\ftplugin\complete-dict'
let g:pydiction_menu_height = 20
autocmd FileType python map <F5> :!python %<CR>
" noocomplete 自动补全插件,官方配置
" ------------------------------------------------------------------------
set completeopt=longest,menu
"Note: This option must be set in .vimrc(_vimrc). NOT IN .gvimrc(_gvimrc)!
" Disable AutoComplPop.
let g:acp_enableAtStartup = 0
" Use neocomplete.
let g:neocomplete#enable_at_startup = 1
" Use smartcase.
let g:neocomplete#enable_smart_case = 1
" Set minimum syntax keyword length.
let g:neocomplete#sources#syntax#min_keyword_length = 3
" Define dictionary.
let g:neocomplete#sources#dictionary#dictionaries = {
\ 'default' : '',
\ 'vimshell' : $HOME.'/.vimshell_hist',
\ 'scheme' : $HOME.'/.gosh_completions'
\ }
" Define keyword.
if !exists('g:neocomplete#keyword_patterns')
let g:neocomplete#keyword_patterns = {}
endif
let g:neocomplete#keyword_patterns['default'] = '\h\w*'
" Plugin key-mappings.
inoremap <expr><C-g> neocomplete#undo_completion()
inoremap <expr><C-l> neocomplete#complete_common_string()
" Recommended key-mappings.
" <CR>: close popup and save indent.
inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
function! s:my_cr_function()
return (pumvisible() ? "<C-y>" : "" ) . "<CR>"
" For no inserting <CR> key.
"return pumvisible() ? "<C-y>" : "<CR>"
endfunction
" <TAB>: completion.
inoremap <expr><TAB> pumvisible() ? "<C-n>" : "<TAB>"
" <C-h>, <BS>: close popup and delete backword char.
inoremap <expr><C-h> neocomplete#smart_close_popup()."<C-h>"
inoremap <expr><BS> neocomplete#smart_close_popup()."<C-h>"
" Close popup by <Space>.
"inoremap <expr><Space> pumvisible() ? "<C-y>" : "<Space>"
" AutoComplPop like behavior.
"let g:neocomplete#enable_auto_select = 1
" Shell like behavior(not recommended).
"set completeopt+=longest
"let g:neocomplete#enable_auto_select = 1
"let g:neocomplete#disable_auto_complete = 1
"inoremap <expr><TAB> pumvisible() ? "<Down>" : "<C-x><C-u>"
" Enable omni completion.
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
" Enable heavy omni completion.
if !exists('g:neocomplete#sources#omni#input_patterns')
let g:neocomplete#sources#omni#input_patterns = {}
endif
"let g:neocomplete#sources#omni#input_patterns.php = '[^. \t]->\h\w|\h\w::'
"let g:neocomplete#sources#omni#input_patterns.c = '[^.[:digit:] *\t]%(.|->)'
"let g:neocomplete#sources#omni#input_patterns.cpp = '[^.[:digit:] \t]%(.|->)|\h\w::'
" For perlomni.vim setting.
" https://github.com/c9s/perlomni.vim
let g:neocomplete#sources#omni#input_patterns.perl = '\h\w->\h\w|\h\w*::'
" }}}
win10/win7下不通过winmanager整合NERDTree和Tagbar的gVim8.0配置的更多相关文章
- win10/win7下vs2013自带IISExpress支持局域网访问
打开IISExpress安装目录(C:\Users\Administrator\Documents\IISExpress\config),一般为我的文档下,用记事本打开applicationhost. ...
- 最详细win7下手动搭建PHP环境:apache2.4.23+php7.0.11
♣资源下载(apache24,php7,phpStorm9) ♣修改apache24配置文件 ♣安装和启动Apache服务 ♣修改php7.0.11配置文件 配置前说明:电脑需要有vc运行库环境,否则 ...
- win7下安装Office2010老是出现提示安装MSXML6.10.1129.0,下载官方MSXML后提示安装成功却也安装不了
在注册表中增加以下信息: [HKEY_CLASSES_ROOT\TypeLib\{F5078F18-C551-11D3-89B9-0000F81FE221}][HKEY_CLASSES_ROOT\Ty ...
- win7下使用Taste实现协同过滤算法
如果要实现Taste算法,必备的条件是: 1) JDK,使用1.6版本.需要说明一下,因为要基于Eclipse构建,所以在设置path的值之前要先定义JAVA_HOME变量. 2) Maven,使用2 ...
- 【我是老中医】Win10系统下MATLAB无法正常打开的解决方案
转眼大四了,要开始做毕设了,导师给的题目要用到他之前做的东西,都是MATLAB做的,所以不太熟悉MATLAB的我也得用这玩意儿了,想想自己目前也就大二的DSS实验和大三的AI实验用过MATLAB,当时 ...
- [转]让程序不触发 Vista/Win7下应用程序兼容性助手弹出 .
原文地址 http://blog.csdn.net/maxuhuiabc/article/details/6081874 在Vista/Win7下 运行一个 exe 应用程序后,系统经常弹出 兼容性助 ...
- vim使用winmanager整合nerd tree和taglist
winmanager插件安装 • 插件简介 winmanager is a plugin which implements a classical windows type IDE in Vim-6. ...
- Win10 Anaconda下TensorFlow-GPU环境搭建详细教程(包含CUDA+cuDNN安装过程)(转载)
win7(win10也适用)系统安装GPU/CPU版tensorflow Win10 Anaconda下TensorFlow-GPU环境搭建详细教程(包含CUDA+cuDNN安装过程) 目录 2.配置 ...
- win10 x64下的DNW驱动不完全安装方法【转】
本文转载自:https://blog.csdn.net/sihaiwenshu/article/details/52503550 一.起因 最新心血来潮想学ARM,JZ2440开发板买回来后就开始折腾 ...
随机推荐
- Pseudo-devices On GNU/Linux
先分享一则有意思Q&A,来自The FreeBSD Funnies 17.4 . Where does data written to* /dev/null* go? It goes in ...
- maven pom.xml 中各个标签元素的作用
<groupId> : 项目或者组织的唯一标识 <artifactId>项目的通用名称 <artifactId>项目的通用名称 <version> 项目 ...
- myeclipse 2014 customize_Perspective 失效解决方法-有效
1.将9个jar复制到myeclipse安装目录\plugins中 2.删除和这9个jar同包名但是版本号较低的9个文件 3.重启myeclipse 2014 三步走: 到这个地址下载 http:// ...
- intellij 打开node项目 一直停留在scanning files to index....,或跳出内存不够的提示框
说明: 在npm install 后,会出现Scanning files to index ...... 出现这个是正常的,但是一直不消失就不正常了.原因是npm install 后 node_mod ...
- 理解cocoa和cocoa touch的响应者链
该文章翻译自:Understanding cocoa and cocoa touch responder chain. 转载注明出处:http://www.cnblogs.com/zhanggui/p ...
- Django的设计模式
MVC模式 MVC将应用程序分解为三个组成部分:mode(模型).view(视图).control(控制器),其中: M 管理应用程序的状态(通常存储到数据库中),并榆树改变状态的行为(或者叫&quo ...
- JavaScript 中 apply 、call 的详解
apply 和 call 的区别 ECMAScript 规范给所有函数都定义了 call 与 apply 两个方法,它们的应用非常广泛,它们的作用也是一模一样,只是传参的形式有区别而已. 原文作者:林 ...
- IOS学习8——常用框架学习汇总
我们在学习和code过程中经常会用到一些框架,本文将会持续更新最新学习和用到的框架 布局框架: Masonry介绍与使用实践:快速上手Autolayout iOS MJRefresh下拉.上拉刷新自定 ...
- lua的通用print函数
1.前言 最近在做关于openresty方面的工作,涉及到lua脚本语言,经常需要打日志查看内容.普通的print函数遇到nil或table时,非常无力.而项目中的代码经常遇到参数为nil或table ...
- Windows as a Service(1)—— Windows 10服务分支
前言 作为公司的IT管理员,管理全公司Windows 10操作系统的更新一直是工作中的头疼之处.微软提供了很多方法来帮助我们管理公司的Windows 10更新,比如Windows Server Upd ...