Re: [PHP] auto indentation

2010-04-28 Thread Paul M Foster
On Wed, Apr 28, 2010 at 09:52:16AM +0100, Ashley Sheridan wrote:



> 
> I set it to use tabs of 4 spaces wide and use c-style indenting. It
> doesn't automatically indent as I write, but I find it a good thing that
> an editor doesn't change anything I write, as that is where problems can
> occur! 



I've had this behavior with most every editor I've had. I lived with it.
However, when I went to vim, I found out that it will automatically
indent braces and code properly. I thought, "Gee, that's nice. Save me
some work". But as it turns out, it's saved me a lot of debug time. When
the indenting goes wonky in vim, I know I've failed to close a brace
somewhere, or put too many in. It has about the same benefit to me as
syntax highlighting (which ensures I don't misspell key words).

Paul


-- 
Paul M. Foster

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] auto indentation

2010-04-28 Thread David McGlone
On Wednesday 28 April 2010 05:00:34 Ashley Sheridan wrote:
> On Tue, 2010-04-27 at 23:25 -0400, Paul M Foster wrote:
> > On Tue, Apr 27, 2010 at 10:29:33PM -0400, David McGlone wrote:
> > > On Tuesday 27 April 2010 19:00:29 D. Dante Lorenso wrote:
> > > > On 4/27/2010 3:55 PM, Ashley Sheridan wrote:
> > > > > On Tue, 2010-04-27 at 16:33 -0400, David McGlone wrote:
> > > > >> Hi everyone.
> > > > >> I got a quickie LOL
> > > > >> is there a way to auto indent code. I'm using Kate and I have it
> > > > >> set so the tab is only 4 spaces, but I was wondering if there was
> > > > >> an easier way than to have to hit the tab key 1x then 2x then 3x
> > > > >> then 2x then 1x to create nice laid out code like this:
> > > >
> > > > I use PHPEclipse for this.  It's not Eclipse with PDT, it's PHP
> > > > Eclipse:
> > > >
> > > > http://www.phpeclipse.com/
> > > >
> > > > The code formatter built into that formats my code when I hit
> > > > Ctrl+Shift+F.  No other code formatter works as well for what I've
> > > > found.  Many formatters just indent, this one will reformatt by
> > > > putting brackets up or down, and reindent all the code to fit my
> > > > coding standards.
> > > >
> > > > Project is getting a little old, though and doesn't yet support PHP
> > > > 5.3 syntax, but it's still the best I've found.
> > >
> > > I haven't tried this one. I am just so stuck on Kate. I've tried a ton
> > > of editors and Kate is simply the best one for me hands down.
> >
> > I have to say, back in the day when I used a GUI editor, Kate was the
> > best I found.
> >
> > Paul
> >
> > --
> > Paul M. Foster
>
> It has the useful ability to split the screen into as many parts and
> have different documents open in each one, and sessions that you can use
> to save the split screen layout and all the documents you had open. It
> doesn't have true code completion, it just auto hints based on what has
> already been typed into the current document. The spellchecker is useful
> too, but it isn't code-aware, so keeps suggesting the 'correct' spelling
> for function names!
>
> I do love it though. I've been using KDE for years too, the interface
> just seems more modern and intuitive than on Gnome, although I might
> give Gnome 3 a whirl when that gets released.

I installed as a promise to a friend that I would give it an honest try and 
it's been about a year since.

 The thing I like the most about it is on a fresh install it only installs the 
absolute necessities and the user can build onto that. I also found that totem 
works much better than kaffeine and as far as Amarok vs Rhythmbox I don't 
notice anything that stands out between the 2 and they both work equally well.

All in all, what I like about Gnome is that the developers seem to stick to 
the the KISS principle, starting with a Pinto and giving you the option to 
build a customized Porsche.

-- 
Blessings,
David M.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] auto indentation

2010-04-28 Thread Gary .
On Tue, Apr 27, 2010 at 10:33 PM, David McGlone wrote:
> I'm using Kate

Since you've already had a suggestion to switch to Eclipse, I'll say
(+ emacs php-mode
  (+ '"(define-key php-mode-map (kbd "RET") 'newline-and-indent)"))

Or something like that.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] auto indentation

2010-04-28 Thread Ashley Sheridan
On Tue, 2010-04-27 at 23:25 -0400, Paul M Foster wrote:

> On Tue, Apr 27, 2010 at 10:29:33PM -0400, David McGlone wrote:
> 
> > On Tuesday 27 April 2010 19:00:29 D. Dante Lorenso wrote:
> > > On 4/27/2010 3:55 PM, Ashley Sheridan wrote:
> > > > On Tue, 2010-04-27 at 16:33 -0400, David McGlone wrote:
> > > >> Hi everyone.
> > > >> I got a quickie LOL
> > > >> is there a way to auto indent code. I'm using Kate and I have it set so
> > > >> the tab is only 4 spaces, but I was wondering if there was an easier 
> > > >> way
> > > >> than to have to hit the tab key 1x then 2x then 3x then 2x then 1x to
> > > >> create nice laid out code like this:
> > >
> > > I use PHPEclipse for this.  It's not Eclipse with PDT, it's PHP Eclipse:
> > >
> > > http://www.phpeclipse.com/
> > >
> > > The code formatter built into that formats my code when I hit
> > > Ctrl+Shift+F.  No other code formatter works as well for what I've
> > > found.  Many formatters just indent, this one will reformatt by putting
> > > brackets up or down, and reindent all the code to fit my coding standards.
> > >
> > > Project is getting a little old, though and doesn't yet support PHP 5.3
> > > syntax, but it's still the best I've found.
> > 
> > I haven't tried this one. I am just so stuck on Kate. I've tried a ton of
> > editors and Kate is simply the best one for me hands down.
> 
> I have to say, back in the day when I used a GUI editor, Kate was the
> best I found. 
> 
> Paul
> 
> -- 
> Paul M. Foster
> 


It has the useful ability to split the screen into as many parts and
have different documents open in each one, and sessions that you can use
to save the split screen layout and all the documents you had open. It
doesn't have true code completion, it just auto hints based on what has
already been typed into the current document. The spellchecker is useful
too, but it isn't code-aware, so keeps suggesting the 'correct' spelling
for function names!

I do love it though. I've been using KDE for years too, the interface
just seems more modern and intuitive than on Gnome, although I might
give Gnome 3 a whirl when that gets released.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] auto indentation

2010-04-28 Thread Ashley Sheridan
On Tue, 2010-04-27 at 22:23 -0400, David McGlone wrote:

> On Tuesday 27 April 2010 16:55:45 Ashley Sheridan wrote:
> > On Tue, 2010-04-27 at 16:33 -0400, David McGlone wrote:
> > > Hi everyone.
> > >
> > > I got a quickie LOL
> > >
> > > is there a way to auto indent code. I'm using Kate and I have it set so
> > > the tab is only 4 spaces, but I was wondering if there was an easier way
> > > than to have to hit the tab key 1x then 2x then 3x then 2x then 1x to
> > > create nice laid out code like this:
> > >
> > > -
> > >  -
> > >   -
> > >-
> > > -
> > >-
> > >   -
> > >  -
> > > -
> > >
> > > or:
> > >
> > > function() {
> > >
> > >   function here
> > > }
> > 
> > I use Kate too, and the indentation changed slightly in KDE 4. In the
> > configure dialogue window, go down to the Editing section in the left
> > menu and set the number of spaces to use in both the General tab (under
> > Tabulators) and the Indentation tab (under Indentation Properties. If
> > they are both different then you have to hit the tab key 4 times in
> > order for your spaces to be replaced by a tab character.
> 
> Thanks Ash. What is your preferences  for indenting code? Do you have it set 
> so you don't have to hit the tab key at all? I set my numbers in kate to 4 
> what about you?
> 
> -- 
> Blessings,
> David M.
> 


I set it to use tabs of 4 spaces wide and use c-style indenting. It
doesn't automatically indent as I write, but I find it a good thing that
an editor doesn't change anything I write, as that is where problems can
occur! I'm quite a fan of the Allman style of indenting, and Kate is
able to line up the closing brackets for functions, etc if I type them
out of position.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] auto indentation

