Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.67 KB | None | 0 0
  1. "vundle
  2. set nocompatible
  3. filetype off
  4.  
  5. set rtp+=~/.vim/bundle/Vundle.vim
  6. call vundle#begin()
  7.  
  8. Plugin 'VundleVim/Vundle.vim'
  9. "git interface
  10. Plugin 'tpope/vim-fugitive'
  11. "filesystem
  12. Plugin 'scrooloose/nerdtree'
  13. Plugin 'jistr/vim-nerdtree-tabs'
  14. Plugin 'kien/ctrlp.vim'
  15.  
  16. "html
  17. " isnowfy only compatible with python not python3
  18. Plugin 'isnowfy/python-vim-instant-markdown'
  19. Plugin 'jtratner/vim-flavored-markdown'
  20. Plugin 'suan/vim-instant-markdown'
  21. Plugin 'nelstrom/vim-markdown-preview'
  22. "python sytax checker
  23. Plugin 'nvie/vim-flake8'
  24. Plugin 'vim-scripts/Pydiction'
  25. Plugin 'vim-scripts/indentpython.vim'
  26. Plugin 'scrooloose/syntastic'
  27.  
  28. "auto-completion stuff
  29. "Plugin 'klen/python-mode'
  30. Plugin 'Valloric/YouCompleteMe'
  31. Plugin 'klen/rope-vim'
  32. "Plugin 'davidhalter/jedi-vim'
  33. Plugin 'ervandew/supertab'
  34. ""code folding
  35. Plugin 'tmhedberg/SimpylFold'
  36.  
  37. " Themes
  38. Plugin 'altercation/vim-colors-solarized'
  39. Plugin 'jnurmine/Zenburn'
  40.  
  41. call vundle#end()
  42.  
  43. filetype plugin indent on " enables filetype detection
  44. let g:SimpylFold_docstring_preview = 1
  45.  
  46. "autocomplete
  47. let g:ycm_autoclose_preview_window_after_completion=1
  48.  
  49. " custom keys and settings
  50. let mapleader="\<Space>"
  51. map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
  52.  
  53. set tabstop=4
  54. set shiftwidth=4
  55. set softtabstop=4
  56. set expandtab
  57.  
  58. inoremap jk <ESC>
  59.  
  60. call togglebg#map("<F5>")
  61.  
  62. set guifont=Menlo:h14
  63. if has('gui_running')
  64. set background=dark
  65. colorscheme solarized
  66. else
  67. colorscheme zenburn
  68. endif
  69.  
  70. let NERDTreeIgnore=['\.pyc$', '\~$'] "ignore files in NERDTree
  71.  
  72. "I don't like swap files
  73. set noswapfile
  74.  
  75. "turn on numbering
  76. set nu
  77.  
  78. "python with virtualenv support
  79. py << EOF
  80. import os.path
  81. import sys
  82. import vim
  83. if 'VIRTUA_ENV' in os.environ:
  84. project_base_dir = os.environ['VIRTUAL_ENV']
  85. sys.path.insert(0, project_base_dir)
  86. activate_this = os.path.join(project_base_dir,'bin/activate_this.py')
  87. execfile(activate_this, dict(__file__=activate_this))
  88. EOF
  89.  
  90. "it would be nice to set tag files by the active virtualenv here
  91. ":set tags=~/mytags "tags for ctags and taglist
  92. "omnicomplete
  93. autocmd FileType python set omnifunc=pythoncomplete#Complete
  94.  
  95. "------------Start Python PEP 8 stuff----------------
  96. " Number of spaces that a pre-existing tab is equal to.
  97. au BufRead,BufNewFile *py,*pyw,*.c,*.h set tabstop=4
  98.  
  99. "spaces for indents
  100. au BufRead,BufNewFile *.py,*pyw set shiftwidth=4
  101. au BufRead,BufNewFile *.py,*.pyw set expandtab
  102. au BufRead,BufNewFile *.py set softtabstop=4
  103.  
  104. " Use the below highlight group when displaying bad whitespace is desired.
  105. highlight BadWhitespace ctermbg=red guibg=red
  106.  
  107. " Display tabs at the beginning of a line in Python mode as bad.
  108. au BufRead,BufNewFile *.py,*.pyw match BadWhitespace /^\t\+/
  109. " Make trailing whitespace be flagged as bad.
  110. au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
  111.  
  112. " Wrap text after a certain number of characters
  113. au BufRead,BufNewFile *.py,*.pyw, set textwidth=100
  114.  
  115. " Use UNIX (\n) line endings.
  116. au BufNewFile *.py,*.pyw,*.c,*.h set fileformat=unix
  117.  
  118. " Set the default file encoding to UTF-8:
  119. set encoding=utf-8
  120.  
  121. " For full syntax highlighting:
  122. let python_highlight_all=1
  123. syntax on
  124.  
  125. " Keep indentation level from previous line:
  126. autocmd FileType python set autoindent
  127.  
  128. " make backspaces more powerfull
  129. set backspace=indent,eol,start
  130.  
  131.  
  132. "Folding based on indentation:
  133. autocmd FileType python set foldmethod=indent
  134. "use space to open folds
  135. nnoremap <space> za
  136. "----------Stop python PEP 8 stuff--------------
  137.  
  138. "js stuff"
  139. autocmd FileType javascript setlocal shiftwidth=2 tabstop=2
  140.  
  141. " set spell check on by default for Markdown files
  142. autocmd BufRead,BufNewFile *.md setlocal spell spelllang=en_gb
  143.  
  144. " Navigate between split windows
  145. nnoremap <C-J> <C-W><C-J>
  146. nnoremap <C-K> <C-W><C-K>
  147. nnoremap <C-L> <C-W><C-L>
  148. nnoremap <C-H> <C-W><C-H>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement