Skip to content

Commit

Permalink
Update readme, update helpdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
tdct12 committed Mar 21, 2019
1 parent 210c0f8 commit 51ac0fd
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 104 deletions.
Binary file added .github/bufsteal.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/default.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions .github/dev_panel.vim
@@ -0,0 +1,15 @@
" Example of regrouping command windows

let s:dev_panel = {
\ 'name': 'dev_panel',
\ 'right':
\ {
\ 'sz': 33,
\ 'fixed': 1,
\ 'init': ['NERDTree'],
\ 'bot':
\ {
\ 'init': ['Tagbar']
\ }
\ }
\}
Binary file added .github/layouts.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 62 additions & 0 deletions .github/layouts.vim
@@ -0,0 +1,62 @@
" Example layouts
"
let s:vimdiff = {
\ 'name': 'vimdiff',
\ 'top':
\ {
\ 'init': ['wincmd o', 'normal ibase'],
\ 'left':
\ {
\ 'init': ['normal ilocal']
\ },
\ 'right':
\ {
\ 'init': ['normal iremote']
\ }
\ },
\ 'bot':
\ {
\ 'init': ['normal imerge'],
\ 'sz': 20
\ }
\}

let s:frame = {
\ 'name': 'frame',
\ 'top': {
\ 'left': {
\ 'init': []
\ },
\ 'right': {
\ 'init': []
\ }
\ },
\ 'bot': {
\ 'left': {
\ 'init': []
\ },
\ 'right': {
\ 'init': []
\ }
\ },
\ 'left': {
\ 'init' :[]
\ },
\ 'right': {
\ 'init' :[]
\ }
\}

let s:bot_panel = {
\ 'name': 'bot_panel',
\ 'bot':
\ {
\ 'sz': 12,
\ 'left':
\ {
\ 'init': []
\ }
\ }
\ }

let g:vwm#layouts = [ s:vimdiff, s:frame, s:bot_panel ]
47 changes: 19 additions & 28 deletions README.md
@@ -1,13 +1,14 @@
# *V*im *W*indow *M*anager
# *V*im *W*indow *M*anager

A layout manager for vim and nvim.
![](expose.gif)
![](./.github/default.gif)

## Features

* Save and manage vim windows via layouts
* Automatically cache and unlist buffers
* Automatically reuse buffers
* Regroup command buffers
* Highly configurable

## Installation
Expand All @@ -20,33 +21,23 @@ A layout manager for vim and nvim.

* **Layout on:** `:VwmOpen *layout_name*`
* **Layout off:** `:VwmClose *layout_name*`
* **Layout toggle:** `:VwmToggle *layout_name*`
* **Layout toggle:** `:VwmToggle *layout_name*`

*note:* `default` *is the only default layout. Test it out!*

## Examples

## Example

**_note:_** For detailed configuration see `help: vwm.vim`, for more examples see `:help
vwm.vim-examples`

The following example will create 3 equally sized terminals of height 12 at the bottom of the vim
screen on **neovim**.

```vim
let g:vwm#layouts = [
\ {
\ 'name': 'test',
\ 'bot':
\ {
\ 'init': ['call termopen("zsh", {"detach": 0})'],
\ 'sz': 12,
\ 'left':
\ {
\ 'init': ['call termopen("zsh", {"detach": 0})'],
\ },
\ 'right':
\ {
\ 'init': ['call termopen("zsh", {"detach": 0})'],
\ }
\ }
\ }
\]
```
### layouts
**[definitions](./.github/layouts.vim)**
![](./.github/layouts.gif)

### command buffer regrouping
*vwm can take commands that open a new window, and incorporate that window in to a defined layout*

The following example will make use of the wonderful [NERDTree plugin](https://github.com/scrooloose/nerdtree) and the equally wonderful [Tagbar plugin](https://github.com/majutsushi/tagbar).

**[definitions](./.github/dev_panel.vim)**
![](./.github/bufsteal.gif)
82 changes: 6 additions & 76 deletions doc/vwm.vim.txt
Expand Up @@ -16,7 +16,7 @@ COMMANDS *vwm.vim-commands*
Closes the layout specified by {name}

:VwmToggle {name}
Togglesthe layout specified by {name}
Toggles the layout specified by {name}

:VwmRefresh
Reinitializes the layout definitions defined in |g:vwm#layouts|
Expand Down Expand Up @@ -53,7 +53,7 @@ g:vwm#layouts *g:vwm#layouts*
{unlisted}[default=1]: If true, all buffers derived from this layout will be
made unlisted.
*vwm-layouts-child*
Each child node consits of itself and 0 more child nodes. A cihld node
Each child node consists of itself and 0 more child nodes. A child node
contains the following attributes.

{'init'}: A list of commands to run on buffer creation.
Expand All @@ -70,78 +70,8 @@ g:vwm#layouts *g:vwm#layouts*

{bot}[opt]: Layout bot relative of this layout.

{fixed}[default=0]: If true, the buffer's size will be made fixed.

==============================================================================
EXAMPLE *vwm.vim-examples*
*vwm-layouts-example*
The following example will create 3 layouts, a vimdiff style layout, a
frame, and lastly a terminal panel for neovim users. Test the commands with
`VwmOpen vimdiff`, `VwmOpen frame`, `VwmOpen test`, making sure to run
VwmClose _name_ between each. >

let s:vimdiff = {
\ 'name': 'vimdiff',
\ 'top':
\ {
\ 'init': ['wincmd o', 'normal ibase'],
\ 'left':
\ {
\ 'init': ['normal ilocal']
\ },
\ 'right':
\ {
\ 'init': ['normal iremote']
\ }
\ },
\ 'bot':
\ {
\ 'init': ['normal imerge'],
\ 'sz': 20
\ }
\}

let s:frame = {
\ 'name': 'frame',
\ 'top': {
\ 'sz': 10,
\ 'left': {
\ 'init': []
\ },
\ 'right': {
\ 'init': []
\ }
\ },
\ 'bot': {
\ 'sz': 10,
\ 'left': {
\ 'init': []
\ },
\ 'right': {
\ 'init': []
\ }
\ },
\ 'left': {
\ 'sz': 50
\ },
\ 'right': {
\ 'sz': 50
\ }
\}

let s:test = {
\ 'name': 'test',
\ 'bot':
\ {
\ 'init': ['call termopen("zsh", {"detach": 0})'],
\ 'sz': 12,
\ 'left':
\ {
\ 'init': ['call termopen("zsh", {"detach": 0})'],
\ },
\ 'right':
\ {
\ 'init': ['call termopen("zsh", {"detach": 0})'],
\ }
\ }
\ }

let g:vwm#layouts = [s:vimdiff, s:frame, s:test]
EXAMPLES *vwm.vim-examples*
see https://github.com/paroxayte/vwm.vim#examples
Binary file removed expose.gif
Binary file not shown.

0 comments on commit 51ac0fd

Please sign in to comment.