Skip to content

Instantly share code, notes, and snippets.

@will-clarke
Created October 8, 2014 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save will-clarke/19b76686f75f3b28dda8 to your computer and use it in GitHub Desktop.
Save will-clarke/19b76686f75f3b28dda8 to your computer and use it in GitHub Desktop.
nmap ,u :GundoToggle<CR> # !> assigned but unused variable - nmap
" RSpec.vim mappings
noremap <Leader>t :call RunCurrentSpecFile()<CR>
noremap <Leader>s :call RunNearestSpec()<CR>
noremap <Leader>l :call RunLastSpec()<CR>
noremap <Leader>a :call RunAllSpecs()<CR>
" sneak # !> possibly useless use of > in void context
nmap ' <Plug>SneakNext
nmap " <Plug>SneakPrevious
" nmap s <Plug>SneakForward
" nmap <Leader>n <Plug>(xmpfilter-run)map S <Plug>SneakBackward
" xmap s <Plug>VSneakForward
" xmap S <Plug>VSneakBackward
"
" To remember how to force save if you have an E212 error message
ca w!! w !sudo tee "%"
"
" inoremap <silent> <C-s> <ESC>:w<CR>
" nnoremap <silent> <C-s> :w<CR>
"
inoremap <silent> <C-q> <ESC>:q<CR><ESC>
nnoremap <silent> <C-q> :q<CR>
"
" noremap <silent> <C-S> :update<CR><ESC>
" vnoremap <silent> <C-S> <C-C>:update<CR><ESC>
" inoremap <silent> <C-S> <C-O>:update<CR><ESC>
noremap <C-s> :update<CR><ESC>
vnoremap <C-s> <C-C>:update<CR><ESC>
inoremap <C-s> <C-O>:update<CR><ESC>
" Emacs-like beginning and end of line.
imap <c-e>e <c-o>$
imap <c-a>e <c-o>^
nnoremap <F6> :buffers<CR>:buffer<Space>
" If the current buffer has never been saved, it will have no name,
" call the file browser to save it, otherwise just save it.
" command! -nargs=0 -bar Update if &modified
" \| if empty(bufname('%'))
" \| browse confirm write
" \| else
" \| confirm write
" \| endif
" \|endif
" nnoremap <silent> <C-S> :<C-u>Update<CR>
"
" inoremap <c-s> <Esc>:Update<CR>
" set autochdir
" define OpenURL (OSX)
:command -bar -nargs=1 OpenURL :!open <args>
noremap <leader>y "*y
noremap <leader>yy "*Y
noremap <leader>p :set paste<CR>:put *<CR>:set nopaste<CR>
noremap <silent><C-e> :CtrlP<CR>
" function! ToggleBackground()
" if &background == "dark"
" set background=light
" elseif &background == "light"
" set background=dark
" end
" endfunction
let g:gist_clip_command = 'pbcopy'
function! ToggleBackground()
let &background = ( &background == "dark"? "light" : "dark" )
endfunction
" NERDTree
" noremap <Leader>as :NERDTreeFind<CR>
" noremap ,n :NERDTreeFind<CR>
" noremap ,m :NERDTreeToggle<CR>
noremap <Leader>n :NERDTreeFind<CR>
noremap <Leader>m :NERDTreeToggle<CR>
"Ever notice a slight lag after typing the leader key + command? This lowers
"the timeout.
set timeoutlen=500
" highlight the status bar when in insert mode
" if version >= 700
au InsertEnter * hi StatusLine ctermfg=235 ctermbg=2
au InsertLeave * hi StatusLine ctermbg=240 ctermfg=12
" endif
noremap <leader>md :!open -a 'Marked 2' %<cr><cr>
noremap ; :
noremap : ;
imap jk <ESC>
noremap <f2> :call ToggleBackground()<CR>
noremap <f3> :call ToggleBackground()<CR>
" noremap <Leader>1 :call ToggleBackground()<CR>
set mouse=a
let g:jekyll_path = "ruby/wmmc.github.io"
noremap <Leader>jb :JekyllBuild<CR>
noremap <Leader>jn :JekyllPost<CR>
noremap <Leader>jl :JekyllList<CR>
map <F4> <Plug>(xmpfilter-mark)
map <F5> <Plug>(xmpfilter-run)
imap <F4> <Plug>(xmpfilter-mark)
imap <F5> <Plug>(xmpfilter-run)
let g:jekyll_prompt_tags = "true"
let g:jekyll_prompt_categories = "true"
let g:jekyll_post_suffix = "md"
" map <Leader>n <Plug>(xmpfilter-mark)
" map <Leader>n <Plug>(xmpfilter-run)
" imap <Leader>n <Plug>(xmpfilter-mark)
" imap <Leader>n <Plug>(xmpfilter-run)
" To enable spelling, it's just :set spell
setlocal spell spelllang=en_gb
noremap <Leader>oc :!open /Applications/Google\ Chrome.app %<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment