How to set margins when printing Xcode source code? - xcode

screen print
I cannot determine how to set margins when printing Xcode source. Xcode sets a good top margin but prints to the absolute bottom of the page. The printer then drops the last line when printing. One would think the presets in the Print popup would have a margin setting but I am missing it if it exists.
Any thoughts?

Related

Text width does not adjust for console width and code is not visible anymore in Spyder4

I just downloaded Spyder 4. The IDE's look and feel are nice.
However, there is one thing that I don't like about it. When adjusting the width of the right-side panel (variable explorer and the console), the code in my text editor on the left doesn't adjust accordingly.
This causes my code to not be visible anymore whenever the right side is pulled over it (my picture below makes it clearer what I mean).
Is there a setting in Python to change this?

VS Code - Hide file path in debug console

In VS Code's debug console, how can I hide the long file path at the right of every line?
As a temporary solution you can disable "words wrap" in
console settings.
This adds horizontal scrollbar in debugger console.
See the issue https://github.com/microsoft/vscode/issues/115625 (Hide or shorten path in Debug Console) which has been implemented and is in the Insiders' Build v1.54.
It shortens the file but does not hide it. In my testing this
c:\Users\Mark\AppData\Local\Programs\Microsoft VS Code\resources\app\out\bootstrap-fork.js
was shortened to
...Code Insiders\resources\app\out\bootstrap-fork.js:5
It doesn't appear to be configurable in any way but is a welcome improvement IMO.
Following up on #rioV8's suggestion here is the themeable reference to those source file paths:
"workbench.colorCustomizations": {
"debugConsole.sourceForeground": "#0000"
}
The last digit of that hex color is opacity. Even if you set the opacity to 0, you can still hover and see the file name and click on it as if it was shown.
But switching off the opacity will have no effect on where your debug values break or wrap into the next line. That wrap still operates as if the source file name was fully visible - which may have been your biggest concern.

How to make VSCode editor stop scrolling past bottom of a file?

In the VSCode editor when you pull the scroll bar down to the bottom of the file, all you see is a blank page, since the text has scrolled up past the top of the text editor window. This makes scrolling to the bottom difficult because you can't just pull the scroll bar quickly all the way down but have to carefully position the cursor so you can still see your code.
Very similar to How to make Visual Studio editor stop scrolling past bottom of a file?, but comments have pointed out that question/answer is for Visual Studio. This answer is for VSCode on the macOS and Windows.
The correct answer is seen here: https://stackoverflow.com/a/40588828/1189470
There is a configuration option provided in VSCode for the functionality you specified. To enable it, go to File -> Preferences -> user settings
On the right side of the editor in settings.json paste the below line at the bottom (before closing bracket), save and close.
"editor.scrollBeyondLastLine": false
This will prevent the editor from scrolling beyond the last line.
This is now exposed as a simple checkbox labeled "Editor: Scroll Beyond Last Line" in File/Apple -> Preferences.
If just for readability you would like some space at the bottom of the file - a configurable amount - try this setting as of v1.43:
editor.padding.bottom in pixels
Editor> Padding: Bottom
Controls the amount of space between the bottom edge of the editor and
the last line.
and/or
editor.padding.top // but this isn't sticky in the sense that you can scroll right past the padding top and it is gone. It doesn't stay.

How to resize column width in RStudio source pane?

Can anyone tell me how to resize a column in the source pane of RStudio? I tried renaming the second column from "n" to "Total number" but it just wraps the header text.
Screen grab of problem
Edit: Earlier screen grab did not, in fact, show the problem. This does.

Line height in Xcode

How do I increase the distance between the lines in Xcode?
I mean in the actual code.
Even when I change the font and font sizes in the Xcode preferences, the code lines are still too close together and it is very annoying.
Also check out the Meslo font; an open source customized version of Menlo that comes with much nicer line-spacing.
Prior to Xcode 9, there was no way to change line height. However, now in Xcode 9 the option is available under Xcode>Preferences...>Fonts & Colors at the bottom there is a popup that has the options of "Tight Spacing", "Normal Spacing", and "Relaxed Spacing".
Since Xcode 9 you can open your theme file and specify the desired line spacing through the property DVTLineSpacing. Example for 1.5 line spacing:
<key>DVTLineSpacing</key>
<real>1.5</real>
Try using the free, open source Droid Mono font.
It has more line spacing build into the font itself.
The tight line spacing in XCode 4 was driving me crazy too!
Create a custom font with whitespace on the top and bottom of the glyphs, install it and set is as the editing font in Xcode.
Read this:
http://hivelogic.com/articles/top-10-programming-fonts
and download your favorite font and decompress it. After that, open Mac's TextEdit and Format-->Font-->Show Fonts-->click the setting in the left corner beside "+-" -->Manage Fonts-->Click "+" to add the font you just downloaded.
Now you've successfully added a font in your Mac, and you can choose this font in your Xcode preference. The line height of the new font is changed.
Edit the DVTLineSpacing property in the .xccolortheme file to change the line height.
Open any .xcolortheme file from ~/Library/Developer/Xcode/UserData/FontAndColorThemes
Edit the DVTLineSpacing key. If there isn't one, add this to the file, replacing 1.8 with the line spacing you want:
<key>DVTLineSpacing</key>
<real>1.4</real>
Close and re-open Xcode
By default Xcode uses 1 for tight spacing, no key for regular spacing, and 1.2 for relaxed spacing.
Tested with Xcode 12.2 and Mac OS 10.15.

Resources