Xcode 4.5 - trailing whitespace - xcode4.5

Latest release of Xcode (4.5) is supposed to strip trailing whitespace from source files.
But when I save a file with some spaces at the end of a line they're still there.
What am I missing?

OK, here's what the problem was.
Xcode will not trim trailing white space if you add a white space at the end of the line, leave the cursor at the end of that line and then save it.
You need to move your cursor off that line and then save it.
May be some conflict between saving the position of the cursor whilst simultaneously trimming the whitespace perhaps?

Yes, committing Xcode edited code shows trailing white-spaces in Git. Going into Xcode preferences > Text Editing : Editing (tab), you have option to include whitespaces-only lines.
Worth to mention my current Xcode version v5.1.
Now, what about code that already uploaded in git which complaints about whitespaces?
Well, find in your editor for 4 spaces (By default in Xcode preferences > Text Editing > Indentation, indent set with 4 spaces which also can be changed ); and replace with empty string manually for those without any code in the line. You may further copy paste code in other editor (for eg TextWrangler) to see if any empty line left with 4 spaces only. "Cmd + G" is short key to "find next", helps while iterating.

Starting from Xcode 4.4 whitespaces will be trimmed automatically (default). I recommend also to activate Including whitespace-only lines.
Go to Xcode > Preferences > Text Editing > While editing

Related

How do I disable the colored highlighting left of the line numbers in the Bracket Editor? What is it called/for?

See below for a screenshot of my brackets editor in a css file.
I see the colored highlighting for all file types. I am not sure what to call it.
I have been downloading extensions lately so it could be one of them but not sure what its called and thus can't search online for how to disable it.
Those colored marks are the "gutter marks" from the Brackets Git extension. They indicate added (green), modified (yellow/orange), or deleted (red) lines in the current file.
Personally, I find them very helpful. In case you still want to turn them off, go to the Git Settings and check the box for "Use Git gutter marks".

Atom is changing my whitespace against my will - how do I stop it?

Every time I diff a change from a file I've edited, I see things like this change (where a tab has been removed automagically):
Where is the setting to stop this from happening?
In Atom's settings, go to the Packages section and search for whitespace.
The whitespace package will do the following by default:
Remove trailing whitespace at the end of a line
Ensure the file contains a trailing newline
You can change the behavior you are seeing in one of two ways.
Uncheck the "Remove Trailing Whitespace" option. That will prevent trailing whitespace from being removed on any line.
Check the "Ignore Whitespace Only Lines" option. If you only care about this behavior when the line is otherwise empty, then this option would serve you better.
For reference: whitespace on atom.io
Disable the whitespace package entirely. Worked for me.

How could I remove text inside quotes in atom editor?

I came from vim. Its biggest win is commands like ci< when <this text is removed if cursor is placed inside angle brackets>
How can I do that in hackable editor for the XXI century?
You can do this using the vim-mode-plus plugin. It natively supports your example, and many other text-object style commands taken straight from Vim, e.g. all of these would work as well:
di<
da<
ca<
And it should work with ', ", (, and other delimiters, just like Vim.
There is a function that comes with the editor named bracket-matcher:select-inside-brackets that highlight everything inside the bracket (but not the bracket itself). You may then press backspace or delete button to remove the content, or any other button to replace the content. For windows, the default key combination is ctrl-alt-m.
If you are not using windows, or you may have accidentally overwritten the settings, you may open Setting > Keybindings and search bracket-matcher:select-inside-brackets. It should tell you what is the correct key combination.

Drag and drop text in Brackets

How can I enable the ability to drag-and-drop text in Adobe Brackets?
For example, when I select text and drag it in Sublime Text, it moves. How can I do the same in Bracket?
You're looking for the dragDropText setting.
To enable it, insert this line into your preferences file:
"dragDropText": true
(Note: You may need to reload Brackets for the changes to take effect)
VoilĂ ! Drag-and-drop that text! :)
Happy coding!
1- go to menu-->Debug
2- go to "open Preferences File"
3- go to the file : "brackets.json"
4- copy and pase these codes on last line and dont forget separate last code with this by ",":
"dragDropText": true
*HOPE TO HELP :))

Atom editor indent size spaces?

I am using OSX El Capitan and Atom 1.2.4. And I also have installed "tabs-to-spaces" package.
I am trying to setup the editor to indent and make the tab be 2 spaces. But I am not able to make this work, here is my setup
Thank you
This is funny. I also like using 2 spaces and was struggling with the described behaviour. When I put the following lines into config:
".python.source":
editor:
tabLength: 2
(Main Menu -> Atom -> Config...)
Atom starts using 2 spaces in my python code. But if try to change settings in language-python package, those lines simply disappear and 4 spaces indentation is back. Thankfully all other settings seem to not reset this, so if you don't mess with language-python settings page, everything should be fine.
I answer my own question because could be useful for someone else.
Atom and the plugin are working, and are indenting 2 spaces.
But as I was writing Python code, the suggestion PEP8 is 4 spaces. Seems Atom is forcing 4 spaces.

Resources