No vimrc, gvimrc and .vim on mac

后端 未结 3 744
北荒
北荒 2020-12-08 11:39

There are no .vimrc, .gvimrc files and .vim/ directory on my mac, and so I can\'t install any script. And when I create a folder

相关标签:
3条回答
  • 2020-12-08 12:17

    A different approach would be as instructed by tim pope in the reference i gave copy to your command line/terminal.app:

    mkdir -p ~/.vim/autoload ~/.vim/bundle; \
    curl -so ~/.vim/autoload/pathogen.vim \
    https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim
    

    also note if curl is not working try wget -O - ~/.vim/autoload/pathogen.vim put then into your .vimrc:

    call pathogen#infect()
    syntax on
    filetype plugin indent on
    

    then unzip the plugin to ~/.vim/bundle/ in a folder of your choice and don't forget to do :call pathogen#helptags() in your vim after the installation to generate the documentation.

    0 讨论(0)
  • 2020-12-08 12:19

    You must create those files and folder yourself:

    1. Open Terminal.app (found under /Applications/Utilities/).

    2. At the prompt, a $, type each of these lines followed by <Enter> (don't type the $):

      $ touch .vimrc
      $ touch .gvimrc
      $ mkdir .vim
      $ open .vim
      
    3. At this point, the ~/.vim folder is open in a new Finder.app window.

    But I'd respectfully suggest you to get accustomed to the command-line and Vim's basics before rushing to install plugins.

    EDIT

    You didn't follow the instructions, no wonder the plugin doesn't work.

    You have to move cvim.zip into ~/.vim and run the command $ unzip cvim.zip in the terminal. Read the instructions more carefully and don't let Safari expand archives automatically.

    Now that you have ~/.vim/c, here is what you should do to go forward.

    Supposing your ~/.vim is empty (beside your ~/.vim/c), move the whole content of ~/.vim/c into ~/.vim. After this operation, your ~/.vim folder should look like that:

    + ~/.vim
       + c <-- your folder
       + c-support
           + (many folders and files)
       + doc
           + csupport.txt
       + ftplugin
           + c.vim
           + make.vim
       + plugin
           + c.vim
       + README.csupport
    

    When you are done, delete ~/.vim/c and start Vim. The plugin should be installed and working.

    If your ~/.vim folder is not empty (say it already has a bunch of folders and files like ~/.vim/color, ~/.vim/syntax, whatever…) you'll have to move manually each subfolder/file from ~/.vim/c to the right place in ~/.vim.

    ENDEDIT

    0 讨论(0)
  • 2020-12-08 12:26

    I found it on OSX Yosemite in /usr/share/vim/vimrc

    Update: Unfortunately on OSX El Capitan, this file is no longer editable even via sudo. So back to user-based versions in ~/.vimrc

    0 讨论(0)
提交回复
热议问题