.vimrc for gvim (Windows)

source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim

imap jk <Esc>
au VimEnter * imap jk <Esc>
"set guifont=Consolas:h11
set guifont=Cascadia\ Code:h12
set number
"set guifont=Cascadia Code:h11
colorscheme onedark
set encoding=utf-8
"colorscheme summerfruit

set nobackup       "no backup files
set nowritebackup  "only in case you don't want a backup file while editing
set noswapfile     "no swap files
set noundofile

set autoindent
set expandtab
set tabstop=4
set shiftwidth=4
set autoread
set autochdir

autocmd BufNewFile,BufRead *.csv   set filetype=csv_semicolon
autocmd BufNewFile,BufRead *.dat   set filetype=csv_pipe

" let g:plug_shallow = 0
call plug#begin('~/.vim/plugged')
" Plug 'mechatroner/rainbow_csv'
Plug 'prabirshrestha/vim-lsp'
Plug 'mattn/vim-lsp-settings'
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'PProvost/vim-ps1'
Plug 'prabirshrestha/asyncomplete-lsp.vim'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'shime/vim-livedown'
call plug#end()

" Live down section reference

" launch the Livedown server and preview your markdown file
" :LivedownPreview

" stop the Livedown server
" :LivedownKill

" launch/kill the Livedown server
" :LivedownToggle

nmap mt :LivedownToggle<CR>

" End Live down section!

" < Other Plugins, if they exist >

" Plug 'fatih/vim-go'
"Plug 'neoclide/coc.nvim', {'do': 'yarn install --frozen-lockfile'}
"Plug 'dense-analysis/ale'
" call plug#end()


" Use the internal diff if available.
" Otherwise use the special 'diffexpr' for Windows.
if &diffopt !~# 'internal'
  set diffexpr=MyDiff()
endif
function MyDiff()
  let opt = '-a --binary '
  if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
  if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
  let arg1 = v:fname_in
  if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
  let arg1 = substitute(arg1, '!', '\!', 'g')
  let arg2 = v:fname_new
  if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
  let arg2 = substitute(arg2, '!', '\!', 'g')
  let arg3 = v:fname_out
  if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
  let arg3 = substitute(arg3, '!', '\!', 'g')
  if $VIMRUNTIME =~ ' '
    if &sh =~ '\<cmd'
      if empty(&shellxquote)
        let l:shxq_sav = ''
        set shellxquote&
      endif
      let cmd = '"' . $VIMRUNTIME . '\diff"'
    else
      let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
    endif
  else
    let cmd = $VIMRUNTIME . '\diff'
  endif
  let cmd = substitute(cmd, '!', '\!', 'g')
  silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3
  if exists('l:shxq_sav')
    let &shellxquote=l:shxq_sav
  endif
endfunction