How to set multiple indentation widths in Geany? - geany

I use Geany mainly for Python, so I've set Indent Type to Spaces and Indent Width to 4. But when working with HTML, I'd like to use 2 spaces.
Is there any way to tell Geany to automatically switch to 2 spaces when working with HTML documents instead of being changing this manually all the time?

You can set indention by filetype or by project. To configure it via filetype copy the filetypes.filetypename from data folder of your Geany installation into your ~/.config/geany/filedefs folder and change
[indentation]
width=4
type=1
to what you like. Please check manual for details.
To start configuration based on a project, start here.

Related

Sublime Text Double Click highlighting modification

Sublime Text does not register a sass variable ($variable) as a single item when highlighting, so when I double click on the name, it highlights the word, but does not include the $-symbol in the highlighting. Visual Studio, on the other hand, selects the $-symbol along with the variable name when double clicking on a variable to select it.
I write sass all day long, and it could make my life drastically easier if I could modify this small behavior. Is there a way to change this? I am sure it would be possible with a plugin, but I don't know if one exists or how to find it.
There is a setting named word_separators which provides a list of characters that are assumed to not be part of a word for the purposes of things like double click selection, navigating by words, and so on.
The default for that particular setting is set to the following, which includes the $ character that is causing you woes:
// Characters that are considered to separate words
"word_separators": "./\\()\"'-:,.;<>~!##$%^&*|+=[]{}`~?",
You can modify this setting to not include the $ character so that it's treated as a part of the identifier, which should do what you want.
In order to ensure that you don't experience any other knock-on effects of this, you may want to set the setting in the preferences specific to the Sass syntax.
To do that, you can select Preferences > Settings - Syntax Specific while you have a Sass file open and focused, and then copy the default setting into those settings and remove the $ character.

How to turn off Xcode 6 autoindent text files

I use a text file (History.txt) for notes and to keep track of my edits. Xcode 6 is applying the indentation rules to all files, and so manual formatting (using tabs) in my text file is changed when I type a line or copy and paste. For example, typing a semicolon causes a line with leading whitespace to left justify. Prior versions of Xcode didn't do this.
I must have autoindent on for my source code files.
How can I tell Xcode 6 to leave my .txt files alone (no auto indent)?
I had the exact same problem. Didn't find a proper solution, but a workaround is to turn off the auto-indent feature (under Preferences -> Text Editing -> Indentation) for the specific characters that you use a lot in your text files (in my case the colon character was the main culprit) and that you can learn to live without having auto-indent when actually editing code. It's a decent way to get around this problem.

Changing all my indents to 3 spaces. Code::Blocks

I have to submit an assignment and they want all the indents to be 3 spaces. I don't know how to change the settings of Astyle.dll so that it will change them 3 spaces instead of the default 4. Any ideas?
Also, Astyle seems to like having no indent between switch() and its cases, and I need there to be an indent there. Any ideas?
All of Astyle's settings are exposed in the Code::Blocks editor settings dialog. To access them, open the Settings menu, click Editor, and scroll through the sidebar to find the Default code entry.
I have to submit an assignment and they want all the indents to be 3 spaces.
Switch to the Indentation tab, found under Source Formatter in the sidebar, and change Indentation size (in spaces): to 3.
Also, Astyle seems to like to have no indent between switch() and its cases, and i need there to be an indent there.
If I understand what you need correctly, check the box that says Indent switches (keyword case:) and check the box that says Indent case: statement in switches (commands under case:).
You can change any other settings you want as well. When you're done, hit OK, then reformat your code and make sure the settings are set the way you want them.

How do I add features to a syntax definition in Sublime Text without editing it?

For example, I would like to highlight #param, #type, and #return (i.e. epytext declarations) in my Python docstrings. I have figured out how to do this by simply editing Python/Python.tmLanguage; however, I would really like to put this in its own file, for a couple of reasons:
I don't always want to apply this highlighting. It's only for projects that use epydoc as their documentation tool; in other projects, I would want to highlight reStructuredText instead.
When Sublime Text updates, I'd like to have my own syntax as an overlay onto the included features. there are several features of Python that Sublime's author may choose to include in future versions and I don't want to have to manually figure out what I changed each time an update modifies the base Python syntax definition.
I keep my own editor configuration in version control, but I want that to be my own original stuff; I don't want to be burdened with having to carry copies (possibly proprietary? I don't know, it doesn't seem to have an independent license) of syntax definitions that come with Sublime.
Is there a way to put highlighting rules into a separate file, perhaps to only be applied to a particular scope?
Sounds to me like you want to create your own syntax file, inherit from the Python syntax file (source.python), and make your changes and customizations there. Sublime Text 2 uses the .tmLanguage format for syntax files, which is a bit complex, but fortunately most of the work has already been done for you, just by inheriting from source.python.
What you want to do is set up a regex pattern to match the substrings that you want to highlight, and give that pattern a name; something like punctuation.definition.comment.epydoc, to follow the convention set in Java/JavaDoc.tmLanguage. Then, check your color scheme file (ending in .tmTheme) and make sure there are settings for the scope that you've chosen -- or for one of its parents, since ST2 should use proper scoping rules for this sort of thing.
To use the syntax file you've created, stick it in Packages/User (so that ST2 doesn't overwrite it on upgrades), open a Python file in the editor, and then select your new syntax from the dropdown list in the bottom right corner of the window. If you've set up everything correctly, the epydoc strings should change to be whatever color you've set in your color scheme.
Good luck! And post a link somewhere when you've got a syntax file that works, so others can see and use it, as well!

Customizing Xcode [fonts, code sense, and more]

How can I make code completion case-sensitive?
How can I make Ctrl-k kill the content of the line and the new line character?
How can I make backspace always delete only one character, no matter what it is? Right now, it deletes spaces in chunks equal to my indent level.
How to change the indentation style in file templates? I like to have the opening brace on its own line.
How can I make the font aliased?
I'm using Xcode 3.2.2.
EDIT: Issues 2, 4, and 5 are solved. 1 and 3 are still open.
EDIT2: ad.3. Yes, I set Xcode to use spaces, not tabs.
3.
Look in Preferences : Key Bindings : Text Key Bindings : Indent Friendly Delete Backwards
If the delete key is mapped to this entry change it to plain Delete Backwards.
2.
In that same preference area, you can see that there is no delete line option to map ^k to.
How can I make code completion case-sensitive?
I don't think that's possible.
How can I make Ctrl-k kill the content of the line and the new line character?
I can't answer that one, you might need to write a script to do it.
How can I make backspace always delete only one character, no matter what it is? Right now, it deletes spaces in chunks equal to my indent level.
Backspace always deletes one character. It sounds like your file has tab characters in it, each one of which takes up the space of 4 spaces by default. You can tell Xcode to use spaces instead by de-selecting Tab key inserts tab, not spaces in the Indentation preference panel.
How to change the indentation style in file templates? I like to have the opening brace on its own line.
You need to create custom file templates. You can find the Xcode templates here:
/Developer/Library/Xcode/Templates/File Templates
You need to copy the appropriate templates to this location:
~/Library/Application Support/Developer/Shared/Xcode/File Templates
You can then edit the template files to use whatever indents you like.
How can I make the font aliased?
You need to use a font that has aliased characters. Try Monaco at 9 or 10 points.

Resources