-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc_3
216 lines (162 loc) · 4.72 KB
/
.vimrc_3
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
"
"
" __ _______ __ __ _____ _____ _____ __ _
" \ \ / /_ _| \/ | __ \ / ____| / ____| / _(_)
" \ \ / / | | | \ / | |__) | | | | ___ _ __ | |_ _ __ _
" \ \/ / | | | |\/| | _ /| | | | / _ \| '_ \| _| |/ _` |
" _ \ / _| |_| | | | | \ \| |____ | |___| (_) | | | | | | | (_| |
" (_) \/ |_____|_| |_|_| \_\\_____| \_____\___/|_| |_|_| |_|\__, |
" __/ |
" |___/
"
"
" run python script always save first {{{
autocmd FileType python map <buffer> <F9> :w<CR>:exec '!clear; python3' shellescape(@%, 1)<CR>
autocmd FileType python imap <buffer> <F9> <esc> :w<CR>:exec '!clear; python3' shellescape(@%, 1)<CR>
" }}}
" global hot key {{{
let mapleader=","
nnoremap <Space> :
nnoremap <C-s> :w <CR>:StripWhitespace <CR>
imap <buffer> <C-S> <esc> :w <CR>:StripWhitespace <CR>
let g:autopep8_on_save = 1
let g:autopep8_disable_show_diff=1
autocmd FileType python noremap <buffer> <F8> :call Autopep8()<CR>
" exit
noremap <Leader>qq :qa <CR>
" }}}
"show number line, mouse, wrap, highlite, tabs {{{
set nu
set relativenumber
set noswapfile
set colorcolumn=80
set shortmess=a
set cmdheight=2
"line on cursor
set cursorline
" no wrap line if its to long
set nowrap
"enable mouse
set mouse=a
nnoremap <A-LeftMouse> <A-LeftMouse>i
"wild menu
set wildmenu
set wildmode=longest:full,full
"enable syntax highlight
syntax enable
" enable all Python syntax highlighting features
let python_highlight_all = 1
set expandtab
set sw=4
set sts=4
" }}}
" show the matching part of the pair for [] {} and () {{{
set showmatch
set smartindent
set smarttab
set autoindent
set shiftwidth=4
" }}}
" split screen {{{
set splitbelow
set splitright
nnoremap <leader>fn :vnew <CR>
nnoremap <leader>jn :new <CR>
nnoremap <leader>hh :noh <CR>
"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>
""inoremap " ""<left>
""inoremap ' ''<left>
""inoremap ( ()<left>
""inoremap [ []<left>
""inoremap { {}<left>
""inoremap {<CR> {<CR>}<ESC>O
""inoremap {;<CR> {<CR>};<ESC>O
" }}}
" Plugin {{{
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'
Plugin 'sheerun/vim-polyglot'
Plugin 'dense-analysis/ale'
Plugin 'davidhalter/jedi-vim'
Plugin 'ycm-core/YouCompleteMe'
Plugin 'Raimondi/delimitMate'
Plugin 'morhetz/gruvbox'
Plugin 'joshdick/onedark.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'Yggdroot/indentLine'
Plugin 'tell-k/vim-autopep8'
Plugin 'tpope/vim-fugitive'
Plugin 'ntpeters/vim-better-whitespace'
Plugin 'preservim/nerdcommenter'
Plugin 'kqito/vim-easy-replace'
"power line
Plugin 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}
"Plugin 'nathanaelkane/vim-indent-guides'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" }}}
" NERDTREE {{{
" Start NERDTree and put the cursor back in the other window.
autocmd VimEnter * NERDTree | wincmd p
nnoremap <leader>n :NERDTreeFocus<CR>
"nnoremap <C-n> :NERDTree<CR>
nnoremap <C-t> :NERDTreeToggle<CR>
nnoremap <C-f> :NERDTreeFind<CR>
nnoremap <C-n> :let NERDTreeShowHidden=1 <CR>
"Plugin 'jistr/vim-nerdtree-tabs'
" }}}
" Color {{{
" }}}
" YouCompleteMe {{{
let g:ycm_autoclose_preview_window_after_completion=1
map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
" }}}
" BuckUp {{{
"Turn on backup option
"set backup
"Where to store backups
"silent !mkdir vim_backup > /dev/null 2>&1
"Make backup before overwriting the current buffer
"set backupdir=vim_backup//
"set writebackup
"Overwrite the original backup file
"set backupcopy=yes
"Meaningful backup name, ex: filename@2015-04-05.14:59
"au BufWritePre * let &bex = '@' . strftime("%F.%H:%M")
" }}}
" copy {{{
set clipboard=unnamedplus
"set clipboard+=autoselect guioptions+=a
noremap <Leader>Y "*y
noremap <Leader>P "*p
noremap <Leader>y "+y
noremap <Leader>p "+p
" }}}
" GIT {{{
noremap <Leader>gg :G <CR>
noremap <Leader>gc :Git commit <CR>
noremap <Leader>gp :Git push <CR>
let g:ycm_show_diagnostics_ui = 0
let g:indentLine_newVersion = 0
" }}}
" Folding in VimRC {{{
" This will enable code folding.
" Use the marker method of folding.
augroup filetype_vim
autocmd!
autocmd FileType vim setlocal foldmethod=marker
augroup END
" More Vimscripts code goes here.
" }}}