From 5a2d7c57a82a17a763f904d19ea4417696c772bd Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 16 Aug 2018 23:04:10 +1200 Subject: First version --- README.md | 13 +++++++++++++ VERSION | 1 + doc/equalalways_resized.txt | 21 +++++++++++++++++++++ plugin/equalalways_resized.vim | 27 +++++++++++++++++++++++++++ 4 files changed, 62 insertions(+) create mode 100644 README.md create mode 100644 VERSION create mode 100644 doc/equalalways_resized.txt create mode 100644 plugin/equalalways_resized.vim diff --git a/README.md b/README.md new file mode 100644 index 0000000..648ea3d --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +equalalways\_resized.vim +======================== + +This tiny plugin extends `'equalalways'` to rebalance windows when Vim itself +is resized. + +License +------- + +Copyright (c) [Tom Ryder][1]. Distributed under the same terms as Vim itself. +See `:help license`. + +[1]: https://sanctum.geek.nz/ diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..6e8bf73 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.1.0 diff --git a/doc/equalalways_resized.txt b/doc/equalalways_resized.txt new file mode 100644 index 0000000..4263c39 --- /dev/null +++ b/doc/equalalways_resized.txt @@ -0,0 +1,21 @@ +*foldlevelstart_stdin.txt* For Vim version 7.0 Last change: 2018 Aug 16 + +DESCRIPTION *foldlevelstart_stdin* + +This tiny plugin extends 'equalalways' to rebalance windows when Vim itself is +resized. + +REQUIREMENTS *foldlevelstart_stdin-requirements* + +This plugin only loads if 'compatible' is not set. It requires the |+autocmd| +and |+windows| features, with the |VimResized| event introduced in |version7|. + +AUTHOR *foldlevelstart_stdin-author* + +Written and maintained by Tom Ryder . + +LICENSE *foldlevelstart_stdin-license* + +Licensed for distribution under the same terms as Vim itself (see |license|). + + vim:tw=78:ts=8:ft=help:norl: diff --git a/plugin/equalalways_resized.vim b/plugin/equalalways_resized.vim new file mode 100644 index 0000000..8865f0a --- /dev/null +++ b/plugin/equalalways_resized.vim @@ -0,0 +1,27 @@ +" +" equalalways_resized: If 'equalalways' is set, extend it to VimResized +" events. +" +" Author: Tom Ryder +" License: Same as Vim itself +" +if exists('g:loaded_equalalways_resized') || &compatible + finish +endif +if !has('autocmd') || !has('windows') || !exists('##VimResized') + finish +endif +let g:loaded_equalalways_resized = 1 + +" If 'equalalways' is set, rebalance the windows +function! s:Rebalance() abort + if &equalalways + wincmd = + endif +endfunction + +" Add hook for VimResized event +augroup equalalways_resized + autocmd! + autocmd VimResized * call s:Rebalance() +augroup END -- cgit v1.2.3