From eb2e7959987ebc405c7a03060f259655e13f01d0 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Mon, 29 Oct 2018 18:02:40 +0100 Subject: Further cleaning finally done --- vimrc-common | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'vimrc-common') diff --git a/vimrc-common b/vimrc-common index 00c7996..7eb499f 100644 --- a/vimrc-common +++ b/vimrc-common @@ -119,8 +119,8 @@ if has('nvim') " Neovim? endif set pumheight=8 | " Determines the maximum number of items to show in the pop-up menu for -set scrolljump=5 | " how many lines get scrolled into view when cursor reaches the screens edge -set scrolloff=0 | " keeps cursor centered +set scrolljump=4 | " how many lines get scrolled into view when cursor reaches the screens edge +set scrolloff=4 | " keeps cursor centered set shiftround | " indent/un-indent snaps to multiple of shiftwidths set writedelay=0 @@ -225,10 +225,6 @@ if has("autocmd") autocmd FileType python setlocal keywordprg=pydoc autocmd FileType vim setlocal keywordprg=:help |. autocmd FileType conf setlocal isfname-== - autocmd FileType c,cpp setlocal equalprg=clang-format - autocmd FileType c,cpp setlocal breakat-=- - autocmd FileType c,cpp setlocal keywordprg=man\ 3 - autocmd FileType c,cpp map = :pyf /usr/share/clang/clang-format.py autocmd Filetype css command! CSSsort :g/{/+1;/}/-1 sort autocmd Filetype html,markdown,xml iabbrev @@ -259,6 +255,7 @@ augroup CUSTOM_COMMANDS \ 'text': '='.printf('%*s, % 3d: %s [%s]', winwidth(0) / 2, '', v:val.bufnr, v:val.name, getbufvar(v:val.bufnr, '&buftype')), \ 'pattern': 'not loaded'} \ ")) + command! Qfls call setqflist([],'r',{ 'title':'listed buffers', 'items':map(getbufinfo({"buflisted":1}), '{"bufnr":get(v:val,"bufnr"),"lnum":get(v:val,"lnum"),"module":printf("%-*s",winwidth(0)-4,fnamemodify(get(v:val,"name"),":t"))}') }) command! Ctoggle \ if(get(getqflist({'winid':1}), 'winid') == win_getid())|cclose|else|botright copen|endif command! Ltoggle @@ -308,7 +305,8 @@ augroup KEYBOARD_MAPPING " exec current line as a command, insert output of command (from: https://youtu.be/MquaityA1SM?t=35m45s) nnoremap Q !!$SHELL " google the word under the cursor - nnoremap G :execute ":!xdg-open https://google.de/search?q=".expand("") + nnoremap g :execute ":!xdg-open https://google.de/search?q=".expand("") + nnoremap u :execute ":!xdg-open ".expand("") " display highlight group under the cursor nnoremap h :echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")') @@ -319,13 +317,11 @@ augroup KEYBOARD_MAPPING " inoremap " Bind CTRL+Backspace to vim's version (CTRL+W) in " insert mode (only works with gvim) - inoremap - \ - \ + inoremap " INDENTATION: allows un-indenting a selected block and keeps selection - vnoremap < >gv + vnoremap < >gv " make shift-home select to the beginning of the line nnoremap v^ -- cgit v1.2.3