Last active
August 29, 2015 13:57
-
-
Save mitaroThanken/9888591 to your computer and use it in GitHub Desktop.
hateblo.vim プラグイン (https://github.com/moznion/hateblo.vim) からの接続先を Vim 起動後に変える
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" .hateblo.vim での定義を破棄し、再定義 | |
unlet g:hateblo_vim | |
let g:hateblo_vim = { | |
\ 'user': 'user_name', | |
\ 'api_key': 'api_key', | |
\ 'api_endpoint': 'https://blog.hatena.ne.jp/.../atom', | |
\ 'WYSIWYG_mode': 0, | |
\ 'always_yes': 0, | |
\ 'edit_command': 'edit' | |
\ } | |
" plugin/hateblo.vim での定義を再定義 | |
let g:hateblo_vim['edit_command'] = get(g:hateblo_vim, 'edit_command', 'edit') | |
unlet g:hateblo_entry_api_endpoint | |
let g:hateblo_entry_api_endpoint = g:hateblo_vim['api_endpoint'] . '/entry' | |
" :HatebloList で表示されるエントリーを破棄(以前に表示した内容を忘れさせる) | |
if exists('b:hateblo_entries') | |
unlet b:hateblo_entries | |
endif | |
" 切り替え完了 | |
echo "hateblo -> ...hateblo.jp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" .vimrc から抜粋 | |
" はてなブログサポート - https://github.com/moznion/hateblo.vim | |
NeoBundle 'moznion/hateblo.vim', { | |
\ 'depends': ['mattn/webapi-vim', 'Shougo/unite.vim'] | |
\ } | |
nnoremap [hateblo] <Nop> | |
nmap <Space>h [hateblo] | |
nnoremap [g:hateblo_vim] <Nop> | |
nmap [hateblo]t [g:hateblo_vim] | |
nnoremap <silent>[g:hateblo_vim]f :source ~/hateblo.foo.vim<CR> | |
nnoremap <silent>[g:hateblo_vim]b :source ~/hateblo.bar.vim<CR> | |
nnoremap <silent>[hateblo]c :HatebloCreateDraft<CR> | |
nnoremap <silent>[hateblo]l :HatebloList<CR> | |
nnoremap <silent>[hateblo]u :HatebloUpdate<CR> | |
nnoremap <silent>[hateblo]d :HatebloDelete<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment