VIM SETUP

CMAP

cmap W w !sudo tee % >/dev/null<CR>

" ENABLE 256 COLORS IN VIM {{{
" COLOR
  set t_Co=256
  if &term =~ '256color'
    set t_ut=
  endif
  set background=light

  let $NVIM_TUI_ENABLE_TRUE_COLOR=1

  if (has("termguicolors"))
   set termguicolors
  endif
" }}}


" CHANGE MAP LEADER KEY GENERAL SETTINGS{{{

  let leader=","
  set backspace=indent,eol,start
  set mouse=a
  set smarttab autoindent smartindent expandtab endofline autochdir novisualbell noerrorbells nohlsearch ignorecase smartcase incsearch
  set tabstop=2 softtabstop=2 shiftwidth=2
  inoremap jkj <Esc>
  nnoremap <Space> i_<Esc>R
  set clipboard+=unnamedplus
  nnoremap ,cd :cd %:h \| cd `git rev-parse --show-toplevel`<CR>
  nnoremap R :exec 'source ~/.vim/init.vim' <CR>
" }}}

" NAVTIAGE WINDOWS {{{
  nnoremap <C-h> <C-w>h
  nnoremap <C-j> <C-w>j
  nnoremap <C-k> <C-w>k
  nnoremap <C-l> <C-w>l
" }}}

" REGEX {{{
  nnoremap <silent> <F5> :g/^(.)\ze\n\%(.\n)*\1$/d <CR>
" }}}