dotfiles/vim/.vimrc
2018-04-23 20:42:44 +02:00

110 lines
2.2 KiB
VimL
Executable file

" 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:\
set splitright
set splitbelow
" syntax on
syntax on
" switch buffers without writing to file
set hidden
" file specific formatting
autocmd Filetype python,bash,sh,java,php setlocal tabstop=4 softtabstop=4 shiftwidth=4 expandtab autoindent fileformat=unix
autocmd Filetype css,html,htmldjango,javascript setlocal tabstop=2 softtabstop=2 shiftwidth=2 expandtab autoindent
" 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
" disable background color erase
set t_ut=
" line numbers
set number
" changes to current directory when creating new files
set autochdir
" higlhight search
set hls
" search as characters are entered
set incsearch
" line for linewrapping
set colorcolumn=80
" remove temporary swap file
set nobackup
set noswapfile
" wrap text instead of being on one line
set lbr
" default Colors for CursorLine
set cursorline
highlight CursorLine cterm=none
" activate statusbar
set laststatus=2
set statusline=\ %F\ %m%r%w\ %=\ %{hostname()}\ \ \ %{strlen(&ft)?&ft:'none'}\ %{(&bomb?\",BOM\":\"\")}\ %{&ff}\ \ %l/%L\ \ %c\ %P
" netrw settings
let g:netrw_banner = 0
let g:netrw_winsize = -30
let g:netrw_browse_split = 4
let g:netrw_liststyle = 3
" tab autocompletion
function! Tab_Or_Complete()
if col('.')>1 && strpart( getline('.'), col('.')-2, 3 ) =~ '^\w'
return "\<C-N>"
else
return "\<Tab>"
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=<F2>
" reload file
map <F5> :e <CR>
" open netrw browser
map <silent> <C-E> :Lexplore <CR>
" tab for completion
inoremap <Tab> <C-R>=Tab_Or_Complete()<CR>
" colorscheme
if exists('+termguicolors')
set termguicolors
colorscheme simplify-dark
endif