Need help with VIM

Discussion in 'Mac Programming' started by Meitou, Sep 7, 2012.

  1. Meitou macrumors member

    Joined:
    Aug 25, 2012
    #1
    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.
     
  2. fwhh macrumors regular

    Joined:
    Aug 11, 2004
    Location:
    Berlin, Germany
    #2
    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)
     
  3. ankurshr macrumors newbie

    Joined:
    Sep 7, 2012
    Location:
    Halifax, NS
  4. mslide macrumors 6502a

    Joined:
    Sep 17, 2007
  5. Meitou thread starter macrumors member

    Joined:
    Aug 25, 2012
    #5
    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?
     
  6. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #6
    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.
     
  7. tomjleeds macrumors 6502

    Joined:
    Jul 19, 2004
    Location:
    Manchester, UK

Share This Page