Permalink
Browse files

404 - commit lost

  • Loading branch information...
torgeir committed Apr 15, 2012
1 parent 0879b2b commit 5595339ecc26611d9682c91741813e60998c64e1
Showing with 60 additions and 12 deletions.
  1. +6 −0 .gitmodules
  2. +4 −2 .vimrc
  3. +1 −0 bundle/ctrlp
  4. +1 −0 bundle/syntastic
  5. +1 −1 bundle/yankring
  6. +0 −8 config/commandt.vim
  7. +11 −0 config/ctrlp.vim
  8. +35 −0 functions.vim
  9. +1 −1 keybindings.vim
View
@@ -115,3 +115,9 @@
[submodule "bundle/rainbow"]
path = bundle/rainbow
url = https://github.com/kien/rainbow_parentheses.vim
+[submodule "bundle/ctrlp"]
+ path = bundle/ctrlp
+ url = https://github.com/kien/ctrlp.vim.git
+[submodule "bundle/syntastic"]
+ path = bundle/syntastic
+ url = https://github.com/scrooloose/syntastic.git
View
6 .vimrc
@@ -40,7 +40,7 @@ filetype plugin on
source ~/.vim/config/colorizer.vim
source ~/.vim/config/nerdtree.vim
source ~/.vim/config/omnicomplete.vim
-source ~/.vim/config/commandt.vim
+source ~/.vim/config/ctrlp.vim
source ~/.vim/config/jshint.vim
source ~/.vim/config/tasklist.vim
source ~/.vim/config/filetypes.vim
@@ -76,6 +76,8 @@ set linebreak " break lines
set breakat=" " " where to insert line breaks
let &showbreak = "" " character to visualize breaks
+set iskeyword+=- " quotes are also keywords, so e.g. vi' works
+
" set columns=84 " 84 - 4 = 80 char width
set numberwidth=6 " linenumber width
set ruler " show ruler
@@ -125,7 +127,7 @@ set statusline+=\ %r
set statusline+=\ "
set statusline+=\ "
set statusline+=%{CurDir()}
-set statusline+=%= " right align
+set statusline+=%= " right align
set statusline+=%h\ \ \
set statusline+=%{strlen(ShowPaste())?ShowPaste():''}
set statusline+=Position:\ %c:%l/%L
Submodule ctrlp added at 3ee411
Submodule syntastic added at 3c569d
Submodule yankring updated 3 files
+2 −0 README
+101 −6 doc/yankring.txt
+423 −194 plugin/yankring.vim
View
@@ -1,8 +0,0 @@
-" command-t
-
-" adjust height
-let g:CommandTMaxHeight = 12
-
-" make command-t open new tabs on enter
-let g:CommandTAcceptSelectionMap = '<C-t>'
-let g:CommandTAcceptSelectionTabMap = '<CR>'
View
@@ -0,0 +1,11 @@
+" ctrlp
+let g:ctrlp_match_window_reversed = 0
+
+" adjust height
+let g:ctrlp_max_height = 12
+
+" fix enter
+" let g:ctrlp_prompt_mappings = {
+" \ 'AcceptSelection("e")': ['<c-t>', '<MiddleMouse>'],
+" \ 'AcceptSelection("t")': ['<cr>', '<2-LeftMouse>'],
+" \ }
View
@@ -1,3 +1,38 @@
+" Extract variable refactoring
+function! Extract_variable()
+ let name = input('Enter variable name: ')
+ exe 'normal gv'
+ exe 'normal c' . name
+ exe 'normal Ovar ' . name . ' = ;'
+ exe 'normal P'
+endfunction
+
+" Extract variable refactoring
+function! Inline_variable()
+ exe 'normal \<esc>'
+ let name = expand('<cword>')
+ exe 'normal k$'
+ " go to end of previous line
+ call search(name, 'b')
+ " step over 'var variable = '
+ exe 'normal 2f w'
+ " select everything to ;
+ exe 'normal vt;'
+ " delete to register k
+ exe 'normal "kd'
+ " delete line
+ exe 'normal dd'
+ " move back to variable
+ call search(name)
+ " select the variable
+ exe 'normal viw'
+ " replace it with the contents from register k
+ exe 'normal "kp'
+endfunction
+
+vnoremap ev <esc>:call Extract_variable()<cr>
+vnoremap ei <esc>:call Inline_variable()<cr>
+
" If the parameter is a directory, cd into it
function! CdIfDirectory(directory)
let explicitDirectory = isdirectory(a:directory)
View
@@ -32,7 +32,7 @@ noremap <silent> <f6> :call CustomNerdTreeToggle()<cr>
noremap <silent> <f7> :TagbarToggle<cr>:wincmd p<cr>
" command-t
-noremap <silent> <leader>t :CommandT<cr>
+noremap <silent> <leader>t :CtrlP<cr>
" ack search
noremap <leader>f :Ack!<space>

0 comments on commit 5595339

Please sign in to comment.