Recently, Apple has included support for displaying the working directory and file in the status bar of the terminal. The equivalent sequence to be sent (to set the current file) is as follows:
ESC ] 6 ; Pt BEL
where Ptis the file://url pointing to the file to be edited. So I decided that I could force Vim to send this command in an escape sequence, but I have problems. I still have this:
au BufNewFile,BufReadPost,BufFilePost,BufWritePost * echo <escape sequence>
but I feel that this will not work like that. Also, I have no idea how to get the current file as a URL file://, although I suspect netrw might help me. Any ideas?
Edit
So far I have this:
au BufNewFile,BufReadPost,BufFilePost * echo printf('\e]6;file://%s%s\a', $HOSTNAME, expand('%:p'))
- $HOSTNAME . - , ?
2
, $HOSTNAME, . , escape-, vim ^[, ! : vim escape- ?
!
:
set title
set t_ts=^[]6;
set t_fs=^G
auto BufEnter * let &titlestring = "file://" . hostname() . expand("%:p")