2006年5月17日水曜日

はてな技術勉強会 .vimrc 説明補足 [vim]


 vim  .vimrc 
secondlife/.vimrc



 .vimrc 
" タブ幅の設定
set expandtab
set tabstop=2
set softtabstop=2
set shiftwidth=2
vim 

expandtab  tabstop, softtabstop, shiftwidth 2 vim   KoRoN 

2ch Vim6 Part3 94 :

'tabstop''shiftwidth''softtabstop'3'softtabstop'vimcindentautoindent'shiftwidth'

'tabstop' ('ts')
<Tab>(9)便

'shiftwidth' ( 'sw')
vim('cindent')(>><<︶で挿入/削除されるインデントの幅を、画面上の見た目で何文字分であるか指定します。自動的に挿入される量、と覚えておくと良いです。

'softtabstop' ('sts')
<Tab>'softtabstop'0'ts'4<Tab>1'softtabstop''softtabstop'0'ts'

vim<Tab>'ts'Tab('expandtab')

Tab48
:set ts=4 sw=4 sts=0

:set ts=8 sw=4 sts=4




 vim  tips 


 highlight 
command! -nargs=0 GetHighlightingGroup echo 'hi<' . synIDattr(synID(line('.'),col('.'),1),'name') . '> trans<' . synIDattr(synID(line('.'),col('.'),0),'name') . '> lo<' . synIDattr(synIDtrans(synID(line('.'),col('.'),1)),'name') . '>'
 colorscheme 便


runtimepath/macro  plugin 
command! -nargs=0 Macros :call <sid>Macros()
function! s:Macros()
  let bakz  = @z
  let baksb = &sb
  let @z=globpath(&rtp, 'macros/*.vim')
  set   splitbelow
  new
  exec "normal! i\<c-r>=@z\<Enter>\<Esc>gg"
  let @z=bakz
  if baksb==0
    set nosb
  endif
  setlocal   buftype=nofile
  setlocal nobuflisted
  setlocal   bufhidden=delete
  setlocal nomodifiable
  nnoremap <buffer> <silent> <cr>  :let f=getline('.')<bar>close<bar>exec 'source ' . f<cr>
  nnoremap <buffer> <silent> <esc> :close<cr>
endfunction
Plugin 
 plugin  $HOME/.vim/macros  :Macros 



nnoremap <silent> ,ha :HighlightCurrentLine Search<cr>
nnoremap <silent> ,hb :HighlightCurrentLine DiffAdd<cr>
nnoremap <silent> ,hc :HighlightCurrentLine Error<cr>
command! -nargs=1 HighlightCurrentLine execute 'match <args> /<bslash>%'.line('.').'l/'

nnoremap <silent> ,H :UnHighlightCurrentLine<cr>
command! -nargs=0 UnHighlightCurrentLine match
使


稿


0 コメント: