From 48cdd5b9d745555a7a51542785c07548ed0cb1ba Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Fri, 18 Oct 2019 20:17:35 +0200 Subject: [PATCH 1/4] Updated readme from doc --- README.md | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4cd4129..957bf6a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,26 @@ -# vim-split-open +# SplitOpen -This is my first vim plugin. It provides a command to open a combination of c++ source and header file in a new tab split side-by-side. +This vim plugin opens file-pairs in a new split-window tab + +## Usage + +Use + + :SplitOpen filename + +with a .cpp or .h file as filename to open a new tab containing a vertical split +with the corresponding header file in the left window and the corresponding +source file in the right window. + +## License + +SplitOpen is GPL-3.0 licensed. See LICENSE file for more info. + +## Changelog + +v0.0.2 +* Added delay-loading +* Added documentation + +v0.0.1 +* Initial release From c170d0779f5ca58625bbd66c4ddf59688064c4c6 Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Fri, 18 Oct 2019 16:17:49 +0200 Subject: [PATCH 2/4] Set fzf.vim keybinding (dangerous) --- plugin/splitopen.vim | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugin/splitopen.vim b/plugin/splitopen.vim index 9036e30..f7741dc 100644 --- a/plugin/splitopen.vim +++ b/plugin/splitopen.vim @@ -1 +1,8 @@ command -nargs=1 SplitOpen :call splitopen#SplitOpenFile("") + +let g:fzf_action = { + \ 'ctrl-s': 'SplitOpen', + \ 'ctrl-t': 'tab split', + \ 'ctrl-x': 'split', + \ 'ctrl-v': 'vsplit' } + From a2736f4579513921f06a1e8bdc9132290f2b58e4 Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Fri, 18 Oct 2019 20:57:12 +0200 Subject: [PATCH 3/4] Added config option g:splitopen_set_fzf_keys to enable fzf keybinding. Disabled by default. --- README.md | 14 ++++++++++++++ doc/splitopen.txt | 28 +++++++++++++++++++++++----- plugin/splitopen.vim | 15 ++++++++++----- 3 files changed, 47 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 957bf6a..318fd50 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,20 @@ with a .cpp or .h file as filename to open a new tab containing a vertical split with the corresponding header file in the left window and the corresponding source file in the right window. +## Configuration + +You can configure the following settings: + + +### g:splitopen_set_fzf_keys + +Set this option to 1 + + let g:splitopen_set_fzf_keys = 1 + +to have SplitOpen overwrite the default fzf keybindings ctrl-t/x/v for opening +files in splits or tabs to add an addional binding ctrl-s to call SplitOpen. + ## License SplitOpen is GPL-3.0 licensed. See LICENSE file for more info. diff --git a/doc/splitopen.txt b/doc/splitopen.txt index 66af367..f7da20a 100644 --- a/doc/splitopen.txt +++ b/doc/splitopen.txt @@ -3,9 +3,11 @@ ================================================================================ CONTENTS *SplitOpenContents* - 1. Usage ..................................|SplitOpenUsage| - 2. License ................................|SplitOpenLicense| - 3. Changelog ..............................|SplitOpenChangelog| + 1. Usage ..............................|SplitOpenUsage| + 2. Configuration ......................|SlitOpenConfiguraton| + 2.1 g:splitopen_set_fzf_keys.......|SplitOpenConfiguration_set_fzf_keys| + 3. License ............................|SplitOpenLicense| + 4. Changelog ..........................|SplitOpenChangelog| ================================================================================ 1. Usage *SplitOpenUsage* @@ -19,12 +21,28 @@ with the corresponding header file in the left window and the corresponding source file in the right window. ================================================================================ -2. License *SplitOpenLicense* +2. Configuration *SplitOpenConfiguration* + +You can configure the following settings: + +-------------------------------------------------------------------------------- + +2.1 g:splitopen_set_fzf_keys *SplitOpenConfiguration_set_fzf_keys* + +Set this option to 1 + + let g:splitopen_set_fzf_keys = 1 + +to have SplitOpen overwrite the default fzf keybindings ctrl-t/x/v for opening +files in splits or tabs to add an addional binding ctrl-s to call SplitOpen. + +================================================================================ +3. License *SplitOpenLicense* SplitOpen is GPL-3.0 licensed. See LICENSE file for more info. ================================================================================ -3. Changelog *SplitOpenChangelog* +4. Changelog *SplitOpenChangelog* v0.0.2 * Added delay-loading diff --git a/plugin/splitopen.vim b/plugin/splitopen.vim index f7741dc..91cabdd 100644 --- a/plugin/splitopen.vim +++ b/plugin/splitopen.vim @@ -1,8 +1,13 @@ command -nargs=1 SplitOpen :call splitopen#SplitOpenFile("") -let g:fzf_action = { - \ 'ctrl-s': 'SplitOpen', - \ 'ctrl-t': 'tab split', - \ 'ctrl-x': 'split', - \ 'ctrl-v': 'vsplit' } +if !exists('g:splitopen_set_fzf_keys') + let g:splitopen_set_fzf_keys = 0 +endif +if g:splitopen_set_fzf_keys + let g:fzf_action = { + \ 'ctrl-s': 'SplitOpen', + \ 'ctrl-t': 'tab split', + \ 'ctrl-x': 'split', + \ 'ctrl-v': 'vsplit' } +endif From 657fc628d57c6d2ef8349774978fe1ed3def9f42 Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Fri, 18 Oct 2019 21:05:08 +0200 Subject: [PATCH 4/4] Updated changelog --- README.md | 3 +++ doc/splitopen.txt | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 318fd50..823c8a7 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,9 @@ SplitOpen is GPL-3.0 licensed. See LICENSE file for more info. ## Changelog +v0.0.3 +* Add fzf.vim keybinding + v0.0.2 * Added delay-loading * Added documentation diff --git a/doc/splitopen.txt b/doc/splitopen.txt index f7da20a..c4b3e6e 100644 --- a/doc/splitopen.txt +++ b/doc/splitopen.txt @@ -44,9 +44,10 @@ SplitOpen is GPL-3.0 licensed. See LICENSE file for more info. ================================================================================ 4. Changelog *SplitOpenChangelog* +v0.0.3 + * Add fzf.vim keybinding v0.0.2 * Added delay-loading * Added documentation - v0.0.1 * Initial release