dotfiles/.vimrc

166 lines
5.5 KiB
VimL

" Vundle
set nocompatible
filetype off
" Set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
" Download plug-ins to the ~/.vim/plugged/ directory
call vundle#begin('~/.vim/plugged')
" Let Vundle manage Vundle; muss immer der erste eintrag sein
Plugin 'VundleVim/Vundle.vim'
Plugin 'nestorsalceda/vim-strip-trailing-whitespaces'
" entferne trailing whitespaces
Plugin 'itchyny/lightline.vim'
" statusline
Plugin 'sheerun/vim-polyglot'
" languagepack
Plugin 'jeetsukumaran/vim-buffergator'
" buffer wechseln
Plugin 'mhinz/vim-signify'
" change icons neben der zeilennummerierung
Plugin 'ctrlpvim/ctrlp.vim'
" fuzzy finder
Plugin 'lifepillar/vim-solarized8'
" farbschema
Plugin 'Yggdroot/indentLine'
" einrückungsmarkierungen
Plugin 'tpope/vim-fugitive'
" git integration G:
Plugin 'jiangmiao/auto-pairs'
" autovervollständigung symbole wie klammern
Plugin 'jreybert/vimagit'
" git integration
call vundle#end()
" allgemeine Optionen
set showcmd " Show (partial) command in status line.
set showbreak=+++
set autoindent
set wrap linebreak "https://vim.fandom.com/wiki/Automatic_word_wrapping
set virtualedit=onemore
set showmatch " When a bracket is inserted, briefly jump to the matching
" one. The jump is only done if the match can be seen on the
" screen. The time to show the match can be set with
" 'matchtime'.set virtualedit=onemore
set encoding=UTF-8
set visualbell
set smartcase " Override the 'ignorecase' option if the search pattern
" contains upper case characters.
set hlsearch " When there is a previous search pattern, highlight all
" its matches.
set gdefault "global bei suche immer mit an"
set nowrap "verhindert zeilenumbrüche
set ignorecase " Ignore case in search patterns.
set incsearch " While typing a search command, show immediately where the
" so far typed pattern matches.set autoindent
set smartindent
set smarttab " When on, a <Tab> in front of a line inserts blanks
" according to 'shiftwidth'. 'tabstop' is used in other
" places. A <BS> will delete a 'shiftwidth' worth of space
" at the start of the line.set softtabstop=4
set ruler
set undolevels=1000
set backspace=indent,eol,start
set number " Show line numbers.
syntax on " Enable syntax highlighting
set tabstop=4 " Number of spaces that a <Tab> in the file counts for.
set shiftwidth=4 " Number of spaces to use for each step of (auto)indent.
set expandtab " Use the appropriate number of spaces to insert a <Tab>.
" Spaces are used in indents with the '>' and '<' commands
" and when 'autoindent' is on. To insert a real tab when
" 'expandtab' is on, use CTRL-V <Tab>.
set incsearch " Enable incremental search
set hlsearch " Enable highlight search
set termwinsize=12x0 " Set terminal size
set splitbelow " Always split below
set mouse=a " Enable mouse drag on window splits
set clipboard=unnamedplus " https://unix.stackexchange.com/questions/12535/how-to-copy-text-from-vim-to-an-external-program
" Keybindings"
:let mapleader = ","
" auto-pairs
let g:AutoPairsShortcutToggle = '<C-P>'
" lightline/statusline
set laststatus=2
let g:lightline = {
\ 'colorscheme': 'wombat',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component_function': {
\ 'gitbranch': 'FugitiveHead'
\ },
\ }
" buffergator
" https://joshldavis.com/2014/04/05/vim-tab-madness-buffers-vs-tabs/
" This allows buffers to be hidden if you've modified a buffer.
" " This is almost a must if you wish to use buffers in this way.
set hidden
" To open a new empty buffer
nmap <C-t> :enew<cr>
" Move to the next buffer
nmap <C-l> :bnext<CR>
" Move to the previous buffer
nmap <C-h> :bprevious<CR>
" Close the current buffer and move to the previous one
" This replicates the idea of closing a tab
nmap <C-q> :bp <BAR> bd #<CR>
" indentLine
" fügt vertikale Striche bei Einrückungen ein
filetype plugin indent on
" aussehen
"set background=dark " dark or light
"colorscheme solarized8 " Your favorite color scheme's name
" ripgrep und ctrlp
" sudo apt install ripgrep(rg)
if executable('rg')
let g:ctrlp_user_command = 'rg %s --files --hidden --color=never --glob ""'
endif
let g:ctrlp_map = '<c-f>' "aufruf mit strg+f
" ignore files
" https://github.com/ctrlpvim/ctrlp.vim
set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux
set wildignore+=*\\tmp\\*,*.swp,*.zip,*.exe " Windows
let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
"https://jeffkreeftmeijer.com/vim-number/
set number relativenumber
augroup numbertoggle
autocmd!
autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
augroup END
" vimagit
" https://github.com/jreybert/vimagit#mappings
nmap <Leader>m :Magit<cr>
" toggle linenumbers
nmap <Leader>c :set norelativenumber!<CR>:set nonu!<CR>
" speichern
nmap <Leader>s :w<CR>
" 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
set wildmenu
set wildignore=*.o,*~