Useful plugins
- VimTeX for $\LaTeX$, and a personal Vimtex Cheat sheet.
- VimWiki together with Taskwiki and Taskwarrior for a personal wiki/todo list/diary. What you see is exported from that by running the following script from my hugo directory to convert links in the hugo format:
cp ../publicwiki/* content/wiki/
perl -pi -e 's| \[\[(.*?)\]\]| [\1]({{< relref "\1.md" >}})|g' content/wiki/*.md
mv content/wiki/index.md content/wiki/_index.md
- Supertab.
- Undotree.
- ayu-vim color theme.
Plugins I’ll try someday
Tips’n tricks I keep forgetting about
ctrl+O and ctrl+I to move back and forth in the list of recent jumps
'. goes to the last edit
:changes show a list of recent changes
operator/sometext applies the operator til the first occurence of someText
- You can reselect the last selected visual area with
gv.
.vimrc
set nocompatible "use vim setting rather than vi settings (this must be first)
set termguicolors "enable true colors support
set encoding=utf-8 "use UTF-8 encoding
set foldmethod=marker "fold using {{{ and }}}
set nofoldenable "default unfolded
filetype plugin on
syntax on "enable syntax highliting and filetype recognition
set backspace=indent,eol,start "make backspace a more flexible
set number "turn on line numbers
set scrolloff=10 "Keep 10 lines (top/bottom) for scope
set showcmd "show the command being typed
set showmatch "show matching brackets
filetype indent on "automatic indentation
let mapleader = ","
let maplocalleader = ","
" some shortcuts and autocorrect
iabbrev wihch which
iabbrev wich which
"moving faster
noremap j 10j
noremap k 10k
noremap h 10h
noremap l 10l
"plugins
call plug#begin('~/.vim/plugged')
Plug 'vimwiki/vimwiki'
Plug 'lervag/vimtex'
Plug 'JuliaEditorSupport/julia-vim'
Plug 'ayu-theme/ayu-vim'
Plug 'chentoast/marks.nvim'
Plug 'tools-life/taskwiki'
Plug 'ervandew/supertab', { 'branch': 'main' }
Plug 'itchyny/lightline.vim'
Plug 'mbbill/undotree'
Plug 'SirVer/ultisnips'
call plug#end()
"vimtex
let g:vimtex_quickfix_open_on_warning=0
let g:tex_flavor='latex'
let g:vimtex_view_method = 'sioyek'
"color scheme
colors ayu
"vimwikis, one private, one public
let g:vimwiki_list = [{'path': '/home/adrien/Nextcloud/vimwiki','syntax': 'markdown', 'ext': '.md'},
{'path': '/home/adrien/Nextcloud/publicwiki','syntax': 'markdown', 'ext': '.md'}]
"ultisnips, following https://ejmastnak.com/tutorials/vim-latex/ultisnips/
let g:UltiSnipsExpandTrigger = '<Tab>' " use Tab to expand snippets
let g:UltiSnipsJumpForwardTrigger = '<Tab>' " use Tab to move forward through tabstops
let g:UltiSnipsJumpBackwardTrigger = '<S-Tab>' " use Shift-Tab to move backward through tabstops
let g:UltiSnipsSnippetDirectories=['/home/adrien/Nextcloud/snips']
"lightline
set laststatus=2
let g:lightline = {
\ 'colorscheme': 'PaperColor',
\ }
"supertab
let g:SuperTabDefaultCompletionType = "<C-X><C-O>"
"undotree
nnoremap <localleader>lu :UndotreeToggle<CR>
tex.vim
"~/.vim/ftplugin/tex.vim
"math mode
imap \[ \[<CR><CR>\]<Up>
iabbrev ** \begin{align*}<CR><CR>\end{align*}<UP>
" shortcut for \item
iabbrev ii \item
"word<F4> inserts "\begin{word} ... \end{word}"
imap <F4> <Esc>v^yi\begin{<Esc>$a}<CR><CR>\end{<Esc>pa}<Up>
imap ( ()<Left>