diff --git a/.gitmodules b/.gitmodules index c025ae9..7412219 100644 --- a/.gitmodules +++ b/.gitmodules @@ -31,3 +31,6 @@ [submodule "vim/.vim/pack/default/start/vim-flog"] path = vim/.vim/pack/default/start/vim-flog url = https://github.com/rbong/vim-flog.git +[submodule "vim/.vim/pack/default/start/vim-gitgutter"] + path = vim/.vim/pack/default/start/vim-gitgutter + url = https://github.com/airblade/vim-gitgutter.git diff --git a/vim/.vim/pack/default/start/vim-gitgutter b/vim/.vim/pack/default/start/vim-gitgutter new file mode 160000 index 0000000..8a2f819 --- /dev/null +++ b/vim/.vim/pack/default/start/vim-gitgutter @@ -0,0 +1 @@ +Subproject commit 8a2f8199b689b93fe4391a8ba1d97dd84b86ebd6 diff --git a/vim/.vimrc b/vim/.vimrc index a8bc88a..8cc8c46 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -6,49 +6,89 @@ syntax on filetype plugin on set tabstop=4 shiftwidth=4 autoindent smartindent expandtab set mouse=v -"set noswapfile +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" " Numbering of lines +" +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " set relativenumber set number +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" " Runtimepath variables +" +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " call -> set rtp? show the runtime path let $RTP=split(&runtimepath, ',')[0] let $RC="$HOME/.vimrc" +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" " Move Swap,Backup and undo files into .vim directory +" +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set directory^=$HOME/.vim/.swap// set backupdir^=$HOME/.vim/.backup// set undodir^=$HOME/.vim/.undo// +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" " Split to the right and below +" +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set splitbelow set splitright +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" " Folding +" +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set foldenable foldlevelstart=20 foldmethod=indent +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" " Rebind shortcut to switch splits +" +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" nmap h nmap j nmap k nmap l +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" " Finding files +" +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set path+=** set wildmenu -" Tags +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" +" Create Tags thorugh :MakeTags +" +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" command! MakeTags !ctags -R . set autochdir set tags=tags; +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" +" Execute Python Scripts " Press F9 to run Python script +" +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" autocmd FileType python map :w:exec '!python3' shellescape(@%, 1) autocmd FileType python imap :w:exec '!python3' shellescape(@%, 1) -" File browsing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" +" File browsing through a tree on the left side +" +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" let g:netrw_banner=0 let g:netrw_browse_split=4 let g:netrw_altv=1 @@ -57,10 +97,20 @@ let g:netrw_list_hide=netrw_gitignore#Hide() let g:netrw_list_hide.=',\(\^\|\s\s\)\zs\.\S\+' map :Lex vertical resize 30 -" Cursorline +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" +" Cursorline on the cursor +" +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set cursorline hi CursorLine cterm=NONE ctermbg=darkgrey ctermfg=white + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" +" Status Line on the bottom +" +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Statusline " function! gitbranch() " return system("git rev-parse --abbrev-ref head 2>/dev/null | tr -d '\n'") @@ -102,24 +152,40 @@ set statusline+=\ %c:%l/%L set statusline+=\ %p%% set statusline+=\ [%n] -"packadd! indentLine -"let g: indentLine_char = '⦙' - -" let g:vimspector_enable_mappings = 'HUMAN' -" packadd! vimspector +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" +" Colors +" +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set termguicolors " colorscheme gruvbox colorscheme catppuccin_macchiato set bg=dark -packadd! vim-log-highlighting +" tmux color correction +if exists('+termguicolors') + let &t_8f = "\[38;2;%lu;%lu;%lum" + let &t_8b = "\[48;2;%lu;%lu;%lum" + set termguicolors +endif + + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" " tagbar, press F8 +" +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" nmap :TagbarToggle -" ---------- Selection Highlighting + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" +" Selection Highlighting +" +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " hlsearch colors highlight Search ctermbg=black ctermfg=darkgrey ctermbg=grey " Highlight all instances of word under cursor, when idle. @@ -133,11 +199,16 @@ function! AutoHighlightToggle() endfunction call AutoHighlightToggle() -" ----------- Code Completion + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" +" Code Completion +" +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" let g:ale_enabled = 1 let g:ale_hover_enabled = 1 " nmap gr :ALEFindReferences -nmap K :ALEHover +" nmap K :ALEHover set completeopt+=menuone set completeopt+=noselect @@ -165,23 +236,27 @@ let g:ale_set_balloons=1 "" autocmd InsertLeave,CompleteDone * if pumvisible() == 0 | pclose | endif +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" +" Remove conceal from Markdown when Insert mode is set +" +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +autocmd InsertEnter *.{markdown,md} set conceallevel=0 +autocmd InsertLeave *.{markdown,md} set conceallevel=2 + +autocmd InsertEnter *.{json} set conceallevel=0 +autocmd InsertLeave *.{json} set conceallevel=2 + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" +" Load all packages and activate tags +" +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +packadd! vim-log-highlighting packloadall " Load all of the helptags now, after plugins have been loaded. " All messages and errors will be ignored. silent! helptags ALL - -" tmux color correction -if exists('+termguicolors') - let &t_8f = "\[38;2;%lu;%lu;%lum" - let &t_8b = "\[48;2;%lu;%lu;%lum" - set termguicolors -endif - -" Remove conceal from Markdown when Insert mode is set -autocmd InsertEnter *.{markdown,md} set conceallevel=0 -autocmd InsertLeave *.{markdown,md} set conceallevel=2 - -" Remove conceal from JSON when Insert mode is on -autocmd InsertEnter *.{json} set conceallevel=0 -autocmd InsertLeave *.{json} set conceallevel=2 +silent! helptags ALE +silent! helptags vim-gitgutter/doc