How to load plugins in a new tab in mac vim?

I am using macvim to generate rails code.

I have used some plugins that are rails specific (like vim-rails) and will only load in the rails app folder.

After I entered the rails folder, I run mvim and everything goes well.

However, when I use command + T to open a new tab. disabled function of these plugins ... it seems that they are not loaded.

How do I load them when opening a new tab?

+3


source to share


2 answers


If these plugins use similar code for this necropolis, then put something like

augroup LaunchFugitiveForAllBuffers
    autocmd!
    autocmd BufNew :doautocmd fugitive BufRead .
augroup END

      

(replace fugitive

with the actual name of the event group [1]). You can find this name either by grepping the plugin files for BufRead

(note: case doesn't matter) or traversing the output au BufRead

as I did (there shouldn't be many items there). Note that things can get tricky: for example, your plugins are attached to an event Filetype

and changing the to above doautocmd fugitive Filetype ruby

may not help. Also note that you can clear a word fugitive

by leaving only a space, but this is a potentially destructive operation and can only be used for testing (potentially very destructive in the case of an event Filetype

and some others).



[1] Note: event group, not plugin name. These groups are likely to have a name that is derived from the name of the plugin, but they should not be equal to it.

Refresh . It seems you need a group railsPluginDetect

for the Tim Popes rails plugin . I don't have a rails project, so I can't say for sure, but the autocommand looks a lot like a fluent one. Better if you go to the bug tracking plugin and add the request there (don't forget to find the existing one).

+2


source


More information may be needed, but I think that's because the new tab creates an empty virtual buffer.



Since your RoR related plugins only work in the Rails folder, and you are not in the Rails folder - you probably are in ~

, check :pwd

to see what the working directory is - these plugins hope they don’t work.

0


source







All Articles