Skip to content

Instantly share code, notes, and snippets.

@tybenz
Created June 5, 2013 18:22
Show Gist options
  • Save tybenz/5716009 to your computer and use it in GitHub Desktop.
Save tybenz/5716009 to your computer and use it in GitHub Desktop.
.vimrc
let hour = strftime("%k")
let hour = substitute(hour, '^\s*\(.\{-}\)\s*$', '\1', '')
let morning = $TERMINATOR_MORNING
let evening = $TERMINATOR_EVENING
if (morning + 0) <= hour && hour < (evening + 0)
color Tomorrow
else
color Tomorrow-Night
endif
noremap <leader>d :color Tomorrow-Night<CR>
noremap <leader>l :color Tomorrow<CR>
" Turn off bell
set noeb vb t_vb=
au GUIEnter * set vb t_vb=
nmap <Leader>j :SplitjoinJoin<cr>
nmap <Leader>s :SplitjoinSplit<cr>
nmap <Leader>wk <C-W>k<C-W>_
nmap <Leader>wj <C-W>j<C-W>_
set autoindent
set hidden
set ruler
set backspace=indent,eol,start
set laststatus=2
set relativenumber
noremap <leader>r :set relativenumber<CR>
noremap <leader>n :set number<CR>
noremap <leader>m :set number<CR>:set nonumber<CR>
nnoremap / /\v
vnoremap / /\v
set ignorecase
set smartcase
set gdefault
set incsearch
set showmatch
set hlsearch
nnoremap <leader><space> :noh<cr>
let @k = 'ddkP'
let @j = 'ddp'
noremap <leader>K ddkP
noremap <leader>J ddp
noremap <leader>p :set paste<CR>
noremap <leader>o :set nopaste<CR>
filetype indent plugin on
nnoremap ! :Clam<space>
vnoremap ! :ClamVisual<space>
noremap <leader>! :Clam<space>
let g:instant_markdown=0
noremap <leader>M :let g:instant_markdown=1<CR>
set modelines=1
noremap <leader>s' :%s/\v(\S+)'(\S+)/\1\&\#8217\;\2/<CR>
imap <F6> <Esc>:ColorPickerInsert<Cr>a
vmap <F6> <Esc>:ColorPickerSelect<Cr>
" Source the vimrc file after saving it
if has("autocmd")
autocmd bufwritepost .vimrc source $MYVIMRC
" Enable file type detection
filetype on
" Syntax of these languages is fussy over tabs Vs spaces
autocmd FileType make setlocal ts=8 sts=8 sw=8 noexpandtab
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
" Customisations based on house-style (arbitrary)
" autocmd FileType html setlocal ts=4 sts=4 sw=4 expandtab
" autocmd FileType css setlocal ts=4 sts=4 sw=4 expandtab
" autocmd FileType javascript setlocal ts=4 sts=4 sw=4 expandtab
autocmd FileType ruby setlocal ts=2 sts=2 sw=2 expandtab
autocmd BufNewFile,BufRead *.mustache set filetype=html
autocmd BufNewFile,BufRead *.scss set filetype=css
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment