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.

I've been trying to set the icon of vim terminals that I run by writing a small line in my .vimrc:

execute '!xseticon -id \"' . v:windowid . '\" /usr/share/icons/Faenza/apps/16/vim.png'

However, I can't get it to properly work. The strings are concatenating and all, however I get the error:

xseticon: error: Invalid window id format: "0".

which I think is because it is running the script before vim can properly grab window ids, perhaps because it is not yet running.

How can I work around or solve this?

share|improve this question

migrated from stackoverflow.com Nov 16 '12 at 11:51

This question came from our site for professional and enthusiast programmers.

1 Answer 1

up vote 4 down vote accepted

You're right, when .vimrc is executed, the window hasn't yet been created. You can use the VimEnter event for that:

:autocmd VimEnter * execute ...
share|improve this answer
    
Perfect! I didn't have to escape my " characters in the working line. Now I just have to make it reset the icon on close ... but I think you got me on the right track and I can figure that out now. –  ndt Nov 16 '12 at 14:31
1  
Great; glad I could help. For closing, there's the VimLeave event. –  Ingo Karkat Nov 16 '12 at 15:51

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.