Cleaned up vim config

This commit is contained in:
2026-02-19 15:56:21 +01:00
parent 1d773607dd
commit e2c2cf41a3
2 changed files with 12 additions and 20 deletions
+9 -18
View File
@@ -1,5 +1,5 @@
set nocompatible
filetype off
filetype plugin indent on
syntax on " enable syntax highlighting
set number relativenumber " relative line numbers
set ai " Sets auto-indentation
@@ -27,20 +27,19 @@ set bg=dark " set dark background
set wildmode=longest,list,full
set mouse=a " enable mouse
set splitright " always split right
set viminfo+=n$HOME/.vim/viminfo " save viminfo in .vim dir to keep ~/ clean
set viminfo+=n~/.config/vim/viminfo " save viminfo in .vim dir to keep ~/ clean
" Set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
set rtp+=~/.config/vim/bundle/Vundle.vim
" Download plug-ins to the ~/.vim/plugged/ directory
call vundle#begin('~/.vim/plugged')
" Download plug-ins to the ~/.config/vim/plugged/ directory
call vundle#begin('~/.config/vim/plugged')
Plugin 'VundleVim/Vundle.vim' " Let Vundle manage Vundle
Plugin 'sheerun/vim-polyglot' " Syntax highlighting
Plugin 'jiangmiao/auto-pairs' " Pair completion
Plugin 'lervag/vimtex' " LaTeX tools
Plugin 'vim-airline/vim-airline' " Nicer info line
Plugin 'junegunn/goyo.vim' " Zen Workspace
Plugin 'alvan/vim-closetag' " Auto close HTML tags
Plugin 'https://github.com/morhetz/gruvbox' " Color scheme
Plugin 'https://github.com/ap/vim-css-color' " highlight color codes in their color
@@ -48,36 +47,28 @@ Plugin 'https://github.com/907th/vim-auto-save.git' " auto save
call vundle#end()
colorscheme gruvbox
filetype plugin indent on
try
colorscheme gruvbox
catch
endtry
let g:auto_save = 1
let g:AutoPairsShortcutToggle = '<C-P>' " Press Ctrl+P to disable pair completion
let g:vimtex_view_method = 'zathura'
let g:airline#extensions#tabline#enabled = 1
" REMAPPING
" jump to last known position when opening a file
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
map <C-g> :Goyo<CR>
imap <C-g> <esc>:Goyo<CR>a
" indent with tab
vnoremap <Tab> >gv
vnoremap <S-Tab> <gv
vnoremap <Tab> >>
inoremap <Tab> <Esc>>>a
nnoremap <Tab> >>
inoremap <S-Tab> <Esc><<a
nnoremap <S-Tab> <<
" jump to beginning of selection when exiting visual mode
vnoremap <Esc> o<Esc>
autocmd BufWritePre,BufRead *.tex :VimtexCompile " autocompile tex docs
autocmd VimLeave *.tex :!texclear % " clear tex junk when closing tex file
autocmd BufWritePre * %s/\s\+$//e " auto delete trailing white space on save
autocmd BufWritePost *.vim source %