dotfiles/.vimrc

161 lines
4.7 KiB
VimL
Raw Normal View History

2021-05-27 22:45:40 +02:00
" vim statusline - kein plugin
" https://shapeshed.com/vim-statuslines/
function! GitBranch()
return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'")
endfunction
function! StatuslineGit()
let l:branchname = GitBranch()
return strlen(l:branchname) > 0?' '.l:branchname.' ':''
endfunction
set statusline=
set statusline+=%#PmenuSel#
set statusline+=%{StatuslineGit()}
set statusline+=%#LineNr#
set statusline+=\ %f
set statusline+=%m\
set statusline+=%=
set statusline+=%#CursorColumn#
set statusline+=\ %y
set statusline+=\ %{&fileencoding?&fileencoding:&encoding}
set statusline+=\[%{&fileformat}\]
set statusline+=\ %p%%
set statusline+=\ %l:%c
set statusline+=\
2021-05-27 17:54:53 +02:00
" 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
Plugin 'VundleVim/Vundle.vim'
2021-05-27 22:27:43 +02:00
"Plugin 'vim-airline/vim-airline'
"Plugin 'vim-airline/vim-airline-themes'
"Plugin 'matze/vim-move'
2021-05-27 17:54:53 +02:00
Plugin 'sheerun/vim-polyglot'
2021-05-27 22:27:43 +02:00
Plugin 'Xuyuanp/nerdtree-git-plugin'
Plugin 'mhinz/vim-signify'
2021-05-27 17:54:53 +02:00
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'lifepillar/vim-solarized8'
Plugin 'Yggdroot/indentLine'
Plugin 'tpope/vim-fugitive'
2021-05-27 22:45:40 +02:00
"Plugin 'ryanoasis/vim-devicons'
2021-05-27 17:54:53 +02:00
Plugin 'jiangmiao/auto-pairs'
Plugin 'preservim/nerdtree'
2021-05-27 21:47:49 +02:00
Plugin 'unkiwii/vim-nerdtree-sync'
2021-05-27 17:54:53 +02:00
" Install:
" vim +PluginInstall +qall
" oder
" :PluginInstall
call vundle#end()
"
" auto-pairs
let g:AutoPairsShortcutToggle = '<C-P>'
" Toogle Auto-Pairs mit Strg+P
" zur Autovervollständigung von Klammern
"
2021-05-27 21:47:49 +02:00
" NERDtree + nerdtree-sync
"https://github.com/preservim/nerdtree
2021-05-27 17:54:53 +02:00
let NERDTreeShowHidden = 1 " Show hidden files
let NERDTreeShowLineNumbers = 0 " Hide line numbers
let NERDTreeMinimalMenu = 1 " Use the minimal menu (m)
let NERDTreeWinSize = 31 " Set panel width to 31 columns
nmap <F2> :NERDTreeToggle<CR> " ruft NERDtree mit F2 auf
2021-05-27 21:47:49 +02:00
" Start NERDTree. If a file is specified, move the cursor to its window.
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * NERDTree | if argc() > 0 || exists("s:std_in") | wincmd p | endif
let g:nerdtree_sync_cursorline = 1 " highlight the file in tree
" open the existing NERDTree on each new tab.
autocmd BufWinEnter * silent NERDTreeMirror
2021-05-27 17:54:53 +02:00
"
2021-05-27 21:47:49 +02:00
" exit Vim if NERDTree is the only window left.
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() |
\ quit | endif
"
2021-05-27 17:54:53 +02:00
" Tastenkürzel
2021-05-27 21:47:49 +02:00
nmap <C-t> :tabnew<CR>:NERDTreeFind<CR>
2021-05-27 17:54:53 +02:00
" erstellt neuen tab und öffnet den open-dialog
"
2021-05-27 22:45:40 +02:00
" nerdtree-git-plugin
let g:NERDTreeGitStatusIndicatorMapCustom = {
\ 'Modified' :'*',
\ 'Staged' :'+',
\ 'Untracked' :'',
\ 'Renamed' :'*',
\ 'Unmerged' :'',
\ 'Deleted' :'-',
\ 'Dirty' :'',
\ 'Ignored' :'',
\ 'Clean' :'',
\ 'Unknown' :'?',
\ }
"
"
2021-05-27 17:54:53 +02:00
" indentLine
" fügt vertikale Striche bei Einrückungen ein
filetype plugin indent on
"
" allgemeine Optionen
2020-12-17 10:02:50 +01:00
set number
2021-05-27 17:54:53 +02:00
set showcmd
set showtabline=2 " zeigt immer die 'tabline'
2020-12-17 10:02:50 +01:00
set showbreak=+++
set textwidth=100
set showmatch
2020-12-17 12:10:07 +01:00
set virtualedit=onemore
2021-05-27 22:27:43 +02:00
set encoding=UTF-8
2020-12-17 10:02:50 +01:00
set visualbell
set hlsearch
set smartcase
set gdefault
set ignorecase
set incsearch
set autoindent
set smartindent
set smarttab
set softtabstop=4
set ruler
set undolevels=1000
set backspace=indent,eol,start
2021-05-27 12:30:15 +02:00
set nu " Enable line numbers
syntax on " Enable syntax highlighting
2021-05-27 17:54:53 +02:00
set tabstop=4 " How many columns of whitespace a \t is worth
set shiftwidth=4 " How many columns of whitespace a level of indentation is worth
set expandtab " Use spaces when tabbing
2021-05-27 12:30:15 +02:00
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
2021-05-27 17:54:53 +02:00
"
" aussehen
2021-05-27 12:30:15 +02:00
set background=light " dark or light
colorscheme solarized8 " Your favorite color scheme's name
2021-05-27 17:54:53 +02:00
"
" 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
2021-05-27 22:27:43 +02:00
" airline
2021-05-27 17:54:53 +02:00
let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
2021-05-27 22:27:43 +02:00
let g:airline_powerline_fonts = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif