dotfiles/nvim.configlink/init.vim

55 lines
1.5 KiB
VimL
Raw Normal View History

2020-07-26 20:15:21 +00:00
" Vim Config
syntax enable " Syntax highlighting
set termguicolors " Set to truecolor
colorscheme gruvbox " Installed in autoload/ and colors/
set number " Show line numbers
set relativenumber " Relative numbers instead of absolute
set expandtab " Tabs into spaces
set shiftwidth=4 "
set softtabstop=4 "
set ignorecase " Ignore case when searching
set smartcase " Check case when using capitals in search
set incsearch " Search while typing
2020-06-03 14:31:58 +00:00
set pastetoggle=<F3>
set visualbell
2020-07-26 20:15:21 +00:00
" Remember last position
2020-06-03 14:31:58 +00:00
if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
endif
2020-07-26 20:15:21 +00:00
" Terraform plugin
2020-06-03 14:31:58 +00:00
let g:terraform_align=1
let g:terraform_remap_spacebar=1
" line type
let &t_ti.="\e[1 q"
let &t_SI.="\e[5 q"
let &t_EI.="\e[1 q"
let &t_te.="\e[0 q"
2020-07-26 20:15:21 +00:00
" Better backup, swap and undo storage
set noswapfile " Instead of swaps, create backups (less annoying)
set backup " Easier to recover and more secure
set undofile " Keeps undos after quit
2020-06-03 14:31:58 +00:00
set backupdir=~/.vim/dirs/backup
set undodir=~/.vim/dirs/undo
2020-07-26 20:15:21 +00:00
" Create backup directories if they don't exist
2020-06-03 14:31:58 +00:00
if !isdirectory(&backupdir)
call mkdir(&backupdir, "p")
endif
if !isdirectory(&undodir)
call mkdir(&undodir, "p")
endif
2020-07-26 20:15:21 +00:00
" Mouse interaction / scrolling
2020-06-08 00:16:03 +00:00
set mouse=nv
2020-06-03 14:31:58 +00:00
2020-07-26 20:15:21 +00:00
" Change title
2020-06-03 14:31:58 +00:00
let &titlestring = @%
set title
2020-07-26 20:15:21 +00:00