From 0f9cde7576eb180b80829a611cfb9c22772e878e Mon Sep 17 00:00:00 2001 From: Connor Moore Date: Fri, 13 Feb 2026 08:25:57 -0500 Subject: Vimrc and other vim setup --- .vimrc | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .vimrc (limited to '.vimrc') diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..22bb5e5 --- /dev/null +++ b/.vimrc @@ -0,0 +1,77 @@ +" plugins +call plug#begin('~/.vim/plugged') +Plug 'lervag/vimtex' +Plug 'NewComer00/octavetui.vim', {'branch': 'main'} +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' + +" basic settings +filetype plugin indent on +syntax enable +set number +set ts=4 +set sw=4 +set smarttab +set expandtab +set autoindent + +" 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 prog' shellescape(@%, 1) ' && ./prog' +autocmd FileType fortran imap :w:exec '!clear && gfortran -o prog' shellescape(@%, 1) ' && ./prog' + +autocmd FileType gnuplot map :w :!gnuplot % -e "pause mouse close,key" +autocmd FileType gnuplot imap :w :!gnuplot % -e "pause mouse close,key" + +autocmd FileType sh map :w :!clear && ./% +autocmd FileType sh imap :w :!clear && ./% + +" big day for ZZ ZQ fans +map q: +nnoremap Q -- cgit v1.2.3