Saturday, March 7, 2020

Re: VIM on Windows Work Laptop

See :help vimfiles for the location of the configuration files on each operating system.
This Vimscript code set the global variable g:vimfiles_dir to their path:

  let s: vimfiles_dir = split(&runtimepath, ',')[0]
  if isdirectory(s:vimfiles_dir)
    let g:vimfiles_dir = s:vimfiles_dir
  elseif if has('unix')
    let g:vimfiles_dir = expand('$HOME') . '/.vim'
  else " if has('win32')
    " see :help vimfiles
    let g:vimfiles_dir = expand('$HOME') . '/vimfiles'
  endif
  unlet s:vimfiles_dir

This code then sources Plug independent of the operating system:

  if filereadable(expand(g:vimfiles_dir . '/plugs.vim'))
    exe 'source ' g:vimfiles_dir . '/plugs.vim'
  endif

To use '.vim' instead of 'vimfiles' on Windows, too, add this Vimscript code to _vimrc :

  if has('win32')
    set runtimepath=$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,$HOME/.vim/after
  endif


Le samedi 7 mars 2020 22:35:00 UTC+1, Jack corley a écrit :

    Hey, guys I recently started a position that requires me to use a windows workstation but I would like to have access to vim and the plugins I normally would use.  I feel infinitely slower doing basic tasks without it. I managed to install the windows version but I am not fully understanding where the vimrc file belongs and how to get plug up and running with it so I can configure things and utilize plugins. Any tips or suggestions are appreciated. So far I have tried modifying the _vimrc in my x86 programs file and added the autoload directory like the Plug installation requires. But when I launch vim it doesn't seem to be recognizing my _vimrc changes or location maybe.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/12d04480-9436-45d5-be20-7fffb8789f10%40googlegroups.com.

No comments: