Skip to content

My Microsoft Windows Terminal settings with vi keybindings and zen burn

I've started playing with the Microsoft Windows Terminal.

My settings.json now contains some simple VI keybindings to easy up creating of tabs and panes. Furthermore, I am a big fan of the zenburn color scheme. You can find your settings.json in the path %userprofile%\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState.

// This file was initially generated by Windows Terminal 1.0.1401.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.
// located in: `%userprofile%\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState`

// 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": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
    "defaultProfile": "{00000000-0000-0000-ba54-000000000002}",

    // 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": false,

    // 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.
            "colorScheme" : "Zenburn"
        },
        "list":
        [
        // BO: Taken from: https://stackoverflow.com/questions/56839307/adding-git-bash-to-the-new-windows-terminal#
            {
                "guid": "{00000000-0000-0000-ba54-000000000002}",
                "acrylicOpacity" : 0.75,
                "closeOnExit" : true,
                //if you have installed windows git globally for all users
                "commandline" : "\"%PROGRAMFILES%\\git\\usr\\bin\\bash.exe\" -i -l",
                //if you have installed windows git only for one user
                // "commandline" : "\"%LOCALAPPDATA%\\Programs\\Git\\bin\\bash.exe\" -i -l",
                "cursorColor" : "#FFFFFF",
                "cursorShape" : "bar",
                "fontFace" : "Consolas",
                "fontSize" : 10,
                "historySize" : 9001,
                "icon" : "%PROGRAMFILES%\\git\\mingw64\\share\\git\\git-for-windows.ico",
                "name" : "Bash",
                "padding" : "0, 0, 0, 0",
                "snapOnInput" : true,
                "startingDirectory" : "%USERPROFILE%",
                "useAcrylic" : true
            },
        // BO: Taken from: https://stackoverflow.com/questions/56839307/adding-git-bash-to-the-new-windows-terminal#
            {
                // 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",
                "hidden": false
            },
            {
                "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
                "hidden": false,
                "name": "PowerShell",
                "source": "Windows.Terminal.PowershellCore"
            },
            {
                "guid": "{58ad8b0c-3ef8-5f4d-bc6f-13e4c00f2530}",
                "hidden": false,
                "name": "Debian",
                "source": "Windows.Terminal.Wsl"
            },
            {
                "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
                "hidden": false,
                "name": "Azure Cloud Shell",
                "source": "Windows.Terminal.Azure"
            }
        ]
    },
    // Add custom color schemes to this array.
    // To learn more about color schemes, visit https://aka.ms/terminal-color-schemes
    "schemes": [
        // @see: https://github.com/agkozak/windows-terminal-zenburn
        {
            "background" : "#3A3A3A",
            "black" : "#1E2320",
            "blue" : "#506070",
            "brightBlack" : "#709080",
            "brightBlue" : "#94BFF3",
            "brightCyan" : "#93E0E3",
            "brightGreen" : "#C3BF9F",
            "brightPurple" : "#EC93D3",
            "brightRed" : "#DCA3A3",
            "brightWhite" : "#FFFFFF",
            "brightYellow" : "#F0DFAF",
            "cyan" : "#8CD0D3",
            "foreground" : "#DCDCCC",
            "green" : "#60B48A",
            "name" : "Zenburn",
            "purple" : "#DC8CC3",
            "red" : "#D78787",
            "white" : "#DCDCCC",
            "yellow" : "#DFAF8F"
        },
        {
            "background" : "#1C1C1C",
            "black" : "#1E2320",
            "blue" : "#506070",
            "brightBlack" : "#709080",
            "brightBlue" : "#94BFF3",
            "brightCyan" : "#93E0E3",
            "brightGreen" : "#C3BF9F",
            "brightPurple" : "#EC93D3",
            "brightRed" : "#DCA3A3",
            "brightWhite" : "#FFFFFF",
            "brightYellow" : "#F0DFAF",
            "cyan" : "#8CD0D3",
            "foreground" : "#DCDCCC",
            "green" : "#60B48A",
            "name" : "High-Contrast Zenburn",
            "purple" : "#DC8CC3",
            "red" : "#D78787",
            "white" : "#DCDCCC",
            "yellow" : "#DFAF8F"
        }
    ],
    // 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
        { "command": {"action": "copy", "singleLine": false }, "keys": "ctrl+c" },
        { "command": "paste", "keys": "ctrl+v" },

        // 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" },

        // Close Tab
        {"command" : "closeTab", "keys" : "ctrl+w"},
        // Open New Tab
        {"command":"newTab", "keys": "ctrl+t"},

        // Open new pane
        { "command": { "action": "splitPane", "splitMode": "duplicate", "split": "vertical" }, "keys": "alt+ctrl+l" },
        { "command": { "action": "splitPane", "splitMode": "duplicate", "split": "horizontal" }, "keys": "alt+ctrl+j" },
        { "command": { "action": "splitPane", "splitMode": "duplicate", "split": "auto" }, "keys": "alt+ctrl+ " },

        // Move around the panes
        { "command": { "action": "moveFocus", "direction": "down" }, "keys": "alt+j" },
        { "command": { "action": "moveFocus", "direction": "left" }, "keys": "alt+h" },
        { "command": { "action": "moveFocus", "direction": "right" }, "keys": "alt+l" },
        { "command": { "action": "moveFocus", "direction": "up" }, "keys": "alt+k" },

        // Resize panes
        { "command": { "action": "resizePane", "direction": "down" }, "keys": "alt+shift+j" },
        { "command": { "action": "resizePane", "direction": "left" }, "keys": "alt+shift+h" },
        { "command": { "action": "resizePane", "direction": "right" }, "keys": "alt+shift+l" },
        { "command": { "action": "resizePane", "direction": "up" }, "keys": "alt+shift+k" }
    ]
}

