Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Meitou

macrumors member
Original poster
Aug 25, 2012
33
0
Hey guys, I just started using a Mac a few days ago and was wondering how to enable syntax highlighting on Vim while editing Python files.
 
You are talking about the "real" vim, the commandline tool? If so:
Code:
:syntax on
Just be sure to have the right extention to the file name (.py)
 
enable works, but only on when I'm using the basic windows. Now I have two questions. The first is, how do I access my vimrc file? When I do cd ~/.vimrc or even vi ~/.vimrc the terminal isn't able to locate the file. My second question: how do I enable syntax on the homebrew windows?
 
When I do cd ~/.vimrc or even vi ~/.vimrc the terminal isn't able to locate the file.

Doing cd ~/.vimrc is nonsense. ~/.vimrc is a file, not a directory. You can't cd (change directory) to anything other than a directory.

How do you know vi ~/.vimrc can't locate the file? What error messages do you get? Copy and paste the exact text of any error messages. If you don't get any error messages, then please explain how you know the file isn't being located. You've reached this conclusion based on some evidence, so describe your evidence.

Copy and paste the following command-line into a Terminal window, then copy and paste the complete output text and post it here:
Code:
pwd ; id -p ; ls -ld ~/.vimrc


Presumably your real goal is to edit python files, not learn vi. So you might be better off using TextWrangler to get started, and put learning vi on the back-burner for a while, until you get its rc-file sorted out.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.