Mercurial > hg > Members > kent > dotfiles
view vimrc @ 0:6d5c73fe5744
Go over to mercurial from CVS.
author | kent <kent@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 15 Nov 2008 00:32:22 +0900 |
parents | |
children | 8812f32e6124 |
line wrap: on
line source
""vim6.x用の設定ファイル ""jvim3.xは .jvimrcを参照 " 1で改行を超えて削除可能、2で元からある字も削除可能 set backspace=2 " 括弧入力時の対応する括弧を表示 set showmatch " ステータスラインを常に表示 set laststatus=2 " 長い行を折り返さない set nowrap " 新しいファイルを開いたとき、前のバッファを保存しなくても開ける。 set hid " インクリメンタルサーチ set incsearch " 現在実行中のcommandを表示 set showcmd " 現在のモードを表示 set showmode " ステータスバーにrow,column表示 set ruler " 行番号表示 set nonumber " 検索文字列をハイライト set hlsearch " コマンドで行を越える " <BS>,<SPACE>,h,l,←,→,~,←,→(insert) set whichwrap=b,s,h,l,<,>,~,[,] " マルチバイト文字なら自動改行を空白に関係なく行う set formatoptions+=mB " OSX用 C&P map <F2> :.w !pbcopy<CR><CR> map <F3> :r !pbpaste<CR> "文字コード """vimが内部で使用する文字コード """(編集中に変えてはいけない!起動時にのみ変更すること!) """utf-8にするべき。そうすれば文字コード変換しても情報は失われない set encoding=utf-8 """ """ターミナル及びキーボードに使われる文字コード set termencoding=utf-8 """ """ファイル読み書き時の文字コード set fileencoding=utf-8 """ """ファイルを読み込むときに試す文字コード """順番に読み、成功したものがfileencodingに設定される。 """なければfileencodingは空になり、encodingがそのまま使われる。 set fileencodings=utf-8,iso-2022-jp,sjis,euc-jp,cp932,utf-8 """ファイルを開くときにエンコードを指定する方法 "" :e ++enc=utf-8 [filename] #省略したら開いてるファイルを開き直す "改行コード """ファイル読み書き時に使われる改行コード set fileformat=unix """ファイル読み込み時に試す改行コード、info参照。下手に変えない方が良い? """新しいファイルを作成したときは最初のコードが使われる set fileformats=unix,mac,dos " タブ文字の見かけの幅 set tabstop=8 " autoindentや'>'のインデント幅(tab幅はかわらない) set shiftwidth=4 " TABを入力した時のインデント幅(8以下ならSpaceが入る) "set softtabstop " 改行時にオートでインデントを行う set autoindent """noautoindent " C言語に特化したオートインデント set nocindent """cindent " タブの変わりにスペースを使用する "set expandtab """noexpandtab set noexpandtab autocmd BufReadPost *.cbc set filetype=cbc "map " C-b でバック "map D " C-f でフォワード "map C """ステータスバー表示 set statusline=%<%f\ %m%r%h%w%{'['.(&fenc!=''?&fenc:&enc).']['.&ff.']'}%=%l,%c%V%8P " バックグラウンドがどちらかを知らせる "set background={dark,light} """カラー表示オフ syntax on """カラースキーマの指定 """/usr/share/vim/vim62/colors/* """~/.vim/colors/* """内のスクリプト名を指定 "colorscheme zellner colorscheme desert """GLOBAL設定 """/usr/local/share/vim/vim70/plugin/にgtags.vimをいれる """ "map <C-]> :Gtags<CR> map <C-]> :GtagsCursor<CR> "map <C-n> :cn<CR> "map <C-p> :cp<CR> """ vim-latex " REQUIRED. This makes vim invoke latex-suite when you open a tex file. filetype plugin on " IMPORTANT: win32 users will need to have 'shellslash' set so that latex " can be called correctly. "set shellslash " IMPORTANT: grep will sometimes skip displaying the file name if you " search in a singe file. This will confuse latex-suite. Set your grep " program to alway generate a file-name. set grepprg=grep\ -nH\ $* " OPTIONAL: This enables automatic indentation as you type. filetype indent on " when open empty file named *.tex let g:tex_flavor = "latex" """ vim-latex end """ VIM commands " " **FOLDING** " zf :fold some lines. " zfap : fold a paragraph. " zf2j : fold two lines under cursor. " zo :open the folded lines. " zc :re-fold (close). " zr :reduce the fold level. zR: reduce all. " zm :increase fold level. zM: fold all. " :set foldmethod :syntax, indent, ... " :set foldcolumn : show folding state in left of window. " " **WINDOWING**" CTRL-W s (split [file]) : separate window horizontaly. " CTRL-W v (vsplit [file]) : separate window verticaly. " CTRL-W c : close current window. " CTRL-W CTRL-W :move cursor to next window. " CTRL-W {hjkl} :move cursor to [lbtr]. " CTRL-W {+-} :{in,de}crease window space. " CTRL-W = :set window space equality. " CTRL-W {HJKL} :move `window' to the far [lbtr] " " " **MOVING COMMAND** " w :move to the start of the next word. " e :move to the end of the next word. " b :move to the start of the previous word. " ge :move to the end of the next word. " " ^ :move to the first non-blank character. " 0 :move to the very first character. " $ :move to the end of a line " " fx :move to the first find 'x' character. " Fx :search toward left. " tx :move to before one, the first find 'x' character. " Tx :search toward left. " ; :repeat f,F,t,T " , :reverse repeat f,F,t,T " " % :move to the matching parentisis. " n% :move to the line on n-% of a file. " " G :move to the end of a file. " gg :move to the start of a file. " ngg | nG :move to the n-th line. " " H :move to first line of the window. " M :move to the line on half window. " L :move to final line of the window. " " CTRL-F :scroll up the window. " CTRL-B :scroll down the window. " CTRL-U :scroll up the window half. " CTRL-D :scroll down the window half. " CTRL-Y :scroll up the window by one line. " CTRL-E :scroll down the window by one line. " " zz :SCROLl the window until the cursor is center of the window. " zt :scroll the window until the cursor is top of the window. " zb :scroll the window until the cursor is bottom of the window. " " /string :search 'string' " ?string :search 'string' toward left. " * :search string under the cursor. " # :search string under the cursor toward left. " n :repeat / or ?. " N :reverse repeat / or ?. " " CTRL-O :move to before jump position. " CTRL-I :back to the position before CTRL-O. " '' | `` :CTRL-O and CTRL-I. " " " **EDITTING COMMAND** " i :start insert-mode on the cursor. " I :start insert-mode on the start of the line. " a :start insert-mode on the next character of one cursor pointing. " A :start insert-mode on the end of the line. " " d[c] :delete from current location to the place where the cursor move to. " [c] is moving command. " c[c] :delete as like d comamnd and start insert-mode. " " x : dl " X : dh " D : d$ " C : c$ " s : cl " S : cc " r[x] : replace a character under the cursor with [x] " R :replace mode " " . :repeats the last change command except for UNDO, REDO and :-COMMAND. " " p :places the text below or after the cursor. " P :places the text abobe or before the cursor. " y :yank text (similar d) " " ~ :change case of the character under the cursor, and move the cursor to next character. " " " " **VISUAL MODE** " v or V or CTRL-V start visual mode. " v : delete from the place that mode started to place where press d key. " V : delete lines that is selected. " CTRL-V : delete rectangular block " " d :delete from the place where visual-mode started to current position. " o | O :switch cursor with the place where visual mode started. " " " **TEXT OBJECT** " aw :A word. " as :A sentence. " iw :Inner word. " is :Inner sentence. " "