From: Jannik ZANDER Date: Sat, 15 Aug 2020 18:45:21 +0000 (+0200) Subject: Cleanup vimrc X-Git-Url: https://git.zndr.dk/?a=commitdiff_plain;h=a432bb218d12aa6d05d6305b2cd0350921efcb08;p=vimfiles.git Cleanup vimrc --- diff --git a/vimrc b/vimrc index b2a7651..f5a2270 100644 --- a/vimrc +++ b/vimrc @@ -5,6 +5,7 @@ endif filetype plugin indent on syntax on +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " minpac silent! packadd minpac @@ -14,9 +15,11 @@ if exists('*minpac#init') call minpac#add('tpope/vim-repeat', {'type': 'opt'}) call minpac#add('tpope/vim-surround', {'type': 'opt'}) call minpac#add('tpope/vim-unimpaired', {'type': 'opt'}) + call minpac#add('tpope/vim-endwise', {'type': 'opt'}) call minpac#add('tpope/vim-fugitive', {'type': 'opt'}) call minpac#add('tpope/vim-commentary', {'type': 'opt'}) call minpac#add('tpope/vim-vinegar', {'type': 'opt'}) + call minpac#add('Yggdroot/indentLine', {'type': 'opt'}) call minpac#add('garbas/vim-snipmate', {'type': 'opt'}) call minpac#add('MarcWeber/vim-addon-mw-utils', {'type': 'opt'}) call minpac#add('tomtom/tlib_vim', {'type': 'opt'}) @@ -48,6 +51,50 @@ if exists('*minpac#init') call minpac#add('junegunn/fzf.vim', {'type': 'opt'}) endif +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Key-mappings +let mapleader = ' ' +let localmapleader = ' ' + +nnoremap w :update +nnoremap t :term +nnoremap * :grep \| copen +nnoremap + :exe "resize " . (winheight(0) * 3/2) +nnoremap - :exe "resize " . (winheight(0) * 2/3) +"nnoremap html :-1read ~/.vim/template/html3jwf>a +"nnoremap php :-1read ~/.vim/template/php2ja + +" Normal Mode +nnoremap Y y$ +nnoremap n nzzzv +nnoremap N Nzzzv + +" jk | Escaping! +inoremap jk +xnoremap jk +cnoremap jk + +" Jump windows +noremap +noremap +noremap +noremap +tnoremap j +tnoremap k +tnoremap l +tnoremap h + +" Vim command line +cnoremap +cnoremap +cnoreabbrev w!! w !sudo tee "%" + +" Visual Mode indent +vnoremap < >gv + + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " indentation set softtabstop=2 set shiftwidth=2 @@ -64,10 +111,8 @@ set shiftround set formatoptions+=j " searching -set incsearch -set hlsearch -set ignorecase -set smartcase +set incsearch hlsearch +set ignorecase smartcase set magic set showmatch set complete-=i @@ -77,8 +122,7 @@ if has('unnamedplus') endif " display -set scrolloff=1 -set scrolljump=5 +set scrolloff=5 set sidescrolloff=5 set display+=lastline set lazyredraw @@ -144,7 +188,7 @@ let g:netrw_list_hide = '\(^\|\s\s\)\zs\.\S\+' "let g:netrw_altv = 1 "let g:netrw_winsize = 25 -" system +" files set path=.,,** set shell=bash let g:is_posix = 1 @@ -183,49 +227,8 @@ endif "let &t_EI.="\e[1 q" "let &t_te.="\e[0 q" -" Mappings -let mapleader = "\" - -noremap -noremap -noremap -noremap - -" Terminal Mode -tnoremap h -tnoremap j -tnoremap k -tnoremap l - -" Normal Mode -nnoremap n nzzzv -nnoremap N Nzzzv -nnoremap g= gg=Gg`` -nnoremap + :exe "resize " . (winheight(0) * 3/2) -nnoremap - :exe "resize " . (winheight(0) * 2/3) -nnoremap hs :noh -nnoremap v :edit $MYVIMRC -nnoremap s :term -nnoremap m :wa:Make -nnoremap * :grep \| copen -nnoremap t :TagbarToggle -"nnoremap html :-1read ~/.vim/template/html3jwf>a -"nnoremap php :-1read ~/.vim/template/php2ja - -"" Visual Mode -"vnoremap jk -vmap < >gv - -" Insert Mode -"inoremap jk -inoremap u - -" Command Mode -cnoremap -cnoremap -cnoreabbrev w!! w !sudo tee "%" +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Functions " vimgrep file:line:coloumn:message @@ -257,6 +260,7 @@ function! Pandoc_Preview() call system('firefox markdown-preview.html 1>/dev/null 2>/dev/null &') endfunction +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Autocommands if has('autocmd') augroup filetypes @@ -289,7 +293,7 @@ if has('autocmd') autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber augroup end - augroup vimrc + augroup vimrc autocmd! autocmd BufWritePost vimrc,gvimrc,vimrc.local source $MYVIMRC augroup end @@ -311,9 +315,19 @@ silent! packadd! vim-unimpaired silent! packadd! vim-fugitive silent! packadd! vim-commentary silent! packadd! vim-vinegar +silent! packadd! vim-endwise silent! packadd! supertab silent! packadd! fzf.vim +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +silent! packadd! indentLine +"let g:indentLine_enabled = 1 +"let g:indentLine_setColors = 0 +"let g:indentLine_setConceal = 0 +autocmd! User indentLine doautocmd indentLine Syntax +let g:indentLine_color_term = 239 +let g:indentLine_color_gui = '#616161' + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Airline silent! packadd! vim-airline @@ -325,9 +339,10 @@ if exists('*airline') let g:airline_section_error = airline#section#create_right(['%{g:asyncrun_status}']) endif + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " ALE -"silent! packadd! ale +silent! packadd! ale let g:ale_enabled = 1 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""