VIM on Windows Work Laptop

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

VIM on Windows Work Laptop

Jack corley
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/8850952a-055a-479d-9692-ddcb50cc09de%40googlegroups.com.
BPJ
Reply | Threaded
Open this post in threaded view
|

Re: VIM on Windows Work Laptop

BPJ
For starters it is called _vimrc on windows, and according to :h _vimrc it lives in $HOME/vimfiles/, which is what ~/.vim is called on Windows.


Den lör 7 mars 2020 22:35Jack corley <[hidden email]> skrev:
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/8850952a-055a-479d-9692-ddcb50cc09de%40googlegroups.com.

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CADAJKhCqnJyMXdSdNe1yMZnf0%2B5%3Dz9JnLw%3Ds3iYD9bERwfhyFA%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: VIM on Windows Work Laptop

Enno
In reply to this post by Jack corley
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/12d04480-9436-45d5-be20-7fffb8789f10%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: VIM on Windows Work Laptop

Tony Mechelynck
In reply to this post by Jack corley
On Sat, Mar 7, 2020 at 10:34 PM Jack corley <[hidden email]> wrote:
>
> 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.

On Unix Vim looks for a startup file named .vimrc, on Windows for one
named _vimrc. In both cases it looks for it in your home directory —
and if $HOME (or, in Windows parlance, %HOME%) is not defined on
Windows, $HOMEDRIVE$HOMEPATH (i.e. %HOMEDRIVE%%HOMEPATH%) is a
fallback location. If the vimrc is not found there, Vim looks for it
on Unix as ~/.vim/vimrc or on Windows as ~/vimfiles/vimrc (i.e., in
the latter case, %HOME%\vimfiles\vimrc or
%HOMEDRIVE%%HOMEPATH%\vimfiles\vimrc). Note that a vimrc in .vim (for
Unix) or in vimfiles (for Windows) must NOT have a . or _ at the start
of its filename.

All this, and more (e.g. how to invoke Vim so as to disregard an
existing vimrc) is explained under ":help vimrc".

For the plugins, they are in the plugin/ subdirectory (for global
plugins) of one of the directories mentioned in the 'runtimepath'
option. These are normally the following:
$HOME/.vim/ (Unix) or $HOME/vimfiles/ (Windows) for user-specific full scripts
$VIM/vimfiles/ for system-wide scripts, usually put there by a system
administrator
$VIMRUNTIME/ _only_ for scripts distributed together with Vim. Any Vim
update may silently modify them.
$VIM/vimfiles/after/ for system-wide snippets overriding any of the above
$HOME/.vim/after/ (Unix) or $HOME/vimfiles/after/ (Windows) for
user-specific snippets overriding any of the above.

All these five directory trees have the same layout, and if a script
looked-for in one of them is absent, it is no error: the result is the
same as if the script had been present but empty. In the case of
global plugins, however, all of them are sourced in the order they are
found, unless you disable them all by means of a command-line switch
which can take several forms, see ":help --noplugin".

In addition, you may have "packages" which add additional directories
to the above five.
See
        :help 'runtimepath'
        :help packages
        :help plugin (which is a whole chapter about the various kinds
of plugins)

HTH,
Tony.

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXugw1Ef%2ByP%3DNmFYnhaGSeff0U4xXiY5yAOZ%2Bzxgg_O%2BVg%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: VIM on Windows Work Laptop

Tekki-2
In reply to this post by Jack corley
Did you consider to use WSL2 and the new Windows terminal? That's how I work with Vim most of the time, even if I edit Windows files.

Am Samstag, 7. März 2020 22:35:00 UTC+1 schrieb Jack corley:
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.

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/a0d81172-3fb3-4b00-9974-b87c5347dca5%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: VIM on Windows Work Laptop

JohannS-2
In reply to this post by Jack corley
On Sat, Mar 07, 2020 at 06:45:52AM -0800, Jack corley wrote:

>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.
>

There have already been many good answers, though there
are a few points I can add.

If Vim configurtion or script files will be migrated back
and forth between Windows and Unix, keeping them in
fileformat=Unix with simple NL line breaks will make this
easier.  Option 'fileformat' aka 'ff' can be toggled to
change files at will between "unix" and "dos" (or "mac")
format.

The vimfiles directory can be placed as a subdirectory
under the main Vim installation container directory,
although if this happens to be under $ProgramFiles or
$ProgramFiles(x86) the files there will be protected by
Windows; Administrative privileges for a Vim instance will
be needed to change them.

Hmm, actually $ProgramFiles(x86) behaves a little strange
when checked with the :echo command; it echos the correct
value but also gives:
E121: Undefined variable: x86
Then again what could go wrong with including parentheses
in an identifier name?  Thanks, Microsoft, spaces weren't
bad enough.

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200310130723.GA23400%40linux.site.