Sublime Forum

PHP indent help PLEASE [st3]

#1

I am a happy user except my main langage is php and the auto-indent is broken and it is driving me crazy.

I get this:

		<div class="contentColumn">
			<?php if (have_posts()) : ?>
			<?php while (have_posts()) : the_post(); ?>
			<article class="blogExcerpt clearfix">
				<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
				<?php the_content('more'); ?>
			</article>
		<?php endwhile; ?>
	<?php else : ?>
	<p>Sorry, but you are looking for something that isn't here.</p>
<?php endif; ?>
</div>

But I want this:

		<div class="contentColumn">
			<?php if (have_posts()) : ?>
				<?php while (have_posts()) : the_post(); ?>
					<article class="blogExcerpt clearfix">
						<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
						<?php the_content('more'); ?>
					</article>
				<?php endwhile; ?>
			<?php else : ?>
				<p>Sorry, but you are looking for something that isn't here.</p>
			<?php endif; ?>
		</div>
0 Likes

Dev please address : Php Indenting
#2

Unfortunately still an issue with Sublime, anybody already find an issue for this?

0 Likes

#3

No way to edit the indenting rules? Think it might have something to do with the parans

0 Likes

#4

No i tried almost everything in the settings pane. It really is an annoying bug especially for wordpress and magento developers.

Also i don’t know why it takes so long to fix this? It seems a small thing to fix to me.

0 Likes

#5

Whats the support like for large files? I routinely deal with fairly large files (Up to 1gb) – and find the handling of files as small as 50mb to be quite painful in ST2, and was one of the reasons I stopped using it Searching and loading is really bad compared to Emacs and Notepad++.

0 Likes

#6

edit tmPreferences file in your PHP package, you can override the dafaults by putting the file in your packages directory.
Use the keys increaseIndentPattern decreaseIndentPattern

0 Likes

#7

Is the current default behavior intended or a bug?

I switched to the ST3 beta today and the lack of smart HTML/PHP auto-indentation already seems like a big weakness. I’m constantly having to indent and un-indent lines.

I had ST2 going for so long, though, that I’m not actually sure if the behavior I’m accustomed to was stock or due to some package or extension I installed. I’m pretty sure it was just stock.

0 Likes

#8

Are you editing gigabyte sized PHP files? That’s pretty amazing. Otherwise, this thread is not the right place for that question.

0 Likes