.dotfiles/.config/vim/vimrc
2022-10-23 01:52:04 +02:00

193 lines
4 KiB
VimL

set runtimepath+=~/.config/vim,~/.config/vim/after
set packpath+=~/.config/vim
" Plug plugins using VimPlug
call plug#begin('~/.config/vim/plugged')
" Tools
Plug 'editorconfig/editorconfig-vim'
Plug 'airblade/vim-gitgutter'
Plug 'samoshkin/vim-mergetool'
Plug 'fidian/hexmode'
Plug 'scrooloose/nerdtree'
Plug 'vim-scripts/DoxygenToolkit.vim'
Plug 'drmikehenry/vim-headerguard'
Plug 'easymotion/vim-easymotion'
" Eye-Candy
Plug 'machakann/vim-highlightedyank'
Plug 'itchyny/lightline.vim'
Plug 'dracula/vim', { 'as': 'dracula' }
Plug 'scrooloose/syntastic'
Plug 'Yggdroot/indentLine'
" Commands
Plug 'machakann/vim-swap'
Plug 'matze/vim-move'
" Syntax highlighting
Plug 'baskerville/vim-sxhkdrc'
Plug 'sirtaj/vim-openscad'
Plug 'lervag/vimtex'
Plug 'sheerun/vim-polyglot'
" Misc
if $WAKATIME_API_KEY != ""
Plug 'wakatime/vim-wakatime'
endif
call plug#end()
"let g:indentLine_setColors = 0
packadd termdebug
set number relativenumber
set splitbelow splitright
let mapleader = " "
augroup numbertoggle
autocmd!
autocmd WinEnter * set relativenumber
autocmd WinLeave * set norelativenumber
augroup END
syntax on
set tabstop=4
set shiftwidth=4
set modeline
set laststatus=2
set encoding=utf-8
set mouse=a
set incsearch
set hlsearch
set nowrap
set nocompatible
if has('nvim')
" Neovim specific commands
set viminfo+=n~/.cache/nviminfo
else
" Standard vim specific commands
set viminfo+=n~/.cache/viminfo
endif
set wildmode=longest,list,full
set fillchars+=vert:\
runtime ftplugin/man.vim
set keywordprg=:Man
if has("autocmd")
" Save cursor position. I don't understand this part
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
au BufNewFile,BufRead neomutt-* setf mail
au FileType yaml setlocal ai tabstop=2 shiftwidth=2 expandtab cuc nu
au FileType lilypond au BufWritePost * !lilypond %
au FileType dot au BufWritePost * !dot -Tpng -O %
endif
map <leader>b :Break<CR>
map <leader>n :NERDTreeToggle<CR>
map <Leader>m <Plug>(easymotion-prefix)
nnoremap <CR> :noh<CR><CR>
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
let g:lightline = {
\ 'active': {
\ 'left': [
\ [ 'mode', 'paste' ],
\ [ 'readonly', 'filename', 'modified', 'gitbranch' ]
\ ],
\ 'right': [
\ [ 'bufnum', 'percent', 'lineinfo' ],
\ [ 'fileformat', 'fileencoding', 'filetype', 'synthastic' ],
\ [ 'charvaluehex' ]
\ ]
\ },
\ 'inactive': {
\ 'left': [
\ [ 'filename' ]
\ ],
\ 'right': [
\ [ 'lineinfo' ],
\ [ 'bufnum' ]
\ ]
\ },
\ 'component': {
\ 'charvaluehex': '0x%B',
\ 'bufnum': '%n'
\ },
\ 'component_function': {
\ 'synthastic': 'SyntasticStatuslineFlag',
\ 'gitbranch': 'fugitive#head'
\ },
\ }
if has('termguicolors') && &termguicolors
let g:jellybeans_overrides['background']['guibg'] = 'none'
endif
let g:jellybeans_overrides = {
\ 'Todo': {
\ 'guifg': '303030',
\ 'guibg': 'f0f000',
\ 'ctermfg': 'Black',
\ 'ctermbg': 'Yellow',
\ 'attr': 'bold'
\ },
\ 'Comment': { 'guifg': 'cccccc' },
\ 'LineNr': { 'guifg': 'aaaaaa' },
\ 'background': {
\ 'ctermbg': 'none',
\ '256ctermbg': 'none'
\ },
\ }
try
packadd! dracula_pro
colorscheme dracula_pro
catch
colorscheme dracula
endtry
let g:dracula_colorterm = 0
highlight Normal ctermbg=NONE
let g:highlightedyank_highlight_duration = 250
let g:syntastic_always_populate_loc_list = 0
let g:syntastic_auto_loc_list = 0
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_oclint_config_file = '.syntastic_oclint_config'
let g:syntastic_c_config_file = '.syntastic_cc_config'
let g:tex_flavor = 'latex'
let g:vimtex_compiler_latexmk = {
\ 'build_dir': 'latexmk_output'
\}
let g:move_key_modifier = 'C'
let g:indentLine_char_list = ['|', '¦', '┆', '┊']
let g:vim_markdown_conceal = 0
let g:rustfmt_autosave = 1