Skip to content

Instantly share code, notes, and snippets.

@jperocho
Last active May 19, 2022 10:46
Show Gist options
  • Save jperocho/8f59d7f35d1272f53cc6000171bf0382 to your computer and use it in GitHub Desktop.
Save jperocho/8f59d7f35d1272f53cc6000171bf0382 to your computer and use it in GitHub Desktop.
Minimal vimrc for vim 8.2
" Plugin Manager Plug
call plug#begin()
" Javascript plugins
Plug 'yuezk/vim-js'
Plug 'maxmellon/vim-jsx-pretty'
Plug 'w0rp/ale'
call plug#end()
syntax on " Syntax on
let g:vim_jsx_pretty_colorful_config=1
let g:ale_fixers = ['eslint']
let g:ale_completion_enabled=1
let g:ale_completion_autoimport=1
let g:ale_sign_error='❌'
let g:ale_sign_warning='⚠️'
let g:ale_fix_on_save=1
let g:ale_set_highlights=0
set directory=$HOME/.vim/swapfiles// " Save all swapfiles to swafiles folder"
set backspace=indent,eol,start " Enables backspace
set t_Co=256 " Enable 256 colors
set rtp+=~/.fzf " fzf initialize
set mouse=a " Enable mouse scroll
set number " Enable line numbers
set foldcolumn=2 " 2 spaces before line number for fold column
set termwinsize=20x0 " Set terminal size to height 30
set hls " Higlights search
nnoremap <silent> <C-t> :FZF!<CR> " Call fzf on ctrl+t
nnoremap <esc><esc> :silent! nohls<cr> " Removes search hilights when escape
autocmd BufWritePre * :%s/\s\+$//e " Trim white space on save
" Basic need of auto pairing
inoremap " ""<left>
inoremap ' ''<left>
inoremap ( ()<left>
inoremap [ []<left>
inoremap { {}<left>
inoremap {<CR> {<CR>}<ESC>O<TAB>
inoremap {;<CR> {<CR>};<ESC>O<TAB>
" Minimal Pimping
set cursorline " Enables cursorline
let &fillchars ..= ',eob: ' " Hides tilde in EndofBuffer for vim 8.2.2508 and above only
set fillchars+=vert:│ " Makes vertical split line consistent
set signcolumn=yes " Enables sign column
set list " Show list characters
set listchars=tab:¦· " Sets list characters symbos
" Sets cursorline to active pane only
augroup CursorLine
au!
au VimEnter,WinEnter,BufWinEnter * setlocal cursorline
au WinLeave * setlocal nocursorline
augroup END
hi ALEWarningSign ctermbg=NONE
hi ALEErrorSign ctermbg=NONE
hi ALEWarning cterm=underline
hi ALEError ctermbg=NONE cterm=underline ctermul=red
hi MatchParen ctermbg=250
hi LineNr ctermfg=245
hi Comment ctermfg=250
hi SpecialKey ctermfg=240
hi NonText ctermfg=240
hi SignColumn ctermbg=NONE " SignColumn bg
hi clear SignColumn " Clear Signcolumn
hi clear CursorLine
hi clear VertSplit
hi CursorLine cterm=none ctermbg=17
hi CursorLineNR cterm=none ctermbg=17
hi Normal ctermbg=NONE " Normal bg color to NONE
hi foldcolumn ctermbg=NONE " Foldcolumn bg to NONE
hi VertSplit ctermfg=60 " VertSplit to NONE
hi EndOfBuffer ctermfg=0 " Fallback of fillchars if not supported color it black
hi StatusLine ctermbg=75 ctermfg=60 " Active status line color
hi StatusLineNC ctermbg=245 ctermfg=240 " Non-Active status line color
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment