diff --git a/README.md b/README.md new file mode 100644 index 0000000..996ccff --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +Toggles between the current window and the current buffer opened in a new tab page. + +![](maximize-window-example.gif) + +## Command + +```vim +:ToggleOnly +``` + +You have to define your own key bindings. For example: + +```vim +nnoremap o :ToggleOnly +``` + +## Installation + +Use your favourite plugin manager. For example, using [Plug](https://github.com/junegunn/vim-plug): + +```vim +call plug#begin() +Plug 'caenrique/nvim-maximize-window-toggle' +call plug#end() +``` diff --git a/autoload/nvim-maximize-window-toggle.vim b/autoload/nvim-maximize-window-toggle.vim index 12890c8..fe6fc77 100644 --- a/autoload/nvim-maximize-window-toggle.vim +++ b/autoload/nvim-maximize-window-toggle.vim @@ -1,9 +1,7 @@ "" " @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 +" Toggles between the current window and the current buffer +" opened in a new tab page. "" function! nvim_maximize_window_toggle#ToggleOnly() if winnr("$") > 1 diff --git a/maximize-window-example.gif b/maximize-window-example.gif new file mode 100644 index 0000000..0b08d82 Binary files /dev/null and b/maximize-window-example.gif differ