-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc
More file actions
173 lines (130 loc) · 3.61 KB
/
Copy path.vimrc
File metadata and controls
173 lines (130 loc) · 3.61 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
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'git-commit'
Bundle 'YankRing.vim'
Bundle 'EasyMotion'
Bundle 'vimwiki'
Bundle 'Rename'
Bundle 'wincent/Command-T'
Bundle 'jade.vim'
Bundle 'taglist.vim'
Bundle 'scrooloose/syntastic'
Bundle 'newspaper.vim'
Bundle 'xoria256.vim'
Bundle 'jpo/vim-railscasts-theme'
Bundle 'vim-ruby/vim-ruby'
Bundle 'tsukkee/unite-help'
Bundle 'kana/vim-textobj-user'
Bundle 'kana/vim-textobj-fold'
Bundle 'kana/vim-textobj-indent'
Bundle 'kana/vim-textobj-lastpat'
Bundle 'Shougo/neocomplcache'
Bundle 'Shougo/vimfiler'
Bundle 'Shougo/unite.vim'
Bundle 'h1mesuke/vim-alignta'
Bundle 'h1mesuke/unite-outline'
Bundle 'tpope/vim-haml'
Bundle 'tpope/vim-rails'
Bundle 'tpope/vim-cucumber'
Bundle 'tpope/vim-endwise'
Bundle 'tpope/vim-surround'
Bundle 'tpope/vim-fugitive'
Bundle 'ecomba/vim-ruby-refactoring'
Bundle 'nelstrom/vim-textobj-rubyblock'
Bundle 'basyura/unite-rails'
Bundle 'tsukkee/unite-tag'
filetype plugin indent on
syntax enable
set term=screen-256color
set background=dark
colorscheme xoria256
hi Pmenu ctermbg=4
set ambiwidth=double
set autoread
set hidden
set number
set showmatch
set ttymouse=xterm2
set wildmode=list:longest,list:full
set directory-=.
"backup
set nobackup
"encoding
set enc=utf-8
set fenc=utf-8
set fencs=utf-8,iso-2022-jp,euc-jp,cp932
set fileformats=unix,dos
"Tab
set expandtab
set smartindent
set ts=2 sw=2 sts=2
"search
set nohlsearch
set ignorecase
set smartcase
set incsearch
"statusline
set laststatus=2
" keymap
nnoremap j gj
nnoremap k gk
nnoremap wh <C-w>h
nnoremap wj <C-w>j
nnoremap wk <C-w>k
nnoremap wl <C-w>l
nnoremap Y y$
nnoremap <Space>. :<C-u>edit $MYVIMRC<CR>
nnoremap <Space>s. :<C-u>source $MYVIMRC<CR>
cnoremap <C-a> <Home>
cnoremap <C-x> <C-r>=expand('%:p:h')<CR>/
cnoremap <expr> / getcmdtype() == '/' ? '\/' : '/'
" 全角空白と行末の空白の色を変える
highlight WideSpace ctermbg=blue guibg=blue
highlight EOLSpace ctermbg=red guibg=red
function! s:HighlightSpaces()
match WideSpace / /
match EOLSpace /\s\+$/
endf
" clipboard
set clipboard+=unnamed
" <Leader>
inoremap <Leader>date <C-R>=strftime('%Y/%m/%d(%a)')<CR>
inoremap <Leader>time <C-R>=strftime('%H:%M:%S')<CR>
" git-commit.vim
let git_diff_spawn_mode = 1
" neocomplcache
let g:neocomplcache_enable_at_startup = 1
let g:neocomplcache_enable_smart_case = 1
let g:neocomplcache_enable_camel_case_completion = 0
let g:neocomplcache_enable_underbar_completion = 1
let g:neocomplcache_min_syntax_length = 3
" unite.vim
nnoremap <silent> ,uf :<C-u>Unite file<CR>
nnoremap <silent> ,uu :<C-u>Unite buffer file_mru<CR>
nnoremap <silent> ,uo :<C-u>Unite outline<CR>
nnoremap <silent> ,uh :<C-u>Unite help<CR>
" Command-T
nnoremap <silent> ,t :<C-u>CommandT<CR>
nnoremap <silent> ,b :<C-u>CommandTBuffer<CR>
let g:CommandTCancelMap = 'q'
" vimwiki
let g:vimwiki_list = [{'path': '~/Dropbox/vimwiki'}]
let g:EasyMotion_leader_key = '<Leader>m'
" vimfiler
let g:vimfiler_as_default_explorer = 1
let g:vimfiler_safe_mode_by_default = 0
augroup MyAutoCmd
autocmd!
au BufRead,BufNewFile *.haml set ft=haml
au BufRead,BufNewFile *.sass set ft=sass
autocmd BufRead,WinEnter * call s:HighlightSpaces()
"自動的に QuickFix リストを表示する
autocmd QuickfixCmdPost make,grep,grepadd,vimgrep,vimgrepadd cwin
autocmd QuickfixCmdPost lmake,lgrep,lgrepadd,lvimgrep,lvimgrepadd lwin
autocmd BufRead,BufNewFile COMMIT_EDITMSG set filetype=git
autocmd BufWritePost $MYVIMRC source $MYVIMRC | if has('gui_running') | source $MYGVIMRC
autocmd BufWritePost $MYGVIMRC if has('gui_running') | source $MYGVIMRC
augroup END