• Stars
    star
    467
  • Rank 93,935 (Top 2 %)
  • Language
    Vim Script
  • License
    Other
  • Created almost 5 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Vim Automatic Window Resizing Plugin
██╗     ███████╗███╗   ██╗███████╗  ██╗   ██╗██╗███╗   ███╗
██║     ██╔════╝████╗  ██║██╔════╝  ██║   ██║██║████╗ ████║
██║     █████╗  ██╔██╗ ██║███████╗  ██║   ██║██║██╔████╔██║
██║     ██╔══╝  ██║╚██╗██║╚════██║  ╚██╗ ██╔╝██║██║╚██╔╝██║
███████╗███████╗██║ ╚████║███████║██╗╚████╔╝ ██║██║ ╚═╝ ██║
╚══════╝╚══════╝╚═╝  ╚═══╝╚══════╝╚═╝ ╚═══╝  ╚═╝╚═╝     ╚═╝

Lens.vim

A Vim Automatic Window Resizing Plugin

Lens.vim automatically resizes windows when their content exceeds their window dimensions, but does so respecting some minimum and maximum resize bounds ensuring automatically resized windows neither become too large (in cases of large content) or too small (in cases of small content).

Demo

Lens

Animation

Lens.vim by default integrates with the camspiers/animate.vim plugin for window animation.

Installation

To install Lens.vim, use your plugin manager of choice, for example

With Animation

Plug 'camspiers/animate.vim'
Plug 'camspiers/lens.vim'

Without Animation

Plug 'camspiers/lens.vim'

Usage

Out of the box Lens.vim it set up to resize windows when they are entered, and as such the minimal usecase is covered. However this can be disabled and resizing can be preformed manually using lens#run().

Options

Lens.vim is set up with some sensible defaults, but if needed the following can be configured:

Disabled

The plugin can be disabled completely with:

let g:lens#disabled = 1

Disabled Filetypes

The plugin can be disabled for specific filetypes:

let g:lens#disabled_filetypes = ['nerdtree', 'fzf']

Animate

Animation is enabled by default, but can be disabled with:

let g:lens#animate = 0

Resize Max Height

When resizing don't go beyond the following height

let g:lens#height_resize_max = 20

Resize Min Height

When resizing don't go below the following height

let g:lens#height_resize_min = 5

Resize Max Width

When resizing don't go beyond the following width

let g:lens#width_resize_max = 80

Resize Min Width

When resizing don't go below the following width

let g:lens#width_resize_min = 20

API

Lens.vim provides the following functions:

Run

Resizes the window to respect minimal lens configuration

function! lens#run() abort

Toggle

Toggles the plugin on and off

function! lens#toggle() abort

Get Size

When current is smaller than target, returns target if target is within bounds otherwise returns a value closest to target within bounds.

function! lens#get_size(current, target, resize_min, resize_max) abort

Get Rows

Gets the rows of the current window

function! lens#get_rows() abort

Get Cols

Gets the cols of the current window

function! lens#get_cols() abort

More Repositories

1

snap

A fast finder system for neovim.
Fennel
421
star
2

dotfiles

Dotfiles (macOS, stow, brew, yabai, nvim, kitty, tmux)
Clojure
206
star
3

animate.vim

A Vim Window Animation Library
Vim Script
202
star
4

statistical-classifier

A PHP implementation of a Naive Bayes statistical classifier, including a structure for building other classifiers, multiple data sources and multiple caching backends.
PHP
175
star
5

reactjs-php-render

React rendering from PHP
PHP
45
star
6

tmuxinator-fzf-start

Uses fzf to provide a selection list for starting tmuxinator projects
Shell
40
star
7

Bayes

A Baysian calculator and visualization tool implemented in HTML, CSS, and JavaScript
JavaScript
23
star
8

json-pretty

Provides support for json pretty printing in php 5.3
PHP
23
star
9

silverstripe-twig

Allows the use of twig as a template engine in SilverStripe
PHP
20
star
10

php-fp

Functional Programming Helpers
PHP
17
star
11

porter-stemmer

Porter Stemmer created by Richard Heyes
PHP
14
star
12

silverstripe-loggerbridge

Provides a bridge between PSR-3 loggers (like monolog) and SilverStripe
PHP
13
star
13

silverstripe-slowlog

Logs slow SilverStripe requests
PHP
10
star
14

pthreads-pool

A basic and experimental implementation of a thread pool for pthreads
PHP
8
star
15

silverstripe-honeypot

SilverStripe honey pot capture
PHP
7
star
16

luarocks

Easily install luarocks with lazy.nvim
Lua
4
star
17

silverstripe-haml

Allows the use of haml in SilverStripe
PHP
4
star
18

elm-redchaser

A basic game written in Elm
Elm
4
star
19

readydocker

A macOS tool for starting then waiting for Docker.app to be ready
Shell
4
star
20

silverstripe-classifierbridge

SilverStripe tools for using statistical classifier
PHP
3
star
21

silverstripe-fixturegenerator

Allows the generation of SilverStripe unit test fixtures from existing DataObjects either programatically created or from the database
PHP
3
star
22

silverstripe-composer-autoload

Allows use of composer in SilverStripe projects
PHP
2
star
23

silverstripe-markdown

Markdown in SilverStripe
PHP
2
star
24

php-trait-convert

Limited ability to convert php classes that use traits
PHP
1
star
25

silverstripe-csp-logging

Logs CSP violations through a logger
PHP
1
star
26

shared-dependency-injection

PHP
1
star
27

closureaccess

Brings JavaScript-like functionality to your objects
PHP
1
star
28

php-lib-create

Creates a PHP composer library with useful defaults (github repo, phpunit, travis, namespace, php-cs-fixer, README)
PHP
1
star