用~/.vimrc打造一个完整python环境
2017-09-22 15:08
369 查看
set nocompatible " required filetype off " required " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() " alternatively, pass a path where Vundle should install plugins "call vundle#begin('~/some/path/here') " let Vundle manage Vundle, required Plugin 'gmarik/Vundle.vim' " Add all your plugins here (note older versions of Vundle used Bundle instead of Plugin) " Split navigations set splitbelow nnoremap <C-J> <C-W><C-J> nnoremap <C-K> <C-W><C-K> nnoremap <C-L> <C-W><C-L> nnoremap <C-H> <C-W><C-H> " Enable folding Plugin 'tmhedberg/SimpylFold' let g:SimpylFold_docstring_preview=1 " PEP8 auto indent hi BadWhitespace guifg=gray guibg=red ctermfg=gray ctermbg=red au BufNewFile,BufRead *.py \ set tabstop=4 | \ set softtabstop=4 | \ set shiftwidth=4 | \ set textwidth=79 | \ set expandtab | \ set autoindent | \ set fileformat=unix au BufNewFile,BufRead *.js, *.html, *.css \ set tabstop=2 | \ set softtabstop=2 | \ set shiftwidth=2 Plugin 'vim-scripts/indentpython.vim' au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/ set encoding=utf-8 Bundle 'Valloric/YouCompleteMe' let g:ycm_autoclose_preview_window_after_completion=1 map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR> "python with virtualenv support "py << EOF "import os "import sys "if 'VIRTUAL_ENV' in os.environ: " project_base_dir = os.environ['VIRTUAL_ENV'] " activate_this = os.path.join(project_base_dir, 'bin/activate_this.py') " execfile(activate_this, dict(__file__=activate_this)) " EOF Plugin 'scrooloose/syntastic' Plugin 'nvie/vim-flake8' let python_highlight_all=1 syntax on Plugin 'jnurmine/Zenburn' Plugin 'scrooloose/nerdtree' Plugin 'jistr/vim-nerdtree-tabs' let NERDTreeIgnore=['\.pyc$', '\~$'] "ignore files in NERDTree Plugin 'kien/ctrlp.vim' set nu Plugin 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'} set clipboard=unnamed """"""""""""""""""""""""" " Quickly Run """"""""""""""""""""""""" map <F5> :call CompileRunGcc()<CR> func! CompileRunGcc() exec "w" if &filetype == 'c' exec "!g++ % -o %<" exec "!time ./%<" elseif &filetype == 'cpp' exec "!g++ % -o %<" exec "!time ./%<" elseif &filetype == 'sh' :!time bash % elseif &filetype == 'python' exec "!time python2.7 %" endif endfunc map lv 0v$ Plugin 'tpope/vim-fugitive' " YouCompleteMe set runtimepath+=~/.vim/bundle/YouCompleteMe let g:ycm_collect_identifiers_from_tags_files = 1 " 开启 YCM 基于标签引擎 let g:ycm_collect_identifiers_from_comments_and_strings = 1 " 注释与字符串中的内容也用于补全 let g:syntastic_ignore_files=[".*\.py$"] let g:ycm_seed_identifiers_with_syntax = 1 " 语法关键字补全 let g:ycm_complete_in_comments = 1 let g:ycm_confirm_extra_conf = 0 let g:ycm_key_list_select_completion = ['<c-n>', '<Down>'] " 映射按键, 没有这个会拦截掉tab, 导致其他插件的tab不能用. let g:ycm_key_list_previous_completion = ['<c-p>', '<Up>'] let g:ycm_complete_in_comments = 1 " 在注释输入中也能补全 let g:ycm_complete_in_strings = 1 " 在字符串输入中也能补全 let g:ycm_collect_identifiers_from_comments_and_strings = 1 " 注释和字符串中的文字也会被收入补全 let g:ycm_global_ycm_extra_conf='~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py' let g:ycm_show_diagnostics_ui = 0 " 禁用语法检查 inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>" | " 回车即选中当前项 nnoremap <c-j> :YcmCompleter GoToDefinitionElseDeclaration<CR>| " 跳转到定义处 "let g:ycm_min_num_of_chars_for_completion=2 " "从第2个键入字符就开始罗列匹配项 " All of your Plugins must be added before the following line call vundle#end() " required filetype plugin indent on " required
相关文章推荐
- Python-Matplotlib(2)打造一个完整的折线图
- 用Docker在Ubuntu下 设置一个完整的Python + TensorFlow + GPU support + jupyter notebook + Deep Learning 开发环境
- Windows下用Editplus打造一个Python调试环境
- 使用pathogen管理Vim插件并托管到Github 参照文章【1】【2】的办法,将vim打造成一个Python开发环境。文章中使用的是 pathogen + git 来管理 Vim 插件的。对这种
- Windows下用Editplus打造一个Python调试环境 - 转
- 关于“用Python和OpenCV创建一个图片搜索引擎的完整指南”在win7操作系统python3.6环境下的测试探索
- Vim as Python IDE on windows(用VIM打造一个Python编程环境)
- 【转载】在Windows环境下用Editplus打造一个Python编辑调试环境
- Vim as Python IDE on windows(用VIM打造一个Python编程环境)
- Windows下用Editplus打造一个Python调试环境
- 在sublimetext上打造一个兼容virtualenv的web&python开发环境
- 安装配置python环境,并跑一个推荐系统的例子
- Anaconda还可以在python3.5的基础上创建一个新的独立的python2.7的环境
- Linux环境.vimrc 设置,自动添加Python源文件头信息
- 在Ubuntu上打造方便好用的Python开发环境 --- ZSHELL
- SublimeText3+python完整开发环境搭建
- Mac打造python2 python3开发环境
- 【实战\聚焦Python分布式爬虫必学框架Scrapy 打造搜索引擎项目笔记】第2章 windows下搭建开发环境