-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.vimrc
171 lines (140 loc) · 4.3 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
set nocompatible
" vundle related
"
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
" my bundles
Bundle 'kana/vim-fakeclip'
Bundle 'sudo.vim'
Bundle 'Shougo/neocomplcache'
Bundle 'Shougo/unite.vim'
"Bundle 'gtags.vim'
Bundle 'git://vim-latex.git.sourceforge.net/gitroot/vim-latex/vim-latex'
Bundle 'tpope/vim-rails'
Bundle 'vim-ruby/vim-ruby'
Bundle 'kchmck/vim-coffee-script'
Bundle 'tpope/vim-markdown'
Bundle 'thinca/vim-quickrun.git'
Bundle 'tyru/open-browser.vim'
Bundle 'altercation/vim-colors-solarized'
Bundle 'fatih/vim-go'
" bundles end
syntax on
"filetype on
filetype indent on
filetype plugin on
"inoremap <tab> <C-n>
" Windows/Linuxにおいて、.vimと$VIM/vimfilesの違いを吸収する
if has('win32') || has('win64')
let $DOTVIM = $VIM."/vimfiles"
else
let $DOTVIM = $HOME."/.vim"
endif
set title
set number
set ruler
set laststatus=2
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
set hlsearch
set statusline=%<%f\ %m\ %r%h%w%{'['.(&fenc!=''?&fenc:&enc).']['.&ff.']'}%y%=\ (%l/%L,%v)%8P\
set encoding=utf-8
set fileencodings=ucs-bom,iso-2022-jp-3,iso-2022-jp,eucjp-ms,euc-jisx0213,euc-jp,sjis,cp932,utf-8
set incsearch
set smartcase
set hid
" □とか○の文字があってもカーソル位置がずれないようにする
if exists('&ambiwidth')
set ambiwidth=double
endif
"bacspace インデントと改行を削除できるようにする
set bs=eol,start
"クリップボードと共有
set clipboard=unnamed
"keymap
nnoremap <C-n> <ESC>:bp<CR>
nnoremap <C-p> <ESC>:bn<CR>
nnoremap <C-c> <ESC>:bd<CR>
nnoremap U <ESC>:redo<CR>
nnoremap <tab> ==
vnoremap <tab> ==
nnoremap <C-b> <Tab>
nnoremap <C-u> 10k
nnoremap <C-d> 10j
"nmap <C-e> $
"nnoremap <C-a> ^
map <C-l> :set cursorcolumn!<Bar>set cursorline!<CR>
set background=dark
colorscheme solarized
set t_Co=16
highlight CursorColumn ctermbg=Blue
highlight CursorColumn ctermfg=Green
set shellslash
filetype indent on
"Vim latexの設定(mac)
let g:tex_flavor='platex'
let g:Tex_CompileRule_dvi = 'platex --interaction=nonstopmode $*'
let g:Tex_BibtexFlavor = 'jbibtex'
let g:Tex_ViewRule_pdf = 'open -a /Applications/Preview.app'
let g:Tex_CompileRule_pdf = 'dvipdfmx $*.dvi'
let g:Tex_FormatDependency_pdf = 'dvi,pdf'
let g:Tex_DefaultTargetFormat = 'pdf'
"changelog config
let g:changelog_timeformat = "%Y-%m-%d"
let g:changelog_username = "harajune <[email protected]>"
autocmd BufNewFile,BufRead *.ru set filetype=ruby
autocmd BufNewFile,BufRead Rakefile set filetype=ruby
autocmd BufRead,BufNewFile *.mkd setfiletype mkd
autocmd BufRead,BufNewFile *.md setfiletype mkd
"for binary
""バイナリ編集(xxd)モード(vim -b での起動、もしくは *.binファイルを開くと発動します)
augroup BinaryXXD
autocmd!
autocmd BufReadPre *.bin let &binary =1
autocmd BufReadPost * if &binary | silent %!xxd -g 1
autocmd BufReadPost * set ft=xxd | endif
autocmd BufWritePre * if &binary | %!xxd -r | endif
autocmd BufWritePost * if &binary | silent %!xxd -g 1
autocmd BufWritePost * set nomod | endif
augroup END
" bell off
set visualbell t_vb=
" neocomplcache
let g:neocomplcache_enable_at_startup = 1
let g:neocomplcache_enable_smart_case = 1
let g:neocomplcache_enable_camel_case_completion = 1
let g:neocomplcache_enable_underbar_completion = 1
let g:neocomplcache_min_syntax_length = 3
let g:acp_enableAtStartup = 0
let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*'
let g:neocomplcache_dictionary_filetype_lists = {
\ 'default' : '',
\ 'php' : $DOTVIM.'/dict/php.dict',
\ 'smarty' : $DOTVIM.'/dict/smarty.dict',
\ 'ruby' : $DOTVIM.'/dict/ruby.dict'
\ }
let g:neocomplcache_snippets_dir = $DOTVIM.'/snippets'
" <TAB> completion.
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" snippets expand key
imap <silent> <C-e> <Plug>(neocomplcache_snippets_expand)
smap <silent> <C-e> <Plug>(neocomplcache_snippets_expand)
" snipetts
let g:snips_author = 'Jun Harada <[email protected]>'
" folding
set foldmethod=marker
" ctags related
set tags=.tags;
" gtags related
nnoremap <C-]> :GtagsCursor<CR>
" filetype settings
au FileType ruby setlocal tabstop=2 shiftwidth=2 softtabstop=2
" quickrun
let g:quickrun_config = {}
let g:quickrun_config['markdown'] = {
\ 'outputter': 'browser'
\ }