Skip to content

Instantly share code, notes, and snippets.

@farhad0085
Last active June 30, 2024 20:40
Show Gist options
  • Select an option

  • Save farhad0085/273ba50e01c6e266d2ab060a2908f4ff to your computer and use it in GitHub Desktop.

Select an option

Save farhad0085/273ba50e01c6e266d2ab060a2908f4ff to your computer and use it in GitHub Desktop.
Settings for windows terminal and vscode
  1. Install oh-my-posh
  2. Install FiraCode Nerd Font
  3. Set FiraCode Nerd Font in windows terminal bash profile.
  4. In ~/.bashrc paste following content:
eval "$(oh-my-posh init bash --config ~/.ohmyposhtheme.omp.json)"
  1. Paste following in ~/.ohmyposhtheme.omp.json
{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "blocks": [
    {
      "alignment": "left",
      "newline": true,
      "segments": [
        {
          "background": "#038028",
          "foreground": "#ffffff",
          "leading_diamond": "\ue0b6",
          "properties": {
            "arch": "\uf303",
            "debian": "\uf306",
            "fedora": "\uf30a",
            "linux": "\uf17c",
            "macos": "\uf179",
            "manjaro": "\uf312",
            "opensuse": "\uf314",
            "ubuntu": "\uf31b",
            "windows": "\uf17a"
          },
          "style": "diamond",
          "template": " {{ if .WSL }}WSL at {{ end }}{{.Icon}} ",
          "type": "os"
        },
        {
          "type": "session",
          "style": "diamond",
          "background": "#038028",
          "foreground": "#ffffff",
          "leading_diamond": "\ue0b6",
          "trailing_diamond": "\ue0b0",
          "template": " {{ if .SSHSession }}\ueba9 {{ end }}{{ .UserName }}@{{ .HostName }} "
        },
        {
          "background": "#e06c75",
          "foreground": "#ffffff",
          "powerline_symbol": "\ue0b0",
          "style": "powerline",
          "template": " \ue799\u2800",
          "type": "root"
        },
        {
          "background": "#0077c2",
          "foreground": "#ffffff",
          "powerline_symbol": "\ue0b0",
          "properties": {
            "folder_separator_icon": "/",
            "home_icon": "~",
            "max_depth": 2,
            "style": "folder"
          },
          "style": "powerline",
          "template": " \ue5fe {{ path .Path .Location }} ",
          "type": "path"
        },
        {
          "background": "#fffb38",
          "background_templates": [
            "{{ if or (.Working.Changed) (.Staging.Changed) }}#ff9248{{ end }}",
            "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#f26d50{{ end }}",
            "{{ if gt .Ahead 0 }}#f17c37{{ end }}",
            "{{ if gt .Behind 0 }}#89d1dc{{ end }}"
          ],
          "foreground": "#193549",
          "powerline_symbol": "\ue0b0",
          "properties": {
            "fetch_stash_count": true,
            "fetch_status": true,
            "fetch_upstream_icon": true
          },
          "style": "powerline",
          "template": " {{ if .UpstreamURL }}{{ url .UpstreamIcon .UpstreamURL }} {{ end }}{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Staging.Changed }} \uf046 {{ .Staging.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}{{ if gt .StashCount 0 }} \ueb4b {{ .StashCount }}{{ end }} ",
          "type": "git"
        },
        {
          "background": "#FFDE57",
          "foreground": "#111111",
          "powerline_symbol": "\ue0b0",
          "properties": {
            "display_mode": "environment",
            "fetch_virtual_env": true,
            "home_enabled": true,
            "folder_name_fallback": false
          },
          "style": "powerline",
          "template": " \ue235 {{ if .Venv }}({{ .Venv }}){{ end }} ",
          "type": "python"
        }
      ],
      "type": "prompt"
    },
    {
      "segments": [
        {
          "type": "status",
          "style": "powerline",
          "foreground": "#fff",
          "background": "#0331fd",
          "invert_powerline": true,
          "leading_powerline_symbol": "\ue0b6",
          "powerline_symbol": "\ue0b2",
          "template": " {{ if gt .Code 0 }}\uf00d{{ else }}\uf00c{{ end }} ",
          "background_templates": [
            "{{ if gt .Code 0 }}#ff5722{{ else }}#06b32c{{ end }}"
          ],
          "properties": {
            "always_enabled": true
          }
        },
        {
          "foreground": "#ffffff",
          "background": "#14a00f",
          "invert_powerline": true,
          "properties": {
            "always_enabled": true
          },
          "style": "powerline",
          "powerline_symbol": "\ue0b2",
          "template": "{{ .FormattedMs }} ",
          "type": "executiontime"
        },
        {
          "background": "#f36943",
          "background_templates": [
            "{{if eq \"Charging\" .State.String}}#40c4ff{{end}}",
            "{{if eq \"Discharging\" .State.String}}#ff5722{{end}}",
            "{{if eq \"Full\" .State.String}}#4caf50{{end}}"
          ],
          "foreground": "#ffffff",
          "invert_powerline": true,
          "powerline_symbol": "\ue0b2",
          "properties": {
            "charged_icon": "\ueb2d ",
            "charging_icon": "\uf241 ",
            "discharging_icon": "\uf242 "
          },
          "style": "powerline",
          "template": " {{ if not .Error }}{{ .Icon }}{{ .Percentage }}{{ end }}{{ .Error }}% ",
          "type": "battery"
        },
        {
          "background": "#61afef",
          "foreground": "#ffffff",
          "invert_powerline": true,
          "properties": {
            "time_format": "15:04 (Mon)"
          },
          "style": "diamond",
          "template": " {{ .CurrentDate | date .Format }} ",
          "trailing_diamond": "\ue0b4",
          "type": "time"
        }
      ],
      "type": "rprompt"
    }
  ],
  "console_title_template": "{{.UserName}}@{{.HostName}} : {{.Folder}}",
  "final_space": true,
  "version": 2
}
  1. Restart your bash terminal!
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "ctrl+d",
"command": "editor.action.copyLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "shift+alt+down",
"command": "-editor.action.copyLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+alt+l",
"command": "notebook.formatCell",
"when": "editorHasDocumentFormattingProvider && editorTextFocus && inCompositeEditor && notebookEditable && !editorReadonly && activeEditor == 'workbench.editor.notebook'"
},
{
"key": "shift+alt+f",
"command": "-notebook.formatCell",
"when": "editorHasDocumentFormattingProvider && editorTextFocus && inCompositeEditor && notebookEditable && !editorReadonly && activeEditor == 'workbench.editor.notebook'"
},
{
"key": "ctrl+alt+l",
"command": "editor.action.formatDocument",
"when": "editorHasDocumentFormattingProvider && editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly && !inCompositeEditor"
},
{
"key": "shift+alt+f",
"command": "-editor.action.formatDocument",
"when": "editorHasDocumentFormattingProvider && editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly && !inCompositeEditor"
},
{
"key": "ctrl+alt+l",
"command": "editor.action.formatDocument.none",
"when": "editorTextFocus && !editorHasDocumentFormattingProvider && !editorHasDocumentFormattingProvider && !editorReadonly"
},
{
"key": "shift+alt+f",
"command": "-editor.action.formatDocument.none",
"when": "editorTextFocus && !editorHasDocumentFormattingProvider && !editorHasDocumentFormattingProvider && !editorReadonly"
},
{
"key": "ctrl+shift+t",
"command": "workbench.action.terminal.new"
},
{
"key": "ctrl+shift+`",
"command": "-workbench.action.terminal.new"
},
{
"key": "ctrl+t",
"command": "workbench.action.terminal.toggleTerminal"
},
{
"key": "ctrl+`",
"command": "-workbench.action.terminal.toggleTerminal"
},
{
"key": "ctrl+shift+s",
"command": "workbench.action.files.saveAll"
},
{
"key": "ctrl+k s",
"command": "-workbench.action.files.saveAll"
},
{
"key": "alt+j",
"command": "editor.action.addSelectionToNextFindMatch",
"when": "editorFocus"
},
{
"key": "ctrl+d",
"command": "-editor.action.addSelectionToNextFindMatch",
"when": "editorFocus"
},
{
"key": "ctrl+alt+j",
"command": "editor.action.selectHighlights",
"when": "editorFocus"
},
{
"key": "ctrl+shift+l",
"command": "-editor.action.selectHighlights",
"when": "editorFocus"
},
{
"key": "ctrl+u",
"command": "editor.action.transformToUppercase"
},
{
"key": "ctrl+l",
"command": "editor.action.transformToLowercase"
}
]
{
"editor.matchBrackets": "never",
"explorer.confirmDelete": false,
"files.autoSave": "off",
"workbench.startupEditor": "newUntitledFile",
"python.showStartPage": false,
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
"kite.showWelcomeNotificationOnStartup": false,
"liveServer.settings.donotVerifyTags": true,
"liveServer.settings.donotShowInfoMsg": true,
"diffEditor.ignoreTrimWhitespace": false,
"workbench.iconTheme": "vscode-great-icons",
"editor.minimap.enabled": false,
"editor.bracketPairColorization.enabled": false,
"workbench.colorCustomizations": {
},
"editor.fontSize": 16,
"git.enableSmartCommit": true,
"editor.multiCursorModifier": "ctrlCmd",
"workbench.tree.indent": 22,
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"python.languageServer": "Pylance",
"editor.detectIndentation": false,
"files.associations": {
"*.html": "html"
},
"[javascriptreact]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"jupyter.textOutputLimit": 0,
"workbench.editorAssociations": {
"*.ipynb": "jupyter-notebook"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"explorer.confirmDragAndDrop": false,
"workbench.editor.enablePreview": false,
"editor.fontLigatures": true,
// custom syntax colors
"editor.tokenColorCustomizations": {
"strings": "#e74bfc"
},
"editor.fontFamily": "'Fira Code', Consolas, 'Courier New', monospace",
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"jupyter.askForKernelRestart": false,
"jupyter.alwaysTrustNotebooks": true,
"json.maxItemsComputed": 50000,
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"notebook.cellToolbarLocation": {
"default": "right",
"jupyter-notebook": "left"
},
"gitlens.advanced.messages": {
"suppressImproperWorkspaceCasingWarning": true
}
}
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "resizePane",
"direction": "up"
},
"keys": "alt+shift+up"
},
{
"command":
{
"action": "copy",
"singleLine": false
},
"keys": "ctrl+c"
},
{
"command":
{
"action": "moveFocus",
"direction": "up"
},
"keys": "alt+up"
},
{
"command": "paste",
"keys": "ctrl+v"
},
{
"command":
{
"action": "splitPane",
"split": "right"
},
"keys": "ctrl+alt+right"
},
{
"command":
{
"action": "newTab"
},
"keys": "ctrl+t"
},
{
"command":
{
"action": "splitPane",
"split": "down"
},
"keys": "ctrl+alt+down"
},
{
"command":
{
"action": "moveFocus",
"direction": "right"
},
"keys": "alt+right"
},
{
"command":
{
"action": "moveFocus",
"direction": "left"
},
"keys": "alt+left"
},
{
"command": "find",
"keys": "ctrl+f"
},
{
"command":
{
"action": "resizePane",
"direction": "down"
},
"keys": "alt+shift+down"
},
{
"command":
{
"action": "resizePane",
"direction": "left"
},
"keys": "alt+shift+left"
},
{
"command": "closePane",
"keys": "ctrl+q"
},
{
"command":
{
"action": "splitPane",
"split": "auto",
"splitMode": "duplicate"
},
"keys": "ctrl+s"
},
{
"command":
{
"action": "moveFocus",
"direction": "down"
},
"keys": "alt+down"
},
{
"command":
{
"action": "resizePane",
"direction": "right"
},
"keys": "alt+shift+right"
}
],
"copyFormatting": "none",
"copyOnSelect": false,
"defaultProfile": "{00000000-0000-0000-ba54-000000000001}",
"profiles":
{
"defaults": {},
"list":
[
{
"backgroundImageAlignment": "top",
"backgroundImageOpacity": 0.5,
"backgroundImageStretchMode": "fill",
"colorScheme": "Whimsy",
"cursorColor": "#00FF00",
"font":
{
"face": "Fira Code"
},
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"hidden": false,
"historySize": 9001,
"name": "Windows PowerShell"
},
{
"colorScheme": "Whimsy",
"cursorColor": "#00FF00",
"font":
{
"face": "Fira Code"
},
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"hidden": false,
"historySize": 9001,
"name": "Command Prompt"
},
{
"backgroundImage": "https://c4.wallpaperflare.com/wallpaper/568/845/216/dark-blue-blur-gradation-wallpaper-preview.jpg",
"closeOnExit": "graceful",
"colorScheme": "Tinacious Design (Dark)",
"commandline": "%PROGRAMFILES%/git/usr/bin/bash.exe -i -l",
"cursorColor": "#FFFFFF",
"cursorShape": "bar",
"font":
{
"face": "Fira Code",
"size": 12
},
"guid": "{00000000-0000-0000-ba54-000000000001}",
"hidden": false,
"historySize": 20000,
"icon": "%PROGRAMFILES%/Git/mingw64/share/git/git-for-windows.ico",
"name": "Bash",
"opacity": 100,
"padding": "0, 0, 0, 0",
"snapOnInput": true,
"useAcrylic": true
},
{
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
"hidden": false,
"name": "Azure Cloud Shell",
"source": "Windows.Terminal.Azure"
}
]
},
"schemes":
[
{
"background": "#0C0C0C",
"black": "#0C0C0C",
"blue": "#0037DA",
"brightBlack": "#767676",
"brightBlue": "#3B78FF",
"brightCyan": "#61D6D6",
"brightGreen": "#16C60C",
"brightPurple": "#B4009E",
"brightRed": "#E74856",
"brightWhite": "#F2F2F2",
"brightYellow": "#F9F1A5",
"cursorColor": "#FFFFFF",
"cyan": "#3A96DD",
"foreground": "#CCCCCC",
"green": "#13A10E",
"name": "Campbell",
"purple": "#881798",
"red": "#C50F1F",
"selectionBackground": "#FFFFFF",
"white": "#CCCCCC",
"yellow": "#C19C00"
},
{
"background": "#012456",
"black": "#0C0C0C",
"blue": "#0037DA",
"brightBlack": "#767676",
"brightBlue": "#3B78FF",
"brightCyan": "#61D6D6",
"brightGreen": "#16C60C",
"brightPurple": "#B4009E",
"brightRed": "#E74856",
"brightWhite": "#F2F2F2",
"brightYellow": "#F9F1A5",
"cursorColor": "#FFFFFF",
"cyan": "#3A96DD",
"foreground": "#CCCCCC",
"green": "#13A10E",
"name": "Campbell Powershell",
"purple": "#881798",
"red": "#C50F1F",
"selectionBackground": "#FFFFFF",
"white": "#CCCCCC",
"yellow": "#C19C00"
},
{
"background": "#282C34",
"black": "#282C34",
"blue": "#61AFEF",
"brightBlack": "#5A6374",
"brightBlue": "#61AFEF",
"brightCyan": "#56B6C2",
"brightGreen": "#98C379",
"brightPurple": "#C678DD",
"brightRed": "#E06C75",
"brightWhite": "#DCDFE4",
"brightYellow": "#E5C07B",
"cursorColor": "#FFFFFF",
"cyan": "#56B6C2",
"foreground": "#DCDFE4",
"green": "#98C379",
"name": "One Half Dark",
"purple": "#C678DD",
"red": "#E06C75",
"selectionBackground": "#FFFFFF",
"white": "#DCDFE4",
"yellow": "#E5C07B"
},
{
"background": "#FAFAFA",
"black": "#383A42",
"blue": "#0184BC",
"brightBlack": "#4F525D",
"brightBlue": "#61AFEF",
"brightCyan": "#56B5C1",
"brightGreen": "#98C379",
"brightPurple": "#C577DD",
"brightRed": "#DF6C75",
"brightWhite": "#FFFFFF",
"brightYellow": "#E4C07A",
"cursorColor": "#4F525D",
"cyan": "#0997B3",
"foreground": "#383A42",
"green": "#50A14F",
"name": "One Half Light",
"purple": "#A626A4",
"red": "#E45649",
"selectionBackground": "#FFFFFF",
"white": "#FAFAFA",
"yellow": "#C18301"
},
{
"background": "#002B36",
"black": "#002B36",
"blue": "#268BD2",
"brightBlack": "#073642",
"brightBlue": "#839496",
"brightCyan": "#93A1A1",
"brightGreen": "#586E75",
"brightPurple": "#6C71C4",
"brightRed": "#CB4B16",
"brightWhite": "#FDF6E3",
"brightYellow": "#657B83",
"cursorColor": "#FFFFFF",
"cyan": "#2AA198",
"foreground": "#839496",
"green": "#859900",
"name": "Solarized Dark",
"purple": "#D33682",
"red": "#DC322F",
"selectionBackground": "#FFFFFF",
"white": "#EEE8D5",
"yellow": "#B58900"
},
{
"background": "#FDF6E3",
"black": "#002B36",
"blue": "#268BD2",
"brightBlack": "#073642",
"brightBlue": "#839496",
"brightCyan": "#93A1A1",
"brightGreen": "#586E75",
"brightPurple": "#6C71C4",
"brightRed": "#CB4B16",
"brightWhite": "#FDF6E3",
"brightYellow": "#657B83",
"cursorColor": "#002B36",
"cyan": "#2AA198",
"foreground": "#657B83",
"green": "#859900",
"name": "Solarized Light",
"purple": "#D33682",
"red": "#DC322F",
"selectionBackground": "#FFFFFF",
"white": "#EEE8D5",
"yellow": "#B58900"
},
{
"background": "#000000",
"black": "#000000",
"blue": "#3465A4",
"brightBlack": "#555753",
"brightBlue": "#729FCF",
"brightCyan": "#34E2E2",
"brightGreen": "#8AE234",
"brightPurple": "#AD7FA8",
"brightRed": "#EF2929",
"brightWhite": "#EEEEEC",
"brightYellow": "#FCE94F",
"cursorColor": "#FFFFFF",
"cyan": "#06989A",
"foreground": "#D3D7CF",
"green": "#4E9A06",
"name": "Tango Dark",
"purple": "#75507B",
"red": "#CC0000",
"selectionBackground": "#FFFFFF",
"white": "#D3D7CF",
"yellow": "#C4A000"
},
{
"background": "#FFFFFF",
"black": "#000000",
"blue": "#3465A4",
"brightBlack": "#555753",
"brightBlue": "#729FCF",
"brightCyan": "#34E2E2",
"brightGreen": "#8AE234",
"brightPurple": "#AD7FA8",
"brightRed": "#EF2929",
"brightWhite": "#EEEEEC",
"brightYellow": "#FCE94F",
"cursorColor": "#000000",
"cyan": "#06989A",
"foreground": "#555753",
"green": "#4E9A06",
"name": "Tango Light",
"purple": "#75507B",
"red": "#CC0000",
"selectionBackground": "#FFFFFF",
"white": "#D3D7CF",
"yellow": "#C4A000"
},
{
"background": "#1D1D26",
"black": "#1D1D26",
"blue": "#6555C0",
"brightBlack": "#636667",
"brightBlue": "#00CBFF",
"brightCyan": "#00D5D4",
"brightGreen": "#00D364",
"brightPurple": "#D783FF",
"brightRed": "#FF2F92",
"brightWhite": "#D5D6F3",
"brightYellow": "#FFD479",
"cursorColor": "#FFFFFF",
"cyan": "#00CECA",
"foreground": "#CBCBF0",
"green": "#00D364",
"name": "Tinacious Design (Dark)",
"purple": "#CC66FF",
"red": "#FF3399",
"selectionBackground": "#FFFFFF",
"white": "#CBCBF0",
"yellow": "#FFCC66"
},
{
"background": "#011116",
"black": "#022026",
"blue": "#459A86",
"brightBlack": "#384451",
"brightBlue": "#61D5BA",
"brightCyan": "#98D028",
"brightGreen": "#2AEA5E",
"brightPurple": "#1298FF",
"brightRed": "#FF4242",
"brightWhite": "#58FBD6",
"brightYellow": "#8ED4FD",
"cursorColor": "#FFFFFF",
"cyan": "#5D7E19",
"foreground": "#FFFFFF",
"green": "#00A941",
"name": "UnderTheSea",
"purple": "#00599D",
"red": "#B2302D",
"selectionBackground": "#FFFFFF",
"white": "#405555",
"yellow": "#59819C"
},
{
"background": "#000000",
"black": "#000000",
"blue": "#000080",
"brightBlack": "#808080",
"brightBlue": "#0000FF",
"brightCyan": "#00FFFF",
"brightGreen": "#00FF00",
"brightPurple": "#FF00FF",
"brightRed": "#FF0000",
"brightWhite": "#FFFFFF",
"brightYellow": "#FFFF00",
"cursorColor": "#FFFFFF",
"cyan": "#008080",
"foreground": "#C0C0C0",
"green": "#008000",
"name": "Vintage",
"purple": "#800080",
"red": "#800000",
"selectionBackground": "#FFFFFF",
"white": "#C0C0C0",
"yellow": "#808000"
},
{
"background": "#29283B",
"black": "#535178",
"blue": "#247ACF",
"brightBlack": "#535178",
"brightBlue": "#65AEF7",
"brightCyan": "#43C1BE",
"brightGreen": "#12EB69",
"brightPurple": "#AA7FF0",
"brightRed": "#EF6487",
"brightWhite": "#FFFFFF",
"brightYellow": "#FDD877",
"cursorColor": "#FFFFFF",
"cyan": "#43C1BE",
"foreground": "#B3B0D6",
"green": "#0FC759",
"name": "Whimsy",
"purple": "#AA7FF0",
"red": "#EF6487",
"selectionBackground": "#FFFFFF",
"white": "#FFFFFF",
"yellow": "#FDD877"
}
],
"useAcrylicInTabRow": false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment