vim使用配置-python
安装vundle
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
添加配置文件
- vim ~/.vimrc
- 将下列配置复制到文件中
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
Plugin 'tmhedberg/SimpylFold'
Plugin 'vim-scripts/indentpython.vim'
Plugin 'Valloric/YouCompleteMe'
Plugin 'scrooloose/syntastic'
Plugin 'nvie/vim-flake8'
Plugin 'jnurmine/Zenburn'
Plugin 'altercation/vim-colors-solarized'
Plugin 'scrooloose/nerdtree'
Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'kien/ctrlp.vim'
Plugin 'Lokaltog/vim-powerline'
Plugin 'Yggdroot/indentLine'
Plugin 'tell-k/vim-autopep8'
Plugin 'jiangmiao/auto-pairs'
Plugin 'scrooloose/nerdcommenter'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
set splitbelow
set splitright
"split navigations
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
set foldmethod=indent
set foldlevel=99
" Enable folding with the spacebar
nnoremap <space> za
let NERDTreeIgnore=['\.pyc$', '\~$'] "ignore files in NERDTree
let g:SimpylFold_docstring_preview=1
set encoding=utf-8
set number
let g:ycm_python_binary_path = 'python'
let g:ycm_autoclose_preview_window_after_completion=1
map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
set clipboard=unnamed
let python_highlight_all=1
syntax on
call togglebg#map("<F5>")
set completeopt=longest,menu "让Vim的补全菜单行为与一般IDE一致(参考VimTip1228)
autocmd InsertLeave * if pumvisible() == 0|pclose|endif "离开插入模式后自动关闭预览窗口
"inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>" "回车即选中当前项
"上下左右键的行为 会显示其他信息
inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>"
inoremap <expr> <Up> pumvisible() ? "\<C-p>" : "\<Up>"
inoremap <expr> <PageDown> pumvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<PageDown>"
inoremap <expr> <PageUp> pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<PageUp>"
"youcompleteme 默认tab s-tab 和自动补全冲突
"let g:ycm_key_list_select_completion=['<c-n>']
let g:ycm_key_list_select_completion = ['<Down>']
"let g:ycm_key_list_previous_completion=['<c-p>']
let g:ycm_key_list_previous_completion = ['<Up>']
let g:ycm_confirm_extra_conf=0 "关闭加载.ycm_extra_conf.py提示
let g:ycm_collect_identifiers_from_tags_files=1 " 开启 YCM 基于标签引擎
let g:ycm_min_num_of_chars_for_completion=2 " 从第2个键入字符就开始罗列匹配项
let g:ycm_cache_omnifunc=0 " 禁止缓存匹配项,每次都重新生成匹配项
let g:ycm_seed_identifiers_with_syntax=1 " 语法关键字补全
nnoremap <F5> :YcmForceCompileAndDiagnostics<CR> "force recomile with syntastic
"nnoremap <leader>lo :lopen<CR> "open locationlist
"nnoremap <leader>lc :lclose<CR> "close locationlist
inoremap <leader><leader> <C-x><C-o>
"在注释输入中也能补全
let g:ycm_complete_in_comments = 1
"在字符串输入中也能补全
let g:ycm_complete_in_strings = 1
"注释和字符串中的文字也会被收入补全
let g:ycm_collect_identifiers_from_comments_and_strings = 0
" 隐藏滚动条"
set guioptions-=r
set guioptions-=L
set guioptions-=b
"隐藏顶标签栏"
set showtabline=0
"设置字体"
set guifont=Monaco:h13
"let g:solarized_termcolors=256 "solarized主题设置在终端下的设置"
"set background=dark "设置背景色"
"colorscheme solarized
set nowrap "设置不折行"
set fileformat=unix "设置以unix的格式保存文件"
set tabstop=4 "设置table长度"
set shiftwidth=4 "同上"
set showmatch "显示匹配的括号"
set scrolloff=5 "距离顶部和底部5行"
set laststatus=2 "命令行为两行"
set fenc=utf-8 "文件编码"
set backspace=2
set mouse=a "启用鼠标"
set selection=exclusive
set selectmode=mouse,key
set matchtime=5
set ignorecase "忽略大小写"
set incsearch
set hlsearch "高亮搜索项"
set noexpandtab "不允许扩展table"
set whichwrap+=<,>,h,l
set autoread
set cursorline "突出显示当前行"
set cursorcolumn "突出显示当前列"
map <F4> <leader>ci <CR>
let mapleader=','
"缩进指示线"
let g:indentLine_char='┆'
let g:indentLine_enabled = 1
"autopep8设置"
let g:autopep8_disable_show_diff=1
"F2开启和关闭树"
map <F2> :NERDTreeToggle<CR>
let NERDTreeChDirMode=1
"显示书签"
let NERDTreeShowBookmarks=1
"设置忽略文件类型"
let NERDTreeIgnore=['\~$', '\.pyc$', '\.swp$']
"窗口大小"
let NERDTreeWinSize=25
安装插件
- 打开vim
- 进入命令模式
- 键入PluginInstall 等待完成安装
vim使用配置-python的更多相关文章
- Ubuntu 14.04的vim编辑器配置Python开发环境
#1 $ sudo apt-get install exuberant-ctags vim-scripts $ vim-addons install taglist #2 到:http://www.v ...
- 在vim中配置python补全,fedora 19
近期发现python是个不错的语言,值得一学,先配置下环境,让vim具有keyword补全功能,步骤例如以下,我这个是fedora,其它发行版类似 $ su ******** # yum instal ...
- vim配置python开发环境
vim配置python开发环境 一.安装vim sudo apt-get install vim 二.vim基础配置 #Centos6.5 /usr/share/vim/vim72 vi /etc/v ...
- vim配置python编程环境及YouCompleteMe的安装教程
python号称人工智能语言,现在可算大热,这篇博客将介绍如何用vim打造一款自己专属的python编程环境. step1 由于安装YouCompleteMe需要vim8.0及以上版本,所以得安装使用 ...
- mac vim shell配置
一 : vim 配置 1 目录/usr/share/vim/vimrc 2 Python 自动缩进 http://blog.csdn.net/ikerpeng/article/details/1866 ...
- vim中设置Python自动补全
转自:http://blog.csdn.net/wangzhuo_0717/article/details/6942428 在VIM里面增加python的autocomplete功能的做法如下: 1. ...
- (转) mac 下的eclipse 配置 python 2.7
原地址: http://marsfreewill.blogspot.it/2012/08/mac-ospythonpydeveclipse.html 在MAC OS上配置Python开发环境(Py ...
- [转载]启用 VIM 中的 Python 自动补全及提示功能
转载: http://zhongwei-leg.iteye.com/blog/941474 周围的同事不喜欢使用 VIM 写 Python 代码的原因之一就是,VIM 不能像 Visual Studi ...
- windows下LINUX模拟终端Cypwin以及Vim的配置使用
Cypwin的安装 从官网下载相应版本后,直接安装. 官网地址:Cypwin 安装过程中可以选择相应的Packages,我们需要安装的Vim就需要在这一步中选择相应的包. Cypwin的使用 纯命令行 ...
随机推荐
- LeetCode 160. Intersection of Two Linked Lists (两个链表的交点)
Write a program to find the node at which the intersection of two singly linked lists begins. For ex ...
- POJ 1741 Tree 树形DP(分治)
链接:id=1741">http://poj.org/problem?id=1741 题意:给出一棵树,节点数为N(N<=10000),给出N-1条边的两点和权值,给出数值k,问 ...
- C# 获得资源文件下图片的路径
最终实现正确的代码是: button8.Image = System.Drawing.Image.FromFile(@"..\\..\\Resources\\GAOJIBAN.png&quo ...
- @注解与普通web.xml的关系
@WebServlet(name = "SimpleServlet" ,urlPatterns = {"/simple"}) public class Simp ...
- IBatis异常: Cannot find class: VARCHAR
今天再项目里添加新功能时,突然爆出 org.springframework.beans.factory.BeanCreationException: Error creating bean with ...
- 使用psutil模块获取电脑运行信息
psutil是python的一个用于获取cpu信息的模块,非常好使,以下附上官方的一些example: CPU-> Examples >>> import psutil > ...
- 【原创】Vue项目中各种功能的实现
已完成: 后台的管理功能: 这里用的组件是 element-UI ====> NavMenu ◆首先是排版 : <div class="manage-page fillcont ...
- Java中的自定义注解
## 元注解 要声明一个注解, 我们需要元注解, 元注解是指注解的注解,包括@Retention, @Target, @Document, @Inherited. @Retention 注解的保留位置 ...
- 解决Oracle 本地可以连接,远程不能连接问题
一.问题描述: 1.telnet 2.输入命令 lsnrctl status 远程访问不到的原因为:监听指向的是localhost,而不是你本机的远程访问ip地址,因此需要将监听的指向修改为你本机的远 ...
- NHibernate系列学习(二)-使用sql和hql以及linq
1.本文主要介绍了NH的三种查询方式 2.界面查看 3.代码架构 4.代码详情 namespace KimismeDemo { public partial class Form2 : Form { ...