Xshell Knowledge Base

How to display the file name that I am working on in VI as the tab name

Last modified: Thursday, January 24, 2013 3:19 AM

PROBLEM DESCRIPTION

This article explains how you can display the file name that you are working on in VI as the tab name in Xshell



RESOLUTION

VI editor includes a feature that allows users to customize the terminal title. You can use this feature with the "Show Terminal Title" feature in Xshell to display the file name that you are working on in VI on Xshell tab name.

To do this, follow the instruction below:

1. Set terminal type to xterm in Xshell
a. Open the Session Properties dialog box
b. Click on the Terminal menu
c. Select xterm from the terminal type list

2. Open $HOME/.vimrc and add the following lines:

auto BufEnter * let &titlestring = hostname() . " - " . expand("%:p")
set title

3. Right click on the Xshell tab and select the Show Terminal Title menu.

For more information on VIM and how to set the terminal title, you can refer to the VIM manual.



AFFECTED SOFTWARE