85 lines
2.7 KiB
VimL
Raw Normal View History

2020-06-03 19:26:12 +02:00
" load other modules
2020-05-08 20:42:52 +02:00
source $HOME/.config/nvim/statusline.vim
source $HOME/.config/nvim/plugins.vim
source $HOME/.config/nvim/bindings.vim
2020-06-03 19:26:12 +02:00
" basic stuff
2020-05-08 20:42:52 +02:00
syntax on
filetype plugin indent on
set scrolloff=5
set pumheight=10
set autoindent
set smarttab
set number relativenumber
set clipboard=unnamedplus
set inccommand=nosplit
set tabstop=2
set shiftwidth=2
set ignorecase
set smartcase
set undofile
set background=light
set mouse=a
set splitright
set splitbelow
set noshowmode
set shortmess+=I
2020-06-03 19:26:12 +02:00
set autochdir
scriptencoding utf-8
2020-05-08 20:42:52 +02:00
color biual
2020-06-03 19:26:12 +02:00
" ignore files which vim doesn't use
set wildignore+=.git,.hg,.svn
set wildignore+=*.aux,*.out,*.toc
set wildignore+=*.o,*.obj,*.exe,*.dll,*.manifest,*.rbc,*.class
set wildignore+=*.ai,*.bmp,*.gif,*.ico,*.jpg,*.jpeg,*.png,*.psd,*.webp
set wildignore+=*.avi,*.divx,*.mp4,*.webm,*.mov,*.m2ts,*.mkv,*.vob,*.mpg,*.mpeg
set wildignore+=*.mp3,*.oga,*.ogg,*.wav,*.flac,*.opus
set wildignore+=*.eot,*.otf,*.ttf,*.woff
set wildignore+=*.doc,*.pdf,*.cbr,*.cbz
set wildignore+=*.zip,*.tar.gz,*.tar.bz2,*.rar,*.tar.xz,*.kgb
set wildignore+=*.swp,.lock,.DS_Store,._*
2020-06-03 19:26:12 +02:00
" restore cursor position
2020-05-08 20:42:52 +02:00
function! ResCur()
if line("'\"") <= line("$")
normal! g`"
return 1
endif
endfunction
augroup resCur
autocmd!
autocmd BufWinEnter * call ResCur()
augroup END
2020-06-03 19:26:12 +02:00
" python paths, needed for virtualenvs
2020-05-08 20:42:52 +02:00
let g:python3_host_prog = '/usr/bin/python3'
let g:python_host_prog = '/usr/bin/python2'
2020-06-03 19:26:12 +02:00
" language-specific
2020-05-08 20:42:52 +02:00
augroup langindentation
autocmd Filetype c setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2
2020-05-26 12:30:46 +02:00
autocmd Filetype python setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4
2020-05-08 20:42:52 +02:00
autocmd Filetype cpp setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2
autocmd Filetype css setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2
autocmd Filetype javascript setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2
autocmd Filetype html setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2
autocmd Filetype json setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2
autocmd Filetype scss setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2
autocmd Filetype php setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2
autocmd Filetype yaml setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2
2020-05-13 15:05:16 +02:00
autocmd Filetype sh setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2
2020-05-08 20:42:52 +02:00
augroup END
2020-06-03 19:26:12 +02:00
" automatically reload configs on save
2020-05-15 17:55:52 +02:00
autocmd BufWritePost *Xresources,*Xdefaults !xrdb %
autocmd BufWritePost *sxhkdrc !pkill -USR1 sxhkd
2020-05-27 12:54:56 +02:00
autocmd BufWritePost *picom.conf !pkill -USR1 picom; picom -b
2020-05-15 17:55:52 +02:00
2020-06-03 19:26:12 +02:00
" automatically deletes all trailing whitespace and newlines at end of file on save
2020-05-15 17:55:52 +02:00
autocmd BufWritePre * %s/\s\+$//e
autocmd BufWritepre * %s/\n\+\%$//e
2020-07-09 17:20:48 +02:00
" chuj
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o