set nocompatible
filetype plugin indent on
syntax enable
set encoding=utf-8
set number relativenumber
set numberwidth=4
set tabstop=4 shiftwidth=4 expandtab smartindent 
set incsearch hlsearch ignorecase smartcase
set wrap
set mouse=a
set scrolloff=5
set cursorline
set noshowmode
set shortmess+=I
set autoindent

hi Normal guibg=NONE ctermbg=NONE guifg=#d7c49a ctermfg=180
hi NormalNC guibg=NONE ctermbg=NONE guifg=#b2996e ctermfg=137
hi LineNr guibg=NONE ctermbg=NONE guifg=#a67c00 ctermfg=136
hi CursorLine guibg=#4b3621 ctermbg=59 guifg=NONE ctermfg=NONE
hi VertSplit guibg=NONE ctermbg=NONE guifg=#5a3e1b ctermfg=94
hi StatusLine guibg=#3e2f1c guifg=#f0d38c ctermbg=59 ctermfg=223
hi StatusLineMode guibg=#d35400 guifg=#3e2f1c ctermbg=166 ctermfg=59 gui=bold
hi Visual guibg=#7f5f2a guifg=NONE ctermbg=136 ctermfg=NONE
hi VisualNOS guibg=#7f5f2a guifg=NONE ctermbg=136 ctermfg=NONE
hi VisualSB guibg=#7f5f2a guifg=NONE ctermbg=136 ctermfg=NONE
hi Search guibg=NONE ctermbg=NONE guifg=#d35400 ctermfg=166
hi IncSearch guibg=NONE ctermbg=NONE guifg=#f39c12 ctermfg=214
hi Pmenu guibg=NONE ctermbg=NONE guifg=#d7c49a ctermfg=180
hi PmenuSel guibg=NONE ctermbg=NONE guifg=#3e2f1c ctermbg=59
hi WildMenu guibg=NONE ctermbg=NONE guifg=#f39c12 ctermfg=214
hi Folded guibg=NONE ctermbg=NONE guifg=#a67c00 ctermfg=136
hi SignColumn guibg=NONE ctermbg=NONE guifg=#a35400 ctermfg=172

function! ModeName()
let modeval = mode()
return modeval ==# 'n'   ? 'NML '  :
\ modeval ==# 'i'   ? 'INT '  :
\ modeval ==# 'v'   ? 'VSL '  :
\ modeval ==# 'V'   ? 'VLI '  :
\ modeval ==# "\<C-v>" ? 'VBL ' :
\ modeval ==# 'R'   ? 'RPL ' :
\ modeval ==# 'c'   ? 'CMD ' :
\ 'UNKNOWN'
endfunction

set statusline=
set statusline+=%#StatusLineMode#
set statusline+=\ %{ModeName()}
set statusline+=%#StatusLine#
set statusline+=\ %f\ %m\ %r\ %y
set statusline+=%=
set statusline+=\ Ln:%l/%L\ Col:%c\ \[%p%%]

let mapleader = "\<Space>"
nnoremap <leader>w \:w<CR>
nnoremap <leader>q \:q<CR>
nnoremap <silent> <leader>h \:nohlsearch<CR>
nnoremap <leader>n \:set relativenumber!<CR>
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
nnoremap <leader>cd :Ex<CR>

map j gj
map k gk

set termguicolors
set list
set listchars=tab:▸\ ,eol:¬,nbsp:_,trail:⋅
set backupdir=~/.cache/nvim/backup
set directory=~/.cache/nvim/swap
set undodir=~/.cache/nvim/undo
set undofile
set wrapscan
set shortmess+=c
set autoread
set cmdheight=1
set belloff=all
set laststatus=2
set smoothscroll
set scrolljump=3
set hidden
set splitbelow
set splitright
set nobackup
set nowritebackup
set lazyredraw
call plug#begin('~/.local/share/nvim/plugged')
Plug 'tpope/vim-sensible'
Plug 'junegunn/fzf.vim'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-commentary'
Plug 'jiangmiao/auto-pairs'
Plug 'tpope/vim-repeat'
Plug 'mattn/emmet-vim'
call plug#end()

