Skip to content

Instantly share code, notes, and snippets.

@brendandawes
Created Feb 3, 2018
Embed
What would you like to do?
.vimrc
set nocompatible " be iMproved, required
filetype off " required
set ignorecase
set autoindent
set cursorline
set noswapfile
set autoread
set t_Co=256
set number
set laststatus=2
set linebreak
set wrap
set autochdir
setlocal spell spelllang=en_gb
set spell
set relativenumber
" Force the cursor onto a new line after 80 characters
"set textwidth=80
" However, in Git commit messages, let’s make it 72 characters
autocmd FileType gitcommit set textwidth=72
" Colour the 81st (or 73rd) column so that we don’t type over our limit
autocmd FileType gitcommit set colorcolumn=+1
" In Git commit messages, also colour the 51st column (for titles)
autocmd FileType gitcommit set colorcolumn+=51
filetype plugin on
autocmd BufRead,BufNewFile *.snippets set syntax=text
let mapleader = ","
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
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 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'lfilho/cosco.vim'
Plugin 'JamshedVesuna/vim-markdown-preview'
Plugin 'tpope/vim-surround'
Plugin 'majutsushi/tagbar'
Plugin 'mechatroner/rainbow_csv'
Plugin 'mileszs/ack.vim'
let g:tagbar_ctags_bin = '/usr/local/bin/ctags'
call vundle#end() " required
"configure netrw to be more like nerdtree
let g:netrw_banner = 0
let g:netrw_liststyle = 3
let g:netrw_browse_split = 4
let g:netrw_altv = 1
let g:netrw_winsize = 25
syntax on
let delimitMate_expand_cr = 1
"" Ultisnips Snippet Track the engine.
Bundle 'SirVer/ultisnips'
" Snippets are separated from the engine. Add this if you want them:
Bundle 'honza/vim-snippets'
let g:UltiSnipsSnippetsDir="~/.vim/UltiSnips"
let g:UltiSnipsSnippetDirectories = ['UltiSnips']
" Trigger configuration. Do not use <tab> if you use YouCompleteMe
let g:ycm_key_list_previous_completion=['<Up>']
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsListSnippets="<c-l>"
" If you want :UltiSnipsEdit to split your window.
let g:UltiSnipsEditSplit="vertical"
if has("gui_running")
colorscheme gruvbox
set background=dark
set guifont=Input:h12
set autowrite
else
highlight clear SpellBad
highlight SpellBad cterm=underline
endif
let g:airline_powerline_fonts=1
filetype plugin indent on
execute pathogen#infect()
call pathogen#helptags()
map <C-n> :Vexplore<CR>
nnoremap n nzz
nnoremap N Nzz
inoremap jk <esc>
inoremap<esc>$a;<esc>
inoremap <c-u> <esc>VUi
nnoremap <leader>T :CtrlPTag<cr>
nnoremap <silent> <leader>t :set filetype=java<cr>:TagbarToggle<cr>:set filetype=processing<cr><C-w>l
nnoremap <leader>ev :vsplit ~/Dropbox/vim/vimrc.vim<cr>
nnoremap <leader>sv :source $MYVIMRC<cr>
nnoremap gf :vertical wincmd f<cr>
map G Gzz
map <leader><Enter> :set hlsearch!<cr>
cnoreabbrev Ack Ack!
nnoremap <Leader>a :Ack!<Space>--processing<Space>
inoremap <leader>n <ESC>la
nnoremap <leader>d :r !date +\\%s<cr>
autocmd BufNewFile *.pde 0r ~/Dropbox/vim/Templates/processing.pde
function! GetSiteIndex()
execute "r ! curl http://brendandawes.com/index.php --silent"
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment