Wikia

Vim Tips Wiki

Changes: Nice window resizing

Edit

Back to page

(delete, not useful)
(will merge and keep redirect, not delete)
 
Line 1: Line 1:
{{delete|no explanation, just a script, and doesn't appear generally useful anyway}}
 
{{review}}
 
 
{{TipImported
 
{{TipImported
 
|id=669
 
|id=669
Line 51: Line 49:
   
 
----
 
----
  +
{{todo}}
  +
This tip (669) was due to be deleted, but I am keeping it temporarily. After merging any useful info from here, this will be replaced with a redirect to a suitable tip.
  +
  +
Related tips (will merge some, and put 'see also' on remainder):
  +
*[[VimTip88|88 Maximize or set initial window size]]
  +
*[[VimTip427|427 Fast window resizing with plus/minus keys]]
  +
*[[VimTip507|507 Quick window resizing]]
  +
*[[VimTip995|995 Resize window when showing/hiding line numbers]]
  +
*[[VimTip1026|1026 Resize xterm when running vimdiff]]
  +
*[[VimTip1110|1110 Toggle gvim window size]]
  +
*[[VimTip1569|1569 Restore screen size and position]]
  +
[[User:JohnBeckett|JohnBeckett]] 03:30, March 9, 2010 (UTC)

Latest revision as of 03:30, March 9, 2010

Tip 669 Printable Monobook Previous Next

created March 2, 2004 · complexity basic · author Yada · version 5.7


" Map F1 for gvim window resizing.
" Put this snippet of code in your vimrc for nice window resizing.
" Press F1 key to toggle between the three settings.
nmap <F1> :call ResizeWindow()<CR>
imap <F1> <Esc><F1>a " for insert mode
function! ResizeWindow()
  if (has("gui"))
    if s:selectedsize == 1
      let s:selectedsize = 2
      set number
      set columns=88 " 88 is exactly 80 with :set number
      set lines=35
    elseif s:selectedsize == 2
      set number
      let s:selectedsize = 3
      set columns=98
      set lines=45
    else " old school console goodness
      let s:selectedsize = 1
      set nonumber
      set columns=80
      set lines=25
    endif
  endif
endfunction
let s:selectedsize=1
call ResizeWindow()

CommentsEdit

"use own map, this is mine
map <M-right> <Esc>:resize +2 <CR>
map <M-left> <Esc>:resize -2 <CR>

 TO DO 
This tip (669) was due to be deleted, but I am keeping it temporarily. After merging any useful info from here, this will be replaced with a redirect to a suitable tip.

Related tips (will merge some, and put 'see also' on remainder):

JohnBeckett 03:30, March 9, 2010 (UTC)

Around Wikia's network

Random Wiki