Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add gary's helpers

  • Loading branch information...
commit ec3aee55c7c76b55c44b7cf0728a63c6128ada00 1 parent 893be43
@coreypurcell authored
Showing with 31 additions and 0 deletions.
  1. +31 −0 vimrc
View
31 vimrc
@@ -74,6 +74,12 @@ nnoremap <c-k> <c-w>k
nnoremap <c-h> <c-w>h
nnoremap <c-l> <c-w>l
+" Insert a hash rocket with <c-l>
+imap <c-l> <space>=><space>
+
+" Can't be bothered to understand ESC vs <c-c> in insert mode
+imap <c-c> <esc>
+
map <Left> :echo "no!"<cr>
map <Right> :echo "no!"<cr>
map <Up> :echo "no!"<cr>
@@ -133,6 +139,19 @@ endfunction
map <leader>n :call RenameFile()<cr>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" PROMOTE VARIABLE TO RSPEC LET
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+function! PromoteToLet()
+ :normal! dd
+ " :exec '?^\s*it\>'
+ :normal! P
+ :.s/\(\w\+\) = \(.*\)$/let(:\1) { \2 }/
+ :normal ==
+endfunction
+:command! PromoteToLet :call PromoteToLet()
+:map <leader>p :PromoteToLet<cr>
+
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" SWITCH BETWEEN TEST AND PRODUCTION CODE
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
function! OpenTestAlternate()
@@ -219,3 +238,15 @@ map <leader>T :call RunNearestTest()<cr>
map <leader>a :call RunTests('')<cr>
map <leader>c :w\|:!script/features<cr>
map <leader>w :w\|:!script/features --profile wip<cr>
+
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" CTRL P
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux
+set wildignore+=tmp\*,*.swp,*.zip,*.exe " Windows
+
+let g:ctrlp_custom_ignore = {
+ \ 'dir': '\.git$\|\.hg$\|\.svn$|ruby',
+ \ 'file': '\.exe$\|\.so$\|\.dll$',
+ \ 'link': 'some_bad_symbolic_links',
+ \ }
Please sign in to comment.
Something went wrong with that request. Please try again.