diff options
author | Adrian Kummerlaender | 2016-03-07 21:41:39 +0100 |
---|---|---|
committer | Adrian Kummerlaender | 2016-03-07 21:41:39 +0100 |
commit | 11890827f16dbcc2856a4305ac6d068df679cff2 (patch) | |
tree | cdce61677c2f4a1d80699ef0bcd443cf2666a518 | |
parent | 9528a454b425fb8d06cd66194eb823b7ab4745b1 (diff) | |
download | dotfiles-11890827f16dbcc2856a4305ac6d068df679cff2.tar dotfiles-11890827f16dbcc2856a4305ac6d068df679cff2.tar.gz dotfiles-11890827f16dbcc2856a4305ac6d068df679cff2.tar.bz2 dotfiles-11890827f16dbcc2856a4305ac6d068df679cff2.tar.lz dotfiles-11890827f16dbcc2856a4305ac6d068df679cff2.tar.xz dotfiles-11890827f16dbcc2856a4305ac6d068df679cff2.tar.zst dotfiles-11890827f16dbcc2856a4305ac6d068df679cff2.zip |
Implement cite command in _pentadactyl_
* `vimrc` changes are required to prevent _airline_ from generating unnecessary warnings concerning the spaces used to signal a blockquote
-rw-r--r-- | pentadactyl/.pentadactylrc | 15 | ||||
-rw-r--r-- | vim/.vimrc | 26 |
2 files changed, 29 insertions, 12 deletions
diff --git a/pentadactyl/.pentadactylrc b/pentadactyl/.pentadactylrc index 7826648..702c881 100644 --- a/pentadactyl/.pentadactylrc +++ b/pentadactyl/.pentadactylrc @@ -59,3 +59,18 @@ if ( selection ) { dactyl.execute('!echo ' + entry + ' >> ~/note/src/web/inbox.wiki'); EOF nmap b :push2inbox<CR> + +command! cite -js <<EOF +function escape(msg) { + return msg.replace(/([^a-zA-Z0-9_])/g, "\\$1"); +} + +var entry = '\\n' + + '\\ \\ \\ \\ \\[...\\] ' + escape(content.getSelection().toString()) + ' \\[...\\]\\n' + + '\\ \\ \\ \\ \\<br\\/\\>\\<br\\/\\>\\n' + + '\\ \\ \\ \\ ― ' + escape(buffer.URL) + + '\\n'; + +dactyl.execute('!echo ' + entry + ' >> ~/note/src/web/inbox.wiki'); +EOF +nmap c :cite<CR> @@ -50,6 +50,7 @@ autocmd FocusGained *.wiki :redraw! autocmd FileType scheme setlocal shiftwidth=2 tabstop=2 expandtab autocmd FileType vimwiki setlocal noswapfile nonumber foldcolumn=1 autoread +autocmd FileType vimwiki let g:airline#extensions#whitespace#checks=['indent', 'trailing', 'long'] vnoremap cc "+y nnoremap cc "+p @@ -76,18 +77,19 @@ nnoremap <A-up> <C-W>k nnoremap <A-down> <C-W>j set laststatus=2 -let g:airline#extensions#tabline#enabled = 1 -let g:airline#extensions#tabline#show_buffers = 0 -let g:airline#extensions#tabline#show_tab_type = 0 -let g:airline#extensions#tabline#formatter = 'unique_tail_improved' -let g:airline#extensions#tabline#buffer_idx_mode = 0 -let g:airline#extensions#tabline#left_sep = '' -let g:airline#extensions#tabline#left_alt_sep = '' -let g:airline#extensions#tabline#right_sep = '' -let g:airline#extensions#tabline#right_alt_sep = '' -let g:airline#extensions#tabline#show_close_button = 0 -let g:airline#extensions#tabline#show_splits = 0 -let g:airline#extensions#tabline#show_tab_nr = 0 +let g:airline#extensions#tabline#enabled = 1 +let g:airline#extensions#tabline#show_buffers = 0 +let g:airline#extensions#tabline#show_tab_type = 0 +let g:airline#extensions#tabline#formatter = 'unique_tail_improved' +let g:airline#extensions#tabline#buffer_idx_mode = 0 +let g:airline#extensions#tabline#left_sep = '' +let g:airline#extensions#tabline#left_alt_sep = '' +let g:airline#extensions#tabline#right_sep = '' +let g:airline#extensions#tabline#right_alt_sep = '' +let g:airline#extensions#tabline#show_close_button = 0 +let g:airline#extensions#tabline#show_splits = 0 +let g:airline#extensions#tabline#show_tab_nr = 0 +let g:airline#extensions#whitespace#mixed_indent_algo = 2 let g:vimwiki_list = [{ \ 'path': '~/note/', |