I'd like to add the short hostname to the statusline in vim. I've looked around but short of installing the Powerline plugin, it doesn't seem posible. Below is my
.vimrc. How can I add the
hostname variable to it?
let hostname=system('hostname -s') set laststatus=2 set statusline+=%F\ %P\ %c:%l
UPDATE: to remove the '^@' which appears after the hostname on the vim status line (I suspect is a newline charcter from the hostname call) I use this instead:
let hostname=system('echo -n $LOGNAME@$(/bin/hostname -s)')