Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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=^[\
endif
if &term == "screen" || &term == "xterm"
  set title
endif

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
  endif

  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!
        autocmd BufEnter * let &t_ts="\<Esc>k" . expand('%:t') . "\<Esc>\\\<Esc>]0;"
      augroup END
    endif
  endif
endif
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.