Created
November 26, 2014 10:00
-
-
Save will-clarke/92995b5bb121b2ebb87a to your computer and use it in GitHub Desktop.
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
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 | |
" | |
" 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> | |
inoremap <silent> <C-q><C-q><C-q> <ESC>:q!<CR><ESC> | |
nnoremap <silent> <C-q><C-q><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. | |
inoremap <c-e>e <c-o>$ | |
inoremap <c-a>e <c-o>^ | |
nnoremap _ ` | |
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=350 | |
nnoremap ,cd :cd %:p:h<CR>:pwd<CR> | |
" 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) | |
map <C-C><C-C> <Plug>(xmpfilter-run) | |
let g:jekyll_prompt_tags = "true" | |
let g:jekyll_prompt_categories = "true" | |
let g:jekyll_post_suffix = "md" | |
" To enable spelling, it's just :set spell | |
setlocal spell spelllang=en_gb | |
" Use ,gx instead | |
noremap <Leader>oc :!open /Applications/Google\ Chrome.app % <CR> | |
set completefunc=syntaxcomplete#Complete | |
" http://alisnic.github.io/posts/vim-run-hotkey/ | |
function RunWith (command) | |
execute "w" | |
execute "!clear;time " . a:command . " " . expand("%") | |
endfunction | |
autocmd FileType coffee nmap <C-C><C-F> :call RunWith("coffee")<cr> | |
autocmd FileType ruby nmap <C-C><C-F> :call RunWith("ruby")<cr> | |
autocmd FileType python nmap <C-C><C-F> :call RunWith("python")<cr> | |
autocmd BufRead *_spec.rb nmap <C-C><C-R> :w\|!clear && rspec % --format documentation --color<cr> | |
" Mouse scrolling | |
set ttymouse=xterm2 | |
" Insert Newline From Normal Mode http://vim.wikia.com/wiki/Insert_newline_without_entering_insert_mode | |
" nnoremap<C-J> ciW<CR><Esc>:if match( @", "^\\s*$") < 0<Bar>exec "norm P-$diw+"<Bar>endif<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment