Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andreikoenig/e29bc150a103e86bd8d6eb78ad7ed084 to your computer and use it in GitHub Desktop.
Save andreikoenig/e29bc150a103e86bd8d6eb78ad7ed084 to your computer and use it in GitHub Desktop.
vimrc
set nocompatible " coz fuck vi
filetype off " required, will turn back on later
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" ========================================================
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'scrooloose/nerdtree'
" Fuzzy finder
Plugin 'kien/ctrlp.vim'
" Support for easily toggling comments.
Plugin 'tpope/vim-commentary'
" Just a shitload of color schemes.
" https://github.com/flazz/vim-colorschemes#current-colorschemes
Plugin 'flazz/vim-colorschemes'
Plugin 'tpope/vim-surround'
Plugin 'vim-ruby/vim-ruby'
" Proper JSON filetype detection, and support.
Plugin 'leshill/vim-json'
" proper indent support for js
Plugin 'pangloss/vim-javascript'
" vim indents HTML very poorly on it's own. This fixes a lot of that.
Plugin 'indenthtml.vim'
" ========================================================
" All of your Plugins must be added before the following line
call vundle#end() " required
" have to turn this stuff back on if we want all of our features.
filetype plugin indent on " Filetype auto-detection
syntax on " Syntax highlighting
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab " use spaces instead of tabs.
set smarttab " let's tab key insert 'tab stops', and bksp deletes tabs.
set shiftround " tab / shifting moves to closest tabstop.
set autoindent " Match indents on new lines.
set smartindent " Intellegently dedent / indent new lines based on rules.
" We have VCS -- we don't need this stuff.
set nobackup " We have vcs, we don't need backups.
set nowritebackup " We have vcs, we don't need backups.
set noswapfile " They're just annoying. Who likes them?
set autoread " when a file has changed on disk, just load it. Don't ask.
" yank and paste with the system clipboard
set clipboard=unnamed
" show trailing whitespace
set list
set listchars=tab:▸\ ,trail:▫
" In many terminal emulators the mouse works just fine, thus enable it.
if has('mouse')
set mouse=a
endif
" Make search more sane
set ignorecase " case insensitive search
set smartcase " If there are uppercase letters, become case-sensitive.
set incsearch " live incremental searching
set showmatch " live match highlighting
" set hlsearch " highlight matches
set gdefault " use the `g` flag by default.
" allow the cursor to go anywhere in visual block mode.
set virtualedit+=block
let mapleader = " "
" Space e - File Explorer
map <leader>e :Explore<cr>
" So we don't have to reach for escape to leave insert mode.
inoremap jj <esc>
" show relative line numbers
set rnu
" theme
colorscheme Tomorrow-Night-Eighties
" create new vsplit, and switch to it.
noremap <leader>v <C-w>v
" bindings for easy split nav
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
" Visual line nav, not real line nav
" If you wrap lines, vim by default won't let you move down one line to the
" wrapped portion. This fixes that.
noremap j gj
noremap k gk
set backspace=indent,eol,start
" Space b - binding.pry
nnoremap <leader>r obinding.pry<esc>
" Let ctrlp have up to 30 results.
let g:ctrlp_max_height = 30
nnoremap <leader>t :CtrlP<CR>
nnoremap <leader>d :NERDTreeToggle<CR>
nnoremap <leader>f :NERDTreeFind<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment