"
" ~/.vimrc
"

source ~/.vim/theme.conf
source ~/.vim/source/python

set autoindent
set conceallevel=2
set expandtab
set incsearch
set linebreak
set mouse=a
set nocompatible
set number
set omnifunc=ale#completion#OmniFunc
set path+=**
set relativenumber
set scrolloff=3
set shiftwidth=4
set showcmd
set showmatch
set smartindent
set smarttab
set tabstop=4
set title
set wildignore=*.docx,*.jpg,*.png,*.gif,*.pdf,*.pyc,*.exe,*.flv,*.img,*.xlsx
set wildmenu "" Show suggestions on another line instead of inplace

syntax enable

filetype on
filetype indent on
filetype plugin on

" File browsing
let g:netrw_browse_split=4  " open in the previous window
let g:netrw_altv=1          " split new windows to the right
let g:netrw_liststyle=3     " treeview

" Autocomplete
" Also see https://vimhelp.org/options.txt.html#%27complete%27
" ^n next
" ^p previous
" ^x^f filename completion

if $TERM == 'alacritty'
    set ttymouse=sgr " Alacritty specific
endif
if $TERM == 'xterm-kitty'
    " Fix <HOME> and <END> not working
    set term=xterm-256color
endif

" Automatically start vim in a server - enable colorscheme switching
call remote_startserver("VIM")

" AUTO ------------------------------------------------------------------ {{{

if has("autocmd")
    au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif

    " https://stackoverflow.com/a/37558470/19044747
    augroup remember_folds
        autocmd!
        autocmd BufWinLeave * silent! mkview
        autocmd BufWinEnter * silent! loadview
    augroup END
endif

" }}}

" PLUGINS --------------------------------------------------------------- {{{

call plug#begin('~/.vim/plugins')

Plug 'catppuccin/vim', { 'as': 'catppuccin' }
Plug 'dense-analysis/ale'
Plug 'NerdyPepper/statix'
Plug 'prabirshrestha/vim-lsp'
Plug 'sheerun/vim-polyglot'
Plug 'vifm/vifm.vim'

" Coq
Plug 'whonore/Coqtail'

call plug#end() 

" }}}

