Skip to content

Instantly share code, notes, and snippets.

@dbankier
Last active Dec 14, 2015
Embed
What would you like to do?
Vim and TiAlloy: automatically open view and styles when opening controller (plus other styling)
function OpenAlloy()
let s:view=substitute(expand('%:r'),"controllers","views","").".jade"
let s:style=substitute(expand('%:r'),"controllers","styles","").".tss"
exec '80vsp' s:style
set filetype=javascript
exec 'sp' s:view
set filetype=jade
endfunction
if has('autocmd')
au BufRead *.tss set filetype=javascript
au BufRead */controllers/*.js call OpenAlloy()
au BufRead *.jmk set filetype=javascript
endif
@dbankier

This comment has been minimized.

Copy link
Owner Author

@dbankier dbankier commented Feb 28, 2013

Updated so it works with widget controllers.
I'm using jade views. Change line 2 for xml...

@dbankier

This comment has been minimized.

Copy link
Owner Author

@dbankier dbankier commented Aug 13, 2013

Insert this between line 11 and 12 if you need it to open tabs for you:

   au BufAdd */controllers/*.js tabnew

I usually just open tabs from ctrl+p when opening controllers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment