Giter Club home page Giter Club logo

vim-maximizer's Introduction

vim-maximizer

Maximizes and restores the current window in Vim.

Installation

Place in ~/.vim/plugin/maximizer.vim or in case of Pathogen:

cd ~/.vim/bundle
git clone https://github.com/szw/vim-maximizer.git

Please, don't forget to star the repository if you like (and use) the plugin. This will let me know how many users it has and then how to proceed with further development :).

About

Maximizer lets you maximize split windows and restore them automatically. It is very useful if you like to have many split windows per tab. And also, if the text you are working with does not ...subscribe to the ridiculous Church of 80-character Lines.... It means, while working with Ruby on Rails code. ;) Or just with lengthy HTML files.

Usage

Maximizer has only one command:

:MaximizerToggle

Also the plugin can define some default mappings if the user wants to. By default it maps to <F3> in normal, insert, and visual modes. See Configuration to get some examples.

When the current window is not in maximized state, Vim-Maximizer saves dimensions and positions of all windows in the current tab, and then it performs maximization of the active window. The second time the command is invoked, Maximizer restores all windows to the previously saved positions.

The toggle command can be invoked with a bang (!):

:MaximizerToggle!

The bang version forces the restoration of previously saved state (if any). It can be used in case you did some changes in the maximized state layout and the current window is not maximized anymore. Despite that, the bang version force restoration anyway. Notice, the bang version can be set as the default one in your mappings.

Configuration -------------

Maximizer is extremely handy with command mappings. By default it uses <F3> like here:

nnoremap <silent><F3> :MaximizerToggle<CR>
vnoremap <silent><F3> :MaximizerToggle<CR>gv
inoremap <silent><F3> <C-o>:MaximizerToggle<CR>

With these mappings you can hit <F3> any time, not only in normal mode. Other handy situations may include typing some text while you don't fit the current split window or selecting some long lines in the visual mode. Just try it yourself.

Maximizer respects minimal allowed window size, both vertically and horizontally. By default the minimal window height and width are set to 1. You can change those values by tweaking 'winminheight' ('wmh') and 'winminwidth' ('wmw') settings in your .vimrc.

Here are some plugin options:

  • maximizer_set_default_mapping

    Whether Maximizer should set default mappings or not:

      let g:maximizer_set_default_mapping = 1
    
  • maximizer_set_mapping_with_bang

    Whether Maximizer should set default mappings with banged version or not:

      let g:maximizer_set_mapping_with_bang = 0
    
  • maximizer_default_mapping_key

    The default mappings key:

      let g:maximizer_default_mapping_key = '<F3>'
    

Author and License

Maximizer was written by Szymon Wrozynski and Contributors. It is licensed under the same terms as Vim itself.

Copyright © 2012-2013 Szymon Wrozynski. See :help license

vim-maximizer's People

Contributors

inkarkat avatar myitcv avatar szw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-maximizer's Issues

Problem when using together with coc.nvim

I face this problem when I am having two or more split windows, one is being maximized. When I use <plug>(coc-references), after I choose an option in [list preview] window, the current layout is broken while my expectation for that is to keep the layout the same.

Here is my recording for demonstration:

issue-maximizer

Thank you

The plugin does not work when other floating windows exist

Hello, I wonder if you are still maintaining the plugin as there has been no update since 2015, but this plugin doesn't work in the precense of floating windows (neovim 0.4.0+ or vim 8.1).

Specifically, when some floating windows get created and are around, they affect winrestcmd() and as a result the winrestcmd command does nothing. I am experiencing this issue because I have such a plugin like https://github.com/dstein64/nvim-scrollview.

How to reproduce:

  • Use neovim 0.5.1
  • Install dstein64/nvim-scrollview
  • Open some windows, and do :MaximizerToggle; this will maximize the current window
  • Do :MaximizerToggle again --- the window layout does not get restored.

I confirmed that the following line is executed but has no effect (when the window layout has changed due to the "floating" scrollview window):

exe t:maximizer_sizes.before

Problem together with vim-easymotion

Hello, and thanks for this very nice plugin!

I have a problem when using vim-easymotion. Lets say I open two tabs splitted vertically, and then :MaximizerToggle. Then one of the windows is maximized. If I now performs easymotion-bd-w, the minimized window gets opened (a bit), since easymotion-bd-w works on both windows. But when my easymotion movement is over, the slightly opened window is not minimized back, and does not even open up back to its original size if I do :MaximizerToggle. I tried the same with windows splitted horizontally, but no problem happened there.

I added this as an issue to vim-easymotion as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.