How to remove line highlight in Xcode? - xcode

I just upgraded to the new version of Xcode, and it now highlights the current line of where my cursor resides. I find it annoying and would like to remove it, but I can't seem to find anything that relates to this in the settings menu. Is this possible to remove?

Select Xcode > Preferences > Fonts & Color
Now click on Current Line (see the red arrow) and select the same color of the background.

Related

Show Assistant Editor missing in Xcode 11?

In Xcode 10, the toolbar had an inter-locking ring icon which showed the assistant editor, it's missing in Xcode 11.
In Xcode 10, the toolbar had an inter-locking ring icon which showed the assistant editor, it's missing in Xcode 11.
The interface has changed a little, but the functionality is still there. The top right corner of the editor pane has two buttons:
Clicking the left button, which looks like lines of text, displays the popup menu, where you can choose various editor configuration options. Clicking the right button just narrows the existing editor and adds another one next to it.
Some of the same options are also available in the Editor menu in the main menu bar.
Update: This is from the Xcode 11 beta release notes, and perhaps more fully explains why the UI was changed:
Editors can be added to any window without needing the Assistant Editor. Editors are added using the “Add Editor” button in the jump bar or the File > New > Editor command. Each editor can now be in one of three modes: “Editor Only”, “Editor and Assistant” or “Editor and Canvas”. The latter two modes automatically show relevant content when available. When using multiple editors, the View > Editor > Focus command can be used to temporarily expand the active editor to fill the entire window, hiding other editors. For source control support, the Code Review button in the Toolbar replaces the Comparison Editor. The “Show Authors” command is now available from the Source Editor’s Editor menu. The SCM Log is now in the Inspector Area. (43806898)
With multiple editors possible in a window, you need editor-specific controls for showing the ancillary views like the assistant editor, author view, etc.
From SMGreenfield's comment:
Sometimes I want to look at a different part of the same darn document. There has always been a way to do this, but it involved jumping through hoops.
Just add another editor: click the Add Editor button in the upper right corner of the editor, or choose File > New > Editor. The new editor will default to showing the same file you were working on in the existing editor.
If new editors show up on the right of the existing editor and you'd prefer them to stack vertically, you can choose View > Change Editor Orientation. If you want them to stack horizontally most of the time (the default) but just want one to show up below, choose File > New > Editor Below.
Shortcuts :
control + option + command + return : Show Assistant Editor
command + return : Show Editor only (hide Assistant Editor)
Using Editor on the Toolbar
It has moved, to show it click on icon with horizontal lines and select Assistant.
In Xcode 11 we now have multiple editor panes. You can summon a second pane, a third pane, as many as you like.
When you have a second pane, it does not have to be an automatic assistant. In other words, the editor pane itself either is an assistant or it is not. So if it is not, it is manual. And if it is, it is automatic.
To toggle between being an assistant and being an ordinary pane, choose Assistant from the Editor menu:
If Assistant is checked, this is an assistant and is automatic. What it displays depends automatically on some other pane.
If Assistant is unchecked, this is an ordinary editor pane and is manual. You can display anything you like in this editor.
In case you can't use Add Editor button just use shortcut:
Cmd + Ctrl + Shift + Enter
Turn Assistant on by navigating to the following in Xcode 11:-
Xcode > Editor > Assistant
For Xcode 11.2.1
command + option + return
or
Main Menu -> Editor -> Line View
it is worth noting, that you can also open the assistant editor by alt-clicking the file

Increasing fonts in Netbeans 8.2

I have a problem with increasing fonts in Netbeans 8.2. I tried to use screenshot form editor .but Im not able to find Fonts & Colors option in tools or menu.
I also tried to press down Alt+z and scroll up or down (mouse wheel) and also use command + but nothing happens.
With third one --fontsize (I have no idea where I should put it...). Could you help me with making fonts a bit bigger?:)
I just solved problem:) On Mac settings are in a different place:preferences in Netbeans
fonts a color changing. Netbeans
You have to go to the left up corner, near to the apple mark, there you have NetBeans preferences. After clicking on Netbeans preferences just search for 'font' and here is font size changing option.:)
edit: And if you didnt start a project, you need to create a new project on Netbeans then Fonts&Colors section will be available in options menu.
I think you are a mac user.
You need to look at this for config file location.
http://wiki.netbeans.org/FaqNetbeansConf
And I also found this. Try this one too.
1.Use Command + , to open the options
2.Select Fonts & Colors tab
3.Click the button in the Font section (button is next to the Font textbox)
4.Change the Font, style and size as needed
In Mac
simply click on the netbeans (upper left corner)
then-> preferences...
a new window will be open and select the font&color Tab
then on right side there will be a font option then click on the "..." option
and then change according to your wish

Xcode Line Wrapping setting doesn't work

I'm trying to disable line wrap in Xcode 4.3.2 (4E2002), but the setting doesn't seem to work. I seriously HATE line wrapping and it makes me super-unproductive. I've always had it turned off before, but since the latest XCode-update, it is enabled regardless of setting.
Is this an Xcode bug?
This is my settings dialog:
This comes by some files you have set Wrap line in Show the File inspector.
Please choose a file. View -> Utilities -> Show File inspector then deselect Wrap lines in Text Settings section.
I had >ONE< file out of two dozen that was wrapping it's text in the XCode editor. Although I don't know how/why the file got into this state, I figured out what it was and how to fix it.
If you show the XCode right-hand Utilities pane, and select the Document icon at the top left, you'll see a variety of settings relevant to that one file, including it's name, type, and location. Below that are some "Text Settings" values, including a checkbox for "Wrap lines". If that box is checked, it overrides the XCode preference and wraps the lines.
This picture shows the XCode editor areas, in case you are confused: XCode Editor Areas

Xcode 4 shortcut for swapping focus between editor and assistant editor

In Xcode, I am big fan of the assitant editor that shows me the corresponding .h or .m for the file that I am editing.
Is there a shortcut that allows me to swap focus between this two windows? I frequently switch between the two and using the mouse every time is annoying.
New answer:
Move Focus To Editor — commandj followed by ←/↑/↓/→ and return
This goes nicely together with commandshiftj which is Reveal in Project Navigator.
Old answer:
Use optioncommand` keyboard shortcut.
It can be remapped in Preferences - Keyboard Bindings - Move Focus To Next Area.
Edit: Removed XVim recommendation.
#Oneiros: Not quite what the OP was asking for..
I don't know of a 'short' shortcut but there's Cmd-J showing a popup where you can choose what to focus.
I made this to help answer another question... Does it help?
Xcode 8+
This is the easiest option:
^` - Move Focus to Next Editor
When using multiple assistant editors, ⇧^` moves focus to previous editor.
Xcode 4+
⌥⌘` - Move Focus to Next Area
⇧⌥⌘` - Move Focus to Previous Area
Using this option you can switch between Project Navigator (left pane), Primary Editor, Assistant Editors, Utility Area (right pane), Debug Area, etc.
⌘J - Move Focus to Editor...
Using this option you can choose where to move the focus using graphical navigation chooser.
For Xcode 4.4:
Use Cmd+Option+` (left to number 1) to Move Focus to Next Area, and use Cmd+Option+Shift+` to Move Focus to Previous Area
For Xcode 4.3:
If you only have the Editor and Assistant open, use Cmd+Option+. to switch between them (Navigator>Move Focus to next area)
Also, if you want to open a different file in the right pane, like the .xib or any other, press
Command ⌘shift ⇧o
The open quickly window will appear, search the file, use capital letters to filter through camel case notation, then press
Alt ⌥enter ↵
The file will be opened in the assistant window
Switching between .h and .m:
Control ^Command ⌘Up Arrow ↑
You can do this:
Assume you have Standart(S) and Assistance(A) editor opened and you want swap them.
1) Double tap with holded Alt to line in navigation bar of S editor with file name (look screenshot). This file will open in A editor.
2) In A editor tap Go Back and do 1. File from A editor will be opened in S editor.
3) In A editor tap Go Forward.
DONE!

Fix code indentation in Xcode

Once I start editing my code and adding for loops or if then statements my code indentation is whacked because the previous code maintains its former indentation instead of adjusting automatically.
In Visual Studio you can highlight code and select 'format selection' to fix these issues - is there anything similar in Xcode?
Before Xcode 9 (for Xcode 9 see default shortcut below)
select text
right-click
there's a "Re-indent selection" item in popup menu
In XCode 4 there is one more step:
select text
right-click
Click on "Structure"
there's a "Re-indent selection" and other options in popup menu
Or using the default shortcut:
select text
press ctrl + i
select text
press Control-I (the default keyboard shortcut)
You can do this automatically in Xcode 11
In Xcode 4.6.3, choose Editor > Structure > Re-Indent.
Shortcut: Control + I
(that's 'i', for 'indent')
This works on current selection. If no text selected, choose Edit > Select All (⌘+A) and then perform the re-indent.
(I'm more clearly restating the other answers)
These solutions re-indent text to the default xCode behaviors. To change these behaviors, go to xCode (v.4) > Preferences > Text Editing. Then to Indentation Tab.
Xcode 9.2:
You can select text and press ctrl + i to re-indent code.
You can do it in different ways, but these two are the easiest
select text ( ⌘ +a) :
Using shortcut -> (control)^ + i
Click on "Editor" -> Click on "Structure" -> Click on "Re-indent"
Sometimes setting Xcode global preferences is not enough for ^ + i to do its job accordingly. The reason is that project settings override global ones. You can set indentations for a concrete project or even a file.
Select project (or file) in the Navigation Pane. Then in File Inspector go to Text Settings section and set desired number of tabs or spaces for indents.
To quickly re-indent the whole file:
⌘+a
⌘+x
⌘+v
Edit: No longer working in Xcode 11
You can try my extension Swimat
https://github.com/Jintin/Swimat
It support format on selection.
Simple install by brew cask install swimat

Resources