Skip to content

Commit

Permalink
added gif
Browse files Browse the repository at this point in the history
  • Loading branch information
Cesar Enrique Ramirez committed Apr 17, 2020
1 parent 291a676 commit 64bcf27
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 <leader>o :ToggleOnly<Enter>
```

## 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()
```
6 changes: 2 additions & 4 deletions autoload/nvim-maximize-window-toggle.vim
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Binary file added maximize-window-example.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 64bcf27

Please sign in to comment.