-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
173 lines (135 loc) · 4.18 KB
/
.vimrc
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
call plug#begin('~/.vim/plugged')
" Plugins
Plug 'sickill/vim-monokai'
Plug 'patstockwell/vim-monokai-tasty'
Plug 'scrooloose/nerdtree'
Plug 'kien/ctrlp.vim'
Plug 'nvie/vim-flake8'
Plug 'bling/vim-airline'
Plug 'docunext/closetag.vim'
Plug 'tomtom/tcomment_vim'
Plug 'Raimondi/delimitMate'
Plug 'jeetsukumaran/vim-buffergator'
Plug 'mattn/emmet-vim'
Plug 'tmhedberg/SimpylFold'
Plug 'sheerun/vim-polyglot'
Plug 'maralla/completor.vim'
Plug 'davidhalter/jedi-vim'
" SnipMate
Plug 'MarcWeber/vim-addon-mw-utils'
Plug 'tomtom/tlib_vim'
Plug 'garbas/vim-snipmate'
Plug 'honza/vim-snippets'
call plug#end()
" Line numbers
set number
" Rebind <Leader> key
" Old key: \
" New key: ,
let mapleader = ","
" set cursorline
" Hidden chars
set list!
set list listchars=tab:»>,trail:·,extends:#
" Backspace bug fix
set backspace=2
" Syntax highlighting
syntax enable
" Color scheme settings
colorscheme vim-monokai-tasty
autocmd FileType python set colorcolumn=79
" Indenting
set smartindent
set expandtab
set nowrap
set autoindent
set sw=2 ts=2 sts=2
autocmd FileType python :setlocal sw=4 ts=4 sts=4
autocmd FileType php :setlocal sw=4 ts=4 sts=4
" Searching
set hlsearch " highlight matches
set incsearch " incremental searching
set ignorecase " searches are case insensitive...
set smartcase " ... unless they contain at least one capital letter
" Clear highlight
nnoremap <space> :noh<return><space>
" File completion
set wildmode=longest,list,full
set wildmenu
" Special copy paste bindings
vnoremap <C-c> "+ygv
vnoremap <C-x> "+x
vnoremap <C-v> c<space><esc>"+gPx
nnoremap <C-v> "+gP
inoremap <C-v> <esc>"+gPa
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-h> <C-w>h
nnoremap <C-l> <C-w>l
nnoremap <C-t> :CtrlPBuffer<return>
" Ignoring files
set wildignore+=*.pyc
" The NERD tree
map <F2> :NERDTreeToggle<CR>
let NERDTreeMapOpenSplit = "s"
let NERDTreeMapOpenVSplit = "v"
let NERDTreeIgnore = ['\.pyc$', '__pycache__']
" autocmd VimEnter * NERDTree
" Open NERDTReee in case no file is specified
autocmd VimEnter * if eval("@%") == "" | silent NERDTree
" CtrlP
let g:ctrlp_working_path_mode = 0
let g:ctrlp_custom_ignore = '\.git$\|\.hg$\|\.svn$\|\.pyc$\|target$'
let g:ctrlp_switch_buffer = 'etH'
" Powerline hack
set laststatus=2
let g:airline_left_sep = ''
let g:airline_right_sep = ''
let g:airline_theme = 'monokai_tasty'
" Flake8
autocmd BufWritePost *.py call Flake8()
let g:pep8_ignore="E702"
" Folding
" set foldmethod=indent
" set foldnestmax=2
" easier moving of code blocks
vnoremap < <gv
vnoremap > >gv
" Quicksave command
noremap <C-z> :update<CR>
vnoremap <C-z> <C-c>:update<CR>
inoremap <C-z> <C-o>:update<CR>
" Quick quit command
noremap <Leader>e :quit<CR> " Quit current window
noremap <Leader>E :qa!<CR> " Quit all windows
" easier moving between tabs
map <Leader>n <esc>:tabprevious<CR>
map <Leader>m <esc>:tabnext<CR>
" Disable stupid backup and swap files
set nobackup
set nowritebackup
set noswapfile
" Commenting blocks of code.
autocmd FileType c,cpp,java,scala let b:comment_leader = '// '
autocmd FileType sh,ruby,python let b:comment_leader = '# '
autocmd FileType conf,fstab let b:comment_leader = '# '
autocmd FileType tex let b:comment_leader = '% '
autocmd FileType mail let b:comment_leader = '> '
autocmd FileType vim let b:comment_leader = '" '
noremap <silent> ,cc :<C-B>silent <C-E>s/^/<C-R>=escape(b:comment_leader,'\/')<CR>/<CR>:nohlsearch<CR>
noremap <silent> ,cu :<C-B>silent <C-E>s/^\V<C-R>=escape(b:comment_leader,'\/')<CR>//e<CR>:nohlsearch<CR>
" Open current file in Google Chrome web browser
nnoremap <silent> <leader>w :!open -a "Google Chrome" %<CR><CR>
" Emmet settings
let g:user_emmet_install_global = 0
autocmd FileType html,css,htmldjango EmmetInstall
" Jedi-vim
autocmd FileType python setlocal completeopt-=preview
" au BufRead,BufNewFile *.vue set filetype=html
let g:completor_racer_binary = '/usr/local/bin/python3'
let g:completor_auto_trigger = 0
" " If you prefer the Omni-Completion tip window to close when a selection is
" " made, these lines close it on movement in insert mode or when leaving
" " insert mode
" autocmd CursorMovedI * if pumvisible() == 0|pclose|endif
" autocmd InsertLeave * if pumvisible() == 0|pclose|endif