From b18fb2ab5efc563b241cf06d1c90075de4a2d361 Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Fri, 18 Oct 2019 13:46:00 +0200 Subject: [PATCH 1/3] Split command and function to plugin and autoload parts to enable delay-loading --- plugin/split-open.vim => autoload/splitopen.vim | 4 +--- plugin/splitopen.vim | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) rename plugin/split-open.vim => autoload/splitopen.vim (74%) create mode 100644 plugin/splitopen.vim diff --git a/plugin/split-open.vim b/autoload/splitopen.vim similarity index 74% rename from plugin/split-open.vim rename to autoload/splitopen.vim index 43992db..d4f2aac 100644 --- a/plugin/split-open.vim +++ b/autoload/splitopen.vim @@ -1,4 +1,4 @@ -function! SplitOpenFile(filename) +function splitopen#SplitOpenFile(filename) execute("tabedit " . a:filename) let l:file_extension = tolower(fnamemodify(a:filename, ":e")) if l:file_extension == "cpp" @@ -9,5 +9,3 @@ function! SplitOpenFile(filename) execute("wincmd h") endif endfunction - -command! -nargs=1 SplitOpen :call SplitOpenFile("") diff --git a/plugin/splitopen.vim b/plugin/splitopen.vim new file mode 100644 index 0000000..9036e30 --- /dev/null +++ b/plugin/splitopen.vim @@ -0,0 +1 @@ +command -nargs=1 SplitOpen :call splitopen#SplitOpenFile("") From 8b92df058a870befc218bd9d9e2e38b608981a1f Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Fri, 18 Oct 2019 14:47:52 +0200 Subject: [PATCH 2/3] Added documentation --- doc/splitopen.txt | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 doc/splitopen.txt diff --git a/doc/splitopen.txt b/doc/splitopen.txt new file mode 100644 index 0000000..a4ef787 --- /dev/null +++ b/doc/splitopen.txt @@ -0,0 +1,30 @@ +*splitopen.txt* opens file-pairs in a new split-window tab + +================================================================================ +CONTENTS *SplitOpenContents* + + 1. Usage ..................................|SplitOpenUsage| + 2. License ................................|SplitOpenLicense| + 3. Changelog ..............................|SplitOpenChangelog| + +================================================================================ +1. Usage *SplitOpenUsage* + +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. + +================================================================================ +2. License *SplitOpenLicense* + +SplitOpen is GPL-3.0 licensed. See LICENSE file for more info. + +================================================================================ +3. Changelog *SplitOpenChangelog* + +v0.0.1 + * Initial release From b690d216d2953798ac3faf7f9e13390f27a6e4e7 Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Fri, 18 Oct 2019 14:53:12 +0200 Subject: [PATCH 3/3] Updated release notes --- doc/splitopen.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/splitopen.txt b/doc/splitopen.txt index a4ef787..66af367 100644 --- a/doc/splitopen.txt +++ b/doc/splitopen.txt @@ -26,5 +26,9 @@ SplitOpen is GPL-3.0 licensed. See LICENSE file for more info. ================================================================================ 3. Changelog *SplitOpenChangelog* +v0.0.2 + * Added delay-loading + * Added documentation + v0.0.1 * Initial release