-
Install the latest stable snapshot version of vim from https://www.vim.org/download.php
-
Add a new environment variable
VIMin the system properties with your Vim installation folder path. (New variable with name =VIMand value =<vim-installation-path>) -
Add a plugin manager
vim-plugby executing following command inWindows PowerShell.iwr -useb https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim |` ni "$env:VIM/vimfiles/autoload/plug.vim" -Force -
Locate the
_vimrcfile in the Vim installation folder, and add the following snippet at the end." Begin plugin section for vim-plug call plug#begin('<your-vim-installation-path>/vimfiles/plugged') " Add your plugins below: Plug 'lervag/vimtex' call plug#end()Make sure to replace
<your-vim-installation-path>with your actual path -
Save the
_vimrcfile, open vim app, and run the following command.:PlugInstall -
Install
SumatraPDFfrom https://www.sumatrapdfreader.org/download-free-pdf-viewer, and add the pdfviewer installation folder path to PATH variable in environment variables. -
Add the following vimtex configuration in
_vimrc." VimTeX configuration filetype plugin indent on syntax enable let g:vimtex_view_method = 'general' let g:vimtex_view_general_viewer = '<sumatra-installatin-path>/SumatraPDF.exe' let g:vimtex_compiler_method = 'latexmk' let g:tex_flavor='latex' let g:vimtex_quickfix_mode=1Make sure to replace
<sumatra-installatin-path>with your actual path. -
To enable save, copy, cut, paste, undo operations with
controlkey in vim (if not working by default), add the following configuration in the_vimrcfile.nnoremap <C-s> :w<CR> inoremap <C-s> <Esc>:w<CR>a vnoremap <C-c> "+y vnoremap <C-x> "+d inoremap <C-v> <C-r>+ nnoremap <C-v> "+p inoremap <C-z> <C-o>u nnoremap <C-z> u -
To enable the line numbering, add the following to the
_vimrcfile.set number -
For the light background Delek theme, add the following to the
_vimrcfile.colorscheme Delek set termguicolors -
To reload Vim with an updated configuration:
:source $MYVIMRC -
To open a file in vim:
:e <file-path>
- The following is set up with the help of https://castel.dev/post/lecture-notes-1/ and https://ejmastnak.com/tutorials/vim-latex/intro/.
- To enable concealing, add the following to the
_vimrcfile.set conceallevel=1 let g:tex_conceal='abdmg' highlight Conceal ctermfg=blue guifg=blue - For snippets, to use the plugin
UltiSnips, add the following in the plugin section of the_vimrcfile.ExecutePlug 'sirver/ultisnips'PlugInstallin Vim (as administrator). - Create the folder
UltiSnipsinside<your-vim-installation-path>/vimfiles/, and create/copy the file tex.snippets in this folder. Add the following to thevimrcfile.The filelet g:UltiSnipsExpandTrigger = '<tab>' let g:UltiSnipsJumpForwardTrigger = '<tab>' let g:UltiSnipsJumpBackwardTrigger = '<s-tab>' let g:UltiSnipsSnippetDirectories=["UltiSnips"]tex.snippetsis a modified version of https://github.com/gillescastel/latex-snippets/blob/master/tex.snippets. - For correcting spellings in US English using
ctrl+l, add the following to the_vimrcfile.setlocal spell set spelllang=en_us inoremap <C-l> <c-g>u<Esc>[s1z=`]a<c-g>u