Plugin copying code to clipboard formatted with line numbers and path to file.
app/services/billing/invoice_sender.rb:10-20 ▾
────────────────────────────────────────────────────────────────────────────────
1 | module Billing
2 | class InvoiceSender
8 | def call
⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝⁝
10 |
11 | @invoice.transaction do
12 | @invoice.lock!
13 | @invoice.update!(sent_at: Time.current)
14 | @invoice.line_items.each(&:freeze_price!)
> 15 | @mailer.invoice(@invoice).deliver_later
16 | log_delivery
17 | end
18 | rescue ActiveRecord::RecordInvalid => e
19 | notify_failure(e)
20 | end
- The plugin is good way to share your code even if your chat does not support block code format
- No more explaining where this fragment of code comes from
- Works out of the box!
via Plug, Neobundle or Vundle:
Plug 'dominikduda/vim_yank_with_context'
NeoBundle 'dominikduda/vim_yank_with_context'
Plugin 'dominikduda/vim_yank_with_context'
via Pathogen:
git clone https://github.com/dominikduda/vim_yank_with_context.git ~/.vim/bundle/vim_yank_with_context
Just enter visual line mode (V), select lines and click one of the mappings:
Control + y- yank selected lines marked with>and 3 lines around them (5 Control + yfor 5 lines)g Control + y- yank only selected lines, without marksm Control + y- mark selected lines in the last yank (regenerates the clipboard)
let g:vim_yank_with_context#yank_mapping = '<C-y>'let g:vim_yank_with_context#plain_yank_mapping = 'g<C-y>'let g:vim_yank_with_context#mark_mapping = 'm<C-y>'let g:vim_yank_with_context#surrounding_lines = 3