Skip to content

Instantly share code, notes, and snippets.

@wellle
Created November 1, 2012 15:00
Show Gist options
  • Save wellle/3994144 to your computer and use it in GitHub Desktop.
Save wellle/3994144 to your computer and use it in GitHub Desktop.
my current vimrc
set nocompatible
syntax enable
set hidden
" set noesckeys " messes up the mouse
" set timeoutlen=0 " messes up mappings
set ttimeoutlen=50
set shortmess=atI
set scrolloff=2
" appearance
set title
set titleold=
set mouse=a
set laststatus=2
set ruler
set showcmd
"set relativenumber
set cursorline
set wildmenu
set wildmode=longest,full
set wildignore+=*.a,*.o
set wildignore+=*.bmp,*.gif,*.ico,*.jpg,*.png
set wildignore+=.DS_Store,*.git,.hg,.svn
set wildignore+=*~,*.swp,*.tmp
set wildignore+=*.aux,*.bbl,*.pdf,*.toc,*.blg
set wildignore+=*.class
set splitbelow
set splitright
set listchars=tab:▸\ ,trail:·,eol:¬
" set showbreak=↪
" searching
set incsearch
set hlsearch
set ignorecase
set smartcase
set gdefault
map <silent> <leader>h :nohlsearch<CR>
" tabs
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
if version >= 703
set undofile
set undodir=~/.vim/tmp/undo//
endif
set backup
set backupdir=~/.vim/tmp/backup//
set swapfile
set directory=~/.vim/tmp/swap//
" go
set rtp+=$GOROOT/misc/vim
autocmd BufWritePre *.go :silent Fmt
filetype plugin indent on
let g:solarized_underline=0
colorscheme solarized
" set background=dark
set guifont=Menlo:h13
set guioptions=
map Y y$
vnoremap . :normal .<CR>
inoremap <silent> <C-C> <Esc>
command! Run :silent wall | echo system("make --silent run")
" switch to alternate file
nnoremap <leader>a <c-^>
nnoremap <leader>v :edit ~/.vimrc<CR>
nnoremap <leader>m :make<CR>
nnoremap <leader>rr :Run<CR>
autocmd BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
if !exists(":DiffOrig")
command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis
\ | wincmd p | diffthis
end
" autowrite or autowriteall?
" Show syntax highlighting groups for word under cursor
nmap <leader>c :call <SID>SynStack()<CR>
function! <SID>SynStack()
if !exists("*synstack")
return
endif
echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
endfunc
" plugins
call pathogen#infect()
autocmd BufNewFile,BufRead *.go set makeprg=go\ run\ %
let g:Tex_ViewRule_pdf = 'Preview'
let g:tex_flavor='latex'
imap <C-space> <Plug>IMAP_JumpForward
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment