-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
188 lines (146 loc) · 4.17 KB
/
vimrc
File metadata and controls
188 lines (146 loc) · 4.17 KB
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
set nobackup
set noswapfile
set number
set ruler
set laststatus=2
set statusline=%<%f\ %m%r%h%w%{'['.(&fenc!=''?&fenc:&enc).']['.&ff.']'}%=%l,%c%V%8P
" if fugitive
"set statusline+=%{fugitive#statusline()}
set title
set wildmenu
set showcmd
set smartcase
set hlsearch
"set background=dark
set incsearch
set hidden
set showmatch
"set list
"set listchars=tab:-»,trail:»
set expandtab
set tabstop=2
set shiftwidth=2
set autoindent
set smartindent
set smarttab
set backspace=indent,eol,start
syntax on
" 全角スペースの表示
function! ZenkakuSpace()
highlight ZenkakuSpace cterm=underline ctermfg=lightblue guibg=darkgray
endfunction
if has('syntax')
augroup ZenkakuSpace
autocmd!
autocmd ColorScheme * call ZenkakuSpace()
autocmd VimEnter,WinEnter,BufRead * let w:m1=matchadd('ZenkakuSpace', ' ')
augroup END
call ZenkakuSpace()
endif
" 自動括弧閉じ
"imap { {}<LEFT>
"imap [ []<LEFT>
"imap ( ()<LEFT>
" NeoBundle
" Note: Skip initialization for vim-tiny or vim-small.
if 0 | endif
if &compatible
set nocompatible " Be iMproved
endif
" Required:
set runtimepath+=~/.vim/bundle/neobundle.vim/
" Required:
call neobundle#begin(expand('~/.vim/bundle/'))
" Let NeoBundle manage NeoBundle
" Required:
NeoBundleFetch 'Shougo/neobundle.vim'
" My Bundles here:
" Refer to |:NeoBundle-examples|.
" Note: You don't set neobundle setting in .gvimrc!
" ファイルオープンを便利に
NeoBundle 'Shougo/unite.vim'
" コメントON/OFFを手軽に実行
NeoBundle 'tomtom/tcomment_vim'
" シングルクオートとダブルクオートの入れ替え等
NeoBundle 'tpope/vim-surround'
" インデントに色を付けて見やすくする
NeoBundle 'nathanaelkane/vim-indent-guides'
" 行末の半角スペースを可視化
NeoBundle 'bronson/vim-trailing-whitespace'
" ALE
NeoBundle 'w0rp/ale'
" Scala 用syntax highlight
NeoBundle 'derekwyatt/vim-scala'
" Python
NeoBundle 'Vimjas/vim-python-pep8-indent'
NeoBundle 'nvie/vim-flake8'
" HTML/CSS入力補助
NeoBundle 'mattn/emmet-vim'
" TypeScript
" Syntax
NeoBundle 'leafgarland/typescript-vim'
" like IDE
" NeoBundle 'Shougo/vimproc'
" NeoBundle 'Quramy/tsuquyomi'
" CSS3 / HTML5
NeoBundle 'hail2u/vim-css3-syntax'
NeoBundle 'othree/html5.vim'
NeoBundle 'pangloss/vim-javascript'
" Vue.js
NeoBundle 'posva/vim-vue'
" NERDTree
NeoBundle 'scrooloose/nerdtree'
call neobundle#end()
" Required:
filetype plugin indent on
" If there are uninstalled bundles found on startup,
" this will conveniently prompt you to install them.
NeoBundleCheck
" vimを立ち上げたときに、自動的にvim-indent-guidesをオンにする
" let g:indent_guides_enable_on_vim_startup = 1
let g:indent_guides_auto_colors = 0
hi IndentGuidesOdd ctermbg=black
hi IndentGuidesEven guibg=green ctermbg=4
" for Python
autocmd FileType python setl autoindent
autocmd FileType python setl smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class
autocmd FileType python setl tabstop=8 expandtab shiftwidth=4 softtabstop=4
" vim-flake8
autocmd BufWritePost *.py call Flake8()
let g:flake8_show_in_gutter=1
" let g:flake8_show_in_file=1
let g:flake8_error_marker='EE'
let g:flake8_warning_marker='WW'
" https://github.com/nvie/vim-flake8#max-line-lengths
" $ vim ~/.config/flake8
" [flake8]
" max-line-length = 120
" Jinja2
" http://www.vim.org/scripts/script.php?script_id=1856
" copy jinja.vim, htmljinja.vim into ~/.vim/syntax
" and ftdetect from
" https://github.com/Glench/Vim-Jinja2-Syntax/blob/master/ftdetect/jinja.vim
" and modified
" Figure out which type of hilighting to use for html.
fun! s:SelectHTML()
let n = 1
while n < 50 && n <= line("$")
" check for jinja
if getline(n) =~ '{{.*}}\|{%-\?\s*\(end.*\|extends\|block\|macro\|set\|if\|for\|include\|trans\)\>'
" if expand("%:p") =~ 'jinja'
set ft=htmljinja
return
" endif
" set ft=htmldjango
" return
endif
let n = n + 1
endwhile
endfun
autocmd BufNewFile,BufRead *.html,*.htm,*.nunjucks,*.nunjs call s:SelectHTML()
autocmd BufNewFile,BufRead *.jinja2,*.j2,*.jinja set ft=jinja
" posva/vim-vue
autocmd FileType vue syntax sync fromstart
" NERDTree shortcut
nnoremap <silent><C-e> :NERDTreeToggle<CR>
filetype on