2010-04-27 Thread Paul M Foster
On Tue, Apr 27, 2010 at 10:29:33PM -0400, David McGlone wrote:

> On Tuesday 27 April 2010 19:00:29 D. Dante Lorenso wrote:
> > On 4/27/2010 3:55 PM, Ashley Sheridan wrote:
> > > On Tue, 2010-04-27 at 16:33 -0400, David McGlone wrote:
> > >> Hi everyone.
> > >> I got a quickie LOL
> > >> is there a way to auto indent code. I'm using Kate and I have it set so
> > >> the tab is only 4 spaces, but I was wondering if there was an easier way
> > >> than to have to hit the tab key 1x then 2x then 3x then 2x then 1x to
> > >> create nice laid out code like this:
> >
> > I use PHPEclipse for this.  It's not Eclipse with PDT, it's PHP Eclipse:
> >
> > http://www.phpeclipse.com/
> >
> > The code formatter built into that formats my code when I hit
> > Ctrl+Shift+F.  No other code formatter works as well for what I've
> > found.  Many formatters just indent, this one will reformatt by putting
> > brackets up or down, and reindent all the code to fit my coding standards.
> >
> > Project is getting a little old, though and doesn't yet support PHP 5.3
> > syntax, but it's still the best I've found.
> 
> I haven't tried this one. I am just so stuck on Kate. I've tried a ton of
> editors and Kate is simply the best one for me hands down.

I have to say, back in the day when I used a GUI editor, Kate was the
best I found. 

Paul

-- 
Paul M. Foster

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] auto indentation

2010-04-27 Thread Programming Guides
On Tue, Apr 27, 2010 at 9:15 PM, Paul M Foster wrote:

> On Tue, Apr 27, 2010 at 08:52:09PM -0500, Programming Guides wrote:
>
> > On Tue, Apr 27, 2010 at 6:00 PM, D. Dante Lorenso 
> wrote:
> >
> > > On 4/27/2010 3:55 PM, Ashley Sheridan wrote:
> > >
> > >> On Tue, 2010-04-27 at 16:33 -0400, David McGlone wrote:
> > >>
> > >>> Hi everyone.
> > >>> I got a quickie LOL
> > >>> is there a way to auto indent code. I'm using Kate and I have it set
> so
> > >>> the
> > >>> tab is only 4 spaces, but I was wondering if there was an easier way
> than
> > >>> to
> > >>> have to hit the tab key 1x then 2x then 3x then 2x then 1x to create
> nice
> > >>> laid
> > >>> out code like this:
> > >>>
> > >>
>
> 
>
> > vim ftw:
> >
> > 1. select the piece of code you want to indent (or select all with
> "ggVG")
> > 2. Hit =
> > 3. profit!
>
> +1 for vim
>
> I use a limited number of "g" commands, like gg, G and gwap, but I use
> them rotely; I've never understood the variations. Can you point me to
> some sort of tutorial on these?
>
> Paul
>
>
> --
> Paul M. Foster
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
I gotta say I dont understand the "g" commands very well either. They dont
seem to have much in common, and I, like yourself know a handful that I am
comfortable using. In any case, this cheat sheet has several "g" commands
(although I commonly use some that are not listed):

http://www.fprintf.net/vimCheatSheet.html

-- 
Viktor
http://programming-guides.com


Re: [PHP] auto indentation

