I used to use Visual Studio Code in Windows as mentioned in a previous post, ♯ My Windows Environment Setup. But its startup time is terrible on Surface Go, so I decide to give vim another try.

First install vim via scoop

scoop install vim

The most important difference of the Windows vim is that it uses different paths:

.vimrc -> _vimrc
.gvimrc -> _gvimrc
.vim -> vimfiles

For example plug.vim has to be saved as ~/vimfiles/autoload/plug.vim.

Following are some Windows specific options:

" Force color and encoding. Put these near the top of the config file.
if has("win32")
  set t_Co=256
  set encoding=utf-8
endif

if has("win32")
  " Support different cursor shapes in Windows Terminal
  let &t_SI="\<CSI>5 q"
  let &t_EI="\<CSI>1 q"

  " Disable fzf preview because it is broken in PowerShell
  let g:fzf_preview_window = ''

  " Use PowerShell as the shell
  set shell=powershell.exe
  set shellcmdflag=-NoLogo\ -NoProfile\ -NonInteractive\ -command
endif

And options in _gvimrc for gvim:

set guifont=JetBrains_Mono:h11
set guioptions-=m

" Show ligatures. It is not perfect and requires C-L to manually refresh.
set renderoptions=type:directx

" Fix the ugly cursor color
hi Cursor guibg=#005f87 guifg=#eeeeee

2 linked references to “Vim Setup for Windows”