Hi,
I'm using Geany for about a year and it's a great application. I mostly use it to edit the C++ and PHP source code, but sometimes I need to edit Makefiles as well. I use 4 spaces as indentation in my C++ and PHP code, and I have set it to automatically 'fix' all the files I open to adhere to this rule. Since GNU make requires tabs to indent rules in Makefile, I have problem because I lose tabs every time I save the file.
Is there some way to tell Geany to use tabs for indentation when "Makefile" is selected as the Filetype in Document menu?
Thanks,
On Fri, 9 Jan 2009 15:35:37 +0100, "Milan Babuskov" milan.babuskov@gmail.com wrote:
Hi,
I'm using Geany for about a year and it's a great application. I mostly use it to edit the C++ and PHP source code, but sometimes I need to edit Makefiles as well. I use 4 spaces as indentation in my C++ and PHP code, and I have set it to automatically 'fix' all the files I open to adhere to this rule. Since GNU make requires tabs to indent rules in Makefile, I have problem because I lose tabs every time I save the file.
Is there some way to tell Geany to use tabs for indentation when "Makefile" is selected as the Filetype in Document menu?
Hmm, Geany should use Tabs for Makefiles already since Geany 0.14. Since 0.15, Geany should auto-detect the used indentation type when opening files, this is especially for Makefiles as they are always using Tabs.
Just make sure that you have enabled the option "Detect from file" in the preferences dialog, Editor tab.
Regards, Enrico
On Fri, Jan 9, 2009 at 7:49 PM, Enrico Tröger enrico.troeger@uvena.de wrote:
Is there some way to tell Geany to use tabs for indentation when "Makefile" is selected as the Filetype in Document menu?
Hmm, Geany should use Tabs for Makefiles already since Geany 0.14. Since 0.15, Geany should auto-detect the used indentation type when opening files, this is especially for Makefiles as they are always using Tabs.
Just make sure that you have enabled the option "Detect from file" in the preferences dialog, Editor tab.
But, I disabled that because sometimes I get a (cpp or php) file from someone else and it has mixed tabs and spaces and I want Geany to 'fix' it to spaces on saving.
On Fri, 9 Jan 2009 20:03:48 +0100, "Milan Babuskov" milan.babuskov@gmail.com wrote:
On Fri, Jan 9, 2009 at 7:49 PM, Enrico Tröger enrico.troeger@uvena.de wrote:
Is there some way to tell Geany to use tabs for indentation when "Makefile" is selected as the Filetype in Document menu?
Hmm, Geany should use Tabs for Makefiles already since Geany 0.14. Since 0.15, Geany should auto-detect the used indentation type when opening files, this is especially for Makefiles as they are always using Tabs.
Just make sure that you have enabled the option "Detect from file" in the preferences dialog, Editor tab.
But, I disabled that because sometimes I get a (cpp or php) file from someone else and it has mixed tabs and spaces and I want Geany to 'fix' it to spaces on saving.
If this happens for single files, just use Document->Set Indendation type and/or Document->Replace Tabs by Spaces.
Then there is also the option "Replace tabs by space" in the preferences dialog, Files tab. But be aware that this options affects all files which are saved with Geany.
Regards, Enrico
On Fri, Jan 9, 2009 at 8:06 PM, Enrico Tröger enrico.troeger@uvena.de wrote:
But, I disabled that because sometimes I get a (cpp or php) file from someone else and it has mixed tabs and spaces and I want Geany to 'fix' it to spaces on saving.
If this happens for single files, just use Document->Set Indendation type and/or Document->Replace Tabs by Spaces.
It happens for about 30% of files I work on, so that's not an option. It's easier to just use a different editor program for Makefiles (which I do now as I don't see a better solution).
Then there is also the option "Replace tabs by space" in the preferences dialog, Files tab. But be aware that this options affects all files which are saved with Geany.
Yes, I know, I have it turned on. What would be nice is that this setting is ignored on a per-file basis if file type is Makefile, or if user manually selects Document -> Set Indentation.
Thanks,
On Fri, 9 Jan 2009 20:24:02 +0100, "Milan Babuskov" milan.babuskov@gmail.com wrote:
On Fri, Jan 9, 2009 at 8:06 PM, Enrico Tröger enrico.troeger@uvena.de wrote:
But, I disabled that because sometimes I get a (cpp or php) file from someone else and it has mixed tabs and spaces and I want Geany to 'fix' it to spaces on saving.
If this happens for single files, just use Document->Set Indendation type and/or Document->Replace Tabs by Spaces.
It happens for about 30% of files I work on, so that's not an option. It's easier to just use a different editor program for Makefiles (which I do now as I don't see a better solution).
Then there is also the option "Replace tabs by space" in the preferences dialog, Files tab. But be aware that this options affects all files which are saved with Geany.
Yes, I know, I have it turned on. What would be nice is that this setting is ignored on a per-file basis if file type is Makefile, or if user manually selects Document -> Set Indentation.
Well, basically we have already a pretty flexible set of indentation settings. Yet your special use case is a bit against the indented work flow.
Does anyone know if Makefiles always need to have tabs indentation? If we could assume all sorts of Makefiles require Tabs, we could add back the forced Tabs setting for Makefiles. But I have no idea about the Makefiles for Windows' nmake or BSD make or whatever else might exist.
Regards, Enrico