¤ª¤ì¤Î.vimrc
.vimrc¤Î²òÀâ¤Î¤è¤¦¤Ê¤â¤Î¤ò½ñ¤³¤¦¤È»×¤Ã¤¿¤±¤É¤á¤ó¤É¤¯¤µ¤¤¤Î¤Ç¼ÂºÝ¤Î¤â¤Î¤ò¸«¤¿Êý¤¬Áᤤµ¤¤¬¤·¤¿¤Î¤Ç¡¤¸½Ãʳ¬¤Ç¤Î.vimrc¤È.gvimrc¤ò»¯¤·¤Æ¤ß¤ë¡¥.gvimrc¤ÏGUIÈǤÎVim¡ÊGVim¡Ë¤Î¤ßÆÉ¤ß¹þ¤Þ¤ì¤ëÀßÄê¥Õ¥¡¥¤¥ë¤Ê¤Î¤Ç¡¤GUI¸ÇͤÎÀßÄê¤Ï¤½¤Ã¤Á¤Ë½ñ¤¤¤È¤¯¤È¤è¤µ¤²¡¥
.vimrc
" ==================== ´ðËܤÎÀßÄê ==================== "
" Á´ÈÌÀßÄê
set nocompatible " ɬ¤ººÇ½é¤Ë½ñ¤¯
set viminfo='20,<50,s10,h,! " YankRingÍѤË!¤òÄɲÃ
set shellslash " Windows¤Ç¥Ç¥£¥ì¥¯¥È¥ê¥Ñ¥¹¤Î¶èÀÚ¤êʸ»ú¤Ë / ¤ò»È¤¨¤ë¤è¤¦¤Ë¤¹¤ë
set lazyredraw " ¥Þ¥¯¥í¤Ê¤É¤ò¼Â¹ÔÃæ¤ÏÉÁ²è¤òÃæÃÇ
colorscheme desert " ¥«¥é¡¼¥¹¥¡¼¥à
" ¥¿¥Ö¼þ¤ê
" tabstop¤ÏTabʸ»ú¤ò²èÌ̾å¤Ç²¿Ê¸»úʬ¤ËŸ³«¤¹¤ë¤«
" shiftwidth¤Ïcindent¤äautoindent»þ¤ËÁÞÆþ¤µ¤ì¤ë¥¤¥ó¥Ç¥ó¥È¤ÎÉý
" softtabstop¤ÏTab¥¡¼²¡¤·²¼¤²»þ¤ÎÁÞÆþ¤µ¤ì¤ë¶õÇò¤ÎÎÌ¡¤0¤Î¾ì¹ç¤Ïtabstop¤ÈƱ¤¸¡¤BS¤Ë¤â±Æ¶Á¤¹¤ë
set tabstop=4 shiftwidth=4 softtabstop=0
set expandtab " ¥¿¥Ö¤ò¶õÇòʸ»ú¤ËŸ³«
set autoindent smartindent " ¼«Æ°¥¤¥ó¥Ç¥ó¥È¡¤¥¹¥Þ¡¼¥È¥¤¥ó¥Ç¥ó¥È
" ÆþÎÏÊä½õ
set backspace=indent,eol,start " ¥Ð¥Ã¥¯¥¹¥Ú¡¼¥¹¤Ç¤Ê¤ó¤Ç¤â¾Ã¤»¤ë¤è¤¦¤Ë
set formatoptions+=m " À°·Á¥ª¥×¥·¥ç¥ó¡¤¥Þ¥ë¥Á¥Ð¥¤¥È·Ï¤òÄɲÃ
" ¥³¥Þ¥ó¥ÉÊä´°
set wildmenu " ¥³¥Þ¥ó¥ÉÊä´°¤ò¶¯²½
set wildmode=list:full " ¥ê¥¹¥Èɽ¼¨¡¤ºÇĹ¥Þ¥Ã¥Á
" ¸¡º÷´ØÏ¢
set wrapscan " ºÇ¸å¤Þ¤Ç¸¡º÷¤·¤¿¤éÀèÆ¬¤ØÌá¤ë
set ignorecase " Âçʸ»ú¾®Ê¸»ú̵»ë
set smartcase " Âçʸ»ú¤Ç¤Ï¤¸¤á¤¿¤éÂçʸ»ú¾®Ê¸»ú̵»ë¤·¤Ê¤¤
set incsearch " ¥¤¥ó¥¯¥ê¥á¥ó¥¿¥ë¥µ¡¼¥Á
set hlsearch " ¸¡º÷ʸ»ú¤ò¥Ï¥¤¥é¥¤¥È
" ¥Õ¥¡¥¤¥ë´ØÏ¢
set nobackup " ¥Ð¥Ã¥¯¥¢¥Ã¥×¼è¤é¤Ê¤¤
set autoread " ¾¤Ç½ñ¤´¹¤¨¤é¤ì¤¿¤é¼«Æ°¤ÇÆÉ¤ßľ¤¹
set noswapfile " ¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ëºî¤é¤Ê¤¤
set hidden " ÊÔ½¸Ãæ¤Ç¤â¾¤Î¥Õ¥¡¥¤¥ë¤ò³«¤±¤ë¤è¤¦¤Ë¤¹¤ë
" ¥Ø¥ë¥×¥Õ¥¡¥¤¥ë
if has('mac')
helptags ~/.vim/doc/
endif
if has('win32')
helptags ~/vimfiles/doc/
endif
"ɽ¼¨´ØÏ¢
set showmatch " ³ç¸Ì¤ÎÂбþ¤ò¥Ï¥¤¥é¥¤¥È
set showcmd " ÆþÎÏÃæ¤Î¥³¥Þ¥ó¥É¤òɽ¼¨
set number " ¹ÔÈÖ¹æÉ½¼¨
set wrap " ²èÌÌÉý¤ÇÀÞ¤êÊÖ¤¹
set list " ÉԲĻëʸ»úɽ¼¨
set listchars=tab:>\ " ÉԲĻëʸ»ú¤Îɽ¼¨ÊýË¡
set notitle " ¥¿¥¤¥È¥ë½ñ¤´¹¤¨¤Ê¤¤
set scrolloff=5 " ¹ÔÁ÷¤ê
" ¥¹¥Æ¡¼¥¿¥¹¥é¥¤¥ó´ØÏ¢
set laststatus=2
set statusline=%<%F\ %r%h%w%y%{'['.(&fenc!=''?&fenc:&enc).']['.&ff.']'}%=%4v(ASCII=%03.3b,HEX=%02.2B)\ %l/%L(%P)%m
" ¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°´ØÏ¢
set ffs=unix,dos,mac " ²þ¹Ôʸ»ú
" ʸ»ú¥³¡¼¥É¤Î¼«Æ°Ç§¼±
" ŬÅö¤Êʸ»ú¥³¡¼¥ÉȽÊÌ
set termencoding=utf-8
set encoding=utf-8
set fileencodings=iso-2022-jp,utf-8,cp932,euc-jp
" ¸·Ì©¤Êʸ»ú¥³¡¼¥ÉȽÊÌ
" http://www.kawaz.jp/pukiwiki/?vim#content_1_7
" http://d.hatena.ne.jp/hazy-moon/20061229/1167407073
" if &encoding !=# 'utf-8'
" set encoding=japan
" set fileencoding=japan
" endif
" if has('iconv')
" let s:enc_euc = 'euc-jp'
" let s:enc_jis = 'iso-2022-jp'
" iconv¤¬eucJP-ms¤ËÂбþ¤·¤Æ¤¤¤ë¤«¤ò¥Á¥§¥Ã¥¯
" if iconv("?x87?x64?x87?x6a", 'cp932', 'eucjp-ms') ==# "?xad?xc5?xad?xcb"
" let s:enc_euc = 'eucjp-ms'
" let s:enc_jis = 'iso-2022-jp-3'
" iconv¤¬JISX0213¤ËÂбþ¤·¤Æ¤¤¤ë¤«¤ò¥Á¥§¥Ã¥¯
" elseif iconv("?x87?x64?x87?x6a", 'cp932', 'euc-jisx0213') ==# "?xad?xc5?xad?xcb"
" let s:enc_euc = 'euc-jisx0213'
" let s:enc_jis = 'iso-2022-jp-3'
" endif
" fileencodings¤ò¹½ÃÛ
" if &encoding ==# 'utf-8'
" let s:fileencodings_default = &fileencodings
" let &fileencodings = s:enc_jis .','. s:enc_euc .',cp932'
" let &fileencodings = &fileencodings .','. s:fileencodings_default
" unlet s:fileencodings_default
" else
" let &fileencodings = &fileencodings .','. s:enc_jis
" set fileencodings+=utf-8,ucs-2le,ucs-2
" if &encoding =~# '^?(euc-jp?|euc-jisx0213?|eucjp-ms?)$'
" set fileencodings+=cp932
" set fileencodings-=euc-jp
" set fileencodings-=euc-jisx0213
" set fileencodings-=eucjp-ms
" let &encoding = s:enc_euc
" let &fileencoding = s:enc_euc
" else
" let &fileencodings = &fileencodings .','. s:enc_euc
" endif
" endif
" Äê¿ô¤ò½èʬ
" unlet s:enc_euc
" unlet s:enc_jis
" endif
" UTF-8¤Î¢¢¤ä¡û¤Ç¥«¡¼¥½¥ë°ÌÃÖ¤¬¤º¤ì¤Ê¤¤¤è¤¦¤Ë¤¹¤ë
" Terminal.app¤Ï¤É¤Ã¤Á¤Ë¤·¤Æ¤â¥À¥á¡¤PrivatePorts¤ÎiTerm¤Ç¤ä¤ë
set ambiwidth=double
" ¥Õ¥¡¥¤¥ë¥¿¥¤¥×´ØÏ¢
" »ÈÍѤǤ¤ë¿§¤Ï
" :edit $VIMRUNTIME/syntax/colortest.vim
" :source %
" ¤Ç¡¢ÀßÄê̾¤È¸½ºß¤Î¿§¤Ï
" :highlight
syntax on " ¥·¥ó¥¿¥Ã¥¯¥¹¥«¥é¡¼¥ê¥ó¥°¥ª¥ó
" ¤Ê¤¼¤«Æ°¤«¤Ê¤¤
" highlight ZenkakuSpace ctermbg=6 guibg=white
" match ZenkakuSpace /\s\+$\|¡¡/
set complete+=k " Êä´°¤Ë¼½ñ¥Õ¥¡¥¤¥ëÄɲÃ
filetype indent on " ¥Õ¥¡¥¤¥ë¥¿¥¤¥×¤Ë¤è¤ë¥¤¥ó¥Ç¥ó¥È¤ò¹Ô¤¦
filetype plugin on " ¥Õ¥¡¥¤¥ë¥¿¥¤¥×¤´¤È¤Î¥×¥é¥°¥¤¥ó¤ò»È¤¦
" OmniÊä´°´ØÏ¢
" $VIMRUNTIME/autoload/htmlcomplete.vim¤Î645¹ÔÌܤò¥³¥á¥ó¥È¥¢¥¦¥ó¥È¤·¤Æ¤ª¤¯¤Èhtml¤ÎÊä´°¤¬¾®Ê¸»ú¤Ë¤Ê¤ë
set completeopt=menu,preview,menuone " Ê䴰ɽ¼¨ÀßÄê
" Tab¤ÇOmniÊä´°µÚ¤Ó¥Ý¥Ã¥×¥¢¥Ã¥×¥á¥Ë¥å¡¼¤ÎÁªÂò
function InsertTabWrapper(is_shift)
if pumvisible()
return a:is_shift ? "\<C-p>" : "\<C-n>"
endif
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k\|<\|/' " html¤ÇÊä´°¤Ç¤¤ë¤è¤¦¤Ë<,/¤Ç¤âOmniÊä´°
return "\<tab>"
elseif exists('&omnifunc') && &omnifunc == ''
return a:is_shift ? "\<C-p>" : "\<C-n>"
else
return "\<C-x>\<C-o>"
endif
endfunction
inoremap <tab> <C-r>=InsertTabWrapper(0)<CR>
" Shift-Tab¤Ï¤¦¤Þ¤¯¤¤¤«¤Ê¤¤¤è¤¦¤À
" inoremap <S-tab> <C-r>=InsertTabWrapper(1)<CR>
" CR¤ÇOmni³ÎÄê&²þ¹Ô
function InsertCrWrapper()
return pumvisible() ? "\<C-y>\<CR>" : "\<CR>"
endfunction
inoremap <CR> <C-r>=InsertCrWrapper()<CR>
" ¥Ý¥Ã¥×¥¢¥Ã¥×¥á¥Ë¥å¡¼¤Î¿§ÊѤ¨¤ë
highlight Pmenu ctermbg=lightcyan ctermfg=black
highlight PmenuSel ctermbg=blue ctermfg=black
highlight PmenuSbar ctermbg=darkgray
highlight PmenuThumb ctermbg=lightgray
" ¥Ð¥¤¥Ê¥ê¥â¡¼¥É
" bvi¤È¤«HexEditor.app¤ÎÊý¤¬³Ú
" vim -b : edit binary using xxd-format!
" augroup BinaryXXD
" autocmd!
" autocmd BufReadPre *.bin,*.swf 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
" Migemo
if has('migemo')
set migemo
set migemodict=/opt/local/share/migemo/utf-8/migemo-dict
endif
" Kaoriya
if has('kaoriya')
" im¤ò̵¸ú¤Ë¤¹¤ë
set iminsert=0
set imsearch=0
endif
" ==================== ¥¡¼¥Þ¥Ã¥× ==================== "
" ɽ¼¨¹Ôñ°Ì¤Ç°Üư
noremap j gj
noremap k gk
vnoremap j gj
vnoremap k gk
" ¥Ï¥¤¥é¥¤¥È¾Ã¤¹
nmap <silent> gh :nohlsearch<CR>
" ¥³¥Ô¥Ú
" Mac¤Î¾ì¹ç¤ÏÉáÄ̤ËComamnd-C¡¤Command-V¤â»È¤¨¤¿¤ê¤¹¤ë
if has('mac')
map <silent> gy :call YankPB()<CR>
function! YankPB()
let tmp = tempname()
call writefile(getline(a:firstline, a:lastline), tmp, 'b')
silent exec ":!cat " . tmp . " | iconv -f utf-8 -t shift-jis | pbcopy"
endfunction
endif
if has('win32')
noremap gy "+y
" ¥Ú¡¼¥¹¥È¤¬¤¦¤Þ¤¯Æ°¤¤¤Æ¤Ê¤¤
noremap gp "+p
endif
" ¥Þ¥¦¥¹Áàºî¤ò͸ú¤Ë¤¹¤ë
" iTerm¤Î¤ß¡¤Terminal.app¤Ç¤Ï̵¸ú
if has('mac')
set mouse=a
set ttymouse=xterm2
endif
" ==================== ¥×¥é¥°¥¤¥ó¤ÎÀßÄê ==================== "
" Rails
autocmd FileType ruby,eruby,yaml set softtabstop=2 shiftwidth=2 tabstop=2
autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1
let g:rails_level = 4
" CakePHP
au BufNewFile,BufRead *.thtml setfiletype php
au BufNewFile,BufRead *.ctp setfiletype php
" .vimperatorrc
au BufNewFile,BufRead .vimperatorrc,_vimperatorrc setfiletype vimperator
" Lusty Explorer
" nmap <unique> <silent> <C-b> :BufferExplorer<CR>
" nmap <unique> <silent> <C-e> :FilesystemExplorer<CR>
" NERD_comments
let NERDSpaceDelims = 1
let NERDShutUp = 1
" NERD_tree
nmap <unique> <silent> <C-e> :NERDTreeToggle<CR>
" Fuzzy
nmap <unique> <silent> <C-b> :FuzzyFinderBuffer<CR>
nmap <unique> <silent> <C-f> :FuzzyFinderFile<CR>
nmap <unique> <silent> <Leader>m :FuzzyFinderMruFile<CR>
nmap <unique> <silent> <Leader>c :FuzzyFinderMruCmd<CR>
nmap <unique> <silent> <Leader>d :FuzzyFinderDir<CR>
" AutoComplete
" 330¹ÔÌܤ館¤ó¤ò½¤Àµ¤·¤Æ¤¢¤ë
let g:AutoComplPop_IgnoreCaseOption = 0
let g:AutoComplPop_CompleteoptPreview = 1
" Project
" let g:proj_flags = "imstg"
" let g:proj_window_width = 30
" nmap <silent> <Leader>p <Plug>ToggleProject
" surround
autocmd FileType php let b:surround_45 = "<?php \r ?>"
" php-doc
autocmd FileType php inoremap <C-p> <ESC>:call PhpDocSingle()<CR>i
autocmd FileType php nnoremap <C-p> :call PhpDocSingle()<CR>
autocmd FileType php vnoremap <C-p> :call PhpDocRange()<CR>
let g:pdv_cfg_Type = "string"
let g:pdv_cfg_Package = ""
let g:pdv_cfg_Version = ""
let g:pdv_cfg_Author = "tsukkee <takayuki0510@gmail.com>"
let g:pdv_cfg_Copyright = ""
let g:pdv_cfg_License = ""
" Firefox¥ê¥í¡¼¥É
" Í×MozRepl
function ReloadFirefox()
if has('ruby')
:ruby <<EOF
require "net/telnet"
telnet = Net::Telnet.new({
"Host" => "localhost",
"Port" => 4242
})
telnet.puts("content.location.reload(true)")
telnet.close
EOF
endif
endfunction
nmap <silent> <Leader>r :call ReloadFirefox()<CR>
" vimsh
nmap <silent> <Leader>s :so ~/.vim/vimsh/vimsh.vim<CR>
" visual studio
if has('win32')
let g:visual_studio_python_exe = "C:/Python25/python.exe"
endif
.gvimrc
" ==================== ¥Õ¥©¥ó¥ÈÀßÄê ==================== "
" ÉáÄ̤ÎMacÈÇGVim
if has('gui_mac')
set guifont=Osaka-Mono:h14
" set guifontwide=Osaka-Mono:h14
" set guifont=Yutapon_coding_Regular:h14:cUTF-8
endif
" ¼Â¸³ÈÇMacVim
if has('gui_macvim')
set showtabline=2
endif
" WindowsÈÇGVim
if has('win32')
set guifont=M+2VM+IPAG_circle:h10:cSHIFTJIS
" set guifont=¤æ¤¿¤Ý¤ó¡Ê¥³¡¼¥Ç¥£¥ó¥°¡ËHeavy:h11:cSHIFTJIS
endif
" ==================== ²èÌÌɽ¼¨ÀßÄê ==================== "
set title " ¥¿¥¤¥È¥ëɽ¼¨
set linespace=4 " ¹Ô´Ö
set columns=110 " Éý
set lines=30 " ¹â¤µ
if has('mac')
set guioptions+=aeT
endif
set transparency=240
" ¥Ý¥Ã¥×¥¢¥Ã¥×¥á¥Ë¥å¡¼¤Î¿§ÊѤ¨¤ë
highlight Pmenu guibg=#3333ff guifg=#000000
highlight PmenuSel guibg=#0000dd guifg=#000000
highlight PmenuSbar guibg=#333333
highlight PmenuThumb guibg=#aaaaaa
2007/11/21 03:15 | Vim | ¥È¥é¥Ã¥¯¥Ð¥Ã¥¯(0) | ¥³¥á¥ó¥È(0)
¥³¥á¥ó¥È¤ÎÅê¹Æ
¥È¥é¥Ã¥¯¥Ð¥Ã¥¯
¥È¥é¥Ã¥¯¥Ð¥Ã¥¯URL
¢ªhttp://relaxedcolumn.blog8.fc2.com/tb.php/101-18c51dce
¥³¥á¥ó¥È