Vimãæå¼·ã®Pythonéçºç°å¢ã«ãã2
æ¬æ°ã§Pythonããããããªããããã¦èªã¿ããããï¼åãã£ãã Python ã®ãã¼ã¸ã§ã³ç®¡çã« pyenv 使ã£ã¦ãã®ã« Vim ã®è£å®ã¯ã·ã¹ãã ã©ã¤ãã©ãªåç §ãã¦ãã®ï¼ã
- 2013-06-23 21:30 ãããã«è¿½è¨ãã¾ãã
- 2013-06-24 10:00 è¨å®ç微修æ£ãã¾ãã
- 2013-06-24 15:20 quickrunã®è¨å®ãä¿®æ£ãã¾ãã
- 2013-07-03 14:30 ééãçãä¿®æ£ãã¾ãã
æ§ã ãªéçºç°å¢ã試ãã¦ãã¾ããããçµå±Vimã«è½ã¡çãã¦ãã¾ã£ã¦ããAlisueã§ããã©ããã Vimãæå¼·ã®Python IDEã«ãããæ¸ãã¦ããããããäºå¹´ã»ã©ãçµã¡ã¾ãã äºå¹´ãããã¨æ°ããVimãã©ã°ã¤ã³ãå¢ãããªã©ããå ã®è¨äºå 容ã§ã¯æå¼·ã§ã¯ãªããªã£ã¦ãã¾ãã¾ããããªã®ã§ãã®è¾ºã§ããä¸åº¦ç¾å¨ã®æå¼·ãã¾ã¨ãã¦ã¿ããã¨æãã¾ãã
åºæ¬æ¹é
- ãã©ã°ã¤ã³é¢ä¿ã¯ãã¹ã¦NeoBundleã§ç®¡ç
- ãã©ã°ã¤ã³ã¯å¯è½ãªéãé 延ãã¼ãã使ããã¨ã§Vimãé«éå
- éçºç°å¢ã¨ãã¦éè²ããªãããã«å¯è½ãªéãèªåå
- ã¡ã¢ãªã©ãåãã®ã«ä¾¿å©ãªMarkdown (Pandoc)ãæ軽ã«ä½¿ããããã«
åææ¡ä»¶
ä¸è¨ã«ãããããã°ã©ã ã使ç¨å¯è½ãªç¶æ ã«ãªã£ã¦ãããã¨ãæ¡ä»¶ã§ãã ãªãä¾ã®å¦ãWindowsã¯å¯¾è±¡ã¨ãã¦ããªãã®ã§ãWindowsã使ç¨ãã¦ãã人ã¯Googleå çã¨ä¸ç·ã«ããã°ã£ã¦ãã ããã
- git -- Vimãã©ã°ã¤ã³ã¤ã³ã¹ãã¼ã«ç¨
- pip -- Pythonç³»ã¢ã¸ã¥ã¼ã«ã¤ã³ã¹ãã¼ã«ç¨
- Pandoc -- ããã¥ã¡ã³ãå¤æ
- Exuberant ctags -- Tagãã¡ã¤ã«çæ
å¿ é è¨å®
æ¬è¨äºã§ä½¿ç¨ãã¦ãããã¯ããªã©ã¯ãã¹ã¦'MyAutoCmd'ã¨ããã°ã«ã¼ãã«å±ãã¦ããã®ã§ããã®
åæåï¼ãªã»ããï¼å¦çã.vimrc
ã®å
é ã«æ¸ãã¦ãã ããã
" release autogroup in MyAutoCmd augroup MyAutoCmd autocmd! augroup END
æ¨å¥¨è¨å®
以ä¸ã¯èªåã使ç¨ãã¦ãã.vimrc
ããæã£ã¦ããæ¨å¥¨è¨å®ã§ãã説æãæ¸ããã®ã§è¯ããããªãã®ãé¸ãã§è¨å®ãã¦ãã ããã
æ¤ç´¢é¢ä¿
set ignorecase " 大æåå°æåãåºå¥ããªã set smartcase " æ¤ç´¢æåã«å¤§æåãããå ´åã¯å¤§æåå°æåãåºå¥ set incsearch " ã¤ã³ã¯ãªã¡ã³ã¿ã«ãµã¼ã set hlsearch " æ¤ç´¢ãããããã¹ãããã¤ã©ã¤ã (2013-07-03 14:30 ä¿®æ£ï¼ " ããã¯ã¹ã©ãã·ã¥ãã¯ã¨ã¹ãã§ã³ãç¶æ³ã«åããèªåçã«ã¨ã¹ã±ã¼ã cnoremap <expr> / getcmdtype() == '/' ? '\/' : '/' cnoremap <expr> ? getcmdtype() == '?' ? '\?' : '?'
ç·¨éé¢ä¿
set shiftround " '<'ã'>'ã§ã¤ã³ãã³ãããéã«'shiftwidth'ã®åæ°ã«ä¸¸ãã set infercase " è£å®æã«å¤§æåå°æåãåºå¥ããªã set virtualedit=all " ã«ã¼ã½ã«ãæåãåå¨ããªãé¨åã§ãåããããã«ãã set hidden " ãããã¡ãéãã代ããã«é ãï¼Undoå±¥æ´ãæ®ãããï¼ set switchbuf=useopen " æ°ããéã代ããã«ãã§ã«éãã¦ãããããã¡ãéã set showmatch " 対å¿ããæ¬å¼§ãªã©ããã¤ã©ã¤ã表示ãã set matchtime=3 " 対å¿æ¬å¼§ã®ãã¤ã©ã¤ã表示ã3ç§ã«ãã " 対å¿æ¬å¼§ã«'<'ã¨'>'ã®ãã¢ã追å set matchpairs& matchpairs+=<:> " ããã¯ã¹ãã¼ã¹ã§ãªãã§ãæ¶ããããã«ãã set backspace=indent,eol,start " ã¯ãªãããã¼ããããã©ã«ãã®ã¬ã¸ã¹ã¿ã¨ãã¦æå®ãå¾ã«YankRingã使ãã®ã§ " 'unnamedplus'ãåå¨ãã¦ãããã©ããã§è¨å®ãåããå¿ è¦ããã if has('unnamedplus') " set clipboard& clipboard+=unnamedplus " 2013-07-03 14:30 unnamed 追å set clipboard& clipboard+=unnamedplus,unnamed else " set clipboard& clipboard+=unnamed,autoselect 2013-06-24 10:00 autoselect åé¤ set clipboard& clipboard+=unnamed endif " Swapãã¡ã¤ã«ï¼Backupãã¡ã¤ã«ï¼åæ代çãã " ãªã®ã§å ¨ã¦ç¡å¹åãã set nowritebackup set nobackup set noswapfile
表示é¢ä¿
set list " ä¸å¯è¦æåã®å¯è¦å set number " è¡çªå·ã®è¡¨ç¤º set wrap " é·ãããã¹ãã®æãè¿ã set textwidth=0 " èªåçã«æ¹è¡ãå ¥ãã®ãç¡å¹å set colorcolumn=80 " ãã®ä»£ãã80æåç®ã«ã©ã¤ã³ãå ¥ãã " åæ代çã¹ã¯ãªã¼ã³ãã«ãç¡å¹å set t_vb= set novisualbell " ããã©ã«ãä¸å¯è¦æåã¯ç¾ãããªãã®ã§Unicodeã§ç¶ºéºã« set listchars=tab:»-,trail:-,extends:»,precedes:«,nbsp:%,eol:â²
ãã¯ãããã³ãã¼è¨å®
" å ¥åã¢ã¼ãä¸ã«ç´ æ©ãjjã¨å ¥åããå ´åã¯ESCã¨ã¿ãªã inoremap jj <Esc> " ESCãäºåæ¼ããã¨ã§ãã¤ã©ã¤ããæ¶ã nmap <silent> <Esc><Esc> :nohlsearch<CR> " ã«ã¼ã½ã«ä¸ã®åèªã * ã§æ¤ç´¢ vnoremap <silent> * "vy/\V<C-r>=substitute(escape(@v, '\/'), "\n", '\\n', 'g')<CR><CR> " æ¤ç´¢å¾ã«ã¸ã£ã³ãããéã«æ¤ç´¢åèªãç»é¢ä¸å¤®ã«æã£ã¦ãã nnoremap n nzz nnoremap N Nzz nnoremap * *zz nnoremap # #zz nnoremap g* g*zz nnoremap g# g#zz " j, k ã«ãã移åãæãè¿ãããããã¹ãã§ãèªç¶ã«æ¯ãèãããã«å¤æ´ nnoremap j gj nnoremap k gk " vãäºåã§è¡æ«ã¾ã§é¸æ vnoremap v $h " TABã«ã¦å¯¾å¿ãã¢ã«ã¸ã£ã³ã nnoremap <Tab> % vnoremap <Tab> % " Ctrl + hjkl ã§ã¦ã£ã³ãã¦éã移å nnoremap <C-h> <C-w>h nnoremap <C-j> <C-w>j nnoremap <C-k> <C-w>k nnoremap <C-l> <C-w>l " Shift + ç¢å°ã§ã¦ã£ã³ãã¦ãµã¤ãºãå¤æ´ nnoremap <S-Left> <C-w><<CR> nnoremap <S-Right> <C-w>><CR> nnoremap <S-Up> <C-w>-<CR> nnoremap <S-Down> <C-w>+<CR> " T + ? ã§å種è¨å®ããã°ã« nnoremap [toggle] <Nop> nmap T [toggle] nnoremap <silent> [toggle]s :setl spell!<CR>:setl spell?<CR> nnoremap <silent> [toggle]l :setl list!<CR>:setl list?<CR> nnoremap <silent> [toggle]t :setl expandtab!<CR>:setl expandtab?<CR> nnoremap <silent> [toggle]w :setl wrap!<CR>:setl wrap?<CR> " make, grep ãªã©ã®ã³ãã³ãå¾ã«èªåçã«QuickFixãéã autocmd MyAutoCmd QuickfixCmdPost make,grep,grepadd,vimgrep copen " QuickFixããã³Helpã§ã¯ q ã§ãããã¡ãéãã autocmd MyAutoCmd FileType help,qf nnoremap <buffer> q <C-w>c " w!! ã§ã¹ã¼ãã¼ã¦ã¼ã¶ã¼ã¨ãã¦ä¿åï¼sudoã使ããç°å¢éå®ï¼ cmap w!! w !sudo tee > /dev/null % " :e ãªã©ã§ãã¡ã¤ã«ãéãéã«ãã©ã«ããåå¨ããªãå ´åã¯èªåä½æ function! s:mkdir(dir, force) if !isdirectory(a:dir) && (a:force || \ input(printf('"%s" does not exist. Create? [y/N]', a:dir)) =~? '^y\%[es]$') call mkdir(iconv(a:dir, &encoding, &termencoding), 'p') endif endfunction autocmd MyAutoCmd BufWritePre * call s:mkdir(expand('<afile>:p:h'), v:cmdbang) " vim èµ·åæã®ã¿ã«ã¬ã³ããã£ã¬ã¯ããªãéãããã¡ã¤ã«ã®è¦ªãã£ã¬ã¯ããªã«æå® autocmd MyAutoCmd VimEnter * call s:ChangeCurrentDir('', '') function! s:ChangeCurrentDir(directory, bang) if a:directory == '' lcd %:p:h else execute 'lcd' . a:directory endif if a:bang == '' pwd endif endfunction " ~/.vimrc.localãåå¨ããå ´åã®ã¿è¨å®ãèªã¿è¾¼ã let s:local_vimrc = expand('~/.vimrc.local') if filereadable(s:local_vimrc) execute 'source ' . s:local_vimrc endif
NeoBundleã«ãããã©ã°ã¤ã³ç®¡ç
æ¨ä»ã®Vimãã©ã°ã¤ã³ç®¡çãã¼ã«ä¹±ç«ã«çµæ¢ç¬¦ãæã¤ã§ãããNeoBundleã使ç¨ãã¾ãã NeoBundleã®ãã©ã°ã¤ã³ç®¡çã¯åºæ¬çã«
NeoBundle 'YankRing'
ã®ããã«ä½¿ç¨ããããã©ã°ã¤ã³ã.vimrc
ã§æå®:NeoBundleInstall
ã§å ã«æå®ãããã©ã°ã¤ã³ããã¦ã³ãã¼ãæå®ï¼åºæ¬çã«èµ·åæã«èªåå¼ã³åºãï¼- ãã©ã°ã¤ã³ã¯ç¹å®ã®ãã£ã¬ã¯ããªï¼é常ã¯
~/.vim/bundle
ï¼ã«ãã¦ã³ãã¼ãããã - NeoBundleãæå®ããããã©ã°ã¤ã³ã®ãã¦ã³ãã¼ãå
ã
runtimepath
ã«èªåçã«å ãã¦ããã
ã¨ããæµãã§ãããããã£ã¦ä¸æææµè¡ã£ãPathogenã¨ã¯ç°ãªãã¦ã¼ã¶ã¼ãè¡ãã¹ããã¨ã¯ä½¿ç¨ããããã©ã°ã¤ã³ããªã¹ãã¢ããããã ãã§ãã ãªãããã®åºæ¬ã³ã³ã»ããã¯æè¿ã§ã¯æãæåãªVundleã¨ãããã©ã°ã¤ã³ã¨åããªã®ã§ãããä¸è¨ã®ç¹ã§NeoBundleã¯Vundleããåªãã¦ãã¾ãã
- Subversionãªã©ã®Git以å¤ã®ãã¼ã¸ã§ã³ç®¡çã·ã¹ãã ã¸ã®å¯¾å¿
- vimprocãç¨ããéåæã¢ãããã¼ã
- ãªãã¸ã§ã³ããã¯ã»ãã©ã³ãããã¯
- ä¾åé¢ä¿æå®
- é 延ãã¼ã
- ä½æè ãæé»ç¾å¤¢çãã¨@Shougoããï¼éè¦ï¼
ãªãã§ãé 延ãã¼ããã§ããç¹ãé常ã«å¤§ããVimã®é«éåã«è²¢ç®ããããè¿·ããNeoBundleãé¸ã³ã¾ãããã
NeoBundleã®ç°¡åãªä½¿ãæ¹
æå°ã®è¨å®ããã³é«åº¦ãªä½¿ç¨æ¹æ³ãªã©ã¯NeoBundleã®READMEãªã©ãè¦ãã¨ãã¦ãããã§ã¯å®ç¨çãªè¨å®ãè¦ã¦ããã¾ãã
ä¸è¨ã«æ±ç¨çãªNeoBundleã®è¨å®ãæ¸ãã¾ããããªã" (ry
ã®é¨åã«æ¬²ãããã©ã°ã¤ã³ãç¾
åãã¾ãã
let s:noplugin = 0 let s:bundle_root = expand('~/.vim/bundle') let s:neobundle_root = s:bundle_root . '/neobundle.vim' if !isdirectory(s:neobundle_root) || v:version < 702 " NeoBundleãåå¨ããªãããããã¯Vimã®ãã¼ã¸ã§ã³ãå¤ãå ´åã¯ãã©ã°ã¤ã³ãä¸å " èªã¿è¾¼ã¾ãªã let s:noplugin = 1 else " NeoBundleã'runtimepath'ã«è¿½å ãåæåãè¡ã if has('vim_starting') execute "set runtimepath+=" . s:neobundle_root endif call neobundle#rc(s:bundle_root) " NeoBundleèªèº«ãNeoBundleã§ç®¡çããã NeoBundleFetch 'Shougo/neobundle.vim' " éåæéä¿¡ãå¯è½ã«ãã " 'build'ãæå®ããã¦ããã®ã§ã¤ã³ã¹ãã¼ã«æã«èªåçã« " æå®ãããã³ãã³ããå®è¡ãã vimproc ãã³ã³ãã¤ã«ããã NeoBundle "Shougo/vimproc", { \ "build": { \ "windows" : "make -f make_mingw32.mak", \ "cygwin" : "make -f make_cygwin.mak", \ "mac" : "make -f make_mac.mak", \ "unix" : "make -f make_unix.mak", \ }} " (ry " ã¤ã³ã¹ãã¼ã«ããã¦ããªããã©ã°ã¤ã³ã®ãã§ãã¯ããã³ãã¦ã³ãã¼ã NeoBundleCheck endif " ãã¡ã¤ã«ã¿ã¤ããã©ã°ã¤ã³ããã³ã¤ã³ãã³ããæå¹å " ããã¯NeoBundleã«ããå¦çãçµäºãããã¨ã«å¼ã°ãªããã°ãªããªã filetype plugin indent on
hooks.on_sourceã«ãããã¼ãæè¨å®
ç¹ã«ä¸è¨ã§ç´¹ä»ããé 延ãã¼ãã®éã«åãçºæ®ãã¾ããNeoBundleã§ã¯ãã©ã°ã¤ã³ãã¼ãæã« ç¹å®ã®é¢æ°ãå®è¡ãããªãã¡ç¹å®ã®ãã©ã°ã¤ã³å°ç¨ã®è¨å®ã³ã¼ããå®è¡ããããã¨ãã§ãã¾ãã
" 次ã«èª¬æãããInsertã¢ã¼ãã«å ¥ãã¾ã§ã¯neocompleteã¯ãã¼ããããªã NeoBundleLazy 'Shougo/neocomplete.vim', { \ "autoload": {"insert": 1}} " neocompleteã®hooksãåå¾ let s:hooks = neobundle#get_hooks("neocomplete.vim") " neocompleteç¨ã®è¨å®é¢æ°ãå®ç¾©ãä¸è¨é¢æ°ã¯neocompleteãã¼ãæã«å®è¡ããã function! s:hooks.on_source(bundle) let g:acp_enableAtStartup = 0 let g:neocomplete#enable_smart_case = 1 " NeoCompleteãæå¹å NeoCompleteEnable endfunction
NeoBundleLazyã«ããé 延ãã¼ã
NeoBundleã§ã¯ä¸è¨ã®ããã«ãããã¨ã§ãã©ã°ã¤ã³ãé 延ãã¼ããããã¨ãã§ãã¾ãã
" Insertã¢ã¼ãã«å ¥ãã¾ã§ãã¼ãããªã NeoBundleLazy 'Shougo/neosnippet.vim', { \ "autoload": {"insert": 1}} " 'GundoToggle'ãå¼ã°ããã¾ã§ãã¼ãããªã NeoBundleLazy 'sjl/gundo.vim', { \ "autoload": {"commands": ["GundoToggle"]}} " '<Plug>TaskList'ã¨ãããããã³ã°ãå¼ã°ããã¾ã§ãã¼ãããªã NeoBundleLazy 'vim-scripts/TaskList.vim', { \ "autoload": {"mappings": ['<Plug>TaskList']}} " HTMLãéãããã¾ã§ãã¼ãããªã NeoBundleLazy 'mattn/zencoding-vim', { \ "autoload": {"filetypes": ['html']}}
å ã«ç´¹ä»ããhooks.on_sourceã«ãããã¼ãæè¨å®ãçµã¿åããããã¨ã§å®å ¨ãªé 延ãã¼ããã§ãã¾ãã
ãã¡ã¤ã«ç®¡çé¢ä¿
vim-templateã«ãããã³ãã¬ã¼ããã¡ã¤ã«ã®ä½¿ç¨
åºæ¬çã«ããã°ã©ãã³ã°ãè¡ãå ´åãã¡ã¤ã«å
é é¨åã¯ã決ã¾ãã®è¡¨ç¾ãPythonã§è¨ãã°æåã³ã¼ãã®æå®ãã·ã§ã«ã¹ã¯ãªãããªãã·ã§ãã³ã°ï¼#!
ããå§ã¾ãã¤ã³ã¿ããªã¿æå®è¡ï¼ã§å§ã¾ããã¨ãå¤ãã§ãã
ãããã®æ±ºã¾ãæå¥ãæ¯åº¦æã¤ã®ãé¢åãªã®ã§ãã³ãã¬ã¼ãã使ç¨ãã¾ããåã®ããããã¯vim-template
ã§ãã
vim-templateã¯æ°ããVimç¨ãã³ãã¬ã¼ããã©ã°ã¤ã³ã®ãªãã§ã極ãã¦ã·ã³ãã«ãªé¨é¡ã«å
¥ãã¾ãã
çµæ§é©å½ãªä½¿ãæ¹ã§æãéãã®æåã示ãã®ã§æ±ããããã§ãã
詳ããã¯ä½è
ã®ç´¹ä»è¨äºãã©ããã
åã®.vimrc
ã§ã¯ä»¥ä¸ã®ããã«è¨å®ãã¦ãã¾ãã
NeoBundle "thinca/vim-template" " ãã³ãã¬ã¼ãä¸ã«å«ã¾ããç¹å®æååãç½®ãæãã autocmd MyAutoCmd User plugin-template-loaded call s:template_keywords() function! s:template_keywords() silent! %s/<+DATE+>/\=strftime('%Y-%m-%d')/g silent! %s/<+FILENAME+>/\=expand('%:r')/g endfunction " ãã³ãã¬ã¼ãä¸ã«å«ã¾ãã'<+CURSOR+>'ã«ã«ã¼ã½ã«ã移å autocmd MyAutoCmd User plugin-template-loaded \ if search('<+CURSOR+>') \ | silent! execute 'normal! "_da>' \ | endif
ãã³ãã¬ã¼ãã¯ä¸è¨ã®ããã«è¨è¼ã~/.vim/template
ã®ä¸ã«template.py
ã®ããã«ä¿åãã¦ããã¾ãã
#!/usr/bin/env python # vim: set fileencoding=utf-8 : # # Author: lambdalisue # URL: http://hashnote.net/ # License: MIT License # Created: <+DATE+> # <+CURSOR+>
Unite.vimã«ããç·å管ç
æ£ç´åã¯å ¨ãã¨ãã£ã¦ããã»ã©ä½¿ãããªãã¦ããªãã®ã§ããUnite.vim ã¨ããããã¾ãShougoããä½ã®ã³ãã³ãã©ã¤ã³ã©ã³ãã£ã¼ã¡ã£ããªãã¤ã¹ãªãã©ã°ã¤ã³ãããã¾ãã
ãã¦ãã¦ãªã©ããã§ç´¹ä»åºæ¥ãã°ããã®ã§ãããããã»ã¨ãã©ä½¿ãã¦ããªãã®ã§ç´¹ä»ã¯ä»ã®æ¹ã«ãä»»ããããã¾ãã
- unite.vimã®ä½¿ãæ¹ã¾ã¨ã
- Vimã§ãã¡ã¤ã©ã¼å ¼ã©ã³ãã£ã¼ãªunite.vimãã©ã°ã¤ã³ã使ã
- unite.vimã«ã¤ãã¦èªã
- Unite.vimã®ã·ã³ãã«ãªä½¿ãæ¹
ãã¤ã使ããããã«ãªã£ããããã®è¨äºãã¢ããã°ã¬ã¼ãããããã¡ãªã¿ã«ç¾å¨ã®åã®.vimrc
ã¯ä»¥ä¸ã®ããã«ãªã£ã¦ãã¾ãã
ãªãåä¸ãã¡ã¤ã«ãå°ãç·¨éãããå ´åãªã©ã¯Unite.vimãä¸è¦ãªããé
延ãã¼ããè¡ãªã£ã¦ãã¾ãã
NeoBundleLazy "Shougo/unite.vim", { \ "autoload": { \ "commands": ["Unite", "UniteWithBufferDir"] \ }} NeoBundleLazy 'h1mesuke/unite-outline', { \ "autoload": { \ "unite_sources": ["outline"], \ }} nnoremap [unite] <Nop> nmap U [unite] nnoremap <silent> [unite]f :<C-u>UniteWithBufferDir -buffer-name=files file<CR> nnoremap <silent> [unite]b :<C-u>Unite buffer<CR> nnoremap <silent> [unite]r :<C-u>Unite register<CR> nnoremap <silent> [unite]m :<C-u>Unite file_mru<CR> nnoremap <silent> [unite]c :<C-u>Unite bookmark<CR> nnoremap <silent> [unite]o :<C-u>Unite outline<CR> nnoremap <silent> [unite]t :<C-u>Unite tab<CR> nnoremap <silent> [unite]w :<C-u>Unite window<CR> let s:hooks = neobundle#get_hooks("unite.vim") function! s:hooks.on_source(bundle) " start unite in insert mode let g:unite_enable_start_insert = 1 " use vimfiler to open directory call unite#custom_default_action("source/bookmark/directory", "vimfiler") call unite#custom_default_action("directory", "vimfiler") call unite#custom_default_action("directory_mru", "vimfiler") autocmd MyAutoCmd FileType unite call s:unite_settings() function! s:unite_settings() imap <buffer> <Esc><Esc> <Plug>(unite_exit) nmap <buffer> <Esc> <Plug>(unite_exit) nmap <buffer> <C-n> <Plug>(unite_select_next_line) nmap <buffer> <C-p> <Plug>(unite_select_previous_line) endfunction endfunction
Vimfilerã«ããéçºç°å¢å®è£
ã©ããªéçºç°å¢ã«ãããã¦ãå·¦å´ã«ã¯ãã¡ã¤ã«ã¨ã¯ã¹ããã¼ã©ã¼ãåå¨ãã¦ãã¾ãã åãåã«æ¸ããVimãæå¼·ã®Python IDEã«ããã§ã¯The NERD Treeãå©ç¨ãã¦ãã¾ããããä»ã¯ããã¾ãShougoããä½ã®Vimfilerã使ç¨ãã¦ãã¾ãã
Vimfilerã«ä¹ãæããçç±ã¨ãã¦ã¯ä¸è¨ã®ãããªãã®ãæãããã¾ãã
- ãã¡ã¤ã«ã®ä½æã»ã³ãã¼ã»ç§»åã»åé¤ãªã©ããããããã
- ãããããããªãã¼ã ã³ãã³ã
- 2ç»é¢ã¢ã¼ãã«ãã移åã»ã³ãã¼ä½æ¥
- é常ã«é«ãæ¡å¼µæ§
- æ°ãããã¼ã¸ã§ã³ããThe NERD Treeã¡ã£ããªèµ·åãå¯è½ã«ãªã£ã
ãªãVimfilerã§ã¯The NERD Treeã¨ã¯ãã¼ãããã³ã°ãç°ãªãã®ã§æ°ãã«è¦ãç´ãå¿ è¦ãããã¾ãã æä½éè¦ããå¿ ç¨ãããã®ã¯ä»¥ä¸ã§ãã
ãã¼ãããã³ã° | ã³ãã³ã |
---|---|
a | ã¢ã¯ã·ã§ã³ãé¸æ |
l | ãã©ã«ããéã |
h | ãã©ã«ããéãã |
t | ãã©ã«ããéãã»éãã |
T | ãã©ã«ããå帰çã«éãã»éãã |
Backspace | 親ãã©ã«ãã«ç§»åãã |
Enter | ãã©ã«ãã«å ¥ã |
e | ãã¡ã¤ã«ãéã |
E | æ°ããã¦ã£ã³ãã¦ã§ãã¡ã¤ã«ãéã |
. | é ããã¡ã¤ã«ï¼ããããã¡ã¤ã«ï¼è¡¨ç¤º |
I | ãã£ã¬ã¯ããªãå ¥åã移å |
yy | ãã«ãã¹ãã¤ã³ã¯ï¼ã³ãã¼ï¼ãã |
ge | ã·ã¹ãã ã®ãã¡ã¤ã©ã¼ã§ãã©ã«ããéã |
gf | ãã¡ã¤ã«ãæ¤ç´¢ (find) |
gg | ãã¡ã¤ã«ããã£ã«ã¿ãªã³ã° (grep) |
x | ã·ã¹ãã ã®é¢é£ä»ãã§ãã¡ã¤ã«ãéã |
ã¾ãä¸è¨ã³ãã³ããè¦ãããã¨ã§Vimfilerä¸ã§ãã¡ã¤ã«ã®ä½æã»ç·¨éã»åé¤ãã§ãã¾ãã
ãªããããã®ç ´å£çã³ãã³ãã«é¢ãã¦ã¯gs
ã¨å
¥åãã»ã¼ãã¢ã¼ããæããªãã¨å®è¡ã§ããªãããã«ãªã£ã¦ãã¾ãã
ãã¼ãããã³ã° | ã³ãã³ã |
---|---|
Cc | ã¯ãªãããã¼ãã«ãã¡ã¤ã«ãã³ãã¼ |
Cm | ã¯ãªãããã¼ãã«ãã¡ã¤ã«ã移å |
Cp | ã¯ãªãããã¼ããããã¡ã¤ã«ãè²¼ãä»ã |
N | æ°è¦ãã¡ã¤ã«ãä½æ |
c | ãã¡ã¤ã«ãã³ãã¼ |
m | ãã¡ã¤ã«ã移å |
r | ãã¡ã¤ã«ããªãã¼ã |
d | ãã¡ã¤ã«ãåé¤ |
ä¸è¨ã«åã®è¨å®ãè¨è¼ãã¾ãããªãåã¯Ctrl + l
ãã¦ã£ã³ãã¦ç§»åã«å²ãå½ã¦ã¦ããããããã©ã«ãã®ãã¼ãããã³ã°ãä¸æ¸ããã¦ãã¾ãã
ã¾ãåä¸ãã¡ã¤ã«ãå°ãç·¨éãããå ´åãªã©ã¯Vimfilerãä¸è¦ãªããé
延ãã¼ããè¡ãªã£ã¦ãã¾ãã
NeoBundleLazy "Shougo/vimfiler", { \ "depends": ["Shougo/unite.vim"], \ "autoload": { \ "commands": ["VimFilerTab", "VimFiler", "VimFilerExplorer"], \ "mappings": ['<Plug>(vimfiler_switch)'], \ "explorer": 1, \ }} nnoremap <Leader>e :VimFilerExplorer<CR> " close vimfiler automatically when there are only vimfiler open autocmd MyAutoCmd BufEnter * if (winnr('$') == 1 && &filetype ==# 'vimfiler') | q | endif let s:hooks = neobundle#get_hooks("vimfiler") function! s:hooks.on_source(bundle) let g:vimfiler_as_default_explorer = 1 let g:vimfiler_enable_auto_cd = 1 " .ããå§ã¾ããã¡ã¤ã«ããã³.pycã§çµãããã¡ã¤ã«ãä¸å¯è¦ãã¿ã¼ã³ã« " 2013-08-14 è¿½è¨ let g:vimfiler_ignore_pattern = "\%(^\..*\|\.pyc$\)" " vimfiler specific key mappings autocmd MyAutoCmd FileType vimfiler call s:vimfiler_settings() function! s:vimfiler_settings() " ^^ to go up nmap <buffer> ^^ <Plug>(vimfiler_switch_to_parent_directory) " use R to refresh nmap <buffer> R <Plug>(vimfiler_redraw_screen) " overwrite C-l nmap <buffer> <C-l> <C-w>l endfunction endfunction
Gité¢ä¿ã®è¨å®
Gité¢ä¿ã¯ä¸è¨ãã©ã°ã¤ã³ã«ã¦è¨å®ãã¦ãã¾ããããããã®ä½¿ãæ¹ç´¹ä»ã¯ä»ã®æ¹ã«ãä»»ããããã¾ãã
ããããã®è¨å®ã¯ä¸è¨ã®ã¨ããã§ããã¾ã ããªããªã¨ã¯ä½¿ã£ã¦ãªãã
NeoBundleLazy "mattn/gist-vim", { \ "depends": ["mattn/webapi-vim"], \ "autoload": { \ "commands": ["Gist"], \ }} " vim-fugitiveã¯'autocmd'å¤ç¨ãã¦ãã£ã½ãã¦é 延ãã¼ãä¸å¯ NeoBundle "tpope/vim-fugitive" NeoBundleLazy "gregsexton/gitv", { \ "depends": ["tpope/vim-fugitive"], \ "autoload": { \ "commands": ["Gitv"], \ }}
ããã¹ãç·¨éé¢ä¿
ä¸ç¨®ã®ç¥å¨
ããã¹ãç·¨éè£ä½ã¨ããã°ä»¥ä¸ï¼ã¤ãéçºç°å¢ã謳ãããã«ã¯å¿ é ã§ãã
ãªããããã«é¢ãã¦ã¯ä¸è¨ã®ããã«æå®ãã¦ãã¾ãã
NeoBundle 'tpope/vim-surround' NeoBundle 'vim-scripts/Align' NeoBundle 'vim-scripts/YankRing.vim'
ã§ã¯ãããããã®ä½¿ãæ¹ãç°¡åã«è¦ã¦ããã¾ãã
vim-surround
vim-surroundã¯ãã®åã®éãå²ãã§ãããã®ã«å¯¾ãã¦æä½ããããã©ã°ã¤ã³ã§ããä¸è¨ã®ãããªæ©è½ãããã¾ãããªãã«ã¼ã½ã«ã¯Worldã®oã®ä½ç½®ã«ããã¨ä»®å®ãã¾ãã
ã³ãã³ã | å®è¡å | å®è¡å¾ |
---|---|---|
ds" |
"Hello World" |
Hello world |
ds( |
(Hello World) |
Hello World |
ds) |
(Hello World) |
Hello World |
dst |
<p>Hello World</p> |
Hello World |
cs"' |
"Hello World" |
'Hello World' |
cs([ |
(Hello World) |
[ Hello World ] |
cs(] |
(Hello World) |
[Hello World] |
cs)[ |
(Hello World) |
[ Hello World ] |
cs)] |
(Hello World) |
[Hello World] |
cst<b> |
<p>Hello World</p> |
<b>Hello World</b> |
ys$" |
Hello World Now |
Hello W"orld Now" |
ysw' |
Hello World Now |
Hello W'orld' Now |
ysiw) |
Hello World Now |
Hello (World) Now |
yss" |
Hello World Now |
"Hello World Now" |
Align
ããã¹ãæ´å½¢ç¨ãã©ã°ã¤ã³ã§ããåºæ¬çã«ã¯:Align åºåãæå
ã¨ããå½¢ã§æå®ãã¾ãã
ãã ã空ç½æåï¼ã¹ãã¼ã¹ã»ã¿ãï¼ã®å ´åã¯<Leader>tsp
ããã³<Leader>tab
ã使ç¨ãã¾ãã
é常ã«è©³ãã説æãæ¸ããããã¼ã¸ãããã®ã§è©³ç´°ã¯ãã¡ããåç §ãã¦ãã ããã
YankRing
'p'ã«ãããã¼ã¹ããå®è¡ãããã¨Ctrl-p
ã§å¤ãå±¥æ´ãCtrl-n
ã§æ°ããå±¥æ´ã¸ã¨è²¼ãã¤ããããã¹ãã®ç½®ãæããèµ·ããã¾ãã
neocompleteã«ããæ°æã¡ãããè£å®
ããã¾ãShougoããä½ã®neocompleteãè£å®ã·ã¹ãã ã¨ãã¦å©ç¨ãã¾ãã neocompleteã¯ä¸ççã«ã絶大ãªäººæ°ãèªã£ãneocomplcacheã®å¾ç¶æ©ã ããã§ãã VimãLua対å¿ãã¦ããå¿ è¦ãããã¾ãããé度æ¹åãå³ããããããªã®ã§ããã使ç¨ãã¾ãã
neocompleteã«é¢ãã¦ã®èª¬æãã§ããã»ã©ä½¿ãããªãã¦ããªãã®ã§ãããã«é¢ãã¦ãä»ã®æ¹ã«ãä»»ããããã¾ãã ã¨ãããneocompleteã¯å ¥ããã ãã§å¿«é©ã«ãªãã¾ããåã¯è¨å®çã¯ã»ã¨ãã©ããã©ã«ãç¶æ ã§ãï¼ä¸è¨åç §ï¼ã ãªãneocompleteã¯ä½¿ç¨æ¡ä»¶ãå²ãã¨å³ããï¼+luaãã¤Vim > 7.3.825ï¼ãªã®ã§æ¡ä»¶ã«å½ã¦ã¯ã¾ããªãå ´å㯠neocomplcacheã使ãããã«è¨å®ãã¦ãã¾ãï¼2013-07-08 追è¨: å度確èªããã¨ããä»ç¾å¨ã®æ¡ä»¶ã¯7.3.885以ä¸ã«ãªã£ã¦ãã¾ããï¼ã ã¾ãVimãlessçãªä½¿ãæ¹ï¼ãã¥ã¯ã¼ã¨ãã¦ä½¿ç¨ï¼ããããã¨ãããã®ã§ã¤ã³ãµã¼ãã¢ã¼ãã«ãªãã¾ã§èªã¿è¾¼ã¾ãªãããã«ãã¦ãã¾ãã
" if has('lua') && v:version > 703 && has('patch825') 2013-07-03 14:30 > ãã >= ã«ä¿®æ£ " if has('lua') && v:version >= 703 && has('patch825') 2013-07-08 10:00 å¿ è¦ãã¼ã¸ã§ã³ã885ã«ã¢ãããã¼ãããã¦ãã¾ãã if has('lua') && v:version >= 703 && has('patch885') NeoBundleLazy "Shougo/neocomplete.vim", { \ "autoload": { \ "insert": 1, \ }} " 2013-07-03 14:30 NeoComplCacheã«åããã let g:neocomplete#enable_at_startup = 1 let s:hooks = neobundle#get_hooks("neocomplete.vim") function! s:hooks.on_source(bundle) let g:acp_enableAtStartup = 0 let g:neocomplet#enable_smart_case = 1 " NeoCompleteãæå¹å " NeoCompleteEnable endfunction else NeoBundleLazy "Shougo/neocomplcache.vim", { \ "autoload": { \ "insert": 1, \ }} " 2013-07-03 14:30 åå ä¸æã ãNeoComplCacheEnableã³ãã³ããè¦ã¤ãããªãã®ã§å¤æ´ let g:neocomplcache_enable_at_startup = 1 let s:hooks = neobundle#get_hooks("neocomplcache.vim") function! s:hooks.on_source(bundle) let g:acp_enableAtStartup = 0 let g:neocomplcache_enable_smart_case = 1 " NeoComplCacheãæå¹å " NeoComplCacheEnable endfunction endif
neosnippetã«ããã³ã¼ãå ¥åã®ç°¡ç¥å
ããã¯ãã®è¨äºãæ¸ãã«å½ããè¨å®ãã¡ã¤ã«ãè¦ç´ã段éã§åãå ¥ããã®ã§æ£ç´å©ä¾¿æ§ã¯ã¾ã æªç¥æ°ã ãã ã¹ããããç³»ã¯å¤§éã«ã³ã¼ããæ¸ãéã«ã¯å¿ é ã¨ãè¨ããæ©è½ãªã®ã§ééããªã便å©ã ãããShougoããä½ã ãã
- Vimã®snippetã«ã¤ãã¦ãã¾ãç¥ããªãã£ãã®ã§è¨å®ãã¦ã¿ãã便å©éãã¦ã¤ãã
- snipMate.vimãã¤ã³ã¹ãã¼ã«ãã¦ã¿ã neosnippetã¯snipMateå½¢å¼ã®ã¹ãããããèªããããªã®ã§åèã«
NeoBundleLazy "Shougo/neosnippet.vim", { \ "depends": ["honza/vim-snippets"], \ "autoload": { \ "insert": 1, \ }} let s:hooks = neobundle#get_hooks("neosnippet.vim") function! s:hooks.on_source(bundle) " Plugin key-mappings. imap <C-k> <Plug>(neosnippet_expand_or_jump) smap <C-k> <Plug>(neosnippet_expand_or_jump) xmap <C-k> <Plug>(neosnippet_expand_target) " SuperTab like snippets behavior. imap <expr><TAB> neosnippet#expandable_or_jumpable() ? \ "\<Plug>(neosnippet_expand_or_jump)" \: pumvisible() ? "\<C-n>" : "\<TAB>" smap <expr><TAB> neosnippet#expandable_or_jumpable() ? \ "\<Plug>(neosnippet_expand_or_jump)" \: "\<TAB>" " For snippet_complete marker. if has('conceal') set conceallevel=2 concealcursor=i endif " Enable snipMate compatibility feature. let g:neosnippet#enable_snipmate_compatibility = 1 " Tell Neosnippet about the other snippets let g:neosnippet#snippets_directory=s:bundle_root . '/vim-snippets/snippets' endfunction
ã¡ãªã¿ã«snipMate.vimå½¢å¼ã®ã¹ããããéãèªã¿è¾¼ãã§ä½¿ç¨ãã¦ãã¾ãã
vim-indent-guidesã«ããã¤ã³ãã³ãã®å¯è¦å
vim-indent-guidesãç¨ãããã¨ã§ä¸è¨åçã®ããã«ã¤ã³ãã³ãã¬ãã«ãå¯è¦åãããã¨ãã§ãã¾ãã ä¸è¨ã®ããã«è¨å®ãã¦ãã ããã
NeoBundle "nathanaelkane/vim-indent-guides" " let g:indent_guides_enable_on_vim_startup = 1 2013-06-24 10:00 åé¤ let s:hooks = neobundle#get_hooks("vim-indent-guides") function! s:hooks.on_source(bundle) let g:indent_guides_guide_size = 1 IndentGuidesEnable " 2013-06-24 10:00 è¿½è¨ endfunction
Gundo.vimã«ããé«æ©è½ã¢ã³ãã¥å®è£
æ®æ®µã¯ãã¾ãæ©æµãåãã¦ãã¾ããããå®ã¯Vimã®å ã«æ»ãã»ããç´ãæ©è½ã¯ä»ã®ã¨ãã£ã¿ã¨ã¯æ¯ã¹ç©ã«ãªããªããããé«æ©è½ã§ãã ã©ãé«æ©è½ãï¼ã«é¢ãã¦ã¯gundo.vimãè¶ ä¾¿å©ãªã®ã¨vimã®ã¢ã³ãã¥ããªã¼ã«ã¤ãã¦ã«å³è§£ã§ããããããä¹ã£ã¦ããã®ã§ãã¡ããåç §ãã¦ãã ããã ã¨ããããªã³ã¯å ã«Gundo.vimãããã«ç´ æ´ãããããæ¸ãã¦ããã®ã§è¦ã¦ãã ããã説æã¯ä»ã®äººã«ä»»ãã¦ãä¸è¨ã«åã®è¨å®ãè¼ãã¾ãã
NeoBundleLazy "sjl/gundo.vim", { \ "autoload": { \ "commands": ['GundoToggle'], \}} nnoremap <Leader>g :GundoToggle<CR>
ããããããã°ï¼ãããã¡ãéãã¦ããéã¯ï¼ç°¡æçãªãã¼ã¸ã§ã³ç®¡çã«ãªãã®ã§ãã¼ã¸ã§ã³ç®¡çããç¨ã§ããªãä¿®æ£ãªã©ã«éå®ãã¾ãã
TaskList.vimã«ããTODO管ç
TaskList.vimã¯Eclipseãªã©ã«ä»ãã¦ããTODOãVimã§ãæå¹åããããã®ãã©ã°ã¤ã³ã§ãã
ä¸è¨ã«åã®è¨å®ãè¨è¼ãã¾ãã
NeoBundleLazy "vim-scripts/TaskList.vim", { \ "autoload": { \ "mappings": ['<Plug>TaskList'], \}} nmap <Leader>T <plug>TaskList
ããã°ã©ãã³ã°é¢ä¿
quickrunã«ããå³æå®è¡
<Leader>r
ãå
¥åããã ãã§é©åãªããã°ã©ã ãé¸æããå®è¡ãã¦ãããã®ãvim-quickrunã§ãã
ã¹ã¯ãªãããªã©ããµãã¨æ¸ãã¦ç¢ºèªããã¨ãã«é常ã«éå®ãã¾ãã
ã¾ãããã©ã«ãã§ã¯åæçã«å®è¡ããããVimãåºã¾ãã¾ããvimprocãå©ç¨ãããã¨ã§éåæéä¿¡ãå®å
¨ã«å®è¡å¯è½ãªããåã¯ãã®è¨å®ã§ä½¿ç¨ãã¦ãã¾ãã
NeoBundleLazy "thinca/vim-quickrun", { \ "autoload": { \ "mappings": [['nxo', '<Plug>(quickrun)']] \ }} nmap <Leader>r <Plug>(quickrun) let s:hooks = neobundle#get_hooks("vim-quickrun") function! s:hooks.on_source(bundle) let g:quickrun_config = { \ "*": {"runner": "remote/vimproc"}, \ } endfunction
éåæå®è¡ã«é¢ãã¦ã¯ä½è ç´¹ä»ããã°è¨äºãåç §ãã¦ãã ããã
Tagbarã«ããã¯ã©ã¹ã¢ã¦ãã©ã¤ã³
Tagbarã¯Exuberant ctagsããããã°å ¨é¨åæã«ãã£ã¦ãããç´ æµãã©ã°ã¤ã³ã§ãã Exuberant ctagsã¯Unixç³»OSãªãããã±ã¼ã¸ããã¼ã¸ã£ãªã©ã§å²ãã¨ç°¡åã«å ¥ããããã®ã§ãæ軽ã§ãã
NeoBundleLazy 'majutsushi/tagbar', { \ "autload": { \ "commands": ["TagbarToggle"], \ }, \ "build": { \ "mac": "brew install ctags", \ }} nmap <Leader>t :TagbarToggle<CR>
syntasticã«ããæ§æã¨ã©ã¼è¡¨ç¤º
ããã«é¢ãã¦ã¯ã¾ã ã¡ããã¨ä½¿ã£ã¦ããªãã®ã§ãããã¾ããããè¦ãæãè¯ãããã§ãã
NeoBundle "scrooloose/syntastic", { \ "build": { \ "mac": ["pip install flake8", "npm -g install coffeelint"], \ "unix": ["pip install flake8", "npm -g install coffeelint"], \ }}
Pythoné¢ä¿
virtualenvã¨djangoåé¡ã®è§£æ±º
Vimã§Pythonãæ¸ãå ´åvirtualenvã¨Djangoãåé¡ã«ãªããã¨ãå¤ãã§ãã ã¾ãã¯ããããä¿®æ£ãããã©ã°ã¤ã³ãå ¥ãã¾ãã
" Djangoãæ£ããVimã§èªã¿è¾¼ããããã«ãã NeoBundleLazy "lambdalisue/vim-django-support", { \ "autoload": { \ "filetypes": ["python", "python3", "djangohtml"] \ }} " Vimã§æ£ããvirtualenvãå¦çã§ããããã«ãã NeoBundleLazy "jmcantrell/vim-virtualenv", { \ "autoload": { \ "filetypes": ["python", "python3", "djangohtml"] \ }}
ãã®äºã¤ã®ãã©ã°ã¤ã³ãå ¥ãããã¨ã§å¤§æµã®æ¢åãã©ã°ã¤ã³ï¼pythoncompleteçï¼ã¯åãããã«ãªãã¾ãã
jedi-vimã«ããæå¼·ã®Pythonè£å®ã»ãªãã¡ã¯ã¿ãªã³ã°ã»ãªãã¡ã¬ã³ã¹ç°å¢ãæ§ç¯
ããå®ç§ã§ããjedi-vimæå¼·ã§ãã 使ã£ã¦ã¿ãã°ãããã¾ããããã以ä¸ã®æ©è½ã¯æããªãã§ããããå®ç§ã«é«éã«åä½ãã¾ãã
ããã«ããªãã¨ããã®jedi-vimã¯è£å®ã ãã§ã¯ãªãã®ã§ããããã¤ãæã£ã¦ããæ©è½ãç¾ åããã¨
.
ã«ããæé«ç´ã®è£å®æ©è½ï¼ãããã¯Ctrl-Space
ï¼<Leader>g
ã§å¼ã³åºãå ã«é£ã¶<Leader>d
ã§å®ç¾©ã¾ã§é£ã¶<Leader>r
ã§ååå¤æ´ãªãã¡ã¯ã¿ãªã³ã°<Leader>n
ã§é¢ä¿ããå¤æ°ï¼ãªãã¡ã¯ã¿ãªã³ã°å¯¾è±¡ï¼ãç¾ åK
ã§ã«ã¼ã½ã«ä¸ã®Pydocãéã
ããã ãèãã¨ããªãã ä»ã®ãã©ã°ã¤ã³ã§ãèãããã¨ããæ©è½ã ãªãã¨æãã¨æãã¾ãããå®æ度ãéãã¾ãã ãã¾ã¾ã§ããã¤ãã®ãã©ã°ã¤ã³ã試ãã¦ãã¾ããããããã¦ãã¯äºæ³å¤ã®åä½ããããã使ãç©ã«ãªãã¾ããã§ããã ããããã®jedi-vimããã¯è³¢ããåå使ç¨å¯è½ãªã¬ãã«ã§ã·ã³ãã«ã«æ©è½ãã¦ããã¾ãã
ä¸è¨ãåã®è¨å®ã§ãã<Leader>r
ã¯quickrunã¨è¢«ããã大æåã«å¤æ´ãã¦æãã¾ãã
ã¾ãè£å®ãæåããé¸æããã¦ããã¨ä½¿ãã«ãããããè£å®èªåé¸ææ©è½ããªãã«ãã¦ããã¾ãã
ããã«é¢æ°å®ç¾©ããã¬ãã¥ã¼ãããç´ æ´ãããæ©è½ãããã®ã§ããã¦ã£ã³ãã¦ãµã¤ãºãã¬ã¿ã¬ã¿å¤ããã®ã§ããããªãã«ãã¦ããã¾ãã
" 2013-07-03 14:30 æ¸ãæ¹ãæãã£ããééãã¦ããã®ã§ä¿®æ£ "NeoBundleLazy "davidhalter/jedi-vim", { " \ "autoload": { " \ "filetypes": ["python", "python3", "djangohtml"], " \ "build": { " \ "mac": "pip install jedi", " \ "unix": "pip install jedi", " \ } " \ }} NeoBundleLazy "davidhalter/jedi-vim", { \ "autoload": { \ "filetypes": ["python", "python3", "djangohtml"], \ }, \ "build": { \ "mac": "pip install jedi", \ "unix": "pip install jedi", \ }} let s:hooks = neobundle#get_hooks("jedi-vim") function! s:hooks.on_source(bundle) " jediã«vimã®è¨å®ãä»»ããã¨'completeopt+=preview'ããã®ã§ " èªåè¨å®æ©è½ãOFFã«ãæåã§è¨å®ãè¡ã let g:jedi#auto_vim_configuration = 0 " è£å®ã®æåã®é ç®ãé¸æãããç¶æ ã ã¨ä½¿ãã«ãããããªãã«ãã let g:jedi#popup_select_first = 0 " quickrunã¨è¢«ããã大æåã«å¤æ´ let g:jedi#rename_command = '<Leader>R' " gundoã¨è¢«ããã大æåã«å¤æ´ (2013-06-24 10:00 追è¨ï¼ let g:jedi#goto_command = '<Leader>G' endfunction
ããã¥ã¡ã³ãé¢ä¿ï¼Pandocï¼
ããã¥ã¡ã³ãå¤æã½ããPandocã使ããç¶æ
ã«ãªã£ã¦ãããã¨ãæ¡ä»¶ã§ãã
ããã§ã¯Cabalã§Pandocãã¤ã³ã¹ãã¼ã«ã~/.cabal/bin
ã®ä¸ã«pandoc
ã¨ããå®è¡ãã¡ã¤ã«ãããã¨ä»®å®ãã¾ãã
vim-pandoc
ãããªãã«é«æ©è½ãªvim-pandocã§ãããå¾è¨ãããã©ã°ã¤ã³ã®ããã«ãã¥ã¯ã¼ãç¡ããã åºæ¬çã«ã¯ã·ã³ã¿ãã¯ã¹ã»ã¤ã³ãã³ãç¨ã«ã¤ã³ã¹ãã¼ã«ãã¾ããä¸è¨ãåã®è¨å®ã§ãã
NeoBundleLazy "vim-pandoc/vim-pandoc", { \ "autoload": { \ "filetypes": ["text", "pandoc", "markdown", "rst", "textile"], \ }}
åèªèº«ãã®ãã©ã°ã¤ã³ã®æ©è½ã¯ã»ã¨ãã©ä½¿ç¨ãã¦ããªãã®ã§èå³ãããæ¹ã¯æ¬å®¶READMEãèªãã§ãã ããã
shareboard & shareboard.vim
shareboard.vim ã¯ã©ããã¦ãVimã§æ©è½ããè¯ããã¥ã¯ã¼ããªãã£ãã®ã§éååã«èªåã§ä½ã£ããã©ã°ã¤ã³ã§ãã shareboard ã¨ããHTTPãã¼ã¹ã®ã¯ãªãããã¼ãã¿ã¤ãããã°ã©ã ããã¼ã¹ã«ããã¬ãã¥ã¼ã表示ãã¾ãã
ã¨ãããã便å©ãªãã§ãããå°ãã¤ã³ã¹ãã¼ã«ãªã©ã®é£æ度ãé«ããããã¥ã¼ããªã¢ã«å½¢å¼ã§èª¬æãã¾ãã
PySideããã³Qtã®ã¤ã³ã¹ãã¼ã«
Mac OS X
% brew install pyside
Debian
% sudo aptitude install python-pyside
Shareboardã®ã¤ã³ã¹ãã¼ã«
% pip install shareboard
èµ·å確èª
% shareboard start
ãå®è¡å¾éãã·ã§ã«ï¼ã¿ã¼ããã«ï¼ã«ã¦
% shareboard set "Hello" % shareboard get Hello
ã¨ãªãã確èªã確èªå¾
Ctrl-C
ã§å ã®shareboard start
ãæ¢ããGUIèµ·å確èª
% shareboard start -v
ã«ã¦ã¦ã£ã³ãã¦ãç«ã¡ä¸ããã確èªã確èªå¾ã¦ã£ã³ãã¦ãéãã
ãããããã¹ã¦ãã¾ãè¡ãã°æ®ãã¯ä¸è¨è¨å®ãè¡ããã¨ã§ä½¿ç¨å¯è½ã«ãªãã¾ãã
NeoBundleLazy "lambdalisue/shareboard.vim", { \ "autoload": { \ "commands": ["ShareboardPreview", "ShareboardCompile"], \ }, \ "build": { \ "mac": "pip install shareboard", \ "unix": "pip install shareboard", \ }} function! s:shareboard_settings() nnoremap <buffer>[shareboard] <Nop> nmap <buffer><Leader> [shareboard] nnoremap <buffer><silent> [shareboard]v :ShareboardPreview<CR> nnoremap <buffer><silent> [shareboard]c :ShareboardCompile<CR> endfunction autocmd MyAutoCmd FileType rst,text,pandoc,markdown,textile call s:shareboard_settings() let s:hooks = neobundle#get_hooks("shareboard.vim") function! s:hooks.on_source(bundle) " VimããPandocãè¦ããªããã¨ãå¤ã ããã®ã§å¿µã®çº~/.cabal/binãPATHã«è¿½å let $PATH=expand("~/.cabal/bin:") . $PATH endfunction
ãªãã«ã¹ã¿ã CSSã使ãããå ´åãããã¹ãã®ç½®ãæãå¦çãªã©ãåã¾ãããå ´å㯠shareboard.vim#advanced-usage ãåç §ãã¦ãã ããã
æå¾ã«
æ£ç´æ¸ãã®ç²ããï¼ï¼ç¬ãæ¬å½ã¯powerlineã®ã¤ã³ã¹ãã¼ã«æ³ãªã©ãæ¸ããã¨æã£ã¦ããã®ã§ããé¢åãããããã®ã§ããã¯ä»ã®äººã«ä»»ãã¾ããGoogleå çã«èãã°èª°ã詳ãã解説ãã¦ããã§ãããããã¶ãã
追è¨
çµæ§åé¿ãåºãã¿ããã§ã¡ãã£ã¨å¬ããã§ãããããããªãå¬ããã§ãï¼çé¡ã
åé¿ã®ä¸ã§ããã¤ãæ°ã«ãªã£ãç¹ã«é¢ãã¦æ¸ãã¾ãã
Pythoné¢ä¿ãªããªãï¼
ã¯ãããã®ã¨ããã§ãï¼ç¬ã æåã¯ãVIMãæå¼·ã®éçºç°å¢ã«ãããã¨ãã¦ããã®ã§ãããåæ¸ããè¨äºã«åãããããã«Pythonãã¤ããã ãã§ãï¼åå人åºæ¬çã«ã¯Pythonã使ããã¨ãå¤ãã¨ããã®ãããã¾ãï¼ã åºæ¬çã«ã¯VIMã®ä¾¿å©è¨å®éã¿ãããªããªã§æ¸ãã¾ããããªã®ã§ããã«æ¸ããã¦ããå 容ã§Pythonã«å ¨ãé¢ä¿ãªãè¨å®ãªã©ãå¤ã ããã¾ãã
ãªãã§ããããVIM使ã£ã¦ãã®ï¼PyCharmã§ããããã
Vimperatorã¨ã使ã£ã¦ãã»ã©VIMãã¼ãã¤ã³ãä¾åãã¦ãã ãã§ãï¼ç¬ã
ã¾ãä¸ã¤ç´å¾ã§ããããªçç±ããããã¨ãããªãã°ããããããã¹ãå½¢å¼ãã¡ã¤ã«ãVimã¨ããå ±éã¤ã³ã¿ã¼ãã§ã¤ã¹ã§ç·¨éã§ããã»ãã楽ã ããï¼ã£ã¦ãã¨ãããã§ããã
C/C++ã¯Code Block, C#ã¯Mono DeveloperãPythonã¯Pydevâ¦ã®ããã«åããã¨çµæ§å¤§å¤ãªãã§ããããVimãªãã°å ±éè¨å®ã§é常ã®ããã¹ãç·¨éè¨å®ããã¦ããã¡ã¤ã«ã¿ã¤ãè¨å®ã§è¨èªä¾åè¨å®ãããã°ä¸ã¤ã®ã½ããã ãã§å®çµããããå人çã«ã¯æ¥½ã§ããã¾ã好ã¿ã®åé¡ã§ãããJavaã¨ãã¯Eclipseä¸æã ã¨æãã¾ããã
ropevimã®è©±ã¯ï¼
æ使ã£ã¦ã¾ããVimãæå¼·ã®Python IDEã«ãã - ropevimã«ãããªãã¡ã¯ã¿ãªã³ã°ã ãã å人çã«ã¯jedi-vimããå ¥ã£ã¦ãã°ä¸äºOKã ã¨æã£ãã®ã§æ¬è¨äºã§ã¯è¨åãã¦ãã¾ããã
vim-markgreenã®è©±ã¯ï¼
ãããæ使ã£ã¦ã¾ããVimãæå¼·ã®Python IDEã«ãã - vim-makegreenã«ããTDDéçºã ãã æè¿ã®ã¦ããããã¹ãã½ããï¼Pythonã«éããï¼ã¯è²ãã¤ãã¦ã°ã©ãã£ã«ã«ãªãã®ãå¤ãã®ã§ã¿ã¼ããã«ã§èµ·åãã¦ãããããã¼ãæãæ¼åºãããã®ã§æè¿ã¯ä¸å使ã£ã¦ã¾ãããVimshellã¨ã使ãã°ãããã§ããããzshä¾åçãé ·ãã®ã§ãããã ãã¯éå¹ççã§ããzshããèµ·åãã¦ãã¾ãï¼Guakeã¨ã使ã£ã¦ãã®ã§ããã¾ã§é¢åãªä½æ¥ã§ã¯ãªãã§ãããï¼ã
ã¾ãåé¿çµæ§ãã£ããã©åããããããããªãã¦Shougoããã¨mattnãããã¸ããã§ã£ã¦è¨äºãªãã§ããããããããç´ æ´ããããã¼ã«ã»ãã©ã°ã¤ã³ãéçºã§ãã人æã«ãªãããâ¦