-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.vim
133 lines (117 loc) · 2.67 KB
/
init.vim
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
if !&compatible
set nocompatible
endif
" reset augroup
"augroup MyAutoCmd
" autocmd!
"augroup END
" dein settings {{{ dein自体の自動インストール
let s:cache_home = empty($XDG_CACHE_HOME) ? expand('~/.cache') : $XDG_CACHE_HOME
let s:dein_dir = s:cache_home . '/dein'
let s:dein_repo_dir = s:dein_dir . '/repos/github.com/Shougo/dein.vim'
if !isdirectory(s:dein_repo_dir)
call system('git clone https://github.com/Shougo/dein.vim ' .
shellescape(s:dein_repo_dir))
endif
let &runtimepath = s:dein_repo_dir .",". &runtimepath
" プラグイン読み込み&キャッシュ作成
let s:toml_file = fnamemodify(expand('<sfile>'), ':h').'/dein.toml'
if dein#load_state(s:dein_dir)
call dein#begin(s:dein_dir)
call dein#load_toml(s:toml_file)
call dein#end()
call dein#save_state()
endif
" 不足プラグインの自動インストール
if has('vim_starting') && dein#check_install()
call dein#install()
endif
" }}}
filetype on
filetype plugin indent on
filetype indent on
set encoding=utf-8
set fileencodings=utf-8,ucs-bom,iso-2022-jp-3,eucjp-ms,euc-jisx0213,euc-jp,sjis,cp932
scriptencoding utf-8
set fileformats=unix,dos,mac
"setting
set number "line
set showmode "showmode
set ruler
set showcmd
set showmatch
nmap <Esc><Esc> :nohlsearch<CR><Esc>
set cursorline
set wildmenu
set title
set backspace=indent,eol,start
set tabstop=2
set shiftwidth=2
set expandtab
set nocp
set whichwrap=b,s,h,l,<,>,[,],~
set ignorecase
set lazyredraw
:au FocusLost * silent! wa
"search
set ignorecase
set smartcase
set wrapscan
set hlsearch
set incsearch
" fold
" set foldenable
" set foldnestmax=3
" nnoremap <space> za
" set foldmethod=indent
"display
syntax on
colorscheme koehler
"set autoindent
set smartindent
set smarttab
set expandtab
set cindent
set statusline=2
set laststatus=2
"enable mouse
if has("mouse") " Enable the use of the mouse in all modes
set mouse=a
endif
"parantheses match
vnoremap { "zdi{z}
vnoremap {" "zdi{"z"}
vnoremap {' "zdi{'z'}
vnoremap [ "zdi[z]
vnoremap [" "zdi["z"]
vnoremap [' "zdi['z']
vnoremap ( "zdi(z)
vnoremap (" "zdi("z")
vnoremap (' "zdi('z')
set completeopt=menuone
nnoremap j gj
nnoremap k gk
nmap <up> gk
nmap <down> gj
imap <c-j> <esc>
imap <c-h> <Left>
imap <c-l> <Right>
if &term =~ "xterm"
let &t_SI .= "\e[?2004h"
let &t_EI .= "\e[?2004l"
let &pastetoggle = "\e[201~"
function XTermPasteBegin(ret)
set paste
return a:ret
endfunction
inoremap <special> <expr> <Esc>[200~ XTermPasteBegin("")
endif
set noswapfile
autocmd BufLeave,FocusLost * silent! wall
set backupskip=/tmp/*,/private/tmp/*
if has('win32') || has('win64') || has('mac')
set clipboard+=unnamed,unnamedplus
else
set clipboard+=unnamed,unnamedplus
endif
set secure