¿Cómo puedo obtener el archivo que tengo abierta en vim a la pantalla en mi pestaña iTerm
Pregunta
que puedo conseguir el título vim para su visualización en la ventana al hacer esto:
let &titlestring = expand("%:t") . " @ " . hostname()
if &term == "screen"
set t_ts=^[k
set t_fs=^[\
endif
if &term == "screen" || &term == "xterm"
set title
endif
Pero las pestañas van a decir "por defecto".
Desde la línea de comandos que puedo hacer esto:
echo -ne "\e]1;hello world\a"
Y que va a mostrar "Hello World" en mis pestañas.
¿Hay una manera de tener escritura vim estas cosas a mi cuenta en lugar de título en su lugar?
Solución
No tengo iTerm, así que no puedo probar esto, pero trate de añadir esto a su .vimrc
:
set t_ts=^[]1;
set t_fs=^G
Tipo de CTRL-V Escape
^[
y CTRL-V CTRL-G
para ^G
.
Otros consejos
Esto es lo que funcionó para mí:
" 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()
Fuente: https://gist.github.com/bignimbus/1da46a18416da4119778
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow