Skip to content

Instantly share code, notes, and snippets.

@rubenmoya
Created February 6, 2018 21:21
Show Gist options
  • Save rubenmoya/30043b523cbb08dbad0c8469d9c48a37 to your computer and use it in GitHub Desktop.
Save rubenmoya/30043b523cbb08dbad0c8469d9c48a37 to your computer and use it in GitHub Desktop.
My .vimrc
" Remember to install Plug first
" (https://github.com/junegunn/vim-plug#installation), start up vim and type
" :PlugInstall to get the plugins installed.
syn on
set number
set noswapfile
set nowrap
set cursorline
set autoread
set incsearch
set backspace=2
set re=1
set scrolloff=10
set clipboard=unnamed
set colorcolumn=101
set laststatus=2
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
set updatetime=250
set tabstop=2 softtabstop=0 expandtab shiftwidth=2 smarttab
set nu relativenumber "show line number and relative line number
set scrolloff=5 "offset of 5 rows on scroll (top/button)
set breakindent "Mantain indent on wrapping lines
set autoindent "autoindent
set tabstop=2 shiftwidth=2 expandtab softtabstop=2 "tabs = 2 spaces
set colorcolumn=120 "highligt 120 column
set cursorline "hight cursor line
set hls "highlight search matches
set is "higlight on search
"clear hghlight on press enter normal mode
nnoremap <CR> :noh<CR><CR>
set nocompatible
filetype off
call plug#begin()
Plug 'ctrlpvim/ctrlp.vim'
Plug 'jimeno0/vim-chito'
Plug 'w0rp/ale'
Plug 'hail2u/vim-css3-syntax'
Plug 'Raimondi/delimitMate'
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
Plug 'terryma/vim-multiple-cursors'
Plug 'bronson/vim-trailing-whitespace'
Plug 'itchyny/lightline.vim'
Plug 'xolox/vim-misc'
Plug 'xolox/vim-notes'
Plug 'dkprice/vim-easygrep'
Plug 'danro/rename.vim'
Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'
Plug 'jparise/vim-graphql'
Plug 'prettier/vim-prettier', { 'do': 'yarn install' }
call plug#end()
" CtrlP config
set wildignore+=*/tmp/*,*.so,*.swp,*.zip
set wildignore+=*\\tmp\\*,*.swp,*.zip,*.exe
let g:ctrlp_prompt_mappings = {
\ 'AcceptSelection("e")': ['<c-t>'],
\ 'AcceptSelection("t")': ['<cr>', '<2-LeftMouse>'],
\ }
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git'
let g:ctrlp_show_hidden = 1
" Emmet config
let g:user_emmet_leader_key='<Tab>'
let g:user_emmet_settings = {
\ 'javascript.jsx' : {
\ 'extends' : 'jsx',
\ },
\}
" JSX Syntax
let g:jsx_ext_required = 0
"Credit joshdick
"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
"If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support
"(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
if (empty($TMUX))
if (has("nvim"))
"For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
endif
"For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
"Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
" < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
if (has("termguicolors"))
set termguicolors
endif
endif
"let g:lightline = {
" \ 'colorscheme': 'chito',
" \ }
set background=dark
colorscheme chito
" Linter config
let g:ale_linters = {
\ 'javascript': ['eslint']
\}
" let g:ale_sign_error = '💥'
let g:ale_fixers = {}
let g:ale_fixers.javascript = [
\ 'eslint',
\]
let g:ale_fix_on_save = 1
" Until today I used to use caps lock as ESC.
" From now using caps lock as ctrl and ctrl-c as ESC:
inoremap <C-c> <Esc>
" switch panes with ctrl jklh
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>
autocmd BufWritePre *.{js,graphql,rb,json} :%s/\s\+$//e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment