Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Was wondering if it'd be possible to somehow show the current file I'm editing in the tabs of my screen

enter image description here

Because it'd be way easier to know what I'm switching between.

share|improve this question
up vote 0 down vote accepted

I have this (indirectly) in my ~/.vimrc:

let &titlestring = "Editing: " . expand("%:p")
if &term == "screen"
  set t_ts=^[k
  set t_fs=^[\
if &term == "screen" || &term == "xterm"
  set title

It changes my terminal tab, and I assume from reading it (and the screen(1) man page) that it should work with screen as well.

share|improve this answer
That seemed to just add the current filename at the bottom row when I'm viewing the file, but not specifically in the screen tabs themselves. – bob_cobb Sep 4 '12 at 17:42

I implemented this to change both the xterm's (or sisters and brothers such as PuTTY) window title and GNU screen's window title.

Put in your vimrc:

if has('title')
  if &term =~# '\v^(screen|xterm|putty).*'
    set title

  if &title
    " xterm OSC for changing window title and icon name
    let &t_ts="\<Esc>]0;"
    let &t_fs="\<C-G>"

    " if inside GNU screen, change screen's window title and 
    " xterm's window title on BufEnter event
    if $STY
      augroup cy.title
        autocmd BufEnter * let &t_ts="\<Esc>k" . expand('%:t') . "\<Esc>\\\<Esc>]0;"
      augroup END
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .