Comment puis-je obtenir le fichier que j'ai ouvert vim pour afficher dans mon onglet iTerm

StackOverflow https://stackoverflow.com/questions/2105880

  •  21-09-2019
  •  | 
  •  

Question

Je peux obtenir le titre de vim pour afficher sur ma fenêtre en faisant ceci:

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

Mais les onglets dire "par défaut".

De la ligne de commande que je peux faire ceci:

echo -ne "\e]1;hello world\a"

Et ça va montrer « Bonjour tout le monde » dans mes onglets.

Est-il possible d'avoir vim écrire ce genre de choses à mon onglet au lieu du titre à la place?

Était-ce utile?

La solution

Je n'ai pas iTerm, donc je ne peux pas tester, mais essayez d'ajouter ceci à votre href="https://stackoverflow.com/a/34005877/90848"> .vimrc :

set t_ts=^[]1;
set t_fs=^G

Type CTRL-V Escape pour ^[ et CTRL-V CTRL-G pour ^G.

Autres conseils

est ce qui a fonctionné pour moi:

" Set the title of the Terminal to the currently open file
function! SetTerminalTitle()
    let titleString = expand('%:t')
    if len(titleString) > 0
        let &titlestring = expand('%:t')
        " this is the format iTerm2 expects when setting the window title
        let args = "\033];".&titlestring."\007"
        let cmd = 'silent !echo -e "'.args.'"'
        execute cmd
        redraw!
    endif
endfunction

autocmd BufEnter * call SetTerminalTitle()

Source: https://gist.github.com/bignimbus/1da46a18416da4119778

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top