" Use Vim settings, rather then Vi settings (much better!). " This must be first, because it changes other options as a side effect. set nocompatible " BEGIN Vundle " git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim filetype off " required " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() " let Vundle manage Vundle, required Plugin 'gmarik/Vundle.vim' Plugin 'tmhedberg/SimpylFold' Plugin 'vim-scripts/indentpython.vim' "https://github.com/Valloric/YouCompleteMe Bundle 'Valloric/YouCompleteMe' "Plugin 'vim-syntastic/syntastic' Plugin 'w0rp/ale' Plugin 'nvie/vim-flake8' Plugin 'jnurmine/Zenburn' Plugin 'altercation/vim-colors-solarized' Plugin 'scrooloose/nerdtree' Plugin 'jistr/vim-nerdtree-tabs' Plugin 'kien/ctrlp.vim' Plugin 'ryanoasis/vim-devicons' Plugin 'vim-airline/vim-airline' Plugin 'vim-airline/vim-airline-themes' Plugin 'farmergreg/vim-lastplace' " add all your plugins here (note older versions of Vundle " used Bundle instead of Plugin) " All of your Plugins must be added before the following line call vundle#end() " required filetype plugin indent on " required " END Vundle " allow backspacing over everything in insert mode set backspace=indent,eol,start set autoindent " always set autoindenting on set backup " keep a backup file set history=50 " keep 50 lines of command line history set ruler " show the cursor position all the time set showcmd " display incomplete commands set incsearch " do incremental searching set ignorecase " Enable folding set foldmethod=indent set foldlevel=99 " Enable folding with the spacebar nnoremap za " Setting für tmhedberg/SimpylFold let g:SimpylFold_docstring_preview=1 set encoding=utf-8 setglobal fileencoding=utf-8 "setglobal bomb set fileencodings=ucs-bom,utf-8,latin1 " Don't use Ex mode, use Q for formatting map Q gq " Make p in Visual mode replace the selected text with the "" register. vnoremap p :let current_reg = @"gvs=current_reg let python_highlight_all=1 syntax on set hlsearch "colorscheme desert if has('gui_running') "set background=dark "colorscheme zenburn colorscheme solarized else "colorscheme solarized colorscheme zenburn endif call togglebg#map("") " Valloric/YouCompleteMe let g:ycm_autoclose_preview_window_after_completion=1 map g :YcmCompleter GoToDefinitionElseDeclaration " Virtualenv Support "python with virtualenv support py3 << EOF import os import sys if 'VIRTUAL_ENV' in os.environ: project_base_dir = os.environ['VIRTUAL_ENV'] activate_this = os.path.join(project_base_dir, 'bin/activate_this.py') execfile(activate_this, dict(__file__=activate_this)) EOF " NerdTree let NERDTreeIgnore=['\.pyc$', '\~$'] "ignore files in NERDTree " ALE let b:ale_linters = ['flake8'] let b:ale_fixers = [ \ 'remove_trailing_lines', \ 'isort', \ 'ale#fixers#generic_python#BreakUpLongLines', \ 'yapf', \] nnoremap = :ALEFix " yapf " pip3 install yapf autocmd FileType python nnoremap = :0,$!yapf " Einzug nur 2 Zeichen! set shiftwidth=2 set tabstop=2 set et " Python PEP8 au BufNewFile,BufRead *.py \ set tabstop=4 \ softtabstop=4 \ shiftwidth=4 \ textwidth=79 \ expandtab \ autoindent \ fileformat=unix " This will mark extra whitespace as bad and probably color it red. highlight BadWhitespace ctermbg=red guibg=darkred au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/ " für bestimmte Dateitypen jeweilige .vimrc laden " autocmd FileType tex source /home/stefan/.vimtex " Zeilen unterstreichen: "map Yp:s/./-/g :let @/="" "map yyp:s/./-/g:let @/ = "": " oder einfacher mit: map YpVr- "set background=dark " Rechtschreibeprüfung: map :w!:!aspell --lang=de check %:e! % " Zeilennummer einausblendne :map :let &number=1-&number " F2 fuer insert mode nnoremap :set invpaste paste? set pastetoggle= " Backup im UserDir function InitBackupDir() if has('win32') || has('win32unix') "windows/cygwin let separator = "_" else let separator = "." endif let parent = $HOME .'/' . separator . 'vim/' let backup = parent . 'backup/' let tmp = parent . 'tmp/' if exists("*mkdir") if !isdirectory(parent) call mkdir(parent) endif if !isdirectory(backup) call mkdir (backup) endif if !isdirectory(tmp) call mkdir (tmp) endif endif let missing_dir = 0 if isdirectory(tmp) execute 'set backupdir=' . escape(backup, " ") . "/,." else let missing_dir = 1 endif if isdirectory(backup) execute 'set directory=' . escape(tmp, " ") . "/,." else let missing_dir = 1 endif if missing_dir echo "Warning: Unable to create backup directories: " . backup ." and " . tmp echo "Try: mkdir -p " . backup echo "and: mkdir -p " . tmp set backupdir=. set directory=. endif endfunction call InitBackupDir() " show the editing mode on the last line set showmode " Powerline "source /usr/local/lib/python3.7/site-packages/powerline/bindings/vim/plugin/powerline.vim set laststatus=2 " Always display the statusline in all windows set showtabline=2 " Always display the tabline, even if there is only one tab set noshowmode " Hide the default mode text (e.g. -- INSERT -- below the statusline)