123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- " ------ settings ------
- " change terminal title
- set title
- " xdg-ish settings
- set undodir=~/.cache/vim/undo,.
- set backupdir=~/.cache/vim/backup,.
- set directory=~/.cache/vim/swap//,.
- " default indentation
- set shiftwidth=2
- set tabstop=4
- set expandtab
- " permanent undo history
- set undofile
- " allow switching buffers
- set hidden
- " always scroll
- set scrolloff=99
- " show line numbers
- set number
- set relativenumber
- " show gutter
- set signcolumn=yes
- " set wordwrap indent
- set nowrap
- set linebreak
- if exists("&breakindent")
- set breakindent
- set breakindentopt=shift:2,sbr
- endif
- " show whitespace
- set list
- " make a new copy of the file for backup
- " setting to no or auto messes with filewatchers
- set backupcopy=yes
- " disable modelines
- set nomodeline
- " ------ key bindings ------
- " ; as :
- nnoremap ; :
- vnoremap ; :
- " allow <ESC> via jj in insert mode
- inoremap jj <ESC>
- " tab switching
- nnoremap <C-T>h :tabprev<cr>
- nnoremap <C-T>l :tabnext<cr>
- " fix j/k with wraps
- nnoremap j gj
- nnoremap k gk
- vnoremap j gj
- vnoremap k gk
- " cursor display
- nnoremap <Leader>c :set cursorline! cursorcolumn!<CR>
- " git
- nnoremap <Leader>gs :Git<CR>
- nnoremap <Leader>gb :Merginal<CR>
- " undo tree
- nnoremap <Leader>ut :UndotreeToggle<CR>
- " vimrc
- nnoremap <Leader>ve :vsplit $MYVIMRC<CR>
- nnoremap <Leader>vs :source $MYVIMRC<CR>
- " ------ nvim specific ------
- if has('nvim')
- set inccommand=split
- tnoremap <C-[><C-[> <C-\><C-N>
- autocmd TermOpen * setlocal scrollback=10000 nonumber norelativenumber
- autocmd TermOpen * startinsert
- autocmd FileType fzf tnoremap <buffer> jj <ESC>
- autocmd BufWinEnter,WinEnter term://* startinsert
- autocmd BufLeave term://* stopinsert
- " fix flickering when clearing terminal
- autocmd TermEnter * setlocal scrolloff=0
- autocmd TermLeave * setlocal scrolloff=99
- nnoremap <Leader>tv :vsp term://$SHELL<CR>
- nnoremap <Leader>to :term<CR>
- endif
- augroup formatting
- au!
- " strip trailing whitespace
- autocmd BufWritePre * :%s/\s\+$//e
- autocmd FileType markdown :set tw=80
- augroup end
- if has('termguicolors')
- set termguicolors
- endif
- let g:sonokai_transparent_background=1
- colorscheme sonokai
- highlight link MiniIndentscopeSymbol Whitespace
- let s:configuration = sonokai#get_configuration()
- let s:palette = sonokai#get_palette(s:configuration.style)
- call sonokai#highlight('MiniStatuslineModeNormal', s:palette.black, s:palette.blue)
- call sonokai#highlight('MiniStatuslineModeCommand', s:palette.black, s:palette.yellow)
- call sonokai#highlight('MiniStatuslineModeInsert', s:palette.black, s:palette.green)
- call sonokai#highlight('MiniStatuslineModeVisual', s:palette.black, s:palette.orange)
- call sonokai#highlight('MiniStatuslineModeReplace', s:palette.black, s:palette.red)
- call sonokai#highlight('MiniStatuslineModeOther', s:palette.black, s:palette.green)
- unlet! g:terminal_color_0
- unlet! g:terminal_color_1
- unlet! g:terminal_color_2
- unlet! g:terminal_color_3
- unlet! g:terminal_color_4
- unlet! g:terminal_color_5
- unlet! g:terminal_color_6
- unlet! g:terminal_color_7
- unlet! g:terminal_color_8
- unlet! g:terminal_color_9
- unlet! g:terminal_color_10
- unlet! g:terminal_color_11
- unlet! g:terminal_color_12
- unlet! g:terminal_color_13
- unlet! g:terminal_color_14
- unlet! g:terminal_color_15
|