-
Notifications
You must be signed in to change notification settings - Fork 0
/
myvimrc
executable file
·111 lines (100 loc) · 3.35 KB
/
myvimrc
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
let mapleader = ","
let maplocalleader = "\\"
echo "\t>^.^<"
" Basic Setting ------------------------------ {{{
set sw=4 ts=4 sts=4 et
set smartindent
set autoindent
set number
set nowrap
set nocompatible
set shiftround
set ignorecase
set foldlevelstart=0 " Set marker
set hlsearch
set incsearch
set guifont=mononoki\ 13 " Setting Gui fonts
set guioptions-=m " Toggle Menu and Toolbar
set guioptions-=T
set guicursor=a:block-blinkon0 " Setting cursor
set cursorline
filetype on
" }}}
" Vim mapping ---------------------- {{{
nnoremap H 0
nnoremap L $
inoremap <C-U> <ESC>vbUA " set UpLetter
inoremap <C-D> <ESC>ddi " delete line
nnoremap <leader>va vi(
nnoremap <leader>sm :source %<cr>
nnoremap <leader>sw vawc
nnoremap <silent><C-L> :<c-u>nohlsearch<cr>
nnoremap <leader>ev :vsplit $MYVIMRC<CR>
nnoremap <leader>sv :source $MYVIMRC<CR>
nnoremap <leader>" viw<esc>a"<esc>hbi"<esc>lel " add "
vnoremap <leader>' <esc>`<i'<esc>`>a'<esc> " add '
nnoremap <leader>vs :execute "leftabove vsplit " . bufname("#")<CR>
nnoremap <leader>sp :execute "leftabove split " . bufname("#")<CR>
nnoremap <silent><leader>w :match Error /\v^\ [^a-zA-Z0-9]*/<cr>
nnoremap <silent><leader>W :match Error //<cr>
"nnoremap <leader>g :silent execute "grep! -R " . shellescape(expand("<cword>")) . " ."<cr>:copen<cr>
nnoremap <leader>cn :cNext<cr>
nnoremap <leader>cp :cprevious<cr>
nnoremap <leader>cl :clist<cr>
nnoremap <leader>cw :cwindow<cr>
nnoremap <leader>N :setlocal number!<cr> " switch bool value
" }}}
" Iabbrev map setting -------------------------- {{{
iabbrev mvo mov
iabbrev operatro operator
iabbrev endf endfunction
" }}}
" Vimscript file settings -------------------- {{{
augroup filetype_html
autocmd!
autocmd FileType javascript nnoremap <buffer> <localleader>c I//<esc>
autocmd FileType python nnoremap <buffer> <localleader>c I#<esc>
autocmd FileType javascript :iabbrev <buffer> iff if ()<left>
autocmd FileType python :iabbrev <buffer> iff if:<left>
autocmd FileType vim setlocal foldmethod=marker
augroup END
" }}}
" Vim statusline setting(powerline) -------------------------- {{{
set ruler
set laststatus=2
set rtp+=/usr/lib/python2.7/site-packages/powerline/bindings/vim
" set statusline+=\ -\ " spilter
" set statusline+=%.20F
"set statusline=%f " file path
"set statusline+=%= " let label to right
"set statusline+=FileType: " Label
"set statusline+=%y " FileType
"set statusline+=[%04l] " line number
"set statusline+=/ " sp
"set statusline+=%L " all line number
" }}}
" Vundle and plugin setting --------------------- {{{
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" 使用Vundle管理插件,这个必须安装。
Bundle 'gmarik/vundle'
Bundle 'scrooloose/nerdtree'
Bundle 'powerline/powerline'
Bundle 'altercation/vim-colors-solarized'
Bundle 'Aiclear/potion'
filetype plugin indent on
" Vim colors setting(vim-colors-solarized) ------------------------- {{{
set background=dark
colorscheme solarized
" }}}
" NERDTree setting --------------------------- {{{
noremap <F1> :NERDTreeToggle<cr>
noremap <C-F1> :NERDTreeFind<cr>
let NERDTreeChDirMode=2 " Select root dir set current dir
let NERDTreeQuitOnOpen=1 " When open file close tree
let NERDTreeShowBookmarks=1 " Show bookmarks
let NERDTreeMinimalUI=1 " Don't show help menu
let NERDTreeDirArrows=1 "
" }}}
" }}}