Skip to content

Instantly share code, notes, and snippets.

@zeroeth
Last active August 29, 2015 14:00
Show Gist options
  • Select an option

  • Save zeroeth/11355492 to your computer and use it in GitHub Desktop.

Select an option

Save zeroeth/11355492 to your computer and use it in GitHub Desktop.
.vimrc
" Plugins used:
" https://github.com/jelera/vim-javascript-syntax
" https://github.com/nathanaelkane/vim-indent-guides
" Indentation Settings
" Hard tab by default
set tabstop=4
set shiftwidth=4
set noexpandtab
" Soft tab for ruby
autocmd FileType ruby setlocal shiftwidth=2 tabstop=2 expandtab
" Generic next-line match
set autoindent
" Smart indentions
filetype plugin indent on
" Visual helpers (requires https://github.com/nathanaelkane/vim-indent-guides)
let g:indent_guides_color_change_percent=2
autocmd VimEnter * :IndentGuidesEnable
" Indentation/Whitespace Visibility
" set list listchars=tab:»·,trail:·
set list listchars=tab:\ \ ,trail:·
" Matching parenthesis blink
set showmatch
" Line numbers
set number
set relativenumber
" Status bar visible always
set laststatus=2
" Search as you type, highlight
set incsearch
set hlsearch
" Whitespace Cleaning
nnoremap <leader>W :%s/\s\+$//<cr>:let @/=''<CR>"
" Buffer Shortcuts
nnoremap gp :bp<CR>
nnoremap gn :bn<CR>
nnoremap gl :ls<CR>
nnoremap gb :ls<CR>:b
" Tab Control
map <D-1> 1gt
map <D-2> 2gt
map <D-3> 3gt
map <D-4> 4gt
map <D-5> 5gt
map <D-6> 6gt
map <D-7> 7gt
map <D-8> 8gt
map <D-9> 9gt
" GUI Minify
set guioptions-=T
set guioptions-=e
set guioptions-=m
set guioptions-=r
set guioptions-=
" Create file buffer / Write directory under cursor (For non existent paths/files)
map <leader>cf :e <cfile><cr>
map <leader>wd :!mkdir %:p:h<cr>
" Copy current file name / directory to system clipboard
map <leader>yn :let @*=expand("%:p")<CR>
map <leader>yd :let @*=expand("%:p:h")<CR>
" Language helpers for gf (go file)
set suffixesadd+=.js
" Theme
color molokai
set gfn=Menlo\ Regular:h15
" Syntax
syntax on
" Color arduino files
autocmd BufRead,BufNewFile *.pde,*.ino setlocal filetype=c++
" Underscore.js syntax highlighter only looks for mtpl
autocmd BufRead,BufNewFile *.tpl setlocal syntax=underscore_template
" Project Themes
autocmd BufRead,BufNewFile */project1/* color inkpot
autocmd BufRead,BufNewFile */project2/* color solarized
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment