From 12102c365247329f4d6964d6b48e12fa2bf67208 Mon Sep 17 00:00:00 2001 From: "jakob.stendahl" Date: Tue, 3 May 2022 08:41:57 +0200 Subject: Some changes --- Common/vimrc | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 54 insertions(+), 6 deletions(-) (limited to 'Common/vimrc') diff --git a/Common/vimrc b/Common/vimrc index 19615e6..56263bb 100644 --- a/Common/vimrc +++ b/Common/vimrc @@ -100,7 +100,7 @@ set hlsearch set incsearch " Don't redraw while executing macros (good performance config) -set lazyredraw +" set lazyredraw " For regular expressions turn magic on set magic @@ -199,6 +199,10 @@ set ai "Auto indent set si "Smart indent set wrap "Wrap lines +" Set options for spesific filetypes +autocmd FileType vhd setlocal shiftwidth=2 +autocmd FileType vhd setlocal shiftwidth=2 + """""""""""""""""""""""""""""" " => Visual mode related @@ -268,11 +272,13 @@ au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g set mouse=a " Fix widescreen mouse support -if has("mouse_sgr") - set ttymouse=sgr -else - set ttymouse=xterm2 -end +if !has("nvim") + if has("mouse_sgr") + set ttymouse=sgr + else + set ttymouse=xterm2 + end +endif """""""""""""""""""""""""""""" " => Status line @@ -351,10 +357,30 @@ autocmd BufEnter * let &titlestring = ' ' . expand("%:t") autocmd BufEnter * let &titlestring = expand("%t") set title +" Toggle displaying special characters +map :call ToggleListChars() + +" Load and save session +map sm :mksession! vim_session.vim +map sl :source vim_session.vim """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Helper functions """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +let g:list_chars_enabled = 0 +function! ToggleListChars() + if g:list_chars_enabled + :set nolist + :set listchars=eol:$ + let g:list_chars_enabled = 0 + else + :set list + :set listchars=tab:→\ ,space:·,nbsp:␣,trail:•,eol:¶,precedes:«,extends:» + let g:list_chars_enabled = 1 + endif +endfunction + " Returns true if paste mode is enabled function! HasPaste() if &paste @@ -431,6 +457,9 @@ Plug 'preservim/tagbar' Plug 'evanleck/vim-svelte', {'branch': 'main'} Plug 'tpope/vim-dadbod' Plug 'christoomey/vim-tmux-navigator' +Plug 'tpope/vim-dotenv' +Plug 'kristijanhusak/vim-dadbod-ui' +Plug 'zivyangll/git-blame.vim' "Plug 'neoclide/coc-tsserver', {'do': 'yarn install --frozen-lockfile'} "Plug 'clangd/coc-clangd', {'do': 'yarn install --frozen-lockfile'} @@ -543,3 +572,22 @@ nnoremap nnoremap nnoremap nnoremap + +" dadbod +xnoremap (DBExe) db#op_exec() +nnoremap (DBExe) db#op_exec() +nnoremap (DBExeLine) db#op_exec() . '_' + +xmap db (DBExe) +nmap db (DBExe) +omap db (DBExe) +nmap dbb (DBExeLine) + +autocmd FileType dbout setlocal nofoldenable + +if !empty(glob("~/.env.vim")) + source ~/.env.vim +endif + +" git-blame +nnoremap s :call gitblame#echo() -- cgit v1.2.3