-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
160 lines (129 loc) · 5.08 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
" .
" ##############..... ##############
" ##############......##############
" ##########..........##########
" ##########........##########
" ##########.......##########
" ##########.....##########..
" ##########....##########.....
" ..##########..##########.........
" ....##########.#########.............
" ..################JJJ............
" ################.............
" ##############.JJJ.JJJJJJJJJJ
" ############...JJ...JJ..JJ JJ
" ##########....JJ...JJ..JJ JJ
" ########......JJJ..JJJ JJJ JJJ
" ###### .........
" .....
" .
set nocompatible " Use Vim, not vi
"--------------------
" plugins(dein)
"--------------------
source ~/.vim/dein.vim
"--------------------
" NeoVim only setting
"--------------------
if has('nvim')
set nopaste " Put Nvim in Paste mode.
else
set paste " Put Vim in Paste mode.
set clipboard =unnamed,autoselect " Set clipboard.
endif
"--------------------
" base
"--------------------
filetype plugin indent on " Load plugins according to detected filetype.
let mapleader = "\<Space>"
"--------------------
" charcode
"--------------------
set fileencodings=utf-8,iso-2022-jp,cp932,euc-jp " Open priority.
set encoding =utf-8 " Default encoding. when not match fileencodings
set fileformats=unix,dos,mac " Formats of new line.
if exists('&ambiwidth')
set ambiwidth=double " Set ambchar of double width
endif
autocmd FileType * setlocal formatoptions-=ro " disable auto commentout.
"--------------------
" edit
"--------------------
set showmatch " show another parenthesis.
set matchtime =1 " time seconds of showmatch
"--------------------
" syntax highlight
"--------------------
syntax on " Enable syntax highlighting.
set synmaxcol =200 " Avoid vim internal error. Only highlight the first 200 columns.
"--------------------
" design
"--------------------
" colorscheme hybrid
colorscheme molokai
set title " Set title on window.
set number " Show line number.
set ruler " Show ruler(line, column numbers) on right bottom.
"--------------------
" cursor highlight
"--------------------
set cursorline " Set cursorline and below is design settings.
hi CursorLine cterm=none ctermfg=234 ctermbg=LightBlue
hi Visual guibg=Blue ctermbg=Blue
"--------------------
" copy to clipboard
"--------------------
" Don't yank when x(delete command).
nnoremap x "_x
"--------------------
" indent
"--------------------
set autoindent " Indent according to previous line.
set expandtab " Use spaces instead of tabs.
set tabstop =4 " Number of spaces that a <Tab> in the file counts for.
set softtabstop =2 " Tab key indents by 2 spaces.
set shiftwidth =2 " >> indents by 2 spaces.
set shiftround " >> indents to next multiple of 'shiftwidth'.
" set local indent by filetype(ft)
autocmd BufNewFile,BufRead *.erb set ft=html " .erb as html
autocmd BufNewFile,BufRead *.json set ft=javascript " .json as js
autocmd Filetype html setlocal ts=4 sts=4 sw=4
autocmd Filetype ruby setlocal ts=2 sts=2 sw=2
autocmd Filetype javascript setlocal ts=2 sts=2 sw=2
"--------------------
" status line
"--------------------
set laststatus =2 " Always show statusline.
set display =lastline " Show as much as possible of the last line.
set showmode " Show current mode in command-line.
set showcmd " Show already typed keys when more are expected.
set report =0 " Always report changed lines.
"--------------------
" search
"--------------------
set incsearch " Highlight while searching with / or ?.
set hlsearch " Keep matches highlighted.
set wrapscan " Searches wrap around end-of-file.
set ignorecase " Ignore Up/Down case on search.
set smartcase " But Upcase search when query includes upcase.
set history =50 " Hold 50 histries of command, search(q:)
"--------------------
" command-line
"--------------------
set wildmode =longest,full " command-line completion
"--------------------
" drawing
"--------------------
set ttyfast " Faster redrawing.
set lazyredraw " Only redraw when necessary.
"--------------------
" split
"--------------------
set splitbelow " Open new windows below the current window.
set splitright " Open new windows right of the current window.
"--------------------
" temporary files
"--------------------
set noswapfile " Don't create *.swp files
set nobackup " Don't create *~ files
set viminfo= " Don't create viminfo