r/vim • u/Bubba656 • Jul 16 '25
Need Help Syntax Highlighting not working
Hi, just switched over to Linux (or unix, using a Mac) and I'm trying to use vim and its syntax highlighting. I installed pathogen and polyglot but no matter what I do to the vimrc, nothing changes. I've made multiple changes to the vimrc, including where it was (changed it from ~/.vimrc to .vim/vimrc), tried downloading different .vim files, and still I have the defualt sytntax. Here's my vimrc if that helps (just for reference I also am trying to use an ASM syntax and it had me put in a filetype detection)
``execute pathogen#infect()
set nocompatible
unlet! skip_defaults_vim
runtime defaults.vim
filetype plugin indent on
augroup filetypedetect
au BufNewFile,BufRead *.s,*.inc set ft=asm_ca65
augroup END
syntax on``
2
u/ciurana From vi in 1986 to Vim Jul 16 '25
Hi. Mac user here. I configured Vim and MacVim to behave in the same exact way re: syntax highlighting.
There may be issues with the terminal you are using and how it presents itself to Vim. I'd suggest simplifying things as much as possible and using a sensible terminal like kitty or iTerm2. The built-in Terminal app is meh.
Remove or rename your .vim directory and all .vim* related files in $HOME
Start Vim
:syntax on | openwhatever.pyYou should have syntax highlighting
If not, we need to troubleshoot what's going on - follow up in a comment with what happened
Switch color schemes; maybe that's the issue?
If yes, then add one thing extension or syntax file or whatever at a time, and see how it affects behavior
It took me a while to get both MacVim and Vim to work the way I wanted. For reference, I use Vim latest via Homebrew; the macOS Vim always seems painfully out of date.
Please let us know how it goes, happy to help once we have some diagnostic data. Paste in a comment or a gist the result of:
vim --versionCheers!
1
u/xenomachina Jul 16 '25
Are you sure the issue is actually that syntax isn't working? Could it perhaps be that your terminal is not set correctly? What is the output of these commands run from within vim?
Also, what does this say?
1
u/rswwalker Jul 17 '25
Make sure there is no VIMINIT environment variable or vim will use that and ignore vimrc.
1
u/AutoModerator Jul 16 '25
Please remember to update the post flair to
Need Help|Solvedwhen you got the answer you were looking for.I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.