Repository navigation
Expand file tree
/
Copy path.vimrc
More file actions
158 lines (122 loc) · 3.54 KB
/
Copy path.vimrc
File metadata and controls
158 lines (122 loc) · 3.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
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)
" ...
" 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
nnoremap <space> za
Plugin 'tmhedberg/SimpylFold'
let g:SimpylFold_docstring_preview=1
" PEP 8
au BufNewFile,BufRead *.py
\ set tabstop=4
\ set softtabstop=4
\ set shiftwidth=4
\ set textwidth=79
\ set expandtab
\ set autoindent
\ set fileformat=unix
"For full stack dev
au BufNewFile,BufRead *.js, *.html, *.css
\ set tabstop=2
\ set softtabstop=2
\ set shiftwidth=2
"For bash files
au BufNewFile,BufRead *.sh
\ set tabstop=3
\ set softtabstop=3
\ set shiftwidth=3
"Auto-indentation
Plugin 'vim-scripts/indentpython.vim'
"Flagging Unnecessary Whitespace
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
"UTF-Support
set encoding=utf-8
"Auto-complete
Bundle 'Valloric/YouCompleteMe'
let g:ycm_autoclose_preview_window_after_completion=1
map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
"python with virtualenv support
python3 << EOF
import os
import sys
if 'VIRTUAL_ENV' in os.environ:
project_base_dir = os.environ['VIRTUAL_ENV']
activate_this = os.path.join(project_base_dir, 'bin/activate_this.py')
execfile(activate_this, dict(__file__=activate_this))
EOF
"Syntax Checking/Highlighting
Plugin 'vim-syntastic/syntastic'
Plugin 'nvie/vim-flake8'
let python_highlight_all=1
syntax on
"Color schemes
Plugin 'jnurmine/Zenburn'
Plugin 'altercation/vim-colors-solarized'
if has('gui_running')
set background=dark
colorscheme solarized
else
colorscheme zenburn
endif
call togglebg#map("<F5>") "to change from dark to light screen mode by pressing F5
"File Browsing: file tree view
Plugin 'scrooloose/nerdtree'
Plugin 'jistr/vim-nerdtree-tabs' "to use tabs
let NERDTreeIgnore=['\.pyc$', '\~$'] "ignore files in NERDTree
"Super searching
Plugin 'kien/ctrlp.vim'
"Line Numbering
set nu
"Git integration
Plugin 'tpope/vim-fugitive'
"Powerline: to see project state and other staff
Plugin 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}
"System clipboard
set clipboard=unnamed
"VIM in the shell
"set editing-mode vi
"save the session, save modified files, and exit
command! Xs :mks! | :xa
" maximize current split or return to previous
Plugin 'szw/vim-maximizer'
noremap <C-w>m :MaximizerToggle<CR>
"running the code with a snap
nnoremap py :!python %
"search class
nnoremap sc :g/^class
"search def
nnoremap sd :g/^def
"integrated terminal macros
nnoremap <C-t> :terminal<CR>
"remap escape
inoremap jk <Esc>
" transparent bg
autocmd vimenter * hi Normal guibg=NONE ctermbg=NONE
" For Vim<8, replace EndOfBuffer by NonText
autocmd vimenter * hi EndOfBuffer guibg=NONE ctermbg=NONE
"hi Normal guibg=NONE ctermbg=NONE
"changing split windows size
nmap <M-Right> :vertical resize +1<CR>
nmap <M-Left> :vertical resize -1<CR>
nmap <M-Down> :resize +1<CR>
nmap <M-Up> :resize -1<CR>