My personalization of vim for mainly LaTeX. Here uploaded are,
- My
.vimrc; - My keybindings, snippets and abbreviations for LaTeX;
- KeyBindings for writing math sets, Greek alphabets, math notations easily and fast;
- Snippets for math sets, Greek alphabets, math environments;
- General word abbreviations (using
tpope/vim-abolish) and math abbreviations.
- My templates for LaTeX;
- A 'universal' latex template (
tex.template).
- A 'universal' latex template (
- A folding technique which is a mixture of LaTeX-Suite,
Latex-Box and
vimtex folding method.
This a modification of petobens
folding technique which can be found
here
and here.
This folding technique uses
foldmethod=markerandfoldmarker=F{O{L{D,F}O}L}D.
Download MahbubAlam231/vim-for-latex form GitHub.
You should consider swapping escape and caps key on your device, it makes
it more convenient to press escape key.
For Linux you can do this from system settings or by adding the line setxkbmap -option "caps:swapescape" at the end of your .bashrc, this will swap escape and
caps key on your computer once you open VIM.
To make this change permanent you can put the same line at the end of your
~/.profile file, this will swap escape and caps key every time you turn
on your computer.
- Install VIM from command line using
sudo apt install vim-gtk3; - Install vim-plug following installation guide;
- Put
.vimrcin your home directory; - Put
Abbreviations,after,KeyBindings,spellandUltiSnipsin~/.vim; - Open
.vimrcusingVIM(it might throw some errors, but enter anyway), and run:PlugInstall; - Put
LaTeX/templatesin~/.vim/bundle/vim-templates/; - Put
LaTeX/texin~/.vim/plugged/vimtex/ftplugin/.
- Install VIM using
homebrew; - Install vim-plug (or Vundle) following installation guide;
- Put
.vimrcin/Users/(your_pc_name); - Replace
~/.vimby/Users/(your_pc_name)/.vimin the above instructions for Linux; - There are some lines (after the 530th line) inside
.vimrcfile as well that contains~/.vim, make similar changes there as well.
Read .vimrc, TeXKeyBindings.vim, NumbersPeacefully.vim, UnmapKeyBindings.vim,
GeneralAbbreviations.vim, MathAbbreviations.vim and tex.snippets to learn about the mappings.
NumbersPeacefully.vim and UnmapKeyBindings.vim are there to disable certain parts of TeXKeyBindings.vim.
The mappings are designed to be easy to remember, just like vim commands. As you go over these mappings I hope you will find that these are time-saving and easy-to-perform mappings.
For me these mappings simplify writing .tex files, and also many other types of files as well.
For basic vim tips you can watch the following videos-
For any query about vimscripts go to :help from inside vim.
You can also look at the book Learn Vimscripts the Hard Way
by Steve Losh.