Sublime Forum

PHP AutoComplete Workflow ins ST2

#1

I’m a WordPress developer who is trying to use Sublime Text 2 to speed up my workflow. There are a few packages that allow me to autocomplete WordPress functions. A typical file is structured like this:

[code]<?php
/**

  • The custom portfolio post type archive template
    */

/** Force full width content layout */
add_filter( ‘genesis_pre_get_option_site_layout’, ‘__genesis_return_full_width_content’ );

/** Remove the breadcrumb navigation */
remove_action( ‘genesis_before_loop’, ‘genesis_do_breadcrumbs’ );

/** Remove the post info function */
remove_action( ‘genesis_before_post_title’, ‘genesis_post_info’ );

/** Remove the post content */
remove_action( ‘genesis_post_content’, ‘genesis_do_post_content’ );

/** Remove the post image */
remove_action( ‘genesis_post_content’, ‘genesis_do_post_image’ );

/** Add the featured image after post title */
add_action( ‘genesis_post_title’, ‘executive_portfolio_grid’ );
function executive_portfolio_grid() {
if ( has_post_thumbnail() ){
echo ‘

’;
echo ‘’;
echo get_the_post_thumbnail($thumbnail->ID, ‘portfolio’ );
echo ‘
’;
echo ‘
’;
}
}

/** Remove the post meta function */
remove_action( ‘genesis_after_post_content’, ‘genesis_post_meta’ );

genesis();[/code]

For the autocomplete to work there needs to be a closing PHP bracket ?> in order for the autocomplete to work properly, yet it isn’t considered a best practice in WordPress or in PHP coding in general. Is there any way to work around this yet still get autocomplete?

Thanks
Zach

0 Likes

#2

[quote=“protechig”]…
For the autocomplete to work there needs to be a closing PHP bracket ?> in order for the autocomplete to work properly, yet it isn’t considered a best practice in WordPress or in PHP coding in general. Is there any way to work around this yet still get autocomplete?

Thanks
Zach[/quote]

u’re right, hope in an answer from jon^

0 Likes

#3

Anyone else have an idea?

0 Likes

#4

Add the following line to your settings file:

"auto_complete_selector": "source, text",
0 Likes