I have problem with VIM command line when calling system commands. e.g. !ls, all command output colors aren't parsed by VIM. My system is Ubuntu 12.04 LTS with VIM 7.3.429 from Ubuntu repositories.

Is there any workaround for this problem?


My vimrc file

:!echo $TERM in VIM returns : dumb


I found a simple workaround but it's not perfect

if [ "$VIM" ] && [ "$TERM" = "dumb" ] 
    # For gvim's monochromatic :shell 
    PS1='\n\u@\h \w\n\$ ' 
    unalias ls 
    unalias grep 

(It's working on bash)

  • $ echo $TERM and show us your ~/.vimrc. – romainl Jun 12 '12 at 14:41

2 Steps:

1) set TERM to something other than "dumb" in .bashrc. xterm should be fine, as it looks like you're on Ubuntu.

2) In .vimrc, add set t_Co=256. That tells vim you're on a 256 color terminal.

That should fix your problems.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.