Advertisement
gluc

.vimrc for Python development

Nov 28th, 2014
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 3.26 KB | None | 0 0
  1. " GitHub repo & instructions: https://github.com/glujan/vimrc
  2.  
  3. set nocompatible
  4. filetype off
  5. set rtp+=~/.vim/bundle/Vundle.vim
  6. call vundle#rc()
  7.  
  8. Bundle 'gmarik/vundle'
  9. Bundle 'klen/python-mode'
  10. Bundle 'airblade/vim-gitgutter'
  11. Bundle 'kien/ctrlp.vim'
  12. Bundle 'scrooloose/nerdcommenter'
  13. Bundle 'bling/vim-airline'
  14. Bundle 'tomasr/molokai'
  15. " Plugin 'JarrodCTaylor/vim-python-test-runner'
  16. Plugin 'tpope/vim-fugitive'
  17.  
  18. " automatically reload .vimrc
  19. autocmd! bufwritepost .vimrc source %
  20.  
  21. " better copying / pasting
  22. set pastetoggle=<F2>
  23. set clipboard=unnamed
  24.  
  25. " molokai theme
  26. colorscheme molokai
  27. if $COLORTERM == 'gnome-terminal'
  28.     set t_Co=256
  29. endif
  30.  
  31. if !exists('g:airline_symbols')
  32. let g:airline_symbols = {}
  33. endif
  34.  
  35. " airline
  36. set laststatus=2
  37. set noshowmode
  38.  
  39. let g:airline_left_sep = '»'
  40. let g:airline_left_sep = '▶'
  41. let g:airline_right_sep = '«'
  42. let g:airline_right_sep = '◀'
  43. let g:airline_symbols.linenr = '␊'
  44. let g:airline_symbols.linenr = '␤'
  45. let g:airline_symbols.linenr = '¶'
  46. let g:airline_symbols.branch = '⎇'
  47. let g:airline_symbols.paste = 'ρ'
  48. let g:airline_symbols.paste = 'Þ'
  49. let g:airline_symbols.paste = '∥'
  50. let g:airline_symbols.whitespace = 'Ξ'
  51.  
  52. " nerdcommenter
  53. let NERDSpaceDelims=1
  54.  
  55. " mouse
  56. set bs=2
  57. set mouse=a
  58.  
  59. let mapleader = ","
  60.  
  61. " podkresla znaleziona fraze
  62. noremap <C-n> :nohl<CR>
  63. vnoremap <C-n> :nohl<CR>
  64. inoremap <C-n> :nohl<CR>
  65.  
  66. " navigate windows
  67. map <c-j> <c-w>j
  68. map <c-k> <c-w>k
  69. map <c-l> <c-w>l
  70. map <c-h> <c-w>h
  71.  
  72. " navigate tabs
  73. map <Leader>n <esc>:tabprevious<CR>
  74. map <Leader>m <esc>:tabnext<CR>
  75.  
  76. " move block left or right
  77. vnoremap < <gv
  78. vnoremap > >gv
  79.  
  80. " filertype recognition, highlight syntax
  81. filetype plugin indent on
  82. syntax on
  83.  
  84. " row number and width
  85. set number
  86. set tw=79
  87. set nowrap
  88. set fo-=t
  89. set colorcolumn=80
  90. highlight ColorColumn ctermbg=233
  91.  
  92. " tab to 4 spaces
  93. set tabstop=4
  94. set softtabstop=4
  95. set shiftwidth=4
  96. set shiftround
  97. set expandtab
  98.  
  99. " search
  100. set incsearch
  101. set hlsearch
  102. set ignorecase
  103. set smartcase
  104.  
  105. " no backupu & swapa
  106. set nobackup
  107. set nowritebackup
  108. set noswapfile
  109.  
  110. " ctrlp
  111. let g:ctrlp_max_height = 30
  112. set wildignore+=*.pyc
  113. set wildignore+=*build/*
  114. set wildignore+=*dist/*
  115. set wildignore+=*.egg-info/*
  116. set wildignore+=*/coverage/*
  117.  
  118. " python-mode
  119. map <Leader>g :call RopeGotoDefinition()<CR>
  120. let ropevim_enable_shortcuts = 1
  121. let g:pymode_rope_goto_def_newwin = "vnew"
  122. let g:pymode_rope_extended_complete = 1
  123. let g:pymode_breakpoint = 0
  124. let g:pymode_syntax = 1
  125. let g:pymode_virtualenv = 1
  126.  
  127. " OmniPopup
  128. set completeopt=longest,menuone
  129. function! OmniPopup(action)
  130.     if pumvisible()
  131.         if a:action == 'j'
  132.             return "\<C-N>"
  133.         elseif a:action == 'k'
  134.             return "\<C-P>"
  135.         endif
  136.     endif
  137.     return a:action
  138. endfunction
  139. inoremap <silent><C-j> <C-R>=OmniPopup('j')<CR>
  140. inoremap <silent><C-k> <C-R>=OmniPopup('k')<CR>
  141.  
  142.  
  143. if v:ctype =~ "UTF-8"
  144.     set tenc=utf8
  145. else
  146.     set tenc=latin2
  147. endif
  148. set enc=utf8
  149. " latin2 catches everything; it makes no sense to set anything after it
  150. set fileencodings=ucs-bom,utf-8,latin2
  151. set smartindent
  152.  
  153.  
  154. let g:indent_guides_auto_colors = 1
  155.  
  156. set tabpagemax=50
  157. set scrolloff=3
  158. set wildmenu
  159.  
  160. " insert newline without entering input mode
  161. nnoremap <C-J> a<CR><Esc>k$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement