← Back to Upcase


Is Vim-Tmux-Runner being used in the above video when the two of you are demonstrating Vim-Rails?

Hi @evan1, I don’t believe tmux runner is being used in this video. @benorenstein was driving and he is not a tmux runner user. Is there a particular part that caught your attention?

Ah, thanks for clearing that up. The way Ben was able to call tests was similar to what you did with Vim-Tmux-Runner in the Configuration video on the Tmux Trail, that was why I was asking.

I need a way to quickly run tests and view output, and now it seems I have two viable paths that fit the bill. :smile:

Yep, @benorenstein uses vim-dispatch with tmux for test running, and I use Vim-Tmux-Runner. Pros and cons to each, but either is a great addition to your workflow.

Awesome episode! I’ve been using vim almost exclusively since starting this series and though I feel like I’m mostly over the productivity hurdle there were some features of my old editor-that-shall-not-be-named that I missed and this episode really addressed some of those pain points, especially fuzzy finding. Thanks again!

In my vim in insert mode the cursor will seemingly randomly jump to the beginning of the line as I type. Is this an issue with my configuration or is it normal? I ask because I’ve tried turning plugins on and off and toggling just about every setting in my vimrc and can’t find the offending line. Just wondering if anyone else out there has seen a similar issue.

@kiramclean is this happening mid-way through an insertion in Insert Mode? Or is it happening sometimes right as you enter Insert Mode? I wonder if you might typing I instead of i (which would insert at the start of the indentation rather than current cursor position)?

I’m trying to think of what would cause Vim with an empty vimrc to jump to the beginning of the line.

It was happening mid-way through the lines in insert mode. I just emptied out my vimrc completely and I’ve ben adding one line back at a time as I need them… sort of annoying because it slows down my workflow but I’m hoping after a week of coding I’ll have everything back the way I need minus the offending line. Bummer. That’s what I get for trying to configure vim in one day I guess.

Having recently hosed my vim configuration in another way recently, you can try adding half the config back at a time instead of one line, which will get you to the offender faster. (If one half contains the problem, cut that half in half, etc.)

Keeping your vimrc in Git and tracking changes can seem like overkill, but it does help you jump back to times when you knew your settings were still OK.

Let me know when you figure out what the cause is, I’m very curious about what it could be.

Just thought I’d put a note here since you guys don’t suggest something like nerdtree I’ll post the single most benefit ( for me ) to using it.

That is, like ctrlp, you don’t have to think about how you want any particular file to be opened before hand as with :e .
with :e, I have to decide if I want it in a split or a tab before I enter. At least as far as I can tell, it replaces an entire buffer – so, it can have undesired side affects.

Where as with nerdtree, I can find a file, hit i to split it or hit T to open it in a tab. Works especially well ( again, for me ), when I map my :NERDTreeToggle to k That way it’s never always taking up a lot of space unless I absolutely need it to be, and it’s mapped where it’s easy for me to reach ( despite not being able to use homerow like a normal person… )]

I’ll also note a downside to it, is that if i :e somefile.txt, in order for it to show up i have to refresh the nerdtree window. ( -r for full refresh or -R for root directory only )

Also, a downside to ctrl-p with cache turned off, is if you’re in a larger project, it takes forever to load every time.

Hey @ch0ke, thanks for sharing. NERDTree is great (and an impressive feat of Vimscript engineering), but I personally no longer use it. Between CtrlP and vim-vinegar (a minimal file explorer plugin) I find I don’t need NERDTree. That said, if you’re looking for a project explorer, NERDTree is a great choice.

@chistoomey that makes a lot of sense actually. I looked at vim-vinegar, and with that you really wouldn’t need NerdTree at all. I may, overtime move over to something like vinegar, but even that has it’s use timeline. I mostly see project explorers in vim, as an easier way to navigate larger projects.

ie: We have one project with 400 models, a lot more tests, a bunch of controllers, libraries, etc that we’ve written. Using ctrlp in this, with the cache shut off ( as in your videos ), it re-indexes it every time which takes upwards of a minute - which renders it virtually useless in my opinion – so it really only excels in normal sized projects since it indexes every time you hit ctrl-p.

Anyway, enjoying the videos – and making the switch from my IDE ( RubyMine and PhpStorm ) to vim. Setup my dotfiles as well: https://github.com/ch0ke/dotfiles

@ch0ke: Have you tried this configuration from the thoughbot dotilfes? For me, it’s near-instant, even on large projects.

I do not think I have an .agignore file, am I supposed to create it? Also, while using CtrlP, every time I create a file ctrlP can’t find it. I thought the no cache option would make it search fresh?
Here is my .vimrc

set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

" Plugins
Plugin 'vim-scripts/ReplaceWithRegister'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'tpope/vim-rails'
Plugin 'vim-ruby/vim-ruby'
Plugin 'tpope/vim-surround'
Plugin 'rking/ag.vim'
Plugin 'thoughtbot/vim-rspec'

call vundle#end()            " required
filetype plugin indent on    " required

imap jj <esc>
nmap <C-u> :split<cr>
imap <C-a> <esc>

let g:ctrlp_user_command = 'ag %s -l --hidden --nocolor -g ""'
let g:crtlp_use_caching = 0

set number
set tabstop=2
set shiftwidth=2
set expandtab

Great Video! What is Upcase and Thoughbots recommendations for an auto-complete plugin for Java, Javascript, C, Python and Rails.

Figured this out ages ago but just saw the notification about replying… it was caused by having settings to strip white space at the end of lines on save and auto saving. If I was typing but the autosave kicked in, it would kick my cursor back to the beginning of a line. I had to change the autosaving timing.

Hey guys! Thanks for this VIM trail. After watching your videos, I have decided to jump into using vim at least for an hour every day for a month and see. I can say that after a few days, things just come up to my mind even without thinking. Awesome!

However, now that I trying to do more and more, I am missing an episode where you explain how to create snippets for creating basic stuff we use every day like: classes, test function and so on.

Again, thanks for these videos

Thanks! Glad you’re enjoying the trail, @estringana. We might add some content around snippets in the future, but in the meantime I’d recommend checking out UltiSnips. I use and enjoy it, and even better, there are three screencasts on vimcast about it.

Thanks for making this Vim course! It’s been extremely helpful in learning my way around Vim.

I did notice a small error in the reference text for this lesson:
When using the CtrlP plugin, the keybinding for opening a file in a new split is , not .
This is shown in the documentation for CtrlP here: https://github.com/ctrlpvim/ctrlp.vim/blob/master/readme.md#once-ctrlp-is-open


**When using the CtrlP plugin, the keybinding for opening a file in a new split is Ctrl-X, not Ctrl-S.