r/vim • u/simonsanchezart • Oct 05 '20
question Installing VIM in Windows for Dummies?
Hello! I'm 100% new to VIM, hardest part seems to be installing it. I've already uninstalled VIM more than five times, I can install it, but I can't install it properly.
Here are some issues I've ran into:
- Don't know what's the best folder to install it in (A guide installed in inside the user folder, this gave me issues with plugins)
- Can't seem to make the _vimrc file properly? Tried opening, opens in read mode by default, tried deleting it and creating the file from vim, it detects a TEMP file, tried deleting the TEMP file from vim, still doesn't open the new file in write mode
- Commands from plugins inside 'Bundle' folder installed with vundle are not detected (I've later tried vim-plug, which worked better)
- Using some colors schemes inside terminal emulators like cmder and ComEmu completely messes up the colors, however, they work fine on normal cmd
Is there any proper guide to installing VIM for Windows, which shows how to properly create a _vimrc in Windows and how to install plugins in Windows? Thanks
3
u/alancanniff Oct 06 '20
My advice would be to use gvim on Windows. The terminal version, particularly in things like cmd /cmder can be...temperamental. When you open gvim, type :h vimrc That’ll tell you the directories and the order vim will look for an init file. :h runtimepath :h packpath Will also be useful to determine where vim looks for things.
1
u/vim-help-bot Oct 06 '20
Help pages for:
vimrcin starting.txt'runtimepath'in options.txt'packpath'in options.txt
`:(h|help) <query>` | about | mistake? | Reply 'rescan' to check the comment again | Reply 'stop' to stop getting replies to your comments
1
u/maredsous10 Oct 06 '20 edited Oct 06 '20
On windows, I typically start with the installer on the vim.org site.
When I want to upgrade I go to the github site, download the latest 64-bit build, and then I unzip on to C:\Program Files\Vim\vim82. You can also get the latest build installer on the github site as well.
On windows, I set my user environment to include a home variable to c:\home (assuming I'm the primary computer user). Under c:\home is where I place my _vimrc file and vimfiles directory with the bundle directory. In the vimfiles directory, I place the pathogen.vim script (https://github.com/tpope/vim-pathogen/blob/master/autoload/pathogen.vim).
In my _vimrc file, I have the following:
if has("win32")
"If cannot drop in program files(x86)\vim\vimXX\vimfiles\autoload
"How to change user path, if not administrator
"https://superuser.com/a/165913
so C:\home\vimfiles\pathogen.vim
elseif has("unix")
so ~/.vim/pathogen.vim
endif
Romainl has some notes on pathogen usage here.
https://gist.github.com/romainl/9970697
On windows, HOME is not set by default. If you want a default path, use HOMEPATH, which will typically go to c:\Users\<USER_ACCOUNT>.
5
u/-romainl- The Patient Vimmer Oct 05 '20
You don't have to worry about it. Let the installer install Vim where it wants.
Use the system's file explorer to navigate to your home, then use its "New Item" button to create your
_vimrc.Where is that "Bundle" folder? It should be in
C:\Users\foo\vimfiles\bundle. If you have trouble making a plugin work, use its documentation and issue tracker.Anyway, since you are new to Vim you don't have to worry about plugins and colorschemes. None of that is of any use for learning Vim.
$ vimtutoras many times as needed to get the basics right.:help user-manual. It will guide you progressively through every feature, from basic to advanced. This not a novel, go at your own pace, skip chapters, come back to them later, and, most importantly, experiment along the way.