Permalink
Browse files

replace Command-T with CtrlP

  • Loading branch information...
1 parent f571d4b commit caf60d612fe923b53c9c1b75c798b1d5345a0ea4 @mislav committed Jan 26, 2013
Showing with 29 additions and 47 deletions.
  1. +3 −3 .gitmodules
  2. +20 −7 README.md
  3. +1 −25 Rakefile
  4. +0 −1 bundle/command-t
  5. +1 −0 bundle/ctrlp
  6. +4 −11 vimrc
View
@@ -22,9 +22,6 @@
[submodule "bundle/endwise"]
path = bundle/endwise
url = https://github.com/tpope/vim-endwise
-[submodule "bundle/command-t"]
- path = bundle/command-t
- url = https://github.com/wincent/Command-T
[submodule "bundle/coffee-script"]
path = bundle/coffee-script
url = https://github.com/kchmck/vim-coffee-script
@@ -64,3 +61,6 @@
[submodule "bundle/turbux"]
path = bundle/turbux
url = https://github.com/jgdavey/vim-turbux
+[submodule "bundle/ctrlp"]
+ path = bundle/ctrlp
+ url = https://github.com/kien/ctrlp.vim
View
@@ -37,16 +37,29 @@ files inside the ".vim" directory.
* `<C-j/k/h/l>` - switch between splits (no need to prepend `<C-w>`)
* cursor keys for movement are disabled!
* `Q` - format lines
-* `,,` alternates between two most recent buffers
-* `,f` - jump to file:
- * `,F` - search in directory of current buffer
- * `,gl` - in `lib/`
- * `,gm` - in `app/models`
- * `,gv` - in `app/views`
- * `,gc` - in `app/controllers`
* `,cf` - search for merge conflicts in buffer
* `:KillWhitespace` - strip trailing whitespace
+### File switching (CtrlP)
+
+* `,,` - toggle between two recently open buffers
+* `<C-p>` - fuzzy file search
+* `<C-P>` - search in directory of current buffer
+* `:CtrlP [dir]` - search files
+* `:CtrlBuffer` - search buffers
+* `:CtrlPTag` - search tags
+* `:CtrlPBufTag` - search tags in current buffer
+* `:CtrlPMixed` - search in files, buffers and MRU
+
+Inside the CtrlP prompt:
+
+* `<C-j/k>` - move down/up between file matches
+* `<C-n/p>` - next/previous string in prompt's history
+* `<C-s/v>` - open file in new horizontal/vertical split
+* `<C-y>` - create a new file and its parent directories
+* `<C-z>` - mark a file to be opened with `<C-o>`
+* `<C-o>` - open marked files
+
### Ack
* `:Ack -w foo_bar --no-js --no-css`
View
@@ -1,4 +1,4 @@
-task :default => [:tmp_dirs, :update, :command_t, :link]
+task :default => [:tmp_dirs, :update, :link, :macvim_check]
desc %(Bring bundles up to date)
task :update do
@@ -35,23 +35,6 @@ task :tmp_dirs do
mkdir_p "_temp"
end
-desc %(Compile Command-T plugin)
-task :command_t => :macvim_check do
- vim = which('mvim') || which('vim') or abort "vim not found on your system"
- ruby = read_ruby_version(vim)
-
- Dir.chdir "bundle/command-t/ruby/command-t" do
- if ruby
- puts "Compiling Command-T plugin..."
- sh(*Array(ruby).concat(%w[extconf.rb]))
- sh "make clean && make"
- else
- warn color('Warning:', 31) + " Can't compile Command-T, no ruby support in #{vim}"
- sh "make clean"
- end
- end
-end
-
task :macvim_check do
if mvim = which('mvim') and '/usr/bin/vim' == which('vim')
warn color('Warning:', 31) + " You have MacVim installed, but `vim` still opens system Vim."
@@ -65,13 +48,6 @@ def color msg, code
end
end
-# Read which ruby version is vim compiled against
-def read_ruby_version vim
- script = %{require "rbconfig"; print File.join(RbConfig::CONFIG["bindir"], RbConfig::CONFIG["ruby_install_name"])}
- version = `#{vim} --nofork --cmd 'ruby #{script}' --cmd 'q' 2>&1 >/dev/null | grep -v 'Vim: Warning'`.strip
- version unless version.empty? or version.include?("command is not available")
-end
-
# Cross-platform way of finding an executable in the $PATH.
#
# which('ruby') #=> /usr/bin/ruby
Submodule command-t deleted from 07087e
Submodule ctrlp added at 78303a
View
15 vimrc
@@ -102,20 +102,13 @@ let mapleader=","
nmap <leader>p pV`]=
nmap <leader>P PV`]=
-map <leader>gv :CommandTFlush<cr>\|:CommandT app/views<cr>
-map <leader>gc :CommandTFlush<cr>\|:CommandT app/controllers<cr>
-map <leader>gm :CommandTFlush<cr>\|:CommandT app/models<cr>
-map <leader>gh :CommandTFlush<cr>\|:CommandT app/helpers<cr>
-map <leader>gl :CommandTFlush<cr>\|:CommandT lib<cr>
-map <leader>gf :CommandTFlush<cr>\|:CommandT features<cr>
-map <leader>gg :topleft 100 :split Gemfile<cr>
-map <leader>f :CommandTFlush<cr>\|:CommandT<cr>
" http://vimcasts.org/e/14
cnoremap %% <C-R>=expand('%:h').'/'<cr>
-map <leader>F :CommandTFlush<cr>\|:CommandT %%<cr>
-let g:CommandTMaxHeight=10
-let g:CommandTMinHeight=4
+map <C-P> :CtrlP %%<cr>
+map <leader>b :CtrlPBuffer<cr>
+let g:ctrlp_root_markers = ['.git', 'tags']
+" let g:ctrlp_extensions = ['tag', 'buffertag']
let g:turbux_command_test_unit = 'ruby -Ilib:test'
" let g:turbux_command_cucumber = 'cucumber -f progress'

0 comments on commit caf60d6

Please sign in to comment.