R Notebook in fullscreen mode - rstudio

I'm trying to enlarge the window of a R notebook, but it seems that the maximum size is half of the sceen. Is it possible to write in a R notebook in fullscreen mode?
EDIT: I'm referring to the window on the left side.

You can add some css to your Rmd-file to overwrite the width constrained of R Notebook preview:
---
title: "R Notebook"
output: html_notebook
---
<style>
.main-container {
max-width: 100% !important;
}
</style>
This is an [R Markdown](http://rmarkdown.rstudio.com) Notebook. When you execute code within the notebook, the results appear beneath the code.
Try executing this chunk by clicking the *Run* button within the chunk or by placing your cursor inside it and pressing *Ctrl+Shift+Enter*.
You can make the source code window of RStudio editor full screen by clicking on View > Panes > Zoom Source

Related

Maximize terminal in VSCode when in side panel

In previous versions of VSCode there was an arrow icon at the top of the panel that could be used to maximize the panel, for instance the terminal. I do not know exactly in which version but that button is now gone and I'm unable to find an equivalent.
My question is: how can I maximize the terminal so it takes the whole VSCode window? Is there any way to get the button back?
Which version of VSCode are you using, and in which OS?
On Mac, and with 1.65.2 (the most recent update by now), I have it in the right corner, near the X button:
Shortcuts
Now talking about shortcuts to make your life easier, there are 2 you should be aware of.
PS: Remember that to change any shortcuts, just go over VSCode Command Palette and type Keyboard Shortcuts to change them.
Maximise panel size
There are no default shortcuts for those, in both Windows and Mac.
If you want to set any, the name of the shortcut is View: Toggle Maximized Panel:
Increasing / decreasing terminal size
Now talking shortcuts, if you want to resize your terminal window, in Mac there's a native shortcut that allows to increase / decrease terminal size with Cmd + Ctrl + Arrow Up / Arrow Down.
There's no default for Windows.
If you want to set / change those shortcuts, they are called Terminal: Resize Terminal Down and Terminal: Resize Terminal Up:
Terminal panel on the side
If you added your panel to either left or right, then the mark to make it fullscreen changes.
After clicking on the arrow below, it'll hide all your files and make the terminal to run in the whole screen for VSCode:
I also got the arrow disappeared, but i manage to bring it back by with command:workbench.action.alignPanelCenter
But i don't know i un align it in the first place
So maybe it will work with you
To get the maximize arrow on the left panel...
Left-click the bottom panel, then choose Move Panel Left
To get the maximize arrow on the bottom panel...
First, press the Customize Layout button
And select Center Panel Alignment
Then move the panel back to the bottom.
Panel can be maximized when centered.
Example: If panel is not centered and the Maximize button is missing you also cannot use the command by hitting
Shift-Ctrl-P View: Toggle Maximize Panel
Fix: run these commands (press Shift-Ctrl-P then begin typing)
First command will enable the maximize button
View: Set Panel alignment to Center
Second command will now work to Maximize (or just press the button that shows up now)
View: Toggle Maximize Panel
Blue and skube have the right answer to the original question. I cannot comment so summarize an answer using commands that can be pasted to verify.

Is there a way to remove this vertical line in the R script background (R Studio 2020 version)

There is a vertical line that shows up automatically in the background of my blank R script - I have just downloaded the latest version of RStudio 2020. Any way to get a clear white view of the script without the line? thanks.
This is a "margin" which shows you when code gets to a certain width. Lots of people/standards choose to limit code width so that it's easier to read on the screen and if you decide to print it it won't overflow to the next line. To disable in Rstudio (at least my version of Rstudio...) in the top toolbar:
Tools -> Global Options -> Code (located in the sidebar) then choose the Display tab and uncheck the Show margin option.

Zoom only Text in Visual Studio Code

Is there a way to make Vs-code on Mac only zoom the text/file pane of the window? When I hit Command ⌘+ to zoom, it'll zoom all of the window, ie. also the icons on the left hand side and the file pane on the left as well.
Compare these two screen shots, maybe ;)
Vs-code window, normal
Vs-code window, zoomed in
I'd only like the source file (nfsd.sh in the screen shot) to be zoomed.
Answered in https://stackoverflow.com/a/41684631/5295392:
Out of Box solution for zoom in/out for text only:
Ctrl + Shift + P
Type (Open User Settings)
Search (Edit settings.json)
Add "editor.mouseWheelZoom": true
Save it.
You can use your mouse wheel to zoom in or zoom out only text in the text box.
Open your settings.json file and increase editor.fontSize to increase the size of the text on the source file.
Ctrl + Shift + P
Search 'Zoom'
Pick "Editor Font Zoom In"
Repeat till you get what you want.
On Mac, while pressing the command key, slide two fingers upward to zoom out. Slide downward to zoom in.

Change columns size in Firefox Developer Tools

Is it possible to change columns width in Firefox Developer Tools? How can I do it?
When I point over column edge (like Status, etc. on the screenshot) there's no resize tool so I can see whole content.
Update: This feature is now available and enabled by default in Firefox 67. You can disable it (are you crazy?) using devtools.netmonitor.features.resizeColumns flag.
Original answer: As you probably know there is no option to change the column(s) size (as of FF57), the only option you have is hide/show columns. it's easy to do, just right-click on any column, you should see the list of columns and can select/un-select them.
But that's it?! no, you can change the column(s) size using CSS (hack the dev tools), here is the steps:
Open up the dev tools (using F12 or ...)
Click on the gear button, up right corner Go to Settings, shortcut: F1
Check this 2 options:
Enable browser chrome and add-on debugging toolboxes
Enable remote debugging
Hit Ctrl+Shift+Alt+I and Click OK (on security prompt) to open Browser Toolbox
You should be able to inspect the Dev tools using opened Browser Toolbox
Play with CSS (same as you do with normal web page)
Save your custom CSS in userChrome.css file
Need more info about userChrome.css, head to userchrome.org
Here is steps to create/modify userChrome.css:
Open up about:support
Click on Open Folder (in Profile Folder row)
Open/Create chrome directory
Open/Create userChrome.css file
Do what I said in first section
To demonstrate how it works, I change the background color of one of Network tab's columns to red.
And here is my userChrome.css file content (for above example)
.requests-list-file.requests-list-column {
background-color: red !important;
color: #fff !important;
}
I used !important just for time's sake, don't use of that if you can
While there seems to be some recent progress on the feature request and its dependency, the latter was created in 2016 so it's fairly safe to assume it could be a while yet before Firefox supports column resizing by default.
In the meantime, here's the CSS I've added to my userChrome.css:
.requests-list-header-button {
padding-inline-start: 0px !important;
padding-inline-end: 0px !important;
}
.requests-list-method {
min-width: 30px !important;
}
.requests-list-status {
min-width: 40px !important;
}
.requests-list-file {
min-width: 100px !important;
}
I wanted to enlarge the File column, but found that reducing the width of the Status and Method columns instead made a big improvement alone. The styles also remove side padding from the column headers to avoid the text being truncated with ….
These are the classes for the default columns:
requests-list-status
requests-list-method
requests-list-file
requests-list-domain
requests-list-cause
requests-list-type
requests-list-transferred
requests-list-size
requests-list-waterfall
Note that if you reduce column widths too much, it may throw off the alignment. See Mehdi's answer if you don't know where to save your userChrome.css or you need to find classes of other columns.

Windows 10 CMD/Powershell Buffer adjusts only when enlarging the console window; not when shrinking. Fix?

I have a seemingly simple question, but my google-fu is failing me:
I have started using CMD / Powershell more in my workflow recently, for a myriad of things including VIM, compiling, and Bash (Window's Ubuntu Subsystem). These all run in window's shell interface (if that is the right term for it? As distinct from Console 2/ConEmu, which are just wrappers around the shell and don't change its behavior).
Here's my problem:
When adjusting the shell window size larger, the buffer resizes to fit it.
However, when readjusting the window size to be smaller, the buffer stays large and scroll bars appear, and I have to use the scroll bars to view my entire window.
I don't want the latter half of this behavior, as it causes problems with programs like VIM, and is just annoying.
I actually like legacy console behavior in windows 10, as though it cannot be dynamically resized, it can be minimized or maximized and the buffer resizes along with both actions. However, I cannot simply enable this option as some things such as Bash require the modern windows 10 console and won't run in legacy mode.
Are there any other ways to have the buffer resize correctly along with the size of the window for either CMD or Powershell, or alternatively, to run Powershell with different settings than CMD (so I could have legacy console enabled in one, and not in the other -- they seem to share the same settings currently).
Additionally, if there are any alternative fixes or console shells that might solve this, feel free to suggest these as well! I've tried Mintty, and it's almost perfect, but messes up my register/clipboard settings in vim.
As you've discovered, switching to the legacy console on Windows 10 (via a console shortcut's Properties dialog, tab Options, checkbox Use legacy console (requires relaunch) is, unfortunately, a global setting (affects all future console windows, irrespective of the shell run in them).
Windows 10's new console, always sets the buffer width to the window width when you resize with the mouse, avoiding the need for horizontal scrolling (whereas the legacy console retains the original, larger buffer width when you make a window narrower with the mouse, at which point a horizontal scrollbar appears; as an aside: the legacy console doesn't allow making a window wider using the mouse).
If a shortcut file of yours doesn't behave that way while not in legacy mode, recreate the shortcut file.
Note: The terms legacy and new console above refer to modes of the legacy conhost.exe-based console windows overall, as distinct from their modern successor, Windows Terminal.
Therefore, the remaining part of this answer is only of interest, if any of the following apply:
you're using the legacy console - either because you've opted to do so on Windows 10 or because you're running on Windows 8.1 or below - and want a simple command to fix the horizontal scrolling issue.
you want to modify the startup dimensions of your console window by way of shortcut files.
you're interested in a script that programmatically resizes a console window.
There's no simple UI fix to avoid the horizontal scrolling when you narrow a window using the mouse - short of using the window's system menu's Properties dialog to make the buffer width match the window with, but that's cumbersome.
Here is a command you can run after mouse-based resizing to fix the horizontal scrolling issue:
PowerShell:
[console]::BufferWidth = [console]::WindowWidth
So you don't have to type this every time, put it in a function, say, fixwin, and add it to your $PROFILE (initialization script):
function fixwin { [console]::BufferWidth = [console]::WindowWidth }
cmd.exe:
Using mode is not an option, because it would set your buffer height to the window height as well, so you'd lose your scroll-back buffer - see this answer.
You, can, however, call the above PowerShell command ad-hoc, using a DOSKEY macro:
doskey fixwin=powershell -noprofile -command "[console]::bufferwidth = [console]::windowwidth"
So you don't have to define the macro in every session, save the command to a batch file, say, .cmdrc.cmd in folder %USERPROFILE%, then modify the shortcut file that you use to start cmd.exe as follows:
Open the shortcut file's Properties dialog (via the shortcut menu, by right-clicking; for a taskbar item, right-click for the taskbar-related shortcut menu, then right-click the second to last item representing the underlying shortcut file).
In the Shortcut tab, replace the existing content of text box Target with the following:
%windir%\system32\cmd.exe /k "%USERPROFILE%\.cmdrc.cmd"
As an alternative to resizing a window after the fact, you can use a shortcut file to launch a console with preconfigured dimensions, which works with both the legacy and the new consoles:
Create a shortcut file pointing to the executable of interest (cmd.exe or powershell.exe).
Launch the shortcut.
Use the window's system menu's Properties dialog to set the desired window and buffer dimensions.
The next time you launch that shortcut file, the previously configured dimensions should take effect again.
To also remember the window position, position the window as desired, open the system menu's Properties dialog (again), uncheck Let system position window, and click OK.
cmd.exe / PowerShell script for fixing the buffer-width issue and/or programmatically resizing the window:
If you follow the instructions below, you'll be able to:
Simply execute rw (for resize window) after having used the mouse to narrow the window, so as to make the buffer width the same as the window width.
Alternatively, call rw <new-width> [<new-height>] to resize your window programmatically, which also sets the buffer width to the window width.
Instructions:
Pick or add a directory in your %PATH% in which to place the scripts below.
Create wrapper batch file rw.cmd with the following content:
#powershell.exe -executionpolicy unrestricted -noprofile -file "%~dpn0.ps1" %*
Create PowerShell script rw.ps1 with the following content (ignore the broken syntax-highlighting):
<#
.SYNOPSIS
Resizes the console window.
.DESCRIPTION
Resizes the current console window to the specified width (in columns)
and/or height (in lines.
Note that the window position doesn't change; i.e., the top-left corner of
the window remains in place, and the width / height expands or shrinks.
To only change the width, specify a single value; e.g.: 120
To only change the height, specify 0 for the width; e.g.: 0 60
Specify neither if you don't want to resize, but want to ensure that the
buffer width is set to the same value as the window width, so as to avoid
the need for horizontal scrolling.
This is convenient after having resized the window with the mouse.
Note that specifying values that are too large causes an error.
.PARAMETER Width
The new width (in columns) to resize the current console window to.
.PARAMETER Height
The new height (in lines) to resize the current console window to.
.PARAMETER KeepBufferWidth
By default, the buffer width is always set to the resulting window width,
so as to avoid the need for horizontal scrolling.
Use this switch if you want to keep the current buffer width.
.EXAMPLE
> rw 100 50
Makes the current console window 100 columns wide, and 50 lines tall.
> rw 100
Makes the current console window 100 columns, without changing the height.
> rw 0 70
Makes the current console window 70 lines tall, without changing the width.
> rw
Doesn't perform resizing, but ensures that the buffer width equals the
window width, so as to prevent horizontal scrolling.
#>
[cmdletbinding()]
param(
[uint16] $Width,
[uint16] $Height,
[switch] $KeepBufferWidth
)
if ($width) { [console]::WindowWidth = $width }
if ($height) { [console]::WindowHeight = $height }
# Unless asked not to, always set the buffer width to the window width to
# prevent horizontal scrolling.
if (-not $KeepBufferWidth) { [console]::BufferWidth = [console]::WindowWidth }

Resources