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

" themes
Plug 'fxn/vim-monochrome'
Plug 'dylanaraps/wal.vim'
Plug 'arcticicestudio/nord-vim'
Plug 'lurst/austere.vim'

" autocomplete
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'mattn/emmet-vim'

" other
Plug 'preservim/nerdcommenter'
Plug 'scrooloose/nerdtree'
Plug '907th/vim-auto-save'
Plug 'szw/vim-maximizer'

" Plugins
Plug 'leafOfTree/vim-vue-plugin'

" telescope
Plug 'nvim-lua/popup.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'fannheyward/telescope-coc.nvim'

" debugging
Plug 'puremourning/vimspector'

call plug#end()

" theme settings
set termguicolors
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"

" Emmet auto complete
let g:user_emmet_leader_key=','


if (empty($TMUX))
	if (has("nvim"))
		let $NVIM_TUI_ENABLE_TRUE_COLOR=1
	endif
	if (has("termguicolors"))
		set termguicolors
	endif
endif

set background=dark
colorscheme minochrome
colorscheme austere

" new leader key
nnoremap <SPACE> <Nop>
let mapleader=" "

" windows splits
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>

" no arrow keys
noremap <Up> <Nop>
noremap <Down> <Nop>
noremap <Left> <Nop>
noremap <Right> <Nop>

" telescope essentials
nnoremap <leader>ff <cmd>Telescope find_files<cr>
nnoremap <leader>fd <cmd>Telescope live_grep<cr>
nnoremap <leader>fb <cmd>Telescope buffers<cr>
nnoremap <leader>ft <cmd>Telescope<cr>

" telescope git
nnoremap <leader>gs <cmd>Telescope git_status<cr>
nnoremap <leader>gb <cmd>Telescope git_branches<cr>
nnoremap <leader>gc <cmd>Telescope git_commits<cr>

" telescope coc
nmap <silent> gd <cmd>Telescope coc definitions<cr>
nmap <silent> gr <cmd>Telescope coc references<cr>

" debugging keys
nmap <Leader>dd <Plug>VimspectorContinue
nmap <Leader>ds <Plug>VimspectorStop
nmap <Leader>dr <Plug>VimpectorRestart
nmap <Leader>dv <Plug>VimspectorToggleBreakpoint

" replace command
vnoremap <C-r> "hy:%s/<C-r>h//gc<left><left><left>

" maximize pane
nnoremap <leader>m :MaximizerToggle<CR>

" emmet key binding
let g:user_emmet_leader_key=','

" build commands
nnoremap <C-b> <Esc>:w<CR>:!clear;python windmill.py /tests/ui/participant/suite_b/test_participant_1028_investment_election_beta.py<CR>
nnoremap <C-t> <Esc>:w<CR>:!clear;pipenv run pytest -v<CR>

" vim settings
set number
set hidden
set nohlsearch
set nocompatible
set relativenumber
set tabstop=4 softtabstop=0 expandtab shiftwidth=4
set backspace=indent,eol,start

let g:auto_save = 1
let g:loaded_matchparen=1