web - USB Fußpedal für den vi/vim

Wenn man einen vi/vim Editor nutzt, muss man die Taste "i" betätigen um einen Text eingeben zu können. Diese wiederkehrende Aufgabe hat ein findiger Nutzer diese Aufgabe zu seinem Fuß delegiert. Er suchte nach einem extrem günstigen USB-Fußpedal und fand eins. Die Wunschvorstellung war "sende ein i beim darauf treten" und "sende ein ESC beim fuß entfernen" und diese Aufgabe konnte er auch umsetzen. Aktuell sucht der Bauherr nach einem verbesserte Model um "Hinzufügen am Anfang und am Ende der Zeile" ebenfalls delegieren zu können. Quelle

tool - vi moving arround

Apanding to the simple editing post i would like to add this time some hints for moving arround

  • ctrl+F - scroll forward one screen
  • ctrl+B - scroll backward one screen
  • ctrl+D - scroll forward half a screen
  • ctrl+U - scroll backward half a screen
  • H - move to the home/top line of the screen
  • M - move to the middle of the screen
  • L - move to the last line of the screen
  • + - move to the first character of the next line
  • - - move to the first character of the previous line
  • ? - search backward
  • N - step search backward

tool - vi a little more basics for simple editing

I am using the vi since a few years. A few months ago i realized that i am just using a bit of the mighty power of the vi. Thats why O`Reilly's Learning the vi editor was welcomed in my house :-). I have just finised a small part of the book but found already some "new" stuff for me. Thats why this entry is a supplement to my vi knowledge. But maybe there is something for you out there too.

  • :e! - returns you the last saved version of your file
  • W - move forward from word by word without considering symbols and punctuation
  • c2b - change two words backwards
  • c$ - change to the end of the line
  • cc - change the entire current line
  • C - change characters from current cursor position to the end of the line
  • s - substitute from current position
  • S - same as cc
  • R - puts you in "overwrite" mode
  • ~ - change case of your letter (Upper- to Lowercase and other way)
  • D - deletes from courrent position to the end of the line
  • x - deletes current character
  • X - deletes character before current position
  • xp - delete current character ad put after curser
  • y$ - yankes to the end of the line
  • . - repeats last command
  • O - opens blank line above curser
  • J - joins two (or more) lines
  • e - moves to the end of a word

Wow, after this list it is hard to believe that i am using the vi for years now, "we are absolute beginners" comes to my ears ;-).