-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Cesar Enrique Ramirez
committed
Apr 17, 2020
0 parents
commit 8aa477b
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"" | ||
" @public | ||
" If the current tab page has more than one window, | ||
" opens the current buffer alone in a new tab. | ||
" Calling this function again in the new window will | ||
" close the tab and go back to the original window | ||
"" | ||
function! nvim-maximize-window-toggle#ToggleOnly() | ||
if winnr("$") > 1 | ||
" There are more than one window in this tab | ||
if exists("b:maximized_window_id") | ||
call win_gotoid(b:maximized_window_id) | ||
else | ||
let b:origin_window_id = win_getid() | ||
tab sp | ||
let b:maximized_window_id = win_getid() | ||
endif | ||
else | ||
" This is the only window in this tab | ||
if exists("b:origin_window_id") | ||
let l:origin_window_id = b:origin_window_id | ||
tabclose | ||
call win_gotoid(l:origin_window_id) | ||
unlet b:maximized_window_id | ||
unlet b:origin_window_id | ||
endif | ||
endif | ||
endfunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
*nvim-maximize-window-toggle.txt* | ||
*nvim-maximize-window-toggle* | ||
|
||
============================================================================== | ||
CONTENTS *nvim-maximize-window-toggle-contents* | ||
1. Commands...........................|nvim-maximize-window-toggle-commands| | ||
|
||
============================================================================== | ||
COMMANDS *nvim-maximize-window-toggle-commands* | ||
|
||
:ToggleOnly *:ToggleOnly* | ||
Maximize the current buffer as a toggle | ||
|
||
|
||
vim:tw=78:ts=8:ft=help:norl: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
"" | ||
" Maximize the current buffer as a toggle | ||
"" | ||
command! ToggleOnly call nvim-maximize-window-toggle#ToggleOnly() |