windows terminal

windows terminal是微软推出的终端工具,快速的受到广大程序员的欢迎。 安装方法,使用微软最新推出的命令行软件包管理器winget安装:

winget install Microsoft.WindowsTerminalPreview

我使用的是最新的Windows terminal preview 1.2版。

把我的windows terminal配置分享一下。尤其是快捷键的部分,能让你更便捷的操作windows terminal。


// This file was initially generated by Windows Terminal Preview 1.1.1671.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
  "$schema": "https://aka.ms/terminal-profiles-schema",
  "defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
  //关闭所有标签时不确认。
  "confirmCloseAllTabs": false,
  // You can add more global application settings here.
  // To learn more about global settings, visit https://aka.ms/terminal-global-settings
  // If enabled, selections are automatically copied to your clipboard.
  // 选择文本自动拷贝到剪贴板
  "copyOnSelect": true,
  // If enabled, formatted data is also copied to your clipboard
  "copyFormatting": false,
  // A profile specifies a command to execute paired with information about how it should look and feel.
  // Each one of them will appear in the 'New Tab' dropdown,
  //   and can be invoked from the commandline with `wt.exe -p xxx`
  // To learn more about profiles, visit https://aka.ms/terminal-profile-settings
  "profiles": {
    "defaults": {
      // Put settings here that you want to apply to all profiles.
    },
    "list": [
      {
        // Make changes here to the powershell.exe profile.
        "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
        "name": "Windows PowerShell",
        "commandline": "powershell.exe",
        "hidden": false
      },
      {
        // Make changes here to the cmd.exe profile.
        "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
        "name": "Command Prompt",
        "commandline": "cmd.exe",
        "colorScheme": "Solarized Dark",
        "fontFace": "Cascadia Code",
        "hidden": false
      },
      {
        "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
        "hidden": true,
        "name": "Azure Cloud Shell",
        "source": "Windows.Terminal.Azure"
      },
      {
        "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
        "hidden": false,
        "name": "PowerShell",
        "colorScheme": "Tango Dark",
        "source": "Windows.Terminal.PowershellCore"
      },
      {
        "guid": "{865e9613-3388-59ff-acd9-e47bac92f614}",
        "hidden": false,
        "name": "Ubuntu20",
        "source": "Windows.Terminal.Wsl"
      }
    ]
  },
  // Add custom color schemes to this array.
  
  // To learn more about color schemes, visit https://aka.ms/terminal-color-schemes
  "schemes": [],
  // Add custom keybindings to this array.
  // To unbind a key combination from your defaults.json, set the command to "unbound".
  // To learn more about keybindings, visit https://aka.ms/terminal-keybindings
  "keybindings": [
    // Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json.
    // These two lines additionally bind them to Ctrl+C and Ctrl+V.
    // To learn more about selection, visit https://aka.ms/terminal-selection
    // Ctrl+c 拷贝
    {
      "command": {
        "action": "copy",
        "singleLine": false
      },
      "keys": "ctrl+c"
    },
    // Ctrl+v 粘贴 
    {
      "command": "paste",
      "keys": "ctrl+v"
    },
    // Press Ctrl+h to open the search box
    {
      "command": "find",
      "keys": "ctrl+h"
    },
    //Ctrl+f4 关闭窗格
    {
      "command": "closePane",
      "keys": "ctrl+f4"
    },
    //Alt+f4 关闭窗口,退出windows terminal
    {
      "command": "closeWindow",
      "keys": "alt+f4"
    },
    //Ctrl+1 切换到第一个标签
    {
      "command": {
        "action": "switchToTab",
        "index": 0
      },
      "keys": "ctrl+1"
    },
    {
      "command": {
        "action": "switchToTab",
        "index": 1
      },
      "keys": "ctrl+2"
    },
    {
      "command": {
        "action": "switchToTab",
        "index": 2
      },
      "keys": "ctrl+3"
    },
    {
      "command": {
        "action": "switchToTab",
        "index": 3
      },
      "keys": "ctrl+4"
    },
    {
      "command": {
        "action": "switchToTab",
        "index": 4
      },
      "keys": "ctrl+5"
    },
    {
      "command": {
        "action": "switchToTab",
        "index": 5
      },
      "keys": "ctrl+6"
    },
    {
      "command": {
        "action": "switchToTab",
        "index": 6
      },
      "keys": "ctrl+7"
    },
    {
      "command": {
        "action": "switchToTab",
        "index": 7
      },
      "keys": "ctrl+8"
    },
    {
      "command": {
        "action": "switchToTab",
        "index": 8
      },
      "keys": "ctrl+9"
    },
    //Ctrl+down 将光标移动到窗口中相邻下方的窗格
    {
      "command": {
        "action": "moveFocus",
        "direction": "down"
      },
      "keys": "ctrl+down"
    },
    {
      "command": {
        "action": "moveFocus",
        "direction": "left"
      },
      "keys": "ctrl+left"
    },
    {
      "command": {
        "action": "moveFocus",
        "direction": "right"
      },
      "keys": "ctrl+right"
    },
    {
      "command": {
        "action": "moveFocus",
        "direction": "up"
      },
      "keys": "ctrl+up"
    },
    //Ctrl+e 整个窗口内容向下滚动一行
    {
      "command": "scrollDown",
      "keys": "ctrl+e"
    },
    //Ctrl+f 整个窗口内容向下滚动一页
    {
      "command": "scrollDownPage",
      "keys": "ctrl+f"
    },
    {
      "command": "scrollUp",
      "keys": "ctrl+u"
    },
    {
      "command": "scrollUpPage",
      "keys": "ctrl+b"
    },
    //{
    //  "command": {
    //    "action": "splitPane",
    //    "split": "vertical"
    //  },
    //  "keys": "ctrl+w"
    //},
    //Ctrl+w 右侧新建一个和左侧内容一样的shell窗格。
    {
      "command": {
        "action": "splitPane",
        "split": "auto",
        "splitMode": "duplicate"
      },
      "keys": "ctrl+w"
    },
     //shift+f11切换窗口隐藏标题栏
    {
      "command": "toggleFocusMode",
      "keys": "shift+f11"
    },
     //shift+f12切换窗口总是置顶
    {
      "command": "toggleAlwaysOnTop",
      "keys": "shift+f12"
    },
    {
      "command": {
        "action": "renameTab",
        "title": "Foo"
      },
      "keys": "shift+f2"
    },
     //Ctrl+shift+p 打开命令输入栏,可以输入英文命令,还可以看到所有命令的快捷键映射
    {
      "command": "commandPalette",
      "keys": "ctrl+shift+p"
    },
    {}
  ]
}
Posted 2020-08-06