From 81ce247cc6c7a6fa45bad76dbc13d43e72085ba3 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 24 Jul 2018 15:11:54 +1200 Subject: Spin out colon_operator.vim plugin into submodule --- vim/bundle/colon_operator | 1 + vim/plugin/colon_operator.vim | 36 ------------------------------------ 2 files changed, 1 insertion(+), 36 deletions(-) create mode 160000 vim/bundle/colon_operator delete mode 100644 vim/plugin/colon_operator.vim (limited to 'vim') diff --git a/vim/bundle/colon_operator b/vim/bundle/colon_operator new file mode 160000 index 00000000..5525627d --- /dev/null +++ b/vim/bundle/colon_operator @@ -0,0 +1 @@ +Subproject commit 5525627dd9727f2ee713e3a06145a145410bcd7c diff --git a/vim/plugin/colon_operator.vim b/vim/plugin/colon_operator.vim deleted file mode 100644 index e752e87c..00000000 --- a/vim/plugin/colon_operator.vim +++ /dev/null @@ -1,36 +0,0 @@ -" -" colon_operator.vim: Select ranges and run colon commands on them, rather -" like the ! operator but for colon commands like :sort. -" -" Author: Tom Ryder -" License: Same as Vim itself -" -if exists('g:loaded_colon_operator') || &compatible - finish -endif -if v:version < 700 - finish -endif -let g:loaded_colon_operator = 1 - -" Operator prompts for a command if it doesn't have one from a prior run, and -" then runs the command on the selected text -function! ColonOperator(type) abort - if !exists('s:command') - let s:command = input('g:', '', 'command') - endif - execute 'normal! :''[,'']'.s:command."\" -endfunction - -" Clear command so that we get prompted to input it, set operator function, -" and return motions to run it -function! ColonMap() abort - unlet! s:command - set operatorfunc=ColonOperator - return 'g@' -endfunction - -" Set up mapping -nnoremap - \ (ColonOperator) - \ ColonMap() -- cgit v1.2.3