From 97d53cf45c001f8026cf96c4b9065372b2d4bf27 Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Wed, 30 Oct 2019 22:40:30 +0100 Subject: [PATCH 1/2] Added new Split() command to split an existing tab --- autoload/splitopen.vim | 12 ++++++++++-- plugin/splitopen.vim | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/autoload/splitopen.vim b/autoload/splitopen.vim index 278a532..1151120 100644 --- a/autoload/splitopen.vim +++ b/autoload/splitopen.vim @@ -49,8 +49,7 @@ function s:addRightSplit(filename) execute("wincmd h") endfunction -function! splitopen#SplitOpenFile(filename) - execute("tabedit " . a:filename) +function s:splitOpenFile(filename) let extension = s:getFileExtension(a:filename) if s:isLeftSideExtension(extension) call s:addRightSplit(a:filename) @@ -58,3 +57,12 @@ function! splitopen#SplitOpenFile(filename) call s:addLeftSplit(a:filename) endif endfunction + +function! splitopen#SplitOpenFile(filename) + execute("tabedit " . a:filename) + call s:splitOpenFile(a:filename) +endfunction + +function! splitopen#SplitFile() + call s:splitOpenFile(expand("%:p")) +endfunction diff --git a/plugin/splitopen.vim b/plugin/splitopen.vim index ed08d08..2534fdb 100644 --- a/plugin/splitopen.vim +++ b/plugin/splitopen.vim @@ -1,4 +1,5 @@ command! -nargs=1 SplitOpen :call splitopen#SplitOpenFile("") +command! Split :call splitopen#SplitFile() " map left-split / right-split file extensions if !exists("g:splitopen_extensions") From 722e2da2f2788cb95bb90a7f40e1115667eb37cd Mon Sep 17 00:00:00 2001 From: changeme Date: Mon, 29 Jun 2020 21:28:07 +0200 Subject: [PATCH 2/2] Added release documentation --- README.md | 10 ++++++++++ doc/splitopen.txt | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/README.md b/README.md index 3f831cf..5bde54f 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,13 @@ 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. +Use + + :Split + +to open the corresponding heder or source file to your currently open file in +a vertical split. + ## Configuration You can configure the following settings: @@ -41,6 +48,9 @@ SplitOpen is GPL-3.0 licensed. See LICENSE file for more info. ## Changelog +v1.1.0 +* Added Split() command + v1.0.0 * Fixed error when reloading plugin diff --git a/doc/splitopen.txt b/doc/splitopen.txt index 30cf547..e8e9c6c 100644 --- a/doc/splitopen.txt +++ b/doc/splitopen.txt @@ -21,6 +21,13 @@ 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. +Use + + :Split + +to open the corresponding heder or source file to your currently open file in +a vertical split. + ================================================================================ 2. Configuration *SplitOpenConfiguration* @@ -55,6 +62,8 @@ SplitOpen is GPL-3.0 licensed. See LICENSE file for more info. ================================================================================ 4. Changelog *SplitOpenChangelog* +v1.1.0 + * Added Split() command v1.0.0 * Fixed error when reloading plugin v0.0.4