-
Notifications
You must be signed in to change notification settings - Fork 125
/
vimrc
211 lines (200 loc) · 6.21 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
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
" ____ ____ __ _______ _______
" \ \ / / | | | \ | ____|
" \ \/ / | | | .--. || |__
" \ / | | | | | || __|
" \ / | | | '--' || |____
" \__/ |__| |_______/ |_______|
"
autocmd BufNewFile *.lua,*.sh,*.php 0r !~/.vim/template.sh %:e
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 *.volt,*.tp,*.mako set filetype=html
autocmd BufWinEnter *.sls set filetype=yaml
autocmd GUIEnter * silent !wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz
autocmd FileType php setlocal commentstring=//\ %s
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>g :set filetype=go <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
"
" function Version ()
" return system("grep -o '^v[0-9]*' ~/.vim/version|tr -d '\n'")
" endfunction
" set statusline=(Vide.%{Version()})\ \ %<%f
" set statusline+=%w%h%m%r
" set statusline+=\ %{getcwd()}
" set statusline+=\ [%{&ff}:%{&fenc}:%Y]
" set statusline+=%=%-14.(%l,%c%V%)\ %p%%
set laststatus=2
let g:lightline = {
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'readonly', 'filename', 'modified', 'method' ] ]
\ },
\ 'component': {
\ 'lineinfo': "%{line('.') . '/' . line('$')}",
\ }
\ }
"
" vim-plug
"
call plug#begin('~/.vim/plug')
" Plug 'vim-scripts/taglist.vim'
" Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'github/copilot'
Plug 'itchyny/lightline.vim'
Plug 'NLKNguyen/papercolor-theme'
Plug 'wgwoods/vim-systemd-syntax'
Plug 'leafgarland/typescript-vim'
Plug 'xolox/vim-misc'
Plug 'xolox/vim-lua-ftplugin'
Plug 'pangloss/vim-javascript'
Plug 'airblade/vim-gitgutter'
Plug 'posva/vim-vue'
Plug 'alvan/vim-php-manual'
Plug 'cespare/vim-toml'
Plug 'godlygeek/tabular'
Plug 'kien/ctrlp.vim'
Plug 'mzlogin/vim-markdown-toc'
Plug 'plasticboy/vim-markdown'
Plug 'roxma/vim-paste-easy'
Plug 'scrooloose/nerdtree'
Plug 'tmhedberg/matchit'
Plug 'tpope/vim-commentary'
" Plug 'vim-syntastic/syntastic'
call plug#end()
set background=dark
colorscheme PaperColor
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" }
let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck']
let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
"
" go-vim
"
let g:go_version_warning = 0
let g:go_fmt_autosave = 1
let g:go_fmt_command = "goimports"
"
" NERDTree
"
let g:NERDTreeDirArrowExpandable = '@'
" let g:NERDTreeNodeDelimiter = "\u00a0"
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'