set nocompatible set backspace=indent,eol,start syntax enable set mouse=a set mousemodel=extend set title let g:airline_theme='term_light' filetype plugin on filetype indent on " Enable spell check for commit messages autocmd FileType gitcommit setlocal spell spelllang=en_gb " Use spaces instead of tabs set expandtab " Be smart when using tabs ;) set smarttab " 1 tab == 4 spaces set shiftwidth=4 set tabstop=4 set wrap "Wrap lines set nobackup set nowb set noswapfile " Set to auto read when a file is changed from the outside set autoread " Leader let mapleader = "," let g:mapleader = "," " Fast saving nmap w :w! " Save and start shell nmap # :w!:tei "tnoremap :buffer # tnoremap :buffer # "autocmd TermClose * bd! " quit when a terminal closes instead of showing exit code and waiting " Highlight search results set hlsearch " Makes search act like search in modern browsers set incsearch " Smart case when searching set ignorecase set smartcase " Show results of pattern matching/replacing while typing set inccommand=split " When you press r you can search and replace the selected text vnoremap r :call VisualSelection('replace') " Disable highlight when is pressed map :noh " For regular expressions turn magic on set magic " Visual mode pressing * or # searches for the current selection " Super useful! From an idea by Michael Naumann vnoremap * :call VisualSelection('f') vnoremap # :call VisualSelection('b') " Show matching brackets when text indicator is over them set showmatch " How many tenths of a second to blink when matching brackets set mat=2 " Spell checking map ss :setlocal spell! spelllang=de_20 map se :setlocal spell! spelllang=en-curly_gb map su :setlocal spell! spelllang=en-curly_us " Treat long lines as break lines (useful when moving around in them) map j gj map k gk " Smart way to move between windows map j map k map h map l " More natural behaviour when splitting set splitbelow set splitright " Useful mappings for managing tabs map tn :tabnew map to :tabonly map tc :tabclose map tm :tabmove " Jump to particular tab directly noremap 1 1gt noremap 2 2gt noremap 3 3gt noremap 4 4gt noremap 5 5gt noremap 6 6gt noremap 7 7gt noremap 8 8gt noremap 9 9gt noremap 0 :tablast " Switch CWD to the directory of the open buffer map cd :cd %:p:h:pwd " Remember info about open buffers on close set viminfo^=% " Toggle paste mode on and off map pp :setlocal paste! " Save and make nnoremap m :wa :Make hi ColorColumn ctermbg=47 let g:vimtex_compiler_enabled = 0 let g:local_vimrc = {'names': ['.local.vimrc'], 'hash_fun': 'LVRHashOfFile'}