Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5962213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:04:27+00:00 2026-05-22T19:04:27+00:00

I recently cloned rails.vim (vim-rails) hoping to modify it to work with Padrino projects.

  • 0

I recently cloned rails.vim (vim-rails) hoping to modify it to work with Padrino projects.

Currently I’m trying to get the Rcontroller command to look not only in app/controllers (perfect for rails) but also in any folder in the project that has a sub-folder called ‘controllers’. So when I type Rcontroller in command-mode and hit tab, I should be able to tab through admin/controllers/base.rb, admin/controllers/accounts.rb, app/controllers/events.rb etc. This will let users of the plugin to jump to controllers in a ‘subapp’ of a Padrino application. e.g. PADRINO_ROOT/admin

The current controllerList function seems to handle this autocompletion and here’s what I have so far (only slightly modified from the original source)

function! s:controllerList(A,L,P)
  let con = padrino#app().relglob("*/controllers/","**/*",".rb") 
  call map(con,'s:sub(v:val,"_controller$","")')
  return s:autocamelize(con,a:A)  
endfunction

I added the wildcard before the controllers directory but this gives results like

  • Rcontroller ers/base
  • Rcontroller ers/sessions
  • Rcontroller s/events

for the last one it looks like there is somethings weird going on with string lengths or overlap…

Ideally I’d like to get it to the point where typing Rcontroller admin<TAB> should result in autocompletion to Rcontroller admin/controllers/accounts.rb. Likewise, Rcontroller app<TAB> should result in Rcontroller app/controllers/events.rb

The code for the viewList function has something similar to this and its code is as follows:

 function! s:viewList(A,L,P)
   let c = s:controller(1)
   let top = padrino#app().relglob("app/views/",s:fuzzyglob(a:A))
   call filter(top,'v:val !~# "\\~$"')
   if c != '' && a:A !~ '/'
     let local = padrino#app().relglob("app/views/".c."/","*.*[^~]")
     return s:completion_filter(local+top,a:A)
   endif
   return s:completion_filter(top,a:A)
 endfunction

Anyone have any suggestions? Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:04:28+00:00Added an answer on May 22, 2026 at 7:04 pm

    You probably want the full path to look like this:

    **/controllers/**/*.rb
    

    which globs as “look under any directory for a directory called controllers, then look anywhere under that for a file ending in .rb”

    Looking at other usages of “relglob”, I can only guess at how it’s supposed to work, but my guess is:

    • first param is “which directory to start looking in”
    • second param is “how to multiply out the directories from there”
    • third param is “actual files that will match”

    based on this assumption, my guess would be to use:

    padrino#app().relglob("app/","**/controllers/**/*",".rb") 
    

    Caveat: this is based on my understanding of glob, not of vim or relglob
    adjust as per actual usage.

    Note: have added “app/” in the assumption that you’re unlikely to want to be tabbing through any controllers under vendor/plugin or vendor/gems. This may not be the case, in which case, feel free to change it to “.”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently cloned a github repo and i'm trying to get it to work
I have recently been trying to upgrade my app form Rails 2.3.8 to newly-releases
Recently I started to get a strange error, While loading xap file it stops!
Recently I've been unable to clone or push to github, and I'm trying to
Recently I've been trying to write my own game (clone of Space Invaders) using
Background: I had an issue with my Rails server recently where it would stop
openCV 2.4.3 / Xcode 4.5.2 / mac osx 10.8.2 I am trying to get
I recently used git-svn to clone an SVN repository, for the purposes of maintaining
Recently one of our app servers went down, when it was rebooted the Python
Recently I was asked to develop an app, which basically is going to use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.