2010-04-27 Thread David McGlone
On Tuesday 27 April 2010 19:00:29 D. Dante Lorenso wrote:
> On 4/27/2010 3:55 PM, Ashley Sheridan wrote:
> > On Tue, 2010-04-27 at 16:33 -0400, David McGlone wrote:
> >> Hi everyone.
> >> I got a quickie LOL
> >> is there a way to auto indent code. I'm using Kate and I have it set so
> >> the tab is only 4 spaces, but I was wondering if there was an easier way
> >> than to have to hit the tab key 1x then 2x then 3x then 2x then 1x to
> >> create nice laid out code like this:
> 
> I use PHPEclipse for this.  It's not Eclipse with PDT, it's PHP Eclipse:
> 
> http://www.phpeclipse.com/
> 
> The code formatter built into that formats my code when I hit
> Ctrl+Shift+F.  No other code formatter works as well for what I've
> found.  Many formatters just indent, this one will reformatt by putting
> brackets up or down, and reindent all the code to fit my coding standards.
> 
> Project is getting a little old, though and doesn't yet support PHP 5.3
> syntax, but it's still the best I've found.

I haven't tried this one. I am just so stuck on Kate. I've tried a ton of 
editors and Kate is simply the best one for me hands down.

I'll check out php Eclipse. Never know I may be impressed with it.

After about 10 or more years of using KDE, I am have been running Gnome for 
about a year now, but I always always install Kontact and kate.

-- 
Blessings,
David M.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] auto indentation

2010-04-27 Thread David McGlone
On Tuesday 27 April 2010 16:55:45 Ashley Sheridan wrote:
> On Tue, 2010-04-27 at 16:33 -0400, David McGlone wrote:
> > Hi everyone.
> >
> > I got a quickie LOL
> >
> > is there a way to auto indent code. I'm using Kate and I have it set so
> > the tab is only 4 spaces, but I was wondering if there was an easier way
> > than to have to hit the tab key 1x then 2x then 3x then 2x then 1x to
> > create nice laid out code like this:
> >
> > -
> >  -
> >   -
> >-
> > -
> >-
> >   -
> >  -
> > -
> >
> > or:
> >
> > function() {
> >
> > function here
> > }
> 
> I use Kate too, and the indentation changed slightly in KDE 4. In the
> configure dialogue window, go down to the Editing section in the left
> menu and set the number of spaces to use in both the General tab (under
> Tabulators) and the Indentation tab (under Indentation Properties. If
> they are both different then you have to hit the tab key 4 times in
> order for your spaces to be replaced by a tab character.

Thanks Ash. What is your preferences  for indenting code? Do you have it set 
so you don't have to hit the tab key at all? I set my numbers in kate to 4 
what about you?

-- 
Blessings,
David M.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] auto indentation

2010-04-27 Thread Paul M Foster
On Tue, Apr 27, 2010 at 08:52:09PM -0500, Programming Guides wrote:

> On Tue, Apr 27, 2010 at 6:00 PM, D. Dante Lorenso  wrote:
> 
> > On 4/27/2010 3:55 PM, Ashley Sheridan wrote:
> >
> >> On Tue, 2010-04-27 at 16:33 -0400, David McGlone wrote:
> >>
> >>> Hi everyone.
> >>> I got a quickie LOL
> >>> is there a way to auto indent code. I'm using Kate and I have it set so
> >>> the
> >>> tab is only 4 spaces, but I was wondering if there was an easier way than
> >>> to
> >>> have to hit the tab key 1x then 2x then 3x then 2x then 1x to create nice
> >>> laid
> >>> out code like this:
> >>>
> >>



> vim ftw:
> 
> 1. select the piece of code you want to indent (or select all with "ggVG")
> 2. Hit =
> 3. profit!

+1 for vim

I use a limited number of "g" commands, like gg, G and gwap, but I use
them rotely; I've never understood the variations. Can you point me to
some sort of tutorial on these?

Paul


-- 
Paul M. Foster

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] auto indentation

