Guest User

Untitled

a guest
Jan 23rd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.65 KB | None | 0 0
  1. " Vundle
  2. filetype off
  3. set rtp+=~/.vim/bundle/vundle
  4. call vundle#rc()
  5. Bundle 'gmarik/vundle'
  6.  
  7. " github
  8. Bundle 'scrooloose/nerdtree'
  9. Bundle 'scrooloose/nerdcommenter'
  10. Bundle 'mattn/zencoding-vim'
  11. Bundle 'tpope/vim-endwise'
  12. Bundle 'tpope/vim-surround'
  13. Bundle 'kchmck/vim-coffee-script'
  14. Bundle 'pylint.vim'
  15.  
  16. filetype plugin indent on
  17.  
  18.  
  19. " make sure language is default i.e. English
  20. language C
  21. set langmenu=none
  22.  
  23. " its vim no vi ;)
  24. set nocompatible
  25.  
  26. " do not prompt for relaod when file modified outside vim
  27. set autoread
  28.  
  29. " allow backspacing over everything in insert mode
  30. set backspace=indent,eol,start
  31.  
  32. " keep 50 lines of command line history
  33. set history=50
  34.  
  35. " show the cursor position all the time
  36. set ruler
  37.  
  38. " display incomplete commands
  39. set showcmd
  40.  
  41. " enable the mouse
  42. set mouse=a
  43.  
  44. " do incremental searching
  45. set incsearch
  46. set ignorecase
  47. set smartcase
  48. set hlsearch
  49.  
  50. " show matching brackets
  51. set showmatch
  52.  
  53. " remove highlighted search in an easy \<space>
  54. nnoremap <leader><space> :noh<cr>
  55.  
  56. " activate syntax highlighting
  57. syntax enable
  58.  
  59. " highlights cursor line
  60. set cursorline
  61.  
  62. " python style tabs
  63. set tabstop=4
  64. set shiftwidth=4
  65. " set softtabstop=4
  66. set expandtab
  67.  
  68. " but for ruby
  69. autocmd FileType ruby setlocal tabstop=2 shiftwidth=2
  70.  
  71. set encoding=utf-8
  72. set scrolloff=3
  73. set autoindent
  74. set showmode
  75. set hidden
  76. set wildmenu
  77. set wildmode=list:longest
  78. set visualbell
  79. set ttyfast
  80. set laststatus=2
  81.  
  82. " no backup
  83. set nobackup
  84. set nowb
  85. set noswapfile
  86.  
  87. set wrap
  88. set linebreak
  89. set textwidth=0
  90. set formatoptions=qrn1
  91. if has("gui_running")
  92. set colorcolumn=80
  93. endif
  94.  
  95. " global substitution i.e. g not required in :%s/foo/bar/
  96. set gdefault
  97.  
  98. " IDLE type execution
  99. " autocmd BufNewFile,BufRead *.py map <buffer> <F5> : w!<cr>:!python %<cr>
  100. " autocmd BufNewFile,BufRead *.py imap <buffer> <F5> <esc>:w!<cr>:!python %<cr>
  101.  
  102. " the very popular desert colorscheme for a reason
  103. colorscheme desert
  104.  
  105. " don't need the toolbar in gVim
  106. set guioptions-=T
  107.  
  108.  
  109. " text with 78 characters
  110. autocmd BufRead *.txt set tw=78
  111.  
  112. " no end of line whitespace
  113. autocmd BufWrite * silent! %s/[\r \t]\+$//
  114.  
  115. " omni completion
  116. autocmd FileType python set omnifunc=pythoncomplete#Complete
  117. autocmd FileType ruby set omnifunc=rubycomplete#Complete
  118. autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
  119. autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
  120. autocmd FileType css set omnifunc=csscomplete#CompleteCSS
  121.  
  122. " pylint (not on write)
  123. autocmd FileType python compiler pylint
  124. let g:pylint_onwrite = 0
  125.  
  126. " jslint
  127. au FileType javascript set makeprg=jslint\ %
  128.  
  129. " NERDTree ignore
  130. let NERDTreeIgnore=['\.pyc']
  131.  
  132. " sudo write with :W
  133. command Sw w !sudo tee % > /dev/null
  134.  
  135. " after saving .vimrc reload
  136. autocmd! bufwritepost .vimrc source ~/.vimrc
Add Comment
Please, Sign In to add comment