dotfiles/vim/vimrc

111 lines
2.8 KiB
VimL
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

" Baco's Vimrc file
" Some defaults to start with
runtime! defaults.vim
runtime! vimrc_example.vim
if has('persistent_undo')
set nobackup " do not keep a backup file, use undo instead
endif
" Essentials
set number
set relativenumber
set cursorline
set tabstop=4 shiftwidth=4
set softtabstop=-1 " Negative value sets to use "shiftwidth" instead
set list listchars=tab:→ ,trail,leadmultispace:⦙···
if has('autocmd')
autocmd OptionSet shiftwidth execute
\ 'setlocal listchars=tab:→ ,trail:·,'
\ .. 'leadmultispace:⦙' .. repeat('·', &sw - 1)
endif
let &colorcolumn = join(range(80+1, 256), ',')
runtime! neovim.vim
set switchbuf+=usetab,newtab
" Coding Styles
if has('autocmd')
" Ensure spelling is loaded when writting text. Also start insert
augroup GitStuff
autocmd!
autocmd FileType gitcommit setlocal spell nonumber norelativenumber
autocmd FileType gitcommit startinsert
augroup END
endif
" Extras
let g:vimsyn_embed = 'Pl'
let g:AutoPairsMapBS = v:true
let g:AutoPairsMultilineBackspace = v:true
runtime! lsp.vim
command -nargs=? Terminal rightbelow terminal ++rows=16 <args>
nnoremap <silent> <leader>tt :rightbelow terminal ++rows=16<CR>
tnoremap <Esc> <C-\><C-n><C-w>p
set foldcolumn=4
set foldlevelstart=99
set foldmethod=expr
set foldexpr=coc#util#refactor_foldlevel(v:lnum)
set foldtext=coc#util#refactor_fold_text(v:foldstart)
set nofoldenable
" Theming
let g:aldmeris_transparent = v:true
let g:aldmeris_termcolors = 'tango'
let g:onedark_terminal_italics = v:true
let g:codedark_italics = v:true
" onedark.vim override: Don't set a background color when running in a
" terminal; just use the terminal's background color
if has('autocmd') && !has('gui_running')
augroup colorset
autocmd!
autocmd ColorScheme onedark silent!
\ call onedark#extend_highlight('Normal', {'bg': {'gui': 'NONE'}})
augroup END
let g:codedark_transparent = v:true
endif
silent! colorscheme codedark
if exists('g:colors_name') && (g:colors_name == 'onedark'
\ || g:colors_name == 'codedark')
if has('termguicolors')
set termguicolors
if !empty($TMUX) && (&term =~ 'tmux' || &term =~ 'screen')
" When using termguicolors :help xterm-true-color
let &t_8f = "\<Esc>[38:2:%lu:%lu:%lum"
let &t_8b = "\<Esc>[48:2:%lu:%lu:%lum"
endif
endif
endif
" Misc
let g:airline#extensions#tabline#enabled = v:true
let g:airline#extensions#tabline#buffer_min_count = 2
let g:airline_mode_map = {
\ '__': '-',
\ 'n': 'N',
\ 'i': 'I',
\ 'R': 'R',
\ 'c': 'C',
\ 'v': 'V',
\ 'V': 'V-L',
\ '': 'V',
\ 's': 'S',
\ }
let g:airline#extensions#tagbar#flags = 'f' " Requires majutsushi/tagbar plugin
let g:airline#extensions#coc#stl_format_err = '%C'
let g:airline#extensions#coc#stl_format_warn = '%C'
let g:DevIconsEnableDistro = v:false
let g:context_max_height = 2
let g:context_highlight_border = '<hide>'