F11: maximize/restore height Shift-F11: maximize/restore width Ctrl-F11: maximize/restore height and width function ToggleWindowSize(act) if a:act < 0 || a:act > 2 | return | endif let posX = getwinposx() let posY = getwinposy() let actTab = "XXX__X_XR__XX_X__RRRR__R" let idx = ((exists("g:twsWM") + exists("g:twsHM") * 2) * 3 + a:act) * 2 let actW = strpart(actTab, idx, 1) let actH = strpart(actTab, idx + 1, 1) " note. g:tws + [Width,Height,X,Y] + [Maximized,Saved] if actW == "X" let g:twsWS = &columns | let g:twsXS = posX set columns=999 let posX = getwinposx() let g:twsWM = &columns | let g:twsXM = posX elseif actW == "R" if g:twsWM == &columns let &columns = g:twsWS if g:twsXM == posX | let posX = g:twsXS | endif endif unlet g:twsWM g:twsWS g:twsXM g:twsXS endif if actH == "X" let g:
Attributes | Values |
---|
rdfs:label
| |
rdfs:comment
| - F11: maximize/restore height Shift-F11: maximize/restore width Ctrl-F11: maximize/restore height and width function ToggleWindowSize(act) if a:act < 0 || a:act > 2 | return | endif let posX = getwinposx() let posY = getwinposy() let actTab = "XXX__X_XR__XX_X__RRRR__R" let idx = ((exists("g:twsWM") + exists("g:twsHM") * 2) * 3 + a:act) * 2 let actW = strpart(actTab, idx, 1) let actH = strpart(actTab, idx + 1, 1) " note. g:tws + [Width,Height,X,Y] + [Maximized,Saved] if actW == "X" let g:twsWS = &columns | let g:twsXS = posX set columns=999 let posX = getwinposx() let g:twsWM = &columns | let g:twsXM = posX elseif actW == "R" if g:twsWM == &columns let &columns = g:twsWS if g:twsXM == posX | let posX = g:twsXS | endif endif unlet g:twsWM g:twsWS g:twsXM g:twsXS endif if actH == "X" let g:
|
Version
| |
dbkwik:vim/property/wikiPageUsesTemplate
| |
Previous
| |
Author
| |
Complexity
| |
Created
| |
ID
| |
NEXT
| |
Rating
| |
abstract
| - F11: maximize/restore height Shift-F11: maximize/restore width Ctrl-F11: maximize/restore height and width function ToggleWindowSize(act) if a:act < 0 || a:act > 2 | return | endif let posX = getwinposx() let posY = getwinposy() let actTab = "XXX__X_XR__XX_X__RRRR__R" let idx = ((exists("g:twsWM") + exists("g:twsHM") * 2) * 3 + a:act) * 2 let actW = strpart(actTab, idx, 1) let actH = strpart(actTab, idx + 1, 1) " note. g:tws + [Width,Height,X,Y] + [Maximized,Saved] if actW == "X" let g:twsWS = &columns | let g:twsXS = posX set columns=999 let posX = getwinposx() let g:twsWM = &columns | let g:twsXM = posX elseif actW == "R" if g:twsWM == &columns let &columns = g:twsWS if g:twsXM == posX | let posX = g:twsXS | endif endif unlet g:twsWM g:twsWS g:twsXM g:twsXS endif if actH == "X" let g:twsHS = &lines | let g:twsYS = posY set lines=999 let posY = getwinposy() let g:twsHM = &lines | let g:twsYM = posY elseif actH == "R" if g:twsHM == &lines let &lines = g:twsHS if g:twsYM == posY | let posY = g:twsYS | endif endif unlet g:twsHM g:twsHS g:twsYM g:twsYS endif execute "winpos " . posX . " " . posY endfunction nnoremap :call ToggleWindowSize(2) nnoremap :call ToggleWindowSize(1) nnoremap :call ToggleWindowSize(0) imap imap imap
|