2010-04-27 Thread Programming Guides
On Tue, Apr 27, 2010 at 6:00 PM, D. Dante Lorenso  wrote:

> On 4/27/2010 3:55 PM, Ashley Sheridan wrote:
>
>> On Tue, 2010-04-27 at 16:33 -0400, David McGlone wrote:
>>
>>> Hi everyone.
>>> I got a quickie LOL
>>> is there a way to auto indent code. I'm using Kate and I have it set so
>>> the
>>> tab is only 4 spaces, but I was wondering if there was an easier way than
>>> to
>>> have to hit the tab key 1x then 2x then 3x then 2x then 1x to create nice
>>> laid
>>> out code like this:
>>>
>>
> I use PHPEclipse for this.  It's not Eclipse with PDT, it's PHP Eclipse:
>
> http://www.phpeclipse.com/
>
> The code formatter built into that formats my code when I hit Ctrl+Shift+F.
>  No other code formatter works as well for what I've found.  Many formatters
> just indent, this one will reformatt by putting brackets up or down, and
> reindent all the code to fit my coding standards.
>
> Project is getting a little old, though and doesn't yet support PHP 5.3
> syntax, but it's still the best I've found.
>
> -- Dante
>
> --
> D. Dante Lorenso
> da...@lorenso.com
> 972-333-4139
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
vim ftw:

1. select the piece of code you want to indent (or select all with "ggVG")
2. Hit =
3. profit!

-- 
http://programming-guides.com


Re: [PHP] auto indentation

2010-04-27 Thread D. Dante Lorenso

On 4/27/2010 3:55 PM, Ashley Sheridan wrote:

On Tue, 2010-04-27 at 16:33 -0400, David McGlone wrote:

Hi everyone.
I got a quickie LOL
is there a way to auto indent code. I'm using Kate and I have it set so the
tab is only 4 spaces, but I was wondering if there was an easier way than to
have to hit the tab key 1x then 2x then 3x then 2x then 1x to create nice laid
out code like this:


I use PHPEclipse for this.  It's not Eclipse with PDT, it's PHP Eclipse:

http://www.phpeclipse.com/

The code formatter built into that formats my code when I hit 
Ctrl+Shift+F.  No other code formatter works as well for what I've 
found.  Many formatters just indent, this one will reformatt by putting 
brackets up or down, and reindent all the code to fit my coding standards.


Project is getting a little old, though and doesn't yet support PHP 5.3 
syntax, but it's still the best I've found.


-- Dante

--
D. Dante Lorenso
da...@lorenso.com
972-333-4139

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] auto indentation

2010-04-27 Thread Ashley Sheridan
On Tue, 2010-04-27 at 16:33 -0400, David McGlone wrote:

> Hi everyone.
> 
> I got a quickie LOL
> 
> is there a way to auto indent code. I'm using Kate and I have it set so the 
> tab is only 4 spaces, but I was wondering if there was an easier way than to 
> have to hit the tab key 1x then 2x then 3x then 2x then 1x to create nice 
> laid 
> out code like this:
> 
> -
>  -
>   -
>-
> -
>-
>   -
>  -
> -
> 
> or:
> 
> function() {
> 
>   function here
> }
> 
> -- 
> Blessings,
> David M.
> 


I use Kate too, and the indentation changed slightly in KDE 4. In the
configure dialogue window, go down to the Editing section in the left
menu and set the number of spaces to use in both the General tab (under
Tabulators) and the Indentation tab (under Indentation Properties. If
they are both different then you have to hit the tab key 4 times in
order for your spaces to be replaced by a tab character.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] auto indentation

2010-04-27 Thread shiplu
There is a command "indent" in your kde.
Check the manual

Shiplu Mokaddim
My talks, http://talk.cmyweb.net
Follow me, http://twitter.com/shiplu
SUST Programmers, http://groups.google.com/group/p2psust
Innovation distinguishes bet ... ... (ask Steve Jobs the rest)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php