Skip to content

Instantly share code, notes, and snippets.

@dmnc-net
Last active March 23, 2021 15:43
Show Gist options
  • Save dmnc-net/ac98e8b19127b4e5a4636278a9257158 to your computer and use it in GitHub Desktop.
Save dmnc-net/ac98e8b19127b4e5a4636278a9257158 to your computer and use it in GitHub Desktop.
WSL cheat sheet

Windows Subsystem for Linux (WSL)

WSL preparation

Run as Administrator:

  1. dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
  2. dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all

After restart:

  1. Install the Linux kernel update package (https://aka.ms/wsl2kernel)
  2. wsl --set-default-version 2

Linux Distribution

Terminal

// =========================
// Windows Terminal settings
// =========================
{
// Set default profile guid from "list" section
"defaultProfile" : "{...}",
// replace this option:
"copyOnSelect" : true,
// List - tuning:
// "fontSize" : 9,
// Replace the default keybindings section with the customized one:
"keybindings":
[
{ "command" : "newTab", "keys" : ["ctrl+t"]},
{ "command" : "closeTab", "keys" : ["ctrl+w"]},
{ "command" : "scrollUpPage", "keys" : "shift+pgup" },
{ "command" : "scrollDownPage", "keys" : "shift+pgdown" },
{ "command" : { "action" : "copy", "singleLine" : false }, "keys" : "ctrl+insert" },
{ "command" : "paste", "keys" : "shift+insert" },
{ "command" : "none", "keys" : "alt+enter" },
// Press Ctrl+Shift+F to open the search box
{ "command" : "find", "keys": "ctrl+shift+f" },
// Press Alt+Shift+D to open a new pane.
// - "split": "auto" makes this pane open in the direction that provides the most surface area.
// - "splitMode": "duplicate" makes the new pane use the focused pane's profile.
// To learn more about panes, visit https://aka.ms/terminal-panes
{ "command" : { "action": "splitPane", "split": "auto", "splitMode": "duplicate" }, "keys": "alt+shift+d" }
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment