-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinit.vim
173 lines (142 loc) · 4.94 KB
/
init.vim
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
" <---------------------------- MuxiVim --------------------------->
" dead simple neovim config
" neo1218 @ MIT License
" https://github.com/neo1218/muxivim
" <----------------------- Plugins Management ---------------------->
" vim-plug
call plug#begin()
Plug 'Shougo/neocomplete.vim'
Plug 'mhinz/vim-startify'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'majutsushi/tagbar'
Plug 'kien/ctrlp.vim'
Plug 'scrooloose/nerdtree'
Plug 'Raimondi/delimitMate'
Plug 'davidhalter/jedi-vim'
Plug 'sjl/gundo.vim'
Plug 'tpope/vim-surround'
Plug 'Valloric/YouCompleteMe'
Plug 'Xuyuanp/nerdtree-git-plugin'
call plug#end()
" <----------------------- Auto Command ---------------------------->
autocmd!
autocmd bufwritepost $MYVIMRC source $MYVIMRC
autocmd ColorScheme * highlight ExtraWhitespace ctermbg=green guibg=green
autocmd BufWinEnter *.py setlocal foldexpr=SimpylFold(v:lnum) foldmethod=expr
autocmd BufWinLeave *.py setlocal foldexpr< foldmethod<
" <------------------------- Code Folding --------------------------->
set foldmethod=manual
" <---------------------------- Leader ------------------------------>
let mapleader = ","
" <---------------------------- Key Map ---------------------------->
nnoremap <c-u> viwU
nnoremap <Leader>c :vs $MYVIMRC<CR>
nnoremap <Leader>s :source $MYVIMRC<CR>
nnoremap <space> :
nnoremap <space>n <space>bn
nnoremap <space>p <space>bp
nnoremap <C-n> :nohl<CR>
noremap <Leader>e :quit<CR>
noremap <Leader>E :qa!<CR>
noremap <Leader>w :w<CR>
inoremap jk <esc>
inoremap <C-n> :nohl<CR>
set pastetoggle=<F2>
set clipboard=unnamed
set bs=2
vnoremap <C-n> :nohl<CR>
let NERDTreeDirArrows=0
map ; :NERDTreeToggle<CR>
map <c-h> <c-w>h
map <c-j> <c-w>j
map <c-k> <c-w>k
map <c-l> <c-w>l
map <Leader>n <esc>:tabprevious<CR>
map <Leader>m <esc>:tabnext<CR>
vnoremap < <gv
vnoremap > >gv
noremap <silent> <expr> j (v:count == 0 ? 'gj' : 'j')
noremap <silent> <expr> k (v:count == 0 ? 'gk' : 'k')
" <--------------------------- Color Theme --------------------------->
" default color theme is molokai
set background=dark
color molokai
let g:molokai_original = 1
" well use item2:)
" <---------------------------- Code Syntax --------------------------->
filetype on
filetype plugin on
filetype plugin indent on
syntax on
" <--------------------- Tab set (important for pythoner) ------------->
set tabstop=4
set shiftwidth=4
set expandtab
vnoremap <space>%ret! 4 <space>op
" <-------------------------- More for Vim --------------------------->
set number " show line num
set numberwidth=1 " number width
set relativenumber " relative number
set tw=80 " text width
set colorcolumn=80 " colorful max text width
set wrap linebreak nolist " auto wrap line
highlight ColorColumn ctermbg=233
" <---------------------------- Format ------------------------------->
vmap Q gq
nmap Q gqap
" <---------------------------- Others ------------------------------->
set history=700
set undolevels=700
" <--------------------------- Search Setting ------------------------->
set hlsearch
set incsearch
set ignorecase
set smartcase
" <----------------- Disable stupid backup and swap files ------------->
set nobackup
set nowritebackup
set noswapfile
" <------------------------ vim-startify setting ---------------------->
let g:startify_custom_header = [
\ ' __ ___ _ __ __ (O)',
\ ' ’ | | | | ` \ \ / / | |\ \ / (_) ',
\ ' | | | | | | \ \_/ / | | \ \ / / _ _ __ ___ ',
\ ' | \__/\ | | | / _ \ | | \ \/ / | | ''_ ` _ \ ',
\ ' | | | | | | / / \ \ | | \ / | | | | | | | ',
\ ' | | |_|____|_|_/_/` `\_\_|_| \/ |_|_| |_| |_| ',
\ ' | |',
\ ' | | ~~ vim for muxistudio ~~ ',
\ ' |_\ -> powered by neo1218 <- ',
\ '',
\ '',
\ ]
" <-------------------------- Plugins Setting ------------------------->
" TagBar setting
nmap <F8> :TagbarToggle<CR>
" vim-airline setting
set laststatus=2
let g:airline_theme="tomorrow"
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#buffer_nr_show = 1
nnoremap <C-N> :bn<CR>
nnoremap <C-M> :bp<CR>
set t_Co=256
let g:Powerline_symbols = 'fancy'
" jedi-vim setting
let g:jedi#usages_command = "<leader>z"
let g:jedi#popup_on_dot = 0
let g:jedi#popup_select_first = 0
map <Leader>b Oimport ipdb; ipdb.set_trace() # BREAKPOINT<C-c>
" vim-minimap setting
let g:minimap_highlight='Visual'
" Python folding
set nofoldenable
" vim/indentLine setting
set background=back
" delimitMate
au FileType python let b:delimitMate_nesting_quotes = ['"']
" vim-gundo
nnoremap <F5> :GundoToggle<CR>
" To be continued