Vim plugin for Emberjs

Hey folks,

Are there any Vim users on this forum? I’m not sure how many people use Vim with Ember, but if you are a Vim user you might be interested in a Vim plugin I’ve built for Ember.

It’s inspired by the vim-rails plugin by @tpope. It has similar features like Alternate and Related, :Efoo Ex-commands, that I’ve adapted to work with Emberjs.

Here’s some of the things currently working,

  • Alternate and Related navigation with :A and :R
  • Resource navigation with :(E|S|T|V|D)resource
  • CtrlP based fuzzy searching for resources
  • New file creation with :Emodel post!
  • Simple refactoring with :Esource destination
  • Ember Appkit based project layout
  • Boilerplate for Javascript and Coffeescript files
  • Improved syntax highlighting for Javascript, Coffeescript and Handlebars files

Github Project: Ember.vim

Installation is with Vundle or Pathogen.

I’d love to hear what you guys think. Thanks.

-ds

7 Likes

I don’t know why but I’m having troubles getting this to load. I’m using janus and am cloning it into my ~/.janus directory. Anyone have any experience doing this?

With Janus the install instructions are a bit different. I’ll try to add them to the repo. The gist of it,

git clone https://github.com/kien/ctrlp.vim.git ~/.janus/ctrlp
git clone https://github.com/dsawardekar/portkey.git ~/.janus/portkey
git clone https://github.com/dsawardekar/ember.vim.git ~/.janus/ember.vim

To customize it add the following to your .vimrc,

let g:portkey_autostart = 1
let g:portkey_adaptive_mappings = 1

" change to your preferred localleader key "
let g:maplocalleader =  ';'

Then in your project create a portkey.json with any of the flavors supported. The default is ember with appkit layout and boilerplate.

{
  "portkeys": ["ember"]
}

That’s it. Let me know how it goes.

Thanks for the information! I abandoned janus last night due to it doing too many things and slowing my Vim down but I’m still experiencing difficulties with this for some reason. I keep getting “:Emodel” command is not defined. I have the portkey.json right next to my package.json. That should be the correct place for it right? I have installed portkey via pathogen. I customized my .vimrc to your specs. I’m not sure what else I’m missing.


EDIT: It is working now. Great stuff. Thanks so much!

1 Like

Awesome! glad you got it working.

You should also try Vundle. It’s basically does the manual git clone stuff that pathogen requires, for you. And can autoupdate plugins with an Ex command like BundleUpdate.

It’s sort of like Janus but native Viml. And importantly makes your vimrc portable. :slight_smile:

This topic was automatically closed after 3 days. New replies are no longer allowed.