Permalink
Browse files

throw out CtrlP and bring back Command-T

 - CtrlP is slow and needs occasional refreshing with F5
 - CtrlP fuzzy matcher sucks
 - Too many features; I seriously don't know what's going on in its prompt
 - Buffers end up in weird state after long sessions of usage
 - It seems to muck with my pwd

This reverts commit caf60d6.
  • Loading branch information...
1 parent 8d0ef7a commit f732d82dde5baf4eff7eba4cdc7c8bec7b5b2a32 @mislav committed Jun 30, 2013
Showing with 51 additions and 29 deletions.
  1. +3 −3 .gitmodules
  2. +13 −19 README.md
  3. +25 −1 Rakefile
  4. +1 −0 bundle/command-t
  5. +0 −1 bundle/ctrlp
  6. +9 −5 vimrc
View
@@ -22,6 +22,9 @@
[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
@@ -61,9 +64,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
[submodule "bundle/scriptease"]
path = bundle/scriptease
url = https://github.com/tpope/vim-scriptease
View
@@ -40,25 +40,19 @@ files inside the ".vim" directory.
* `Q` - format lines
* `: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
+### File switching (Command-T)
+
+* `,,` alternates between two most recent buffers
+* `,f` - jump to file:
+ * `,F` - search in directory of current buffer
+ * `,b` - search buffer list
+ * `,gl` - search in `lib/`
+ * `,gt` - search tags
+ * `<C-s>`,`<C-CR>` - open the selected file in a new split window
+ * `<C-v>` - open the selected file in a new vertical split window
+ * `<C-t>` - open the selected file in a new tab
+ * `<C-j>` - select next file in the file listing
+ * `<C-k>` - select previous file in the file listing
### Ack
View
@@ -1,4 +1,4 @@
-task :default => [:update, :link, :macvim_check]
+task :default => [:update, :link, :command_t]
desc %(Bring bundles up to date)
task :update do
@@ -30,6 +30,23 @@ task :link do
end
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."
@@ -43,6 +60,13 @@ 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 added at 8866bb
Submodule ctrlp deleted from 287b9c
View
14 vimrc
@@ -137,14 +137,18 @@ let mapleader=","
nmap <leader>p pV`]=
nmap <leader>P PV`]=
+" expand %% to current directory in command-line mode
" http://vimcasts.org/e/14
cnoremap %% <C-R>=expand('%:h').'/'<cr>
-map <leader>F :CtrlP %%<cr>
-map <leader>b :CtrlPBuffer<cr>
-" let g:ctrlp_root_markers = ['.git', 'Rakefile']
-let g:ctrlp_working_path_mode = 0
-" let g:ctrlp_extensions = ['tag', 'buffertag']
+map <leader>gl :CommandTFlush<cr>\|:CommandT lib<cr>
+map <leader>gt :CommandTTag<cr>
+map <leader>f :CommandTFlush<cr>\|:CommandT<cr>
+map <leader>F :CommandTFlush<cr>\|:CommandT %%<cr>
+
+let g:CommandTMatchWindowAtTop=1
+let g:CommandTMaxHeight=10
+let g:CommandTMinHeight=2
let g:turbux_command_test_unit = 'ruby -Ilib:test'
" let g:turbux_command_cucumber = 'cucumber -f progress'

0 comments on commit f732d82

Please sign in to comment.