" NERDTree remap let g:NERDTreeDirArrowExpandable = '▸' let g:NERDTreeDirArrowCollapsible = '▾' nnoremap :NERDTreeToggle " open builtin terminal function OpenTerm() vsplit terminal endfunction nnoremap :call OpenTerm() " open new files right/below set splitright set splitbelow set clipboard+=unnamedplus " Autoformat on save augroup FormatAutogroup autocmd! autocmd BufWritePost * FormatWrite augroup END " set spellcheck according to Filetype autocmd VimEnter * set spell spelllang=en_us function Litde() set spell spelllang=de_de endfunction function Liten() set spell spelllang=en_us endfunction nnoremap :call Liten() nnoremap :call Litde() " Theme nnoremap :colo morning nnoremap :colo slate " Fuzzy finder nnoremap :Lines function RestoreSession() if @% == "" source ~/.config/nvim/lastSession.vim endif endfunction " Git-Blame configuration let g:gitblame_message_template = ' => ' let g:gitblame_date_format = '%r' if executable('vhdl-tool') au User lsp_setup call lsp#register_server({ \ 'name': 'vhdl-tool', \ 'cmd': {server_info->['vhdl-tool', 'lsp']}, \ 'whitelist': ['vhdl'], \ 'root_uri':{server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), 'vhdltool-config.yaml'))}, \ }) endif autocmd FileType vhdl setlocal omnifunc=lsp#complete nnoremap BufferNext " update function and call function Update_Sys() PackerSync TSUpdate MasonUpdate endfunction nnoremap :call Update_Sys() " Call build function function! Build() let l:filetype = &filetype if l:filetype == 'c' || l:filetype == 'cpp' || l:filetype == 'h' || l:filetype == 'hpp' execute 'make' elseif l:filetype == 'py' || l:filetype == 'python' execute '!python3 %' elseif l:filetype == 'tex' execute '!lualatex % < /dev/null' elseif l:filetype == 'rs' execute 'cargo run' elseif l:filetype == 'S' execute 'make' else echo "Unsupported file type: " . l:filetype endif endfunction nnoremap :call Build()