" indent, load plugin and detect filetype depending on filetype filetype indent plugin on set autoindent " fix different locale settings when ssh'ing set encoding=utf-8 " replace vertical split pipe character with space set fillchars="vert:\ |,fold:\ " set splitright set splitbelow " colorscheme if exists('+termguicolors') " enable termguicolors correctly for terminals other than " xterm-256color see https://github.com/vim/vim/issues/993 " also see :h xterm-true-color let &t_8f = "\[38;2;%lu;%lu;%lum" let &t_8b = "\[48;2;%lu;%lu;%lum" set termguicolors set background=dark colorscheme space_vim_theme endif " syntax on syntax on " switch buffers without writing to file set hidden " file specific formatting autocmd Filetype python,bash,sh,java,php,json setlocal tabstop=4 softtabstop=4 shiftwidth=4 expandtab autoindent fileformat=unix autocmd Filetype css,scss,html,htmldjango,javascript,yaml setlocal tabstop=2 softtabstop=2 shiftwidth=2 expandtab autoindent " fold indents set foldmethod=indent " search down into subfolders " provides tab-completion for all file-related tasks set path+=** " display all matching files when we tab complete set wildmenu " use normal backspace behavior set backspace=2 " allow arrow keys to be used set nocompatible " Color trailing spaces with red color highlight ExtraWhitespace ctermbg=green guibg=green match ExtraWhitespace /\s\+$/ autocmd BufWinEnter * match ExtraWhitespace /\s\+$/ autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@1 && strpart( getline('.'), col('.')-2, 3 ) =~ '^\w' return "\" else return "\" endif endfunction " persistent undo history if !isdirectory("/tmp/vim-undo") call mkdir("/tmp/vim-undo", "", 0700) endif set undodir=/tmp/vim-undo set undofile " ------------ Keybindings ---------------- " paste mode toggle set pastetoggle= " reload file map :e " open netrw browser map :Lexplore " tab for completion inoremap =Tab_Or_Complete()