" Plugins call plug#begin('~/.vim/plugged') Plug 'lervag/vimtex' Plug 'NewComer00/octavetui.vim', {'branch': 'main'} Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug'] } Plug 'vlime/vlime', {'rtp': 'vim/'} call plug#end() " Speed up making new reports autocmd BufNewFile report.tex 0r ~/.vim/templates/skeleton.tex " Octave IDE let g:octavetui_octave_executable = '/usr/bin/octave' let g:octavetui_user_keymaps = { \ 'OctaveTUISetBreakpoint': '', \ 'OctaveTUIDelBreakpoint': '', \ 'OctaveTUINext': '', \ 'OctaveTUIStepIn': '', \ 'OctaveTUIStepOut': '', \ 'OctaveTUIRun': '', \ 'OctaveTUIRunStacked': '', \ 'OctaveTUIQuit': 'q', \ 'OctaveTUIQuitStacked': '', \ 'OctaveTUIContinue': '', \ 'OctaveTUIAddToWatch': '', \ 'OctaveTUIRemoveFromWatch': '', \ 'OctaveTUIGoToLastError': 'E', \ } " Hotkey for viewing pdf for vimtex function! SyncZathura() " Get the window ID of the CURRENT terminal (where Vim is running) let l:term_id = system('xdotool getactivewindow') " 1. Raise Zathura using its Class name (-x) " 2. Raise the terminal back up using the ID we just captured silent exec '!wmctrl -xa Zathura && wmctrl -ia ' . l:term_id redraw! endfunction nnoremap z :call SyncZathura() " Vimtex setup let g:vimtex_view_method = 'zathura' let g:vimtex_view_automatic = 1 let g:vimtex_compiler_method = 'latexmk' " Tab autocomplete (but only when wanted) function! SmartTab() let col = col('.') - 1 if !col || getline('.')[col - 1] !~ '\k' return "\" else return "\" endif endfunction " Map it to easily go forward and backwards inoremap =SmartTab() inoremap " Make it nice like bash set completeopt=menu,menuone,noselect set wildmode=list:longest " Basic settings filetype plugin indent on syntax enable set number set ts=4 set sw=4 set smarttab set expandtab set autoindent " Move easily between splits nnoremap h h nnoremap j j nnoremap k k nnoremap l l " Compile/run hotkeys (when not using make) autocmd FileType python map :w:exec '!clear && python3' shellescape(@%, 1) autocmd FileType python imap :w:exec '!clear && python3' shellescape(@%, 1) autocmd FileType python map :!python3 -m openmc_plotter autocmd FileType python map :!python3 -m openmc_plotter autocmd FileType java map :w:exec '!clear && java' shellescape(@%, 1) autocmd FileType java imap :w:exec '!clear && java' shellescape(@%, 1) autocmd FileType fortran map :w:exec '!clear && gfortran -o %:r.x % && ./%:r.x' "autocmd FileType fortran imap :w:exec '!clear && gfortran -o %:r.out' shellescape(@%, 1) ' && ./prog' autocmd FileType gnuplot map :w:!gnuplot % "autocmd FileType gnuplot imap :w:!gnuplot % -e "pause mouse close,key" autocmd FileType sh map :w :!clear && ./% autocmd FileType sh imap :w :!clear && ./% " Starting and closing OctaveTUI autocmd FileType matlab map :w :OctaveTUIStart autocmd FileType matlab imap :w :OctaveTUIStart autocmd FileType matlab map :w :OctaveTUIStop autocmd FileType matlab imap :w :OctaveTUIStop " Big day for ZZ ZQ fans! map q: nnoremap Q