Skip to content

Instantly share code, notes, and snippets.

@ellimist
Created August 9, 2016 21:19
Show Gist options
  • Save ellimist/9cafaac07061605f95b843dbe645bc6d to your computer and use it in GitHub Desktop.
Save ellimist/9cafaac07061605f95b843dbe645bc6d to your computer and use it in GitHub Desktop.
syntax enable
" VUNDLE CONFIG
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
" VUNDLE PLUGINS BELOW
Plugin 'scrooloose/syntastic'
Plugin 'ctrlpvim/ctrlp.vim'
" VUNDLE PLUGINS ABOVE
call vundle#end()
filetype plugin indent on
" END VUNDLE
" PLUGIN configuration
let g:syntastic_auto_loc_list = 0
let g:syntastic_check_on_wq = 1
let g:syntastic_javascript_checkers = ['eslint']
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*/node_modules/*,*/npm-debug.log
let g:ctrlp_working_path_mode = 'ra'
let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
" END PLUGIN configuration
colorscheme default
set clipboard+=unnamedplus
" Make Vim more useful
set nocompatible
" Enhance command-line completion
set wildmenu
" Allow cursor keys in insert mode
set esckeys
" Allow backspace in insert mode
set backspace=indent,eol,start
" Optimize for fast terminal connections
set ttyfast
" Add the g flag to search/replace by default
set gdefault
" Change mapleader
let mapleader=","
" Don’t add empty newlines at the end of files
set binary
set noeol
" Centralize backups, swapfiles and undo history
if exists("&undodir")
set undodir=~/.vim/undo
endif
set nobackup
set nowritebackup
set noswapfile
set history=50
set autowrite
" Show linenumber
set number
" Respect modeline in files
set modeline
set modelines=4
" Enable per-directory .vimrc files and disable unsafe commands in them
set exrc
set secure
" Enable line numbers
set number
" Enable syntax highlighting
syntax on
" Make tabs as wide as two spaces
set tabstop=2
" Show “invisible” characters
" set lcs=trail:·
set listchars=tab:\ \ ,eol:·
set list
" Set tab width to 2 spaces
set expandtab
set shiftwidth=2
set softtabstop=2
" Highlight searches
set hlsearch
" Ignore case of searches
set ignorecase
" Highlight dynamically as pattern is typed
set incsearch
" Always show status line
set laststatus=2
" Disable error bells
set noerrorbells
" Don't reset cursor to start of line when moving around.
set nostartofline
" Show the cursor position
set ruler
" Don't show the intro message when starting Vim
set shortmess=atI
" Show the current mode
set showmode
" Show the filename in the window titlebar
set title
" Show the (partial) command as it’s being typed
set showcmd
" Use relative line numbers
"if exists("&relativenumber")
" set relativenumber
" au BufReadPost * set relativenumber
"endif
" Start scrolling three lines before the horizontal window border
set scrolloff=5
" Save a file as root (,W)
noremap <leader>W :w !sudo tee % > /dev/null<CR>
" Select the text that was just pasted so you can indent it
nnoremap <leader>v V`]
" Map the Esc key to jj
inoremap jj <ESC>
" Open a new vertical split and switch to it
nnoremap <leader>w <C-w>v<C-w>l
" Open the file Explorer
nnoremap <leader>e :Ex<ENTER>
" Make it easier to switch between splits
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
" Disable arrow keys
noremap <Up> <NOP>
noremap <Down> <NOP>
noremap <Left> <NOP>
noremap <Right> <NOP>
" " Copy to clipboard
vnoremap <leader>y "+y
nnoremap <leader>Y "+yg_
nnoremap <leader>y "+y
nnoremap <leader>yy "+yy
" " Paste from clipboard
nnoremap <leader>p "+p
nnoremap <leader>P "+P
vnoremap <leader>p "+p
vnoremap <leader>P "+P
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment