mirror of
https://git.decapod.one/brethil/dotfiles
synced 2024-11-25 04:51:31 +01:00
74 lines
2.0 KiB
VimL
74 lines
2.0 KiB
VimL
" Install all plugins
|
||
source $DOTFILES/vim/plugs.vim
|
||
|
||
" Sanity
|
||
set encoding=utf-8
|
||
scriptencoding utf-8
|
||
|
||
" Style
|
||
set background=dark
|
||
let g:gruvbox_contrast_dark='hard'
|
||
let g:gruvbox_sign_column='bg0'
|
||
|
||
colorscheme gruvbox
|
||
" enable truecolor support
|
||
set termguicolors
|
||
if ! has('termguicolors')
|
||
let &t_8f = "\<Esc>[38:2:%lu:%lu:%lum"
|
||
let &t_8b = "\<Esc>[48:2:%lu:%lu:%lum"
|
||
endif
|
||
|
||
" General stuff
|
||
set nowrap
|
||
set mouse=a
|
||
set relativenumber number
|
||
set foldlevelstart=3 foldmethod=indent foldenable "without nofoldenable all folds are closed at startup"
|
||
set ttymouse=xterm2 " fix mouse when used in tmux/byobu https://unix.stackexchange.com/q/50733
|
||
|
||
set nobackup nowb noswapfile " no need for backups of every file
|
||
set history=10000
|
||
|
||
set list listchars=tab:›\ ,trail:•,extends:#,nbsp:.
|
||
|
||
set splitbelow splitright
|
||
set autoread
|
||
" Don't redraw while executing macros (good performance config)
|
||
set lazyredraw
|
||
|
||
set ignorecase smartcase " ignore case on search but be smart about it
|
||
set hlsearch "highlight search results (using *)
|
||
|
||
set expandtab shiftwidth=4 tabstop=4 "always use spaces
|
||
|
||
" Completion menu config (see :h completopt)
|
||
set completeopt=menu,menuone,noselect,noinsert
|
||
" Show completion suggestions in popups instead of preview window
|
||
set completeopt+=popup
|
||
|
||
autocmd FileType yaml,yml setlocal shiftwidth=2 softtabstop=2 expandtab
|
||
autocmd FileType vue setlocal shiftwidth=2 softtabstop=2 expandtab
|
||
autocmd FileType go setlocal noexpandtab
|
||
|
||
au BufRead,BufNewFile */playbooks/*.yml set filetype=yaml.ansible
|
||
au BufRead,BufNewFile rules.v[46] *.rules setlocal filetype=iptables
|
||
|
||
if has('persistent_undo')
|
||
set undodir=$HOME/.vim/undo
|
||
set undofile
|
||
endif
|
||
|
||
" Return to last edit position when opening files (from amix's vimrc)
|
||
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
|
||
|
||
" Bash like keys for the command line
|
||
cnoremap <C-A> <Home>
|
||
cnoremap <C-E> <End>
|
||
cnoremap <C-K> <C-U>
|
||
|
||
cnoremap <C-P> <Up>
|
||
cnoremap <C-N> <Down>
|
||
|
||
source $DOTFILES/vim/plugins_config.vim
|
||
source $DOTFILES/vim/shortcuts.vim
|
||
source $DOTFILES/vim/functions.vim
|