Vimã®tabæ©è½ãå©ç¨ããã¨ï¼ä»¥ä¸ã®ããã«ç»é¢ä¸é¨ã«ç¾å¨éãã¦ãããããã¡ã®ä¸è¦§ã表示ãããããã«ãªãï¼GNU screenã®hardstatusã£ã½ãæãï¼
ã¾ãï¼fuzzyfinder.vimã¯ãããã¡ããã¡ã¤ã«ãããã¾ãæ¤ç´¢ãé¨åä¸è´æ¤ç´¢ã§éããã¨ãã§ãããã©ã°ã¤ã³ï¼åè£ä¸è¦§ãæè¿ä½¿ã£ããã¡ã¤ã«ãåºã«ã½ã¼ããããããã¦ä¾¿å©ï¼
ä¾ãã°Fuzzyfinderã®ãã¡ã¤ã«ã¢ã¼ãã§ãrcãã«é¨åä¸è´ãããã¡ã¤ã«ãåæããã¨ãããªæãã«ãªãï¼
fuzzyfinder.vim
http://www.vim.org/scripts/script.php?script_id=1984
ãã ï¼ãããã¯ããã©ã«ãã®ã¾ã¾ã ã¨:tabmoveã:FuzzyFinderFileãªã©é常ã«é·ãExã³ãã³ãã使ããªãã¨å©ç¨ã§ããªãã®ã§ï¼æ¼ãããããã¼ããããè¨å®ãã¦ç°¡åã«æä½ã§ããããã«ãã¦ã¿ãï¼
è¨å®ãããããã³ã°ä¸è¦§
CtrlãShiftãä¸å使ããã«æä½ã§ããããã«ãã¦ã¿ãï¼å°æã«ããããï¼
- ã¿ãæä½
- tc : ã¿ããä½ã(create)
- tk : ã¿ããéãã(kill)
- tn : 次ã®ã¿ãã«ç§»å(next)
- tp : åã®ã¿ãã«ç§»å(previous)
- ç¾å¨ã®ã¿ãã§Fuzzyfinderã使ã£ã¦ãã¡ã¤ã«/ãããã¡ãéã
- fb : ç¾å¨ã®ã¿ãã§ãããã¡ãåãæ¿ãã
- ff : ç¾å¨ã®ã¿ãã§ãã¡ã¤ã«ãéã
- fm : ç¾å¨ã®ã¿ãã§æè¿ä½¿ã£ããã¡ã¤ã«ãéã
- æ°ããã¿ãã§Fuzzyfinderã使ã£ã¦ãã¡ã¤ã«/ãããã¡ãéã
- tb : ç¾å¨ã®ã¿ãã§ãããã¡ãåãæ¿ãã
- tf : ç¾å¨ã®ã¿ãã§ãã¡ã¤ã«ãéã
- tm : ç¾å¨ã®ã¿ãã§æè¿ä½¿ã£ããã¡ã¤ã«ãéã
.vimrc
.vimrcã®è¨å®ã¯ä»¥ä¸ã®éãï¼
set showtabline=2 " Tabs nnoremap <Space>t t nnoremap <Space>T T nnoremap t <Nop> nnoremap <silent> tc :<C-u>tabnew<CR>:tabmove<CR> nnoremap <silent> tk :<C-u>tabclose<CR> nnoremap <silent> tn :<C-u>tabnext<CR> nnoremap <silent> tp :<C-u>tabprevious<CR> " FuzzyFinder.vim nnoremap <Space>f f nnoremap <Space>F F nnoremap f <Nop> nnoremap <silent> fb :<C-u>FuzzyFinderBuffer!<CR> nnoremap <silent> ff :<C-u>FuzzyFinderFile! <C-r>=expand('%:~:.')[:-1-len(expand('%:~:.:t'))]<CR><CR> nnoremap <silent> fm :<C-u>FuzzyFinderMruFile!<CR> nnoremap <silent> tb :<C-u>tabnew<CR>:tabmove<CR>:FuzzyFinderBuffer!<CR> nnoremap <silent> tf :<C-u>tabnew<CR>:tabmove<CR>:FuzzyFinderFile! <C-r>=expand('#:~:.')[:-1-len(expand('#:~:.:t'))]<CR><CR> nnoremap <silent> tm :<C-u>tabnew<CR>:tabmove<CR>:FuzzyFinderMruFile!<CR>
è£è¶³
- ãnnoremap {lhs} {rhs}ãã¯normalã¢ã¼ãã®key mappingãå®ç¾©ããã³ãã³ãï¼{lhs}ã®ãã¼ã·ã¼ã±ã³ã¹ã{rhs}ã«ãããã³ã°ããï¼{rhs}ä¸ã®ãã¼ãããã«ãããã³ã°ããã¦ãã¦ãå帰çãªå±éã¯ããªãï¼
- nnoremapã®{rhs}ã«
ãæå®ããã¨ï¼{lhs}ãå ¥åãã¦ãä½ãèµ·ãããªããªã(No Operation)ï¼ - nnoremapã§ã
ããæå®ããã¨ï¼ãããã³ã°ããããã¼ãå®è¡ãããã¨ãã«ã³ãã³ãã©ã¤ã³ã¸ã®åºåãè¡ããªããªã(ã¡ãã¤ã対ç)ï¼ - tabnewã¯ç¾å¨éãã¦ããã¿ãã®æ¬¡ã®ä½ç½®ã«æ°ããã¿ããéãï¼
- tabmoveã¯å¼æ°ãªãã§å¼ã³åºãã¨ç¾å¨ã®ã¿ããæå¾å°¾ã«ç§»åãããï¼
- FuzzyFinder****!ã®ããã«ï¼ã!ããä»ããã¨Fuzzyfinderã§é¨åä¸è´æ¤ç´¢ãæå¹ã«ãªãï¼ã!ããåãé¤ãã¨ããã¾ãæ¤ç´¢ã«ãªãï¼
- FuzzyFinderFile!ã§ãã¡ã¤ã«ãéãã¨ãã«ï¼expand()ã使ã£ã¦ç¾å¨ç·¨éä¸ã®ãã¡ã¤ã«ããããã£ã¬ã¯ããªãèµ·ç¹ã«ãã¦ãã¡ã¤ã«ãæ¢ãããã«ãã¦ããï¼
- å
ã®t(ã«ã¬ã³ãè¡ã§æåãå¾æ¹æ¤ç´¢)ã¯
tã«ãããã³ã°ãã¦ããï¼ - å
ã®f(ã«ã¬ã³ãè¡ã§æåãåæ¹æ¤ç´¢)ã¯
fã«ãããã³ã°ãã¦ããï¼
以ä¸
修飾ãã¼ãªãã®ãã¼ã¿ã¤ãã ãã§ã¿ãåãæ¿ãããã¡ã¤ã«æä½ãã§ããã®ã¯ããªãå¿«é©ï¼ããã¨ï¼fuzzyfinder.vimã«ããé¨åä¸è´æ¤ç´¢ãæè¿éãããã¡ã¤ã«ãéãã¢ã¼ãããªããªã便å©ã§ï¼ãããæ軽ã«ä½¿ããããã«ãªã£ãã®ã¯å¤§ããï¼ãã:eãªããã§ãã¡ã¤ã«ãéãã¦ããå ´åãããªãã§ããããã¯ï¼
ãã°ãããã®ãããã³ã°è¨å®ã§Vimã使ã£ã¦ã¿ãäºå®ï¼ã¾ãï¼fuzzyfinder.vimã¯ã¾ã ã¾ã ã«ã¹ã¿ãã¤ãºã§ããé¨åãããã®ã§ï¼æ°ãåãããããããããã£ã¦ã¿ããï¼