Last active
March 3, 2016 19:46
-
-
Save VaughnGH/585a2500c8115f86769c to your computer and use it in GitHub Desktop.
My VIM preferences
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set number | |
set com=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,b:- | |
set expandtab | |
set backspace=indent,eol,start " Make backspace work as expected | |
set mouse=nicr " Enables mouse scrolling in vim inside iterm2 | |
set ruler | |
set rulerformat=%55(%{strftime('%a\ %b\ %e\ %I:%M\ %p')}\ %5l,%-6(%c%V%)\ %P%) "Add time to statusbar | |
set list lcs=tab:\¦\ "adds lines under tabs | |
set background=dark | |
"run python script | |
command Rpy !python % | |
command WRpy w <bar> Rpy | |
command WRPY w <bar> Rpy | |
command Rnode !node % | |
command WRnode w <bar> Rnode | |
command Rc !gcc % && ./a.out | |
command WRc w <bar> Rc | |
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
" Keep Plugin commands between vundle#begin/end. | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins | |
"call vundle#begin('~/some/path/here') | |
" let Vundle manage Vundle, required | |
Plugin 'VundleVim/Vundle.vim' | |
Plugin 'scrooloose/syntastic' | |
Plugin 'morhetz/gruvbox' | |
Plugin 'Yggdroot/indentLine' | |
Plugin 'tpope/vim-fireplace' | |
Plugin 'mileszs/ack.vim' | |
Plugin 'honza/vim-snippets' | |
call vundle#end() " required | |
filetype plugin indent on " required | |
" To ignore plugin indent changes, instead use: | |
"filetype plugin on | |
" Brief help | |
" :PluginList - lists configured plugins | |
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate | |
" :PluginSearch foo - searches for foo; append `!` to refresh local cache | |
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal | |
" | |
" see :h vundle for more details or wiki for FAQ | |
" Put your non-Plugin stuff after this line | |
" Search highlight | |
set hlsearch | |
" Default tab sizes | |
set ts=2 sts=2 sw=2 | |
" Different tab sizes based on filetypes | |
autocmd Filetype html setlocal ts=2 sts=2 sw=2 | |
autocmd Filetype javascript setlocal ts=2 sts=2 sw=2 | |
autocmd Filetype json setlocal ts=2 sts=2 sw=2 | |
autocmd Filetype css setlocal ts=2 sts=2 sw=2 | |
autocmd Filetype python setlocal ts=4 sts=4 sw=4 | |
autocmd Filetype c setlocal ts=4 sts=4 sw=4 | |
autocmd Filetype cpp setlocal ts=4 sts=4 sw=4 | |
"associate handlebars with html | |
au BufNewFile,BufRead *.handlebars set filetype=html | |
"syntax enable | |
"set tabstop=4 shiftwidth=4 expandtab "sets 4 spaces instead of tabs | |
"colorscheme gruvbox | |
"IndentLine -- Recommended chars: ¦ , ┆ , ︙, │ --but only works with UTF-8 encoded files | |
" Vim | |
"let g:indentLine_color_term = 239 | |
"let g:indentLine_loaded = 1 | |
"let g:indentLine_char = '¦' | |
"let g:indentLine_enabled = 1 | |
if !exists("g:syntax_on") | |
syntax enable | |
colorscheme gruvbox | |
endif | |
"Status Line indent options | |
set statusline+=%#warningmsg# | |
set statusline+=%{SyntasticStatuslineFlag()} | |
set statusline+=%* | |
let g:syntastic_always_populate_loc_list = 1 | |
let g:syntastic_auto_loc_list = 1 | |
let g:syntastic_check_on_open = 1 | |
let g:syntastic_check_on_wq = 0 | |
""Connormcd.com Notetaking in Markdown | |
map <leader>n :e! ~/notes | |
map <leader>] :Note | |
map <leader>[ :NoteTab | |
map <leader>0 :Nls | |
command -nargs=1 Note :exe "e! " . fnameescape("~/notes/<args>.txt") | |
command -nargs=1 NoteTab :exe "tabnew " . fnameescape("~/notes/<args>.txt") | |
command -nargs=1 Nls :Ack --text "<args>" ~/notes | |
""Note-taking snippets | |
"snippet img | |
"${3} | |
"snippet t | |
"# `expand("%:r")` | |
"> Date: `strftime("%m-%d-%y")` | |
"> Instructor: ${1} ` | |
" | |
"## ${2} | |
"Markdown settings : http://technicalpickles.com/posts/using-markdown-in-vim/ | |
augroup mkd | |
autocmd BufRead *.mkd set ai formatoptions=tcroqn2 comments=n:> | |
augroup END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment