博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
我的vim 配置(python)
阅读量:7305 次
发布时间:2019-06-30

本文共 5879 字,大约阅读时间需要 19 分钟。

http://blog.csdn.net/g_brightboy/article/details/14229139

#tips:(ycm没有生效)肯是自带的jedi-vim,备注以后研究

   xdebug和DBGPavim没有生效。

" An example for a vimrc file.

" author holen
" data     2016-6
" Use Vim settings, rather than Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set incsearch " do incremental searching
" In many terminal emulators the mouse works just fine, thus enable it.
set mouse=a
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
set incsearch
endif
" folder code setting
set foldmethod=indent
au BufWinLeave * silent mkview
au BufRead * silent loadview
nnoremap <space> za
" detection filetype
filetype off
" loading filetype plugin
"filetype plugin on
" load indent files, to automatically do language-dependent indenting.
" filetype indent on
" python utomatic insufficiency
":inoremap ( ()<ESC>i
":inoremap ) <c-r>=ClosePair(')')<CR>
":inoremap { {}<ESC>i
":inoremap } <c-r>=ClosePair('}')<CR>
":inoremap [ []<ESC>i
"":inoremap ] <c-r>=ClosePair(']')<CR>
"":inoremap " ""<ESC>i
"":inoremap ' ''<ESC>i
function! ClosePair(char)
    if getline(".")[col('.')-1] == a:char
        return "\<Right>"
    else
        return a:char
    endif
endfunction
" auto add file header
autocmd BufNewFile *.py 0r ~/.vim/.vim_head_template/vim_python
autocmd BufNewFile *.py ks|call FileName()|'s
autocmd BufNewFile *.py ks|call CreatedTime()|'s
autocmd BufNewFile * normal G
fun FileName()
    if line("$") > 10
        let l = 10
    else
        let l = line("$")
    endif
    exe "1,".l."g/File Name:.*/s/File Name:.*/File Name: ".expand("%")
endfun
 
fun CreatedTime()
    if line("$") > 10
        let l = 10
    else
        let l = line("$")
    endif
    exe "1,".l."g/Created Time:.*/s/Created Time:.*/Created Time: ".strftime("%Y-%m-%d %T")
endfun
" other general settings
set nu
winpos 225 225
set lines=35 columns=115
colo peachpuff
set autoindent
" set guifont=Lucida_Console:h12
set tabstop=4
set shiftwidth=4
set autoindent
set showmatch
set autowrite
set magic
set confirm
set history=500
set noswapfile
set whichwrap+=<,>,h,l
set clipboard+=unnamed
set pastetoggle +=<F9>
set noautoindent
set nosmartindent
set nocindent
"allow folder
set foldenable
set foldmethod=manual
" set encode
set encoding=utf-8
set fileencoding=utf-8
set fileencodings=ucs-bom,utf-8,GB18030,cp936,big5,euc-jp,euc-kr,latin1"
" moved window mapping
nmap <C-H> <C-W>h
nmap <C-J> <C-W>j
nmap <C-K> <C-W>k
nmap <C-L> <C-W>l
" Keyboard mapping
" None
" vundle Plug-in settings
" filetype off   " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle, required
" original repos on github(On Github repository site non-vim-scripts plugins)
"                Bundle 'tpope/vim-fugitive'
"  vim-scripts repos(vim-scripts plugins)
"                  Bundle 'FuzzyFinder'
"  other
"                  Bundle 'git://git.wincent.com/command-t.git'
" folder views
Bundle 'scrooloose/nerdtree.git'
" html and css
Bundle 'mattn/emmet-vim.git'
" code completion
Bundle 'Valloric/YouCompleteMe'
" right tagbar
Bundle 'majutsushi/tagbar'
" Folder code
Bundle 'tmhedberg/SimpylFold'
" Programming symbol completion
Bundle 'Raimondi/delimitMate'
" comment and cancel comment
Bundle 'scrooloose/nerdcommenter'
" like sourceInsight
"Bundle 'wesleyche/SrcExpl'
" xdebug
Bundle 'xdebug/xdebug'
" script language debug
Bundle 'brookhong/DBGPavim'
"YouComplete use jedi to Completion python
"Bundle 'davidhalter/jedi-vim'
filetype plugin indent on
let NERDTreeWinPos='left'
let NERDTreeWinSize=23
"let g:NERDTreeDirArrowExpandable = '▸'
"let g:NERDTreeDirArrowCollapsible = '▾'
"mapping open or close  nerdteree
map <silent> <F2> :NERDTreeToggle<CR>
" mapping tagbarToggle
let g:tagbar_width = 25
map <silent> <F3> :TagbarToggle<CR>
" mapping SrcExplToggle
"map <silent> <F4> :SrcExplToggle<CR>
" Brief help
 " :BundleList - list configured plugins " :PluginInstall(!)
 " :BundleSearch(!) foo - search(or refresh cache first) for foo
 " :BundleInstall (update) plugins
 " :BundleClean(!)      - confirm (or auto-approve) removal of unused
" hide .pyc
let NERDTreeIgnore=['\.pyc$', '\~$'] "ignore files in NERDTree
" setting cscope
" cs find c|d|e|g|f|i|s|t name
" using cscope to find word where is define,models as below:
" find where statement
nmap <C-@>s :cs find s <C-R>=expand("<cword>")<CR><CR>
" find where definition
nmap <C-@>g :cs find g <C-R>=expand("<cword>")<CR><CR>
" find current function calling that function
nmap <C-@>d :cs find d <C-R>=expand("<cword>")<CR><CR>
" find function that who was calling cur function
nmap <C-@>c :cs find c <C-R>=expand("<cword>")<CR><CR>
" find current string
nmap <C-@>t :cs find t <C-R>=expand("<cword>")<CR><CR>
" egrep models
nmap <C-@>e :cs find e <C-R>=expand("<cword>")<CR><CR>
" find current file
nmap <C-@>f :cs find f <C-R>=expand("<cword>")<CR><CR>
"find that file who contain current file
nmap <C-@>i :cs find i <C-R>=expand("<cword>")<CR><CR>
" set debugger
let g:dbgPavimPort = 9000
let g:dbgPavimBreakAtEntry = 0
" Ycm
let mapleader = ","
let g:mapleader = ","
autocmd FileType python set omnifunc=pythoncomplete#Complete  
autocmd FileType python setlocal completeopt-=preview
autocmd FileType javascrīpt set omnifunc=javascriptcomplete#CompleteJS  
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags  
autocmd FileType css set omnifunc=csscomplete#CompleteCSS  
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags  
autocmd FileType php set omnifunc=phpcomplete#CompletePHP  
autocmd FileType c set omnifunc=ccomplete#Complete  
colorscheme desert

转载于:https://www.cnblogs.com/holens/p/5554649.html

你可能感兴趣的文章
div+css学习笔记一(转)
查看>>
【总结整理】关于Json的解析,校验和验证
查看>>
<fmt:timeZone/>显示全球时间
查看>>
JAVA数据结构-----栈
查看>>
sonar常见
查看>>
它组对我们组的建议
查看>>
模拟栈的回溯,完全二叉树搜索,(ZOJ1004)
查看>>
Intellij IDEA 创建消息驱动Bean - 接收JMS消息
查看>>
flask笔记(一)
查看>>
ES6学习笔记
查看>>
Spring.NET学习笔记1——控制反转(基础篇)
查看>>
kindeditor之video插件开发
查看>>
ios-表视图-问题
查看>>
Java中原子类的实现
查看>>
数组索引,内容交换
查看>>
第四次实验报告
查看>>
测试计划
查看>>
Visual Studio 常用快捷键
查看>>
(转) java 复制文件,不使用输出流复制,高效率,文件通道的方式复制文件
查看>>
【BZOJ 1861】Book 书架
查看>>