-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc.editing
91 lines (66 loc) · 2.35 KB
/
.vimrc.editing
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
""" .vimrc.editing
"-------------------------------------------------
" config editing (search, replace ...)
"-------------------------------------------------
" Search {{{
" 検索語の位置を自動で画面の中心にする
nnoremap n nzz
nnoremap N Nzz
" }}}
" ctags {{{
set tags=tags;/
" }}}
" external grep command
set grepformat=%f:%l:%m,%f:%l%m,%f\ \ %l%m,%f
set grepprg=grep\ -nh
" vimgrep pipe quickfix-window
autocmd QuickFixCmdPost *grep* cwindow
" qfixgrep {{{
" see : http://himinato.sblo.jp/category/1597668-1.html
" exclude file extension when you use :Grep
let MyGrep_ExcludeReg = '[~#]$\|\.dll$\|\.exe$\|\.lnk$\|\.o$\|\.obj$\|\.pdf$\|\.xls$\|\.git$\|\.svn$'
" not ignore case when you use :Grep
let g:MyGrepDefault_Ignorecase = 0
" see : https://sites.google.com/site/fudist/Home/grep/usage
"Grepコマンドのキーマップ
let MyGrep_Key = 'gr'
"Grepコマンドの2ストローク目キーマップ
"let MyGrep_KeyB = 'gr'
" QFixGrepの検索時にカーソル位置の単語を拾う/拾わない
let MyGrep_DefaultSearchWord = 0
"Quickfixウィンドウの高さ
let QFix_Height = 10
" }}}
" commentary.vim {{{
autocmd FileType bib set commentstring=%%\ %s
" }}}
" Clang {{{
let g:clang_format#style_options = {
\ 'AccessModifierOffset' : -1,
\ 'AllowShortIfStatementsOnASingleLine' : 'true',
\ 'AlwaysBreakTemplateDeclarations' : 'true',
\ 'BasedOnStyle' : 'Google',
\ 'Standard' : 'C++11',
\ 'BreakBeforeBraces' : 'Stroustrup',
\ }
" map to <Leader>cf in C++ code
autocmd FileType c,cpp,objc nnoremap <buffer><Leader>cf :<C-u>ClangFormat<CR>
autocmd FileType c,cpp,objc vnoremap <buffer><Leader>cf :ClangFormat<CR>
"}}}
" I/O buffer {{{
imap <C-b> <ESC>:read ~/.vim/bf<CR>i
" nmap <C-b> :read ~/.vim/bf<CR>
vmap <C-b> :w!~/.vim/bf<CR>
" }}}
" Binary {{{
" see: http://d.hatena.ne.jp/rdera/20081022/1224682665
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
" }}}