aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-05-30 23:27:02 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-05-30 23:27:02 +1200
commite132c864e873e8f8f040f4048e992d20468e4255 (patch)
tree71a1ceb97ad44003fa886735bcf490be7cf29b65
parentAdd some structure to .gitmodules (diff)
downloaddotfiles-e132c864e873e8f8f040f4048e992d20468e4255.tar.gz
dotfiles-e132c864e873e8f8f040f4048e992d20468e4255.zip
Spin off fixed_join Vim plugin
-rw-r--r--.gitmodules3
-rw-r--r--Makefile7
m---------vim/bundle/fixed_join0
-rw-r--r--vim/doc/fixed_join.txt52
-rw-r--r--vim/plugin/fixed_join.vim45
5 files changed, 3 insertions, 104 deletions
diff --git a/.gitmodules b/.gitmodules
index 90217ff7..8772a8e5 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,4 +1,7 @@
# My Vim plugins
+[submodule "vim/bundle/fixed_join"]
+ path = vim/bundle/fixed_join
+ url = https://sanctum.geek.nz/code/vim-fixed-join.git
[submodule "vim/bundle/insert_suspend_hlsearch"]
path = vim/bundle/insert_suspend_hlsearch
url = https://sanctum.geek.nz/code/vim-insert-suspend-hlsearch.git
diff --git a/Makefile b/Makefile
index def064d6..ff1cad84 100644
--- a/Makefile
+++ b/Makefile
@@ -82,7 +82,6 @@
dist-vim-plugin-big-file-options \
dist-vim-plugin-command-typos \
dist-vim-plugin-copy-linebreak \
- dist-vim-plugin-fixed-join \
dist-vim-plugin-mail-mutt \
dist-vim-plugin-strip-trailing-whitespace \
dist-vim-plugin-toggle-option-flag
@@ -678,7 +677,6 @@ dist-vim-plugin: dist-vim-plugin-auto-backupdir \
dist-vim-plugin-command-typos \
dist-vim-plugin-copy-linebreak \
dist-vim-plugin-detect-background \
- dist-vim-plugin-fixed-join \
dist-vim-plugin-mail-mutt \
dist-vim-plugin-strip-trailing-whitespace \
dist-vim-plugin-toggle-option-flag
@@ -718,11 +716,6 @@ dist-vim-plugin-detect-background: \
vim/doc/detect_background.txt \
VERSION
sh dist/vim-plugin.sh detect_background
-dist-vim-plugin-fixed-join: \
- vim/plugin/fixed_join.vim \
- vim/doc/fixed_join.txt \
- VERSION
- sh dist/vim-plugin.sh fixed_join
dist-vim-plugin-mail-mutt: \
vim/plugin/mail_mutt.vim \
vim/doc/mail_mutt.txt \
diff --git a/vim/bundle/fixed_join b/vim/bundle/fixed_join
new file mode 160000
+Subproject 9e17f60eec422d2fd2669b909d602dfb05ac546
diff --git a/vim/doc/fixed_join.txt b/vim/doc/fixed_join.txt
deleted file mode 100644
index d12985ef..00000000
--- a/vim/doc/fixed_join.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-*fixed_join.txt* For Vim version 7.0 Last change: 2017 November 12
-
-DESCRIPTION *fixed_join*
-
-This plugin provides a mapping target and an optional command to `:join` lines
-in normal mode while keeping the cursor in-place.
-
-REQUIREMENTS *fixed_join-requirements*
-
-This plugin is only available if 'compatible' is not set.
-
-MAPPINGS *fixed_join-mappings*
- *<Plug>FixedJoin*
-
-This plugin provides a mapping target |<Plug>FixedJoin| to create a binding
-for a user to `:join` lines in normal mode without the cursor jumping around.
-
-If the user's configuration does not specify a mapping to this target by the
-time this plugin is loaded, it will attempt to map 'J' in normal mode to
-simply replace the default functionality.
-
-COMMANDS *fixed_join-commands*
- *:FixedJoin*
-
-The plugin also provides a `:FixedJoin` command if Vim has the
-|+user_commands| feature, but this is not required.
-
-ALTERNATIVE *fixed-join-alternative*
-
-If you don't mind clobbering a mark, this whole plugin can be replaced with
-one mapping in your |vimrc|:
->
- :nnoremap J mzJ`z
-<
-This was what the author was doing before writing this plugin as an exercise.
-
-AUTHOR *fixed_join-author*
-
-Written and maintained by Tom Ryder <tom@sanctum.geek.nz>.
-
-LICENSE *fixed_join-license*
-
-Licensed for distribution under the same terms as Vim itself (see |license|).
-
-DISTRIBUTION *fixed_join-distribution*
-
-This plugin lives in Tom Ryder's "dotfiles" suite, and may eventually be spun
-off into a separate distribution as it solidifies and this documentation
-improves. See <https://sanctum.geek.nz/cgit/dotfiles.git/about/> for more
-information.
-
- vim:tw=78:ts=8:ft=help:norl:
diff --git a/vim/plugin/fixed_join.vim b/vim/plugin/fixed_join.vim
deleted file mode 100644
index 2e7f2abd..00000000
--- a/vim/plugin/fixed_join.vim
+++ /dev/null
@@ -1,45 +0,0 @@
-"
-" fixed_join.vim: User-defined key mapping and optional command to keep cursor
-" in place when joining lines in normal mode.
-"
-" Author: Tom Ryder <tom@sanctum.geek.nz>
-" License: Same as Vim itself
-"
-if exists('g:loaded_fixed_join') || &compatible
- finish
-endif
-let g:loaded_fixed_join = 1
-
-" Declare function
-function! s:FixedJoin()
-
- " Save current cursor position
- let l:lc = line('.')
- let l:cc = col('.')
-
- " Build and execute join command
- let l:command = '.,+' . v:count1 . 'join'
- execute l:command
-
- " Restore cursor position
- call cursor(l:lc, l:cc)
-
-endfunction
-
-" Create mapping proxy to the function just defined
-noremap <silent> <unique>
- \ <Plug>FixedJoin
- \ :<C-U>call <SID>FixedJoin()<CR>
-
-" If there's no mapping to it already, try to bind normal-mode J to it, to
-" simply replace the old functionality
-nmap <unique>
- \ J
- \ <Plug>FixedJoin
-
-" Create a command as well in case it's useful
-if has('user_commands')
- command -nargs=0
- \ FixedJoin
- \ call <SID>FixedJoin()
-endif