2020-06-26 21:23:12 +00:00
|
|
|
set termguicolors
|
|
|
|
set mouse=a " Enable mouse in all modes
|
|
|
|
|
|
|
|
set undofile
|
2020-09-04 10:02:34 +00:00
|
|
|
set wildmode=longest,list,full " Auto-completion for cmdline
|
2020-06-26 21:23:12 +00:00
|
|
|
set clipboard+=unnamedplus " Merge with system clipboard
|
|
|
|
|
|
|
|
set tabstop=4 shiftwidth=4 " Indentation
|
|
|
|
|
|
|
|
" visuals
|
|
|
|
set number relativenumber " Relative line numbering on the left
|
2020-09-04 10:02:34 +00:00
|
|
|
set linebreak
|
2020-06-26 21:23:12 +00:00
|
|
|
set cursorline cursorcolumn
|
|
|
|
set scrolloff=7 sidescrolloff=20 " Keep some context when scrolling
|
|
|
|
|
|
|
|
set colorcolumn=81,121
|
|
|
|
highlight ColorColumn ctermbg=grey guibg=#888888
|
|
|
|
" call matchadd('ColorColumn', '\%81v', 100)
|
|
|
|
|
|
|
|
" search
|
|
|
|
set incsearch hlsearch " Handier search, even though nvim seems to enable it by default
|
|
|
|
set ignorecase smartcase " Only search case-sensitive when searching with uppercase
|
|
|
|
" matching
|
|
|
|
set showmatch " Highlight matching parenthesis
|
|
|
|
set matchpairs+=<:> " More pairings for '%'
|
|
|
|
|
|
|
|
set splitright " Vertical split to right by default
|
|
|
|
set diffopt+=vertical
|
|
|
|
|
|
|
|
" Folding
|
|
|
|
set foldmethod=marker " Use triple curly braces for folds
|
|
|
|
set foldopen+=jump " Automatically open folds on jump
|
|
|
|
|
|
|
|
" FILETYPES
|
|
|
|
syntax on
|
|
|
|
filetype plugin on
|
|
|
|
autocmd FileType json syntax match Comment +\/\/.\+$+ " Comment highlighting in JSON
|
|
|
|
autocmd Filetype * set formatoptions-=o " Don't automatically comment on o
|
|
|
|
" custom hardcoded types
|
2020-09-04 10:02:34 +00:00
|
|
|
autocmd BufRead,BufNewFile $CONFIG_SHELLS/*,$CONFIG_ZSH/* setlocal filetype=zsh
|
|
|
|
autocmd BufRead $XDG_CONFIG_HOME/yadm/bootstrap setlocal filetype=sh
|
|
|
|
|
|
|
|
" shebang shortcut - https://www.reddit.com/r/vim/comments/4z7z7s/add_shebang_lines_to_your_vim_files_automatically/d6v7op8 and https://stackoverflow.com/a/52135425
|
|
|
|
inoreabbrev <expr> #!! "#!/usr/bin/env" . (empty(&filetype) ? '' : ' '.&filetype)
|
|
|
|
autocmd BufNewFile *.sh,$HOME/.local/bin/* execute 'silent! 1s/.*/#!\/bin\/sh\r\r'| setlocal filetype=sh | :startinsert
|
|
|
|
"autocmd BufNewFile * if !empty(&filetype) | execute 'silent! 1s/.*/#!\/usr\/bin\/' . &filetype . '\r\r'| :startinsert | endif
|
2020-06-26 21:23:12 +00:00
|
|
|
|
|
|
|
set spelllang=en_us,de_de
|
2020-09-04 10:02:34 +00:00
|
|
|
autocmd FileType markdown setlocal wrap spell colorcolumn= " Spell checking & no guiding columns in markdown
|
2020-06-26 21:23:12 +00:00
|
|
|
|
|
|
|
" Center on insert mode
|
|
|
|
autocmd InsertEnter * norm zz
|