vim: housekeeping

Signed-off-by: Michael Grote <michael.grote@posteo.de>
This commit is contained in:
Michael Grote 2023-05-27 14:09:25 +02:00
parent 31e96c6215
commit 137a8bfe19
No known key found for this signature in database
GPG key ID: 4D4C2CD4AE7F095E

32
.vimrc
View file

@ -36,16 +36,8 @@ Plugin 'mhinz/vim-startify'
Plugin 'ConradIrwin/vim-bracketed-paste'
" bessere textoperatroren
Plugin 'wellle/targets.vim'
" multi cursor; setze cursor mit \\\
Plugin 'mg979/vim-visual-multi'
" Undotree
Plugin 'mbbill/undotree'
" Markdown-Preview in Browser
" :source %
" :PluginInstall
" :call mkdp#util#install()
" Befehle nach Installation notwendig
Plugin 'iamcco/markdown-preview.nvim'
call vundle#end()
let mapleader = ","
@ -54,18 +46,23 @@ let mapleader = ","
" ### Suche
" While typing a search command, show immediately where the so far typed pattern matches.
set incsearch
" When there is a previous search pattern, highlight all its matches.
set hlsearch
" Ignore case in search patterns.
set ignorecase
" Override the 'ignorecase' option if the search pattern contains upper case characters.
set smartcase
" Show line numbers.
set number
" setze cursorline
set cursorline
highlight CursorLine cterm=NONE ctermbg=green ctermfg=white guibg=darkred guifg=white
" ### Kommandovervollständigung
" https://www.reddit.com/r/vim/comments/oo9gms/any_way_to_get_vim_to_not_defaulting_to_the_first/h5wygix/?context=8&depth=9
set wildmode=longest,list,full
@ -166,45 +163,52 @@ xnoremap <F8> c``<C-r>"``<Esc>
" ### Keybindings
" deaktiviere Ex-Mode keybinding
nnoremap Q <Nop>
" Ctrl+S zum speichern
nnoremap <C-s> :w<CR>
" Navigate tabs
nnoremap <C-j> :bnext<CR>
nnoremap <C-k> :bprev<CR>
" Saner CTRL-L
" https://github.com/mhinz/vim-galore#saner-ctrl-l
nnoremap <Leader>dh :nohlsearch<cr>:diffupdate<cr>:syntax sync fromstart<cr><c-l>
" toggle cursorline
nnoremap <Leader>h :set nocursorline!<CR>
" strg+f sucht fuzzy nach dateien
nnoremap <C-f> :CtrlP<CR>
" strg+l sucht fuzzy in Zeilen des aktuellen Buffers
nnoremap <C-l> :CtrlPLine<CR>
" mit , + n/p wechsele den Eintrag im Quickfix-Windows vor/zurück
" mit , c Öffne ShellCheck im Quickfix Windows
nnoremap cn :cn<CR>
nnoremap cp :cp<CR>
nnoremap <Leader>sc :ShellCheck!<CR>
" ### markdown-preview
nnoremap <Leader>m :MarkdownPreviewToggle<CR>
" format paragraphs as markdown table
nnoremap <Leader>mm Vap:EasyAlign *\|<cr><esc>
nnoremap <F7> Vap:EasyAlign *\|<cr><esc>
"
" lasse Y wie C oder D funktionieren
nmap Y y$
" https://www.reddit.com/r/vim/comments/s1he17/is_there_a_plugin_that_makes_searching_and
nnoremap <Leader>sr :%s/<C-r><C-w>//gc<Left><Left><Left>
vnoremap <Leader>sr y:%s/<C-R>"//gc<Left><Left><Left>
" Toggle NERDTree
nnoremap <F2> :call ToggleNERDTreeFind()<CR>
" toogle floaterm
let g:floaterm_keymap_toggle = '<F3>'
" toddle Undotree
nnoremap <F6> :UndotreeToggle<CR>
nnoremap <Leader>u :UndotreeToggle<CR>
" surround words with backticks
nnoremap <F8> ciw``<C-r>"``<Esc>
xnoremap <F8> c``<C-r>"``<Esc>
" besseres undo
" https://www.reddit.com/r/vim/comments/13gk0nl/is_there_a_way_to_make_undo_sensible/
@ -219,13 +223,13 @@ inoremap \" \"<c-g>u
inoremap <space> <space><c-g>u
inoremap <CR> <CR><c-g>u
" ### Abbreviations
iabbrev ncicht nicht
iabbrev nciht nicht
" linenumbers
nnoremap <Leader>z :set nonumber! norelativenumber!<CR>
" https://jeffkreeftmeijer.com/vim-number/
:augroup numbertoggle
: autocmd!