Unix terminal display related issue

Want few input related to unix environment and terminal settings:

  1. Am trying to find a way to keep the unix terminal display intact even after opening and closing a vi/less file. Currently if I open a vim file in the unix terminal and then close the file,it displays the contents of vim file on the unix terminal display, whereas I want to see the previous commands that were executed on the display (without doing the history)
  2. While trying to open a file in vim, with the syntax enabled, it still displays the file in black and while only instead of in color format as per the syntax of the file, example vim/perl etc have keywords which gets displayed in different colors, if the file is opened in gvim the file opens in a different terminal with all the colors, but the same effect is not seen when the file is opened in the vim prompt.

It might help if you could tell us which machine, OS, terminal, etc. you are sitting at.

bakunin

Its:

SunOS cx86-ban-02 5.10 Generic_141445-09 i86pc i386 i86pc

check the TERM variable? set it to TERM=xterm and try if vim is highlighting syntax

I syntax highlighting issue setting proper terminal fixes with xterm + bash shell.

Colour management is somewhat complicated in vim. I found out a few options in my quest to accomplish the opposite you want to achieve: make vim as monochrome as possible (i am used to vi and would like to have vim look as bare-bone as vi).

The following option can bei entered in command mode at the ":" or put into ~/.exrc to have a lasting effect.

set hlsearch
set nohlsearch

This switches on/off the highlighting of search results.

syntax on
syntax off

Switches on/off syntax highlighting. Which colours are used to highlight is not configured with this, just the feature as a whole is switched on/off. The colours used are stored in "colour-schemes", which can be selected by the

colorscheme <name>

command. Switch off all colorschemes by:

set t_Co=0

I hope this helps.

bakunin