where is ~\.vim folder in mac os? and how to install themes in gvim?

38,270

Solution 1

First of all, open vim, and get help from :help colorscheme

:colo[rscheme] {name}   Load color scheme {name}.  This searches 'runtimepath'
                        for the file "colors/{name}.vim.  The first one that
                        is found is loaded.

After reading the manual above. Take the following steps maybe help you:

  • find runtimepath

    :set runtimepath?
    

    It will print out run-time paths:
    runtimepath=~/.vim,/usr/share/vim/vimfiles,/usr/share/vim/vim71,/usr/share/vim/vimfiles/after,~/.vim/after

  • create directory called colors under one of them if not exist(for example: ~/.vim)

    $ ls ~/.vim
    ls: cannot access /root/.vim: No such file or directory <== we need create it!!!
    $ mkdir -p ~/.vim/colors
    
  • copy your color.vim to your colors directory

    $ cp /path/to/your/color.vim  ~/.vim/colors
    
  • restart vim to use new colorscheme

    :colorscheme color
    
  • (optional) put command above to ~/.vimrc file to make it permanent

Solution 2

In UNIX parlance, ~ represents your home folder which is /Users/<username> in Mac OS X.

You are supposed to put all your custom scripts/colorschemes/whatever in a .vim folder situated in your home folder. In Terminal.app, type each line (without the $) then hit Enter:

$ cd

to be sure you are in your home folder

$ mkdir .vim

here you'll have an error message if ~/.vim already exists; if you don't receive a message it means that the folder is created

$ cd .vim

to move into it

$ open .

to open a Finder window here. At this point you should follow specific indications.

Share:
38,270
pythoniku
Author by

pythoniku

python dev

Updated on March 07, 2020

Comments

  • pythoniku
    pythoniku about 4 years

    I downloaded color sample pack from http://vim.sourceforge.net/scripts/script.php?script_id=625

    it says i should unzip and place it into ~/.vim but where is this folder? I tried unzip it to my usr/share/.vim folder but it is not working, I don't see themes added to gvim Edit>color scheme menu, and i tried "colorscheme sometheme", "color sometheme" in my gvimrc. Both not working for new themes

    Isn't the ~/.vim should be the .vim folder in use/share? or I should create a new folder under home?

    Note:there is a folder vim73 in my .vim, I guess this doesn't affect anything

    thanks for any help!

  • huangli
    huangli over 11 years
    Every time I open my vim it still use the default color scheme, it's not permanently.
  • kev
    kev over 11 years
    @huangli You need to create a vimrc file, and put the command into vimrc.
  • ILikeTurtles
    ILikeTurtles almost 10 years
    I think a lot of people don't know that you have to create your own .vim folder.
  • Zach Saucier
    Zach Saucier almost 5 years
    Make sure to also put :syntax enable if you haven't already.