simeji / winresizer Goto Github PK
View Code? Open in Web Editor NEWvery simple vim plugin for easy resizing of your vim windows
License: MIT License
very simple vim plugin for easy resizing of your vim windows
License: MIT License
The message does not change even if I change the settings.
g:winresizer_keycode_finish = 32 (Space)
winresizer/plugin/winresizer.vim
Line 126 in 186e02e
It has been hard coding.
echo '[window resize mode]... "Enter": OK , "q": Cancel'
โฏ [window resize mode]... "Space": OK , "q": Cancel
โ [window resize mode]... "Enter": OK , "q": Cancel
For example below,
the window *
is considered not right edge,
and it works as if the window's right partition can be movable
(i.e left key (j
) decreases window width / right key (l
) increases).
This looks quite strange.
+-----+-----+-----+
| | | |
| | * | wfw |
| | | |
+-----+-----+-----+
^
This moves
I tried to fix it like below, however, it is still incomplete.
--- a/autoload/winresizer.vim
+++ b/autoload/winresizer.vim
@@ -13,12 +13,12 @@ fun! winresizer#getEdgeInfo()
let chk_direct = ['left', 'down', 'up', 'right']
let result = {}
for direct in chk_direct
- exe 'let result["' . direct . '"] = ' . !winresizer#canMoveCursorFromCurrentWindow(direct)
+ exe 'let result["' . direct . '"] = ' . !winresizer#canMoveCursorToResizableWindowFromCurrentWindow(direct)
endfor
return result
endfun
-fun! winresizer#canMoveCursorFromCurrentWindow(direct)
+fun! winresizer#canMoveCursorToResizableWindowFromCurrentWindow(direct)
let map_direct = {'left':'h', 'down':'j', 'up':'k', 'right':'l'}
if has_key(map_direct, a:direct)
let direct = map_direct[a:direct]
@@ -28,8 +28,9 @@ fun! winresizer#canMoveCursorFromCurrentWindow(direct)
let from = winnr()
exe "wincmd " . direct
let to = winnr()
+ let fixed = (a:direct ==# 'up' || a:direct ==# 'down') ? &winfixheight : &winfixwidth
exe from . "wincmd w"
- return from != to
+ return from != to && !fixed
endfun
fun! winresizer#swapTo(direct)
With the window arrangement like below,
the right partition of the window *
moves.
+-----+-----+-----+
| | | |
| | | wfw |
| | | |
| | +-----+
| | | |
| | * | wfw |
| | | |
| | +-----+
| | | |
| | | wfw |
| | | |
+-----+-----+-----+
^
This moves
As title. Is there a shortcut to use move mode only, for example? So I don't have to cycle through all the other modes to find it.
NVIM v0.7.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by [email protected]
Installation instructions are too vague.
I tried all of those
let g:winresizer_keycode_up = '<C-UP>'
let g:winresizer_keycode_up = '<C-up>'
let g:winresizer_keycode_up = '<Up>'
let g:winresizer_keycode_up = '<UP>'
let g:winresizer_keycode_up = '<up>'
And similar, but nothing worked.
Expecting: I expected to be able to use regular cursors for window size movement
this is the nicest split management tool i've come across.
After pressing the start key, some ghost keys(i.e. I didn't type those keys but they got detected) will appear and this causes all resizing/moving/focusing not usable: if I press l
it receives something like lhlakjklh<CR>
.
nvim --version
NVIM v0.9.0-dev-567+ga731a40f7
Build type: Release
LuaJIT 2.1.0-beta3
Could you add window close hotkey?
If some hotkey, such as [C]
is added,
in walking around on windows in window focus mode,
you can quickly close windows without leaving the plugin.
Hi,
i cant enter move mode and move a window with one macro like this:
noremap <silent> <A-h> <A-r>mh<CR>
I aim for an i3-like behaviour, but the above just does nothing.
Is there a way to make this mapping available in the config?
It would be more faster to exit the resize mode if <Esc>
key could be used.
Thank you for this plugin!
I tried using hjkl but it doesn't seem to permute the windows after I enter move mode, instead it just switches the context
Check out this short video: I've got three horizontal splits, all on top of each other and I use the standard vim window commands (CTRL-W
+ H
,J
,K
,L
) to move one of them around.
When I try to move any of the windows to the right or left, it creates a new vertical split that is completely filled by the window I moved.
And when I try to move the vertically split window downwards or upwards, it deletes the vertical split and becomes a horizontal split again.
Basically, standard vim behaviour is: Trying to move a window towards the "edge" of the entire vim window changes the type of split it is. While the standard window movement commands can be pretty unintutive, this is a feature I quite like.
Any chance you could replicate it in the window move mode
of this plugin?
This plugin would really benefit from a :help
page suitable for viewing as documentation in Vim itself.
What brought this to my attention: the new move/focus features showed up after I updated my version of the plugin, and I figured them out via experimentation but wanted to read more about them. I was unable to find documentation within Vim or the plugin other than the README.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.