forked from bilibili/vim-vide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
178 lines (170 loc) · 5.53 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
174
175
176
177
178
" ____ ____ __ _______ _______
" \ \ / / | | | \ | ____|
" \ \/ / | | | .--. || |__
" \ / | | | | | || __|
" \ / | | | '--' || |____
" \__/ |__| |_______/ |_______|
"
autocmd BufNewFile *.lua 0r /tmp/lua.template
autocmd BufNewFile *.lua normal gnp
autocmd BufNewFile *.php 0r /tmp/php.template
autocmd BufNewFile *.php normal gnp
autocmd BufRead,BufNewFile *.conf setfiletype conf
autocmd BufRead *.php set includeexpr=substitute(v:fname,'\\\','/','g')
autocmd BufRead *.php set include=^#\s*use
autocmd BufRead *.php set suffixesadd+=.php
autocmd BufWinEnter *.mako set filetype=html
autocmd BufWinEnter *.sls set filetype=yaml
autocmd BufWinEnter *.tp set filetype=html
autocmd BufWinEnter *.volt set filetype=html
autocmd GUIEnter * silent !wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz
autocmd FileType php setlocal commentstring=//\ %s
call system('bash ~/.vim/lua.template > /tmp/lua.template')
call system('bash ~/.vim/php.template > /tmp/php.template')
call system('mkdir -p ~/.vimtmp/undodir ~/.vimtmp/backupdir ~/.vimtmp/directory')
colorscheme torte
filetype on
filetype plugin indent on
filetype plugin on
let g:is_bash=1
let $VIMFILES=$HOME.'/.vim'
let @w = 'x~n'
nmap <c-l> <esc>:noh<cr>
nmap <leader>3 :NERDTreeFind<cr>
nmap <leader>a :set filetype=awk <CR>
nmap <leader>c :set filetype=css <CR>
nmap <leader>d :set filetype=htmldjango <CR>
nmap <leader>e :set filetype=sed <CR>
nmap <leader>h :set filetype=html <CR>
nmap <leader>j :set filetype=javascript <CR>
nmap <leader>l :set filetype=lua <CR>
nmap <leader>m :set filetype=markdown <CR>
nmap <leader>p :set filetype=php <CR>
nmap <leader>s :set filetype=sh <CR>
nmap <leader>t :set filetype=txt <CR>
nmap <leader>v :set filetype=vim <CR>
nmap <leader>y :set filetype=python <CR>
set ambiwidth=double
set autoread
set autowriteall
set backup
set bs+=start
set smartindent cindent autoindent
set shiftwidth=4 tabstop=4 smarttab
set clipboard+=unnamed
set complete-=i
set cursorline
set expandtab
set encoding=utf-8 fileencodings=ucs-bom,utf-8,cp936 fileencoding=utf-8
set foldmethod=manual
set hidden hlsearch
set ignorecase smartcase
set noautochdir
set noshowmatch
set nowrapscan
set number
set pastetoggle=<F5>
set path+=./model/,./ctrl/,./lib/,*/templates/,*/static/,..,*/src/main/java/
set printoptions=formfeed:y,header:0,paper:A4,duplex:off,syntax:n
set scrolloff=1
set shell=/bin/bash
set nocompatible
set showcmd " Show cmd in vim-cmdline.
set t_Co=256 " Make vim look better in putty.
set textwidth=0
set undodir=~/.vimtmp/undodir
\ directory=~/.vimtmp/directory
\ backupdir=~/.vimtmp/backupdir
\ viewdir=~/.vimtmp/view
\ undofile
set vb t_vb= " Turn off bi-sound of vim.
set wildignore+=*.git\\*,*.tgz,*.zip,*.url,*.pyc,*.class
syntax on
"
" statusline
"
set laststatus=2
set statusline=(Vide)\ \ %<%f
set statusline+=%w%h%m%r
set statusline+=\ %{getcwd()}
set statusline+=\ [%{&ff}:%{&fenc}:%Y]
set statusline+=%=%-14.(%l,%c%V%)\ %p%%
"
" vim-plug
"
call plug#begin('~/.vim/plug')
Plug 'mzlogin/vim-markdown-toc'
Plug 'vim-syntastic/syntastic'
Plug 'alvan/vim-php-manual'
Plug 'plasticboy/vim-markdown'
Plug 'godlygeek/tabular'
Plug 'scrooloose/nerdtree'
Plug 'tpope/vim-commentary'
Plug 'kien/ctrlp.vim'
Plug 'tmhedberg/matchit'
Plug 'airblade/vim-gitgutter'
call plug#end()
let g:vim_markdown_folding_disabled = 1
let g:gitgutter_max_signs=10000
"
" syntastic
"
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_quiet_messages = { "level": "errors" }
"
" NERDTree
"
let g:NERDTreeDirArrowExpandable = '@'
let g:NERDTreeDirArrowCollapsible = '-'
let g:NERDTreeShowHidden = 0
let g:NERDTreeBookmarksFile = $HOME.'/.vimtmp/NerdBookmarks.txt'
let g:NERDTreeShowBookmarks = 1
let g:NERDTreeShowFiles = 1
let g:NERDTreeShowLineNumbers = 0
let g:NERDTreeWinSize = 29
let g:NERDTreeMinimalUI = 1
let g:NERDTreeDirArrows = 1
let g:NERDTreeIgnore = [
\ '.*\.class',
\ '.*\.pyc',
\ '.*\.chm',
\ '.*\.ttf',
\ '.*\.lnk',
\ '.*\.cproj',
\ '.*\.exe',
\ '.*\.dll',
\ '.*\.out',
\ '.*\.files',
\ '.*\.zip',
\ '.*\.rar',
\ '.*\.gif'
\ ]
let g:NERDTreeIndicatorMapCustom = {
\ "Modified" : "✹",
\ "Staged" : "✚",
\ "Untracked" : "✭",
\ "Renamed" : "➜",
\ "Unmerged" : "═",
\ "Deleted" : "✖",
\ "Dirty" : "✗",
\ "Clean" : "✔︎",
\ "Unknown" : "?"
\ }
"
" ctrlp
"
" Making CtrlP.vim load 100x faster — A Tiny Piece of Vim — Medm
" https://medium.com/a-tiny-piece-of-vim/making-ctrlp-vim-load-100x-faster-7a722fae7df6#.emcvo89nx
let g:ctrlp_user_command = [
\ '.git/',
\ 'git --git-dir=%s/.git ls-files -oc --exclude-standard'
\ ]
let g:ctrlp_match_window = 'bottom,order:btt,min:5,max:5,results:10'
let g:ctrlp_cmd = 'CtrlPMixed'
let g:ctrlp_mruf_default_order = 1
"
" utime.vim
"
let g:timeStampFormat = '170101'
let g:timeStampString = '%y%m%d'
let g:timeStampLeader = 'version'