-
Notifications
You must be signed in to change notification settings - Fork 1
/
vimrc
71 lines (54 loc) · 2.16 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
set langmenu=japanese
set encoding=utf-8
set fileencodings=utf-8,iso-2022-jp,euc-jp,sjis
set fileformats=unix,dos,mac " end-of-line formats
" adding extended attribute for QuickLook
au BufWritePost * call SetUTF8Xattr(expand("<afile>"))
function! SetUTF8Xattr(file)
let isutf8 = &fileencoding == "utf-8" || ( &fileencoding == "" && &encoding == "utf-8")
if has("unix") && match(system("uname"),'Darwin') != -1 && isutf8
call system("xattr -w com.apple.TextEncoding 'utf-8;134217984' '" . a:file . "'")
endif
endfunction
set vb t_vb= " stop the beeping
set viminfo+=n~/.cache/vim/viminfo
set backup
set backupdir=~/.cache/vim/backup
set swapfile
set directory=~/.cache/vim/swap
set undodir=~/.cache/vim/undo
set undofile
set background=dark
syntax on
set listchars=eol:$,tab:>- " highlight hard tab and EOL
set showmatch " highlight matching braces
set hlsearch " highlight matching pattern
" hilight multibyte space
if has('syntax')
syntax enable
function! ZenkakuSpace()
highlight ZenkakuSpace cterm=underline ctermfg=red gui=underline guifg=red
silent! match ZenkakuSpace / /
endfunction
augroup ZenkakuSpace
autocmd!
autocmd VimEnter,BufEnter * call ZenkakuSpace()
augroup END
endif
set autoindent
set tabstop=4
set ruler
" line number
if version < 703
set nu
elseif version >= 703
set relativenumber
endif
set wildmenu " completion in the command line by TAB
set backspace=indent,eol,start " delete indent, end-of-line, start of insert
" opening file of relative path with `gf (goto file)'
autocmd FileType html setlocal includeexpr=substitute(v:fname,'^\\/','','') | setlocal path+=;/
set incsearch " incremental search
set ignorecase " ignore upper and lower case
set smartcase " disable 'ignorecase' when uppercase has pattern
set wrapscan " wrap around to the beginning