Skip to content

Instantly share code, notes, and snippets.

@chl03ks
Created August 31, 2017 16:54
Show Gist options
  • Save chl03ks/ce6fc510a7fe8c971582bbe3b86e1c29 to your computer and use it in GitHub Desktop.
Save chl03ks/ce6fc510a7fe8c971582bbe3b86e1c29 to your computer and use it in GitHub Desktop.
.VIMRC
"Custom vimrc file based on vim-sublime
set shell=/bin/sh
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'tpope/vim-surround'
Bundle 'gcmt/breeze.vim'
Bundle 'kien/ctrlp.vim'
Bundle 'tomtom/tcomment_vim'
Bundle 'bling/vim-airline'
Bundle 'airblade/vim-gitgutter'
Bundle 'ZucchiniZe/vim-spider'
Plugin 'scrooloose/nerdtree'
Plugin 'Xuyuanp/nerdtree-git-plugin'
Plugin 'Quramy/vim-js-pretty-template'
Plugin 'fatih/vim-go'
Plugin 'mattn/emmet-vim'
Plugin 'valloric/MatchTagAlways'
Plugin 'digitaltoad/vim-jade'
Plugin 'jelera/vim-javascript-syntax'
Plugin 'vim-scripts/SyntaxComplete.git'
Plugin 'kchmck/vim-coffee-script'
Plugin 'Valloric/YouCompleteMe'
Plugin 'pangloss/vim-javascript'
Plugin 'mxw/vim-jsx'
Plugin 'elixir-lang/vim-elixir'
Plugin 'scrooloose/syntastic'
Plugin 'jiangmiao/auto-pairs'
Plugin 'bdauria/angular-cli.vim'
" Typescript
"
let g:typescript_compiler_binary = 'tsc'
let g:typescript_compiler_options = ''
autocmd QuickFixCmdPost [^l]* nested cwindow
autocmd FileType typescript JsPreTmpl html
autocmd FileType typescript syn clear foldBraces
autocmd QuickFixCmdPost l* nested lwindow
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:tsuquyomi_disable_quickfix = 1
let g:syntastic_typescript_checkers = ['tsuquyomi']
autocmd FileType typescript,html call angular_cli#init()`
" Color Themes
Bundle 'flazz/vim-colorschemes'
colorscheme Monokai
""""""""
filetype plugin indent on
syntax enable
" Open NERDTree by default
" autocmd vimenter * NERDTree
" Toggle NERDTree
"map <C-a> :NERDTreeToggle<CR>
" Close NERDTree when thats the last window
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
" Use :help 'option' to see the documentation for the given option.
set autoindent
set backspace=indent,eol,start
set complete-=i
set showmatch
set showmode
set smarttab
set nrformats-=octal
set shiftround
set ttimeout
set ttimeoutlen=50
set colorcolumn=80
"set incsearch
" Use <C-L> to clear the highlighting of :set hlsearch.
"if maparg('<C-L>', 'n') ==# ''
" nnoremap <silent> <C-L> :nohlsearch<CR><C-L>
"endif
set laststatus=2
set ruler
set showcmd
set wildmenu
set autoread
set encoding=utf-8
set tabstop=2 shiftwidth=2 expandtab
set listchars=tab:▒░,trail:▓
set list
"inoremap <C-U> <C-G>u<C-U>
set number
set hlsearch
set ignorecase
set smartcase
" Don't use Ex mode, use Q for formatting
map Q gq
" In many terminal emulators the mouse works just fine, thus enable it.
if has('mouse')
set mouse=a
endif
" do not history when leavy buffer
set hidden
" FIXME: (broken) ctrl s to save
noremap <C-S> :update<CR>
vnoremap <C-S> <C-C>:update<CR>
inoremap <C-S> <Esc>:update<CR>
set nobackup
set nowritebackup
set noswapfile
set fileformats=unix,dos,mac
" exit insert mode
inoremap <C-c> <Esc>
set completeopt=menuone,longest,preview
"
" Plugins config
"
" CtrlP
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/node_modules/*
" Allow JSX in normal JS files
let g:jsx_ext_required = 0
" Ultisnip
" NOTE: <f1> otherwise it overrides <tab> forever
let g:UltiSnipsExpandTrigger="<f1>"
let g:UltiSnipsJumpForwardTrigger="<f1>"
let g:UltiSnipsJumpBackwardTrigger="<c-k>"
let g:did_UltiSnips_vim_after = 1
" vim-airline
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
"
" Basic shortcuts definitions
" most in visual mode / selection (v or ⇧ v)
"
" Find
map <C-f> /
" indend / deindent after selecting the text with (⇧ v), (.) to repeat.
vnoremap <Tab> >
vnoremap <S-Tab> <
" comment / decomment & normal comment behavior
vmap <C-m> gc
" Disable tComment to escape some entities
let g:tcomment#replacements_xml={}
" Text wrap simpler, then type the open tag or ',"
vmap <C-w> S
" Cut, Paste, Copy
vmap <C-x> d
vmap <C-v> p
vmap <C-c> y
" Undo, Redo (broken)
nnoremap <C-z> :undo<CR>
inoremap <C-z> <Esc>:undo<CR>
nnoremap <C-y> :redo<CR>
inoremap <C-y> <Esc>:redo<CR>
" Tabs
"let g:airline_theme='badwolf'
let g:airline#extensions#tabline#enabled = 1
nnoremap <C-b> :tabprevious<CR>
inoremap <C-b> <Esc>:tabprevious<CR>i
nnoremap <C-n> :tabnext<CR>
inoremap <C-n> <Esc>:tabnext<CR>i
nnoremap <C-t> :tabnew<CR>
inoremap <C-t> <Esc>:tabnew<CR>i
nnoremap <C-k> :tabclose<CR>
inoremap <C-k> <Esc>:tabclose<CR>i
" lazy ':'
map \ :
let mapleader = ','
nnoremap <Leader>p :set paste<CR>
nnoremap <Leader>o :set nopaste<CR>
noremap <Leader>g :GitGutterToggle<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment