ãã¯ã2ã¶æéã§å¦ãã Vimã®ã¾ã¨ã
ç¶ç·¨æ¸ãã¾ãã ボクが1年間で学んだVimのまとめ - ゆず日記
å¹´æ«ã«ä¼ç¤¾ã®éçºç°å¢ãæãåã£ã¦WindowsããLinux Mint(Ubuntu)ã«æãã¦æ©2ã¶æã
ä½µãã¦æ¬æ°ã§Vimã使ãè¾¼ãã§ã¿ããã¨ãã¡ã¤ã³ã¨ãã£ã¿ãAptana StudioããVimã¸ã
ã¤ã³ã¹ãã¼ã«
- Macãªããmacvim-kaoriya - MacVim KaoriYa - Google Project Hosting
- Ubuntuãªããsudo apt-get install vim-gnome
- WindowsãªããVim — KaoriYa
åºæ¬çãªæä½
ããã¯å
人ãæ°å¤ãå±
ãã®ã§å²æã
ãããé常ã«åãæãã§ããVim 基本操作まとめ - Archiva
å人çãªææã¨ãã¦ã以ä¸ã®ã³ãã³ããè¦ãã¦ããã°ä»ã®ã¨ãã£ã¿ã§åºæ¥ããã¨ã¨åçã®ãã¨ã¯ããåºæ¥ãããã«ãªããã¨ã
ä»ã®ã¨ãã£ã¿ã¨æ¯è¼ãã¦æ°ãã¤ããã¹ããã¨ã¨ãã¦ã¯ãddããxããã®åé¤ç³»ã®ã³ãã³ãã§ããããã¡ã«ã³ãã¼ããããã¨ãé »ç¹ã«å¼ã³åºãããã¨æããã®ã¯"ayyã"b5yyãªã©ã§ã©ãã«("ã®æ¬¡ã®æå)ãä»ãããããã¡ã«æ ¼ç´ãã¦ç½®ãããã«ã
移åé¢é£
hjkl | 移å |
---|---|
c-u,c-d,c-f,c-b | ãã¼ã¸åä½ç§»å |
w,b,e,0,$ | åèªæ¯ãã¾ãã¯è¡é ãè¡æ«ã®ç§»å |
1G, 100G,G | 1è¡ç®ã 100è¡ç®ãæçµè¡ã¸ç§»å |
ã³ããé¢é£
yy | è¡ããããã¡ã«ã³ãã¼ |
---|---|
5yy | 5è¡ãã³ãã¼ |
"a5yy | 5è¡ãaã¨ãããããã¡ã«ã³ãã¼ |
p | ãããã¡ã®å 容ããã¼ã¹ã |
10p | ãããã¡ã®å 容ã10åãã¼ã¹ã |
"ap | aã¨ãããããã¡ã«æ ¼ç´ãããå 容ããã¼ã¹ã |
dd | è¡ãåé¤(ãããã¡ã«æ ¼ç´) |
dw | 1åèªåé¤(ãããã¡ã«æ ¼ç´) |
x | 1æååé¤(ãããã¡ã«æ ¼ç´) |
ã¢ã¼ãåãæ¿ãé¢é£
i | æ¿å ¥ã¢ã¼ã㸠|
---|---|
cw | ãã©ã¼ã«ã¹ããã¦ããåèªãåé¤ãã¦æ¿å ¥ã¢ã¼ã㸠|
r | 1æåã ãç½®æã¢ã¼ãã¸ãå ¥åå¾èªåã§ãã¼ãã«ã¢ã¼ãã¸æ»ã |
Esc | ãã¼ãã«ã¢ã¼ãã¸æ»ã |
æ¤ç´¢é¢é£
/æåå | æååãæ¤ç´¢ |
---|---|
n, N | 次ã®æååããã©ã¼ã«ã¹ãåã®æååããã©ã¼ã«ã¹ |
:%s/æ¤ç´¢æåå/ç½®ææåå/g | ãã¡ã¤ã«å ã®æ¤ç´¢æååãç½®ææååã¸å¤æ |
:%s//ç½®ææåå/g | ååæ¤ç´¢ããæååãç½®ææååã¸ç½®æ |
ä¿åé¢é£
:w | ä¿å |
---|---|
:w filename | filenameã«ä¿å |
:q | çµäº |
:q! | ç¾å¨ã®å¤æ´ãç ´æ£ãã¦çµäº |
大ä½ä¸è¨ã®ã³ãã³ãããè¦ãã¦ç½®ãã°ä½ã¨ããªããã¨ã
ç¹ã«ãã5è¡ã³ãã¼ãã¦10åãã¼ã¹ã(5yy10p)ããªã©ã®å¦çã¯ä»ã®ã¨ãã£ã¿ã§ã¯ã¾ãåºæ¥ãªãã®ã§ãæ
£ããã°Vimã®è¯ããå®æã§ããã¨æãã¾ãã
ãã¡ãããä»ã«ãã¾ã ã¾ã ã³ãã³ãã¯æ²¢å±±ããã®ã§ããããããã¹ã¿ã¼ããã°ããã«ãããããªä½æ¥ããæ軽ã«å®è¡ã§ãã¾ãã
以ä¸ã¯ç¥ã£ã¦ãããªã便å©ã¨ããã³ãã³ãã
ç»é¢åå²é¢é£
:e filename | ç¾å¨ã®ãããã¡ã«æ°ãããã¡ã¤ã«ã表示 |
---|---|
:e # | ç¾å¨ã®ãããã¡ã«ä¸ã¤åã«éãã¦ãããã¡ã¤ã«ã表示 |
:vsp filename | 縦ã«åå²ãã¦æ°ãããã¡ã¤ã«ã表示 |
:sp filename | 横ã«åå²ãã¦æ°ãããã¡ã¤ã«ã表示 |
c-w c-w | å¥ã®ãããã¡ã¸ç§»å |
c-w 10>[<,+,-] | ç¾å¨ã®ãããã¡ãå³[å·¦, ä¸, ä¸]ã«10è¡(æå)æ¡å¼µ |
:q | ç¾å¨ã®ãããã¡ãéãã |
ãªããfilenameãçç¥ããã¨ç¾å¨ã®ãã¡ã¤ã«ãåå²ããããããã¡ã«ãå±éãã¾ãã
ã·ã§ã«ã³ãã³ãå®è¡
:! ï¼ã·ã§ã«ã³ãã³ãï¼ | ã·ã§ã«ã³ãã³ããå®è¡ããã |
---|
(:!以éã®ã³ãã³ãããã·ã§ã«ã³ãã³ãã¨ãã¦å¦çåºæ¥ãã)
vimgrep
vimã«ã¯æ¨æºã§grepæ©è½ãä»ãã¦ãã¾ãã
:vim ï¼æ¤ç´¢æååï¼ *.js | cwin | ãã©ã«ãå ã®ãjsãã¡ã¤ã«ã®ä¸ããæ¤ç´¢æååãå«ãè¡ãgrep |
---|---|
:vim ï¼æ¤ç´¢æååï¼ **/*.js | cwin | ãµããã©ã«ããå«ãããjsãã¡ã¤ã«ã®ä¸ããæ¤ç´¢æååãå«ãè¡ãgrep |
詳ããã³ãã¯ãã¡ãVimでGrepする覚え書き 1/2 「内部grep」編 - ナレッジエース
vimdiffã§æ¯è¼
Windowsã«ã¯WinMerge 日本語版ã¨ãã便å©ãªdiff & mergeãã¼ã«ããããã©ãLinuxã«ã¯ããã¾ã§GUIã«ç¹åãããã¼ã«ã¯ããã¾ããã
ããã©ãå®ã¯Vimã«ãvimdiffã¨ããæ¯è¼æ¹æ³ããã£ã¦ã
vimdiff filename1 filename2
ã§æ¯è¼ãåºæ¥ã¾ãã
ãã¡ã¤ã«ãéãã¦ããæä¸ããå®è¡ããã®ã§ããã°ã
:vertical diffsplit filename
ã§æ¯è¼éå§ã
æ¯è¼ããã¨ããããªæããå·®åãèªåçã«è²åãããã¦è¡¨ç¤ºããã¾ãã
å·®åã®ã³ãã¼ãåãè¾¼ã¿ã¯ã以ä¸ã®ã³ãã³ãã§ã
do | ä»ã®ãããã¡ãããç¾å¨ã®ãããã¡ã«ã³ãã¼ |
---|---|
dp | ç¾å¨ã®ãããã¡ãããä»ã®ãããã¡ã«ã³ãã¼ |
ãã¡ããã5yyãªã©ã§ãããã¡ã«ã³ãã¼ããå¾ã«ãc-w,c-wã§å¥ã®ãããã¡ã«ç§»åãã¦pã§5è¡æ¿å ¥ãªãã¦ã®ãå¯è½ã§ãã
ãªããè¡ã¬ãã«ã®å¤æ´ã¯èªååæ ããã¾ãããåèªã¬ãã«ã®å¤æ´ã¯èªååæ ããã¾ããã
ãã®å ´åãæåã§å·®åæ
å ±ã®æ´æ°ãããå¿
è¦ãããã¾ãã®ã§ã
:diffu ã¾ã㯠:diffupdate
ãå®è¡ãã¾ãã
vimdiff filename1 filename2 filename3 gvimdiff filename1 filename2
å¿ç¨ã¨ãã¦ã3ã¤ã®ãã¡ã¤ã«ã®æ¯è¼ããgvimã§ã®diffãå¯è½ã
3ã¤ã®ãã¡ã¤ã«ã®æ¯è¼æã®ç»å
詳ããã¯ããVim documentation: diff: http://www.ac.cyberhome.ne.jp/~yakahaira/vimdoc/diff.html ãã§ã
ã¾ããMacç°å¢ã§WinMergeç¸å½ã®æ¯è¼ãã¼ã«ã¨ããã°ãxcodeå
èµã®æ¯è¼ãã¼ã«ä½ããããã¾ããããvimdiffãããã°å種æåã³ã¼ãã«ãã ãããã«æ°è»½ã«æ¯è¼ãåºæ¥ãã®ã§Macã¦ã¼ã¶ã«ããªã¹ã¹ã¡ã§ãã
VimãgVimã©ã¡ãã使ãã¹ãï¼
ã¿ã¼ããã«ä¸ã§åä½ããVimã¨ã°ã©ãã£ã«ã«ã«åä½ããgVimã両è
ã®æ¯è¼ãããã¨ã
Vim
- ã¿ã¼ããã«ä¸ã§å¼ã³åºãã
- ã¬ã³ããªã³ã°ãé ã
- ã·ã§ã«ã³ãã³ãã®å®è¡ãéã
- âãâ¡ã綺éºã«è¡¨ç¤ºãããªããã¾ãã¯æ£ããæåæ°ãã«ã¦ã³ããããªãã
- ã¿ã¼ããã«ã¨ã¯å¥ã«å¼ã³åºããã
- ã¬ã³ããªã³ã°ãéã
- ã·ã§ã«ã³ãã³ãã®å®è¡ãé ã
- âãâ¡ã綺éºã«è¡¨ç¤ºããããæåæ°ãæ£ããã«ã¦ã³ããããã
ä¸é·ä¸çã ã¨ã¯æãã®ã§ãããèªåã¯ä»ã¾ã§ä½ã¨ãªãVimã1ã¶æ以ä¸ä½¿ã£ã¦ããããã©ãã¬ã³ããªã³ã°å¦çã®å¤ããã©ã°ã¤ã³ã使ç¨ãããã¨ãããgVimã¸ç§»è¡ã
軽ãä½æ¥ããã·ã§ã«ã³ãã³ããå¤æ§ããç·¨éã®éã«ã®ã¿Vimã使ç¨ããã¨ããã¹ã¿ã³ã¹ã¸ãªãã¾ããã
ç¹ã«ãå¾è¿°ã®neocomplcacheãã©ã°ã¤ã³ã®åä½ãVimã¨gVimã§ã¯æããã«åä½é度ãç°ãªãgVimã®æ¹ãéãã§ãã
.vimrc
ããã辺ããæ¬çªã
.vimrcã§åæè¨å®ã®å¤æ´ãåºæ¥ã¾ãã以ä¸ã¯èªåã®.vimrcã
" Common ------------------------------- set nocompatible " vim colorscheme metroid " ã«ã©ã¼ã¹ãã¼ã ã®è¨å® set background=light " èæ¯è²ã®å¾å(ã«ã©ã¼ã¹ãã¼ã ãããã«ä½µãã¦è²ã®ææãå¤ãã¦ããã) " File --------------------------------- set autoread " æ´æ°æèªååèªè¾¼ã¿ set hidden " ç·¨éä¸ã§ãä»ã®ãã¡ã¤ã«ãéããããã«ãã set noswapfile " ã¹ã¯ãããã¡ã¤ã«ãä½ããªã set nobackup " ããã¯ã¢ãããåããªã autocmd BufWritePre * :%s/\s\+$//ge " ä¿åæã«è¡æ«ã®ç©ºç½ãé¤å»ãã syntax on " ã·ã³ã¿ãã¯ã¹ã«ã©ã¼ãªã³ã°ãªã³ " Indent ------------------------------- " tabstop: Tabæåãç»é¢ä¸ã§ä½æååã«å±éããã " shiftwidth: cindentãautoindentæã«æ¿å ¥ãããã¤ã³ãã³ãã®å¹ " softtabstop: Tabãã¼æ¼ãä¸ãæã®æ¿å ¥ããã空ç½ã®éï¼0ã®å ´åã¯tabstopã¨åãï¼BSã«ãå½±é¿ãã set tabstop=4 shiftwidth=4 softtabstop=0 set autoindent smartindent " èªåã¤ã³ãã³ãï¼ã¹ãã¼ãã¤ã³ãã³ã " Assist imputting --------------------- set backspace=indent,eol,start " ããã¯ã¹ãã¼ã¹ã§ç¹æ®è¨å·ãåé¤å¯è½ã« set formatoptions=lmoq " æ´å½¢ãªãã·ã§ã³ï¼ãã«ããã¤ãç³»ã追å set whichwrap=b,s,h,s,<,>,[,] " ã«ã¼ã½ã«ãè¡é ãè¡æ«ã§æ¢ã¾ããªãããã«ãã "set clipboard=unnamed,autoselect " ãããã¡ã«ã¯ãªãããã¼ããå©ç¨ãã " Complement Command ------------------- set wildmenu " ã³ãã³ãè£å®ãå¼·å set wildmode=list:full " ãªã¹ã表示ï¼æé·ããã " Search ------------------------------- set wrapscan " æå¾ã¾ã§æ¤ç´¢ãããå é ã¸æ»ã set ignorecase " 大æåå°æåç¡è¦ set smartcase " 大æåã§ã¯ãããã大æåå°æåç¡è¦ããªã set incsearch " ã¤ã³ã¯ãªã¡ã³ã¿ã«ãµã¼ã set hlsearch " æ¤ç´¢æåããã¤ã©ã¤ã " View --------------------------------- set showmatch " æ¬å¼§ã®å¯¾å¿ããã¤ã©ã¤ã set showcmd " å ¥åä¸ã®ã³ãã³ãã表示 set showmode " ç¾å¨ã®ã¢ã¼ãã表示 set number " è¡çªå·è¡¨ç¤º set nowrap " ç»é¢å¹ ã§æãè¿ããªã set list " ä¸å¯è¦æå表示 set listchars=tab:>\ " ä¸å¯è¦æåã®è¡¨ç¤ºæ¹æ³ set notitle " ã¿ã¤ãã«æ¸ãæããªã set scrolloff=5 " è¡éã set display=uhex " å°åä¸å¯è½æåã16é²æ°ã§è¡¨ç¤º hi ZenkakuSpace gui=underline guibg=DarkBlue cterm=underline ctermfg=LightBlue " å ¨è§ã¹ãã¼ã¹ã®å®ç¾© match ZenkakuSpace /ã/ " å ¨è§ã¹ãã¼ã¹ã®è²ãå¤æ´ set cursorline " ã«ã¼ã½ã«è¡ããã¤ã©ã¤ã augroup cch autocmd! cch autocmd WinLeave * set nocursorline autocmd WinEnter,BufRead * set cursorline augroup END :hi clear CursorLine :hi CursorLine gui=underline hi CursorLine ctermbg=black guibg=black " StatusLine --------------------------- set laststatus=2 " ã¹ãã¼ã¿ã¹ã©ã¤ã³ã2è¡ã« set statusline=%<%f\ #%n%m%r%h%w%{'['.(&fenc!=''?&fenc:&enc).']['.&ff.']'}%y%=%l,%c%V%8P " Charset, Line ending ----------------- set termencoding=utf-8 set encoding=utf-8 set fileencodings=utf-8,cp932,euc-jp,iso-2022-jp set ffs=unix,dos,mac " LF, CRLF, CR if exists('&ambiwidth') set ambiwidth=double " UTF-8ã®â¡ãâã§ã«ã¼ã½ã«ä½ç½®ããããªãããã«ãã endif " -------------------------------------- " my config " -------------------------------------- " When insert mode, enable hjkl and enable go to home/end. imap <c-o> <END> imap <c-a> <HOME> imap <c-h> <LEFT> imap <c-j> <DOWN> imap <c-k> <UP> imap <c-l> <Right> " When insert mode, change statusline. let g:hi_insert = 'hi StatusLine gui=None guifg=Black guibg=Yellow cterm=None ctermfg=Black ctermbg=Yellow' if has('syntax') augroup InsertHook autocmd! autocmd InsertEnter * call s:StatusLine('Enter') autocmd InsertLeave * call s:StatusLine('Leave') augroup END endif let s:slhlcmd = '' function! s:StatusLine(mode) if a:mode == 'Enter' silent! let s:slhlcmd = 'highlight ' . s:GetHighlight('StatusLine') silent exec g:hi_insert else highlight clear StatusLine silent exec s:slhlcmd endif endfunction function! s:GetHighlight(hi) redir => hl exec 'highlight '.a:hi redir END let hl = substitute(hl, '[\r\n]', '', 'g') let hl = substitute(hl, 'xxx', '', '') return hl endfunction " for Opera ---------------------------- " opera -remote \"openURL()\" function! s:ExecOpera() exe "! opera -remote \"openURL(%)\"" :endfunction command! Exec call <SID>ExecOpera() nmap <c-p> :call <SID>ExecOpera()<CR> " for Python --------------------------- filetype plugin on autocmd Filetype python setl autoindent autocmd FileType python setl smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class autocmd FileType python setl tabstop=4 shiftwidth=4 softtabstop=0 " Execute python script C-P function! s:ExecPy() exe "!" . &ft . " %" :endfunction command! Exec call <SID>ExecPy() autocmd FileType python map <silent> <c-p> :call <SID>ExecPy()<CR>
ã¡ãã£ã¨è§£èª¬ã
ä¸ã®æ¹ã®set ã ã¯åºæ¬çã«ã³ã¡ã³ãéãã
ãWhen insert mode, enable hjkl and enable go to home/endã ã¯ãæ¿å
¥ã¢ã¼ãã§ãåãã¼ã§ç§»åãåºæ¥ãããã«ããè¨å®ã
ãWhen insert mode, change statuslineãã¯ãæ¿å
¥ã¢ã¼ãæã¨é常ã¢ã¼ãæã®ã¹ãã¼ã¿ã¹ã©ã¤ã³ã®è²ãå¤æ´ããè¨å®ã
ãfor Operaãã¯ãç¾å¨éãã¦ãããã¡ã¤ã«ãOperaã§éãã¦ãããã³ãã³ãã®è¨å®ãhtmlãä½ã£ã¦ããæã«ä¾¿å©ã*1Opera's Command Line Options
ãfor Pythonãã¯ãç¾å¨éãã¦ãããã¡ã¤ã«ãPythonã§å®è¡ãã¦ãããã³ãã³ãã®è¨å®ãä»ã®è¨èªã§ãåæ§ã®ãã¨ãåºæ¥ã¾ãã
.gvimrc
gVimå°ç¨ã®è¨å®ã§ããåç°å¢ã§ãã£ã¹ãã¬ã¤ãµã¤ãºãé©ç¨å¯è½ãªè¨å®ãç°ãªãã¾ãã®ã§ãããã«å¿ãã¦è¨å®ãå¤æ´ãã¾ãã
colorscheme Metroid set background=dark if has('mac') set transparency=30 " opacity set guifont=Monaco:h14 " font set columns=150 " width set lines=200 " line else set guifont=Monaco\ 12 set columns=160 set lines=100 endif set mouse=a " ã©ã®ã¢ã¼ãã§ããã¦ã¹ãå©ç¨å¯è½ã« set nomousefocus " ãã¦ã¹ç§»åã«ãããã©ã¼ã«ã¹åãæ¿ããç¡å¹
ãã©ã°ã¤ã³
以ä¸ã®ãã©ã°ã¤ã³ãã¤ã³ã¹ãã¼ã«ããã¨ä½ãã¨ä¾¿å©ãªã®ã§ãä¸è¨ã®è¨å®ãé©ç¨ããå ´åã«ã¯ä»¥ä¸ãå ¥ãã¡ããã¾ãããã
- unite.vimãall in oneãªãã©ã°ã¤ã³ Shougo/unite.vim · GitHub, Unite vim
- neocomplcacheãincludeè£å®ãã¦ããããã©ã°ã¤ã³Shougo/neocomplcache.vim · GitHub, Ultimate completion environment with neocomplcache in vim
- NERDCommenterãç°¡åã«ã³ã¡ã³ãã¢ã¦ããã³ã¡ã³ãåºæ¥ããã©ã°ã¤ã³scrooloose/nerdcommenter · GitHub
- zen-codingãHTMLãæ軽ã«ä½æåºæ¥ããã©ã°ã¤ã³ Big Sky :: zen-codingの殆どの機能をzencoding.vimに取り込んだ。
ã¾ã£ããé¢ä¿ããã¾ããããShougoããã®ã¹ã©ã¤ãã«ã¯ä½ãã¨æ¹ããããã®ãããã¾ãã
ä¸è¨ã®ãã©ã°ã¤ã³ç¨ã®è¨å®ã.vimrcã«è¨å®ãã¾ããèªåã¯ãã£ãã®.vimrcã«ä»¥ä¸ã®è¨å®ã追å ãã¦ã¾ãã
" for Plugin --------------------------- " for zen-coding c-eã§zen-codingå®è¡ let g:user_zen_expandabbr_key = '<c-e>' " for NERDCommenterToggle c-oã§ã³ã¡ã³ãã¢ã¦ãã»ã³ã¡ã³ã let g:NERDCreateDefaultMappings = 0 let NERDSpaceDelims = 1 nmap <c-o> <Plug>NERDCommenterToggle vmap <c-o> <Plug>NERDCommenterToggle " for neocomplcache èªåè£å®ãæå¹ let g:neocomplcache_enable_at_startup = 1 " for unite.vim unite.vimã«åãã¹ã追å let g:unite_update_time = 1000 call unite#set_substitute_pattern('file', '\$\w\+', '\=eval(submatch(0))', 200) call unite#set_substitute_pattern('file', '[^~.]\zs/', '*/*', 20) call unite#set_substitute_pattern('file', '/\ze[^*]', '/*', 10) call unite#set_substitute_pattern('file', '^@@', '\=fnamemodify(expand("#"), ":p:h")."/*"', 2) call unite#set_substitute_pattern('file', '^@', '\=getcwd()."/*"', 1) call unite#set_substitute_pattern('file', '^\\', '~/*') call unite#set_substitute_pattern('file', '^;v', '~/.vim/*') call unite#set_substitute_pattern('file', '^;r', '\=$VIMRUNTIME."/*"') call unite#set_substitute_pattern('file', '\*\*\+', '*', -1) call unite#set_substitute_pattern('file', '^\~', escape($HOME, '\'), -2) call unite#set_substitute_pattern('file', '\\\@<! ', '\\ ', -20) call unite#set_substitute_pattern('file', '\\ \@!', '/', -30)
ä¸è¨ã®è¨å®ãæå¹ã«ããã¨ããããªæãã«ãªãã¾ãã
ç¹ã«neocomplcacheã®åè£æ©è½ã¯ç´ æ´ãããã§ãã
ã«ã©ã¼ã¹ãã¼ã
ããã¾ã§ã«ã¹ã¿ãã¤ãºãããè²è¨å®ã¾ã§ï¼
ã«ã©ã¼ã¹ãã¼ã ãã¡ã¤ã«ãè¨å®ãããã¨ã§ãVimã®å種é
è²ãè¨å®ã§ããã®ã§èªåã§ä½æã
ããããã¯ã«ã¹ã¿ãã¤ãºå¤§å¥½ãããºãã¼ã®è¡ããç¥ãã¾ããã
" Vim color file " Maintainer: yuzuemon set background=dark hi clear if exists("syntax_on") syntax reset endif let g:colors_name = "Metroid" " ããã¹ã hi Normal gui=NONE guifg=White guibg=Black " é常 hi NonText guifg=LightBlue ctermfg=LightBlue " EOF以éã®~ãªã© hi Comment gui=Italic guifg=LightGreen cterm=Italic ctermfg=LightGreen " ã³ã¡ã³ã hi Statement gui=Bold guifg=Magenta cterm=Bold ctermfg=Magenta " å½ä»¤ãåå² hi Identifier gui=Bold guifg=Green cterm=Bold ctermfg=Green " é¢æ°ãèå¥å hi PreProc gui=Bold guifg=Yellow cterm=Bold ctermfg=Yellow " ããªããã»ããµã¡ã½ãã hi Type gui=Bold guifg=Cyan cterm=Bold ctermfg=Cyan " å(ã¯ã©ã¹ãæ§é ä½) hi Constant gui=Bold guifg=LightBlue cterm=Bold ctermfg=LightBlue " å®æ°(æååãæåãæ°ãBoolean) hi Special gui=Bold guifg=LightBlue cterm=Bold ctermfg=LightBlue " ç¹æ®è¨å· hi Conditional gui=Bold guifg=Yellow cterm=Bold ctermfg=Yellow " if, not hi Repeat gui=Bold guifg=Yellow cterm=Bold ctermfg=Yellow " for hi Exception gui=Bold guifg=Yellow cterm=Bold ctermfg=Yellow " try " ããã¹ãç¶æ hi Visual guibg=Blue ctermbg=Blue " ã¢ã¯ãã£ãé¸æç¯å² hi VisualNOS guibg=DarkBlue ctermbg=DarkBlue " éã¢ã¯ãã£ããªé¸æç¯å² hi Search gui=Bold guifg=White guibg=Magenta cterm=Bold ctermfg=White ctermbg=Magenta " æ¤ç´¢æåå hi IncSearch gui=Reverse,Bold cterm=Reverse,Bold " ã¤ã³ã¯ãªã¡ã³ã¿ã«ä¸ã®æ¤ç´¢æåå hi Folded guibg=DarkGray ctermbg=DarkGray " æãããã¾ããè¡ hi FoldColumn guibg=DarkGray ctermbg=DarkGray " ãã©ã¼ã«ãã«ã©ã " diff hi DiffAdd guibg=DarkMagenta ctermbg=DarkMagenta " çå´ã«ããè¡ hi DiffDelete guifg=Black guibg=LightMagenta ctermfg=Black ctermbg=LightMagenta " çå´ã«ãªãè¡ hi DiffText guibg=DarkGreen ctermfg=Black ctermbg=DarkGreen " å·®ç°ã®ããç®æ hi DiffChange guibg=Gray30 ctermbg=DarkCyan ctermfg=White " å¤æ´ç®æ " ãããã¢ããã¡ãã¥ã¼(æªæ´ç) hi Pmenu ctermbg=lightcyan ctermfg=black hi PmenuSel ctermbg=blue ctermfg=black hi PmenuSbar ctermbg=darkgray hi PmenuThumb ctermbg=lightgray " ãã®ä» hi LineNr gui=NONE guifg=Green cterm=NONE ctermfg=Green " è¡çªå· hi VertSplit gui=NONE guifg=Black guibg=Cyan cterm=NONE ctermfg=Black ctermbg=Cyan " :vspã®å¢çç· " ã¹ãã¼ã¿ã¹ã©ã¤ã³ hi StatusLine gui=NONE guifg=Black guibg=Green cterm=NONE ctermfg=Black ctermbg=Blue " ã¢ã¯ãã£ããªã¹ãã¼ã¿ã¹ã©ã¤ã³ hi StatusLineNC gui=NONE guifg=Black guibg=Green cterm=NONE ctermfg=Black ctermbg=Blue " éã¢ã¯ãã£ããªã¹ãã¼ã¿ã¹ã©ã¤ã³ hi Question gui=NONE guifg=Black guibg=Yellow cterm=NONE ctermfg=Black ctermbg=Yellow " ããã³ããã¡ãã»ã¼ã¸ hi ModeMsg gui=NONE guifg=Green cterm=NONE ctermfg=Green " --æ¿å ¥--ã¨ãã®ã¡ãã»ã¼ã¸ hi MoreMsg gui=NONE guifg=Magenta cterm=NONE ctermfg=Magenta " --ç¶ç¶--ã¡ãã»ã¼ã¸ hi WarningMsg gui=NONE guifg=Yellow cterm=NONE ctermfg=Yellow " è¦åã¡ãã»ã¼ã¸ hi ErrorMsg gui=NONE guifg=White guibg=Magenta cterm=NONE ctermfg=White ctermbg=Magenta " ã¨ã©ã¼ã¡ãã»ã¼ã¸
gui, cterm | gVim, vimã®æåæ¸ä½ |
---|---|
guifg, ctermbg | gVim, vimã®æåè² |
guibg, ctermbg | gVim, vimã®èæ¯è² |
ãªãã:hiã³ãã³ãã§ã©ã®ãã©ã¼ããããä½è²ãªã®ã確èªåºæ¥ã¾ãã
ä¸è¨ãã¡ã¤ã«ã~/.vim/color/ï¼ã«ã©ã¼ã¹ãã¼ã åï¼.vimã¨ãã¦ä¿åãã¾ãã
ä¿åããã«ã©ã¼ã¹ãã¼ã ã.vimrcã«ä»¥ä¸ã®è¡ã追å ãã¦èªã¿ããã°ã«ã©ã¼ã¹ãã¼ã ãé©ç¨ããã¾ãã
colorscheme ã«ã©ã¼ã¹ãã¼ã å
ã«ã©ã¼ã¹ãã¼ã åã¯ãã«ã©ã¼ã¹ãã¼ã ã®ãã¡ã¤ã«åã§ã¯ãªãã以ä¸ã®å®ç¾©é¨åã«ãªãã®ã§ããã¡ã¤ã«åã¨g:colors_nameã¯ä¸è´ããã¦ç»é²ããå¿
è¦ãããã¾ãã(2012/03/17 ä¿®æ£)
let g:colors_name = "metroid" # ï¼ã«ã©ã¼ã¹ãã¼ã åï¼ã¨åãåå
ç·ã¨ãã¼ã³ã¿ã®ã³ã³ãã©ã¹ããç¾ããã¦ä½ã¨ãªããããªååã«ãªãã¾ããã
å®éã«é©ç¨ããæã
Mac/gVim
Linux/gVim
ç°å¢ã«ãã£ã¦çºè²ãå¤ããã®ã¯ã¿ã¼ããã«ã®ã«ã©ã¼è¨å®ã®æçºã
ãããã大ä½ãããªæãããªã
使ã£ã¦1å¹´å¾ä½ã«ã¾ãçºãã¦ã¿ã¾ãã
*1:æ´æ°ã³ãã³ããããã°å°ããã®ã§ããâ¦ã