Skip to content

Commit

Permalink
Add usage instructions and fix <Plug> definition
Browse files Browse the repository at this point in the history
  • Loading branch information
rnevius committed Apr 19, 2020
1 parent 5b5ed81 commit f35cba4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,11 @@ Execute the contents of a register on each line of a visual selection.

![guillotine](https://upload.wikimedia.org/wikipedia/commons/thumb/1/14/Maiden_d%27halifax_Croker.jpg/197px-Maiden_d%27halifax_Croker.jpg)

## Usage

Add a mapping to your (Neo)vim configuration:

```vim
xnoremap @ <Plug>(execution_execute)
```

16 changes: 16 additions & 0 deletions plugin/execution.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
" vim-execution
" Maintainer: rnevius <[email protected]>
" Version: 0.0.1
" License: MIT
" Location: plugin/execution.vim
" Website: https://github.com/rnevius/vim-execution


function! execution#ExecuteRegisterOnVisualLineRange()
echo "@".getcmdline()
execute ":'<,'>normal! @" . nr2char(getchar())
endfunction

xnoremap <silent> <Plug>(execution_execute) :<C-u> call
\ execution#ExecuteRegisterOnVisualLineRange()<CR>

0 comments on commit f35cba4

Please sign in to comment.