aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-07-24 15:11:54 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-07-24 15:11:54 +1200
commit81ce247cc6c7a6fa45bad76dbc13d43e72085ba3 (patch)
tree9abae79f778c31652c6fe345156817c30536029f
parentImproved colon_operator.vim plugin (diff)
downloaddotfiles-81ce247cc6c7a6fa45bad76dbc13d43e72085ba3.tar.gz
dotfiles-81ce247cc6c7a6fa45bad76dbc13d43e72085ba3.zip
Spin out colon_operator.vim plugin into submodule
-rw-r--r--.gitmodules3
m---------vim/bundle/colon_operator0
-rw-r--r--vim/plugin/colon_operator.vim36
3 files changed, 3 insertions, 36 deletions
diff --git a/.gitmodules b/.gitmodules
index c7d2d0bd..972ca896 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -5,6 +5,9 @@
[submodule "vim/bundle/cmdwin_ctrlc"]
path = vim/bundle/cmdwin_ctrlc
url = https://sanctum.geek.nz/code/vim-cmdwin-ctrlc.git
+[submodule "vim/bundle/colon_operator"]
+ path = vim/bundle/colon_operator
+ url = https://sanctum.geek.nz/code/vim-colon-operator.git
[submodule "vim/bundle/copy_linebreak"]
path = vim/bundle/copy_linebreak
url = https://sanctum.geek.nz/code/vim-copy-linebreak.git
diff --git a/vim/bundle/colon_operator b/vim/bundle/colon_operator
new file mode 160000
+Subproject 5525627dd9727f2ee713e3a06145a145410bcd7
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 <tom@sanctum.geek.nz>
-" 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."\<CR>"
-endfunction
-
-" Clear command so that we get prompted to input it, set operator function,
-" and return <expr> motions to run it
-function! ColonMap() abort
- unlet! s:command
- set operatorfunc=ColonOperator
- return 'g@'
-endfunction
-
-" Set up mapping
-nnoremap <expr> <silent> <unique>
- \ <Plug>(ColonOperator)
- \ ColonMap()