Tuesday, April 30, 2024
15
rated 0 times [  15] [ 0]  / answers: 1 / hits: 8182  / 2 Years ago, thu, june 2, 2022, 2:49:33

I am editing multiple files located in the same folder, in multiple tabs, on a single terminal.



pwd(directory in which I am currently working) is displayed on the top of the heading of the terminal, but not the name of the file I am editing. It gets confusing when working with multiple files in the same directory.



How to display the name of the current file on the top of the terminal in addition to the pwd.



I am running vim in a bash shell in gnome-terminal, on 12.04 LTS.


More From » command-line

 Answers
2

You must to have/create a file named .vimrc in your home directory with the following code inside:



let &titlestring = $USER . "@" . hostname() . " " . expand("%:p")
if &term == "screen"
set t_ts=^[k
set t_fs=^[
endif
if &term == "screen" || &term == "xterm"
set title
endif


enter image description here



Source: gnome-terminal does not allow changing the title


[#26375] Friday, June 3, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
epypian

Total Points: 130
Total Questions: 111
Total Answers: 113

Location: Romania
Member since Mon, Jun 6, 2022
2 Years ago
;