When I use vi or vim to edit files in putty, it only shows a limited lines and columns. So how to extend the editor to full screen?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
The problem is likely that the program does not know what the correct screensize is. Usually the system can get this information from the terminal program. But sometimes it cannot, or it is overridden.
Assuming that you are using some unix-like system, the
stty command can show what the system thinks the screensize is, e.g.,
$ stty -a speed 38400 baud; rows 40; columns 80; line = 0; intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0; -parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8 opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke $
columns values are what the system thinks the screensize is. If that is wrong, you can use
stty to change them, e.g.,
stty rows 50 columns 132
but a better way is using
resize (just by running it, it calls the same interface that
stty may show correct values. Your environment may override its settings with the
COLUMNS environment variables. (Those are longstanding legacy crutches for termcap applications). Just unsetting those variables fixes that problem.
the best and easiest way of doing is create .vimrc file on your home directory then paste below content in file
set ai set mouse=a set incsearch set confirm set number set ignorecase set smartcase set wildmenu set wildmode=list:longest,full set lines=80 set columns=80
Save the file and exit then reload the file on current shell