Visual Studio Code, PowerShell, and Git Bash - powershell

I have been trying to configure VSCode to use GitBash as the integrated terminal. However no mater what I try the integrated terminal always shows up as PowerShell. I have disable PowerShell, uninstall Windows Terminal, and Windows Terminal Preview. Here is my settings.json:
{
"sync.gist": "16ea877040ee819fae27275ae71be30b",
"sync.quietSync": true,
"workbench.iconTheme": "material-icon-theme",
"editor.minimap.enabled": false,
"workbench.colorCustomizations": {
"editorGutter.background": "#30208b",
"statusBar.background": "#1b5c12",
"statusBar.debuggingBackground": "#1b5c12",
"statusBar.noFolderBackground": "#1b5c12",
"statusBar.border": "#ff0000"
},
"python.autoComplete.addBrackets": true,
"python.dataScience.themeMatplotlibPlots": true,
"python.linting.pylamaEnabled": true,
"python.linting.pycodestyleEnabled": true,
"git.autofetch": true,
"python.pythonPath": "/usr/bin/python3",
"code-runner.respectShebang": false,
"code-runner.fileDirectoryAsCwd": true,
"code-runner.runInTerminal": true,
"editor.fontSize": 12,
"editor.fontFamily": "'Aurulent Sans Mono Regular','Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.formatOnPaste": true,
"prettier.printWidth": 120,
"prettier.singleQuote": true,
"prettier.tabWidth": 4,
"prettier.jsxSingleQuote": true,
"prettier.jsxBracketSameLine": true,
"browser-preview.startUrl": "http://127.0.0.1:8000/",
"browser-preview.verbose": false,
"python.linting.pylintArgs": ["--extension-pkg-whitelist=PyQt5"],
"[python]": {
"editor.defaultFormatter": "iansan5653.format-python-docstrings"
},
"explorer.confirmDragAndDrop": false,
"explorer.confirmDelete": false,
"git.enableSmartCommit": true,
"files.associations": {
"**/*.html": "html",
"**/templates/**/*.html": "django-html",
"**/templates/**/*": "django-txt",
"**/requirements{/**,*}.{txt,in}": "pip-requirements"
},
"terminal.integrated.fontFamily": "'Fira Code Medium'",
"terminal.integrated.fontSize": 12,
"terminal.integrated.inheritEnv": true,
"#terminal.integrated.defaultProfile.osx#": "C:\\Windows\\System32\\cmd.exe",
"#terminal.integrated.defaultProfile.windows": "C:\\Windows\\System32\\cmd.exe",
"terminal.integrated.cwd": "C:\\Users\\DawsonSchaffer\\Documents\\Projects",
"workbench.colorTheme": "Monokai",
"workbench.editorAssociations": [
{
"viewType": "jupyter.notebook.ipynb",
"filenamePattern": "*.ipynb"
}
],
"terminal.integrated.profiles.windows": {
"Git Bash": {
"source": "Git Bash",
"path": "C:\\Program Files\\Git\\git-bash.exe",
}
},
"terminal.integrated.defaultProfile.windows": "Git Bash",
"python.analysis.completeFunctionParens": true,
"settingsSync.ignoredSettings": [
"terminal.external.windowsExec"
],
"terminal.explorerKind": "external",
}
Any help in finding a solution for this would be greatly appreciated.
Thanks
Dawson

I finally got it working using the following:
"terminal.integrated.profiles.windows": {
"Git Bash": {
"source": "Git Bash",
"path": "C:\\Program Files\\Git\\git-bash.exe",
"icon": "C:\\Program Files\\gitbash.png"
}
},
"terminal.integrated.defaultProfile.windows": "Git Bash",

As a temporary workaround you may use the deprecated setting:
"terminal.integrated.shell.windows": "C:\Program Files\Git\bin\bash.exe"

Related

Unable to write in VScode settings

It seems i am unable to write in any new setting as my settings.json has an error of some kind. I have tried removing certain duplicate lines and also adding new brackets to see if it would assist with the issue but so far i have not been able to figure out the problem. Here is what i have managed to do so far,
{
"editor.suggest.localityBonus": true,
"editor.suggest.statusBar.visible": true,
"editor.quickSuggestions": null,
"editor.snippetSuggestions": "bottom",
"files.autoSave": "afterDelay",
"liveServer.settings.donotShowInfoMsg": true,
"workbench.iconTheme": "material-icon-theme",
"prettier.jsxSingleQuote": true,
"prettier.singleQuote": true,
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
"workbench.colorTheme": "Monokai Pro (Filter Spectrum)",
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"emmet.preferences": {
},
"workbench.editorAssociations": {
"*.ipynb": "jupyter.notebook.ipynb"
},
"mssql.connections": [
{
"server": "{{put-server-name-here}}",
"database": "{{put-database-name-here}}",
"user": "{{put-username-here}}",
"password": "{{put-password-here}}"
}
],
"security.workspace.trust.untrustedFiles": "open",
"editor.fontSize": 18,
"editor.tabSize": 3,
"editor.guides.bracketPairs": true
{
"editor.bracketPairColorization.enabled": true,
"editor.guides.bracketPairs":"active"
}
}
I get an error saying "expected comma Ln33 col 3" and "end of file expected at Ln 37"
Change from:
"editor.guides.bracketPairs": true
{
"editor.bracketPairColorization.enabled": true,
"editor.guides.bracketPairs":"active"
}
to
"editor.guides.bracketPairs": true, // choose true/false/active
// { // gat rid of this {
"editor.bracketPairColorization.enabled": true,
// "editor.guides.bracketPairs":"active"
// } // get rid of this }

Can't word wrap on vs code?

I have tried almost everything but could not figure out how could i remove the horizontal scrollbar from my vs code i have changed every setting but could not figure out how to on my word wrap on vs code. At first it worked but suddenly it stopped working a month before could not figure out what could be the reason maybe some extension. Any help would be appreciated.
Following is code for my setting.json and screen shot of my settings and the horizontal scroll bar.
{
"editor.mouseWheelZoom": true,
"code-runner.runInTerminal": true,
"liveServer.settings.donotShowInfoMsg": true,
"C_Cpp.updateChannel": "Insiders",
"code-runner.saveFileBeforeRun": true,
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"debug.terminal.clearBeforeReusing": true,
"code-runner.clearPreviousOutput": true,
"latex-workshop.view.pdf.viewer": "browser",
"workbench.colorTheme": "Visual Studio Dark",
"workbench.iconTheme": "vscode-icons",
"diffEditor.wordWrap": "on",
"emmet.triggerExpansionOnTab": true,
"editor.accessibilitySupport": "on",
"bracket-pair-colorizer-2.depreciation-notice": false,
"editor.wrappingColumn": 0,
"kite.showWelcomeNotificationOnStartup": false,
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell"
},
"Command Prompt": {
"path": [
"${env:windir}\\Sysnative\\cmd.exe",
"${env:windir}\\System32\\cmd.exe"
],
"args": [],
"icon": "terminal-cmd"
},
"Git Bash": {
"source": "Git Bash"
},
"Ubuntu-18.04 (WSL)": {
"path": "C:\\WINDOWS\\System32\\wsl.exe",
"args": [
"-d",
"Ubuntu-18.04"
]
}
},
"terminal.integrated.defaultProfile.windows": "PowerShell",
"security.workspace.trust.untrustedFiles": "open",
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"files.associations": {
"*.css": "css"
},
"[css]": {
"editor.defaultFormatter": "vscode.css-language-features"
},
"workbench.startupEditor": "none",
"editor.wordWrap": "on"
}
Q: You'd like to see word wrap in the editor window, as you're editing an HTML file in VSCode, correct?
Q: And you DON'T want the editor to insert line breaks in the actual HTML - you just don't want to have to scroll left and right. Correct?
Q: Have you tried Alt-Z? Or View > Toggle word wrap?
NOTE: be sure the HTML editor pane is "Selected" when you try "Alt-Z".

Is there a list of all VS Code settings.json fields?

In the example settings.json below, the html.fake setting is greyed out with the error Unknown Configuration Setting, meaning VSCode is aware of all possible config settings.
Is there a way to view this full list, or view an example settings.json with the default values for all accepted fields?
{
"html.autoClosingTags": "never",
"html.fake": "never"
}
I understand extensions may have their own config settings; I'm only interested in the base settings.
Please find the list of all default settings for VSCode(Link). I believe this is what you are looking for.
{
"files.autoSave": "afterDelay",
//"workbench.colorTheme": "Dracula Soft",
//"compile-hero.generate-minified-html": true,
//"compile-hero.generate-minified-css": true,
"php.validate.executablePath": "C:/php-7.4.28/php.exe",
"php.executablePath": "C:/php-7.4.28/php.exe",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
//"editor.renderIndentGuides": true,
"editor.fontWeight": "normal",
"editor.detectIndentation": false,
"editor.tabSize": 3,
"editor.suggestSelection": "first",
"editor.codeLensFontFamily": "Fira Code, Operator Mono",
"editor.codeLensFontSize": 16,
"breadcrumbs.enabled": false,
"editor.fontSize": 15,
"editor.fontFamily": "Fira Code, Operator Mono",
"editor.fontLigatures": "terminal.integrated.cursorWidth",
"editor.cursorWidth": 2,
"editor.lineHeight": 24,
// cursor
"editor.cursorSmoothCaretAnimation": true,
"editor.cursorBlinking": "expand",
"editor.quickSuggestions": {
"other": true,
"comments": true,
"strings": true,
"tag": true,
"class": true,
"id": true
},
// config related to code formatting
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": false,
"[javascript]": {
"editor.formatOnSave": true
},
"[javascriptreact]": {
"editor.formatOnSave": true
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.tslint": true,
"source.organizeImports": true
},
//terminal
//"terminal.integrated.cursorSmoothCaretAnimation": true,
"terminal.integrated.cursorBlinking": true,
"terminal.integrated.cursorStyle": "line",
"terminal.integrated.fontSize": 16,
"terminal.integrated.lineHeight": 1.5,
//"terminal.integrated.fontWeight": "normal",
"terminal.integrated.fontFamily": "Fira Code, Operator Mono",
"terminal.integrated.cursorWidth": 2,
// "terminal.integrated.shell.windows": "C:/Users/user/AppData/Local/Microsoft/WindowsApps/wt.exe",
"terminal.integrated.automationShell.windows": null,
// terminal customization
"workbench.colorCustomizations": {
"terminal.ansiBlack": "#171c2a",
"terminal.ansiRed": "#E35535",
"terminal.ansiGreen": "#52AB62",
"terminal.ansiYellow": "#ffd866",
"terminal.ansiBlue": "#00B3BD",
"terminal.ansiMagenta": "#e991e3",
"terminal.ansiCyan": "#78e8c6",
"terminal.ansiWhite": "#FFFFFFcc",
"terminal.ansiBrightBlack": "#00B3BD",
"terminal.ansiBrightRed": "#E35535",
"terminal.ansiBrightGreen": "#52AB62",
"terminal.ansiBrightYellow": "#ffd866",
"terminal.ansiBrightBlue": "#00B3BD",
"terminal.ansiBrightMagenta": "#e991e3",
"terminal.ansiBrightCyan": "#78e8c6",
"terminal.ansiBrightWhite": "#ffffff",
"terminal.background": "#171c2a",
"terminalCursor.background": "#ffd866",
"terminalCursor.foreground": "#ffd866",
// Editor customaize
// "editorIndentGuide.activeBackground": "#430f7e",
// "editorIndentGuide.background": "#3a383a",
// "activityBar.background": "#740ee9f8",
// "editorBracketMatch.background": "#430f7e",
// "editorBracketMatch.border": "#ffffff",
//"editor.wordHighlightStrongBackground": "#740ee9f8",
"editor.wordHighlightBorder": "#740ee9f8",
//"editor.rangeHighlightBackground": "#740ee9f8",
// "editor.rangeHighlightBorder": "#740ee9f8",
"editor.selectionBackground": "#c7c7c76b",
// "editor.selectionHighlightBorder": "#ffffff",
// "tab.activeBackground": "#5332a0",
// "tab.border": "#430f7e"
},
// "prettier.disableLanguages": ["html", "css"],
"dictCompletion.addSpaceAfterCompletion": true,
"beautify.language": {
"js": {
"type": ["javascript", "json", "jsonc"],
"filename": [".jshintrc", ".jsbeautifyrc"]
},
"css": ["css", "scss"],
"html": ["htm", "html", "css", "javascript", "php", "blade"],
"php": ["javascript", "php", "blade"]
},
"phpformatter.logging": true,
"[json]": {
"editor.quickSuggestions": {
"strings": true
},
"editor.suggest.insertMode": "replace"
},
"workbench.colorTheme": "Learn with Sumit - Peace of the eye",
"workbench.iconTheme": "vscode-icons",
"[php]": {
"editor.defaultFormatter": "bmewburn.vscode-intelephense-client"
},
"[html]": {
"editor.defaultFormatter": "HookyQR.beautify"
},
"cSpell.userWords": [
"backorder"
],
"explorer.confirmDelete": false,
"window.zoomLevel": 1,
}
I hope you got the answering.

VSCode Python Intellisense Not Working Properly

Python autocomplete in VSCode is messing up my code
Here is my system:
If I use Pylance, Intellisense does not work properly
and if I use Jedi, Intellisense does not work properly
When I press enter, my code is completely borked. This is just one example and has been frustrating the heck out of me!
Below is my settings.json file:
{
"AREPL.pythonPath": "${workspaceFolder}\\.venv\\Scripts\\python.exe",
"dicom.alwaysShowMenu": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"editor.formatOnSave": true,
"editor.insertSpaces": false,
"editor.rulers": [
90
],
"editor.suggestSelection": "first",
"explorer.compactFolders": false,
"explorer.confirmDragAndDrop": false,
"files.exclude": {
"**/.git": false
},
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"git-graph.defaultColumnVisibility": {
"Author": false,
"Commit": true,
"Date": false
},
"git-graph.referenceLabels.alignment": "Branches (aligned to the graph) & Tags (on the right)",
"glassit.alpha": 255,
"json.format.enable": true,
"mypy.dmypyExecutable": "${workspaceFolder}\\.venv\\Scripts\\dmypy.exe",
"mypy.runUsingActiveInterpreter": true,
"notebook.cellToolbarLocation": {
"default": "right",
"jupyter-notebook": "left"
},
"python.defaultInterpreterPath": "${workspaceFolder}\\.venv\\Scripts\\python.exe",
"python.formatting.blackArgs": [
"--line-length",
"90"
],
"python.formatting.provider": "black",
"python.languageServer": "Jedi",
"python.linting.enabled": true,
// "python.linting.flake8Args": [
// "--line-length",
// "90"
// ],
"python.linting.mypyEnabled": true,
"python.linting.mypyPath": "${workspaceFolder}\\.venv\\Scripts\\mypy.exe",
// "python.linting.pylintArgs": [
// "--generate-members"
// ],
// "python.linting.pylintEnabled": true,
"python.pythonPath": "${workspaceFolder}\\.venv\\Scripts\\python.exe",
"python.terminal.activateEnvironment": true,
"python.testing.pytestArgs": [
"${workspaceFolder}\\tests"
],
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": true,
"python.venvPath": ".venv",
"restructuredtext.builtDocumentationPath": "${workspaceFolder}\\docs\\build\\html",
"restructuredtext.confPath": "{workspaceFolder}\\docs\\source",
"restructuredtext.languageserver.disabled": true,
"restructuredtext.sphinxBuildPath": "${workspaceFolder}\\.venv\\Scripts\\sphinx-build.exe",
"screencastMode.keyboardOverlayTimeout": 1500,
"screencastMode.mouseIndicatorSize": 20,
"screencastMode.onlyKeyboardShortcuts": true,
"screencastMode.verticalOffset": 0,
"security.workspace.trust.untrustedFiles": "open",
"shellcheck.customargs": [
"-x"
],
"terminal.integrated.defaultProfile.windows": "PowerShell",
"terminal.integrated.fontFamily": "CaskaydiaCove Nerd Font Mono",
"terminal.integrated.tabs.enabled": true,
"trailing-spaces.syntaxIgnore": [
"markdown"
],
"update.enableWindowsBackgroundUpdates": false,
"vsicons.dontShowNewVersionMessage": true,
"workbench.colorTheme": "Predawn",
"workbench.editor.enablePreview": true,
"workbench.editorAssociations": {
"*.dcm": "default",
"*.ipynb": "jupyter-notebook",
"*.tiff": "tiff.preview",
"git-rebase-todo": "default"
},
"workbench.iconTheme": "material-icon-theme",
"workbench.settings.editor": "json",
"workbench.settings.openDefaultSettings": true,
"workbench.settings.useSplitJSON": true,
"workbench.startupEditor": "newUntitledFile"
}
Why is this happening and how can I fix my Intellisense?
Update:
Removing "editor.suggestSelection": "first" helped, but I still get errors:
Adding the following to my settings.json makes Intellisense work as expected:
"editor.acceptSuggestionOnEnter": "off",
"editor.tabCompletion": "on"
Why the defaults are "on" and "off", respectively, I will never know. Everyone expects to press tab if you want to use the suggestion (like in bash terminal), and no one wants the autocomplete to complete blindly upon hitting enter.

How to set indent and formatting behavior for each language in visual studio code?

Is there a way to make vscode format python files using 4 spaces while formatting files from other languages such JS, Typescript and HTML using 2 spaces only?
It`s pretty annoying to have to indent manually every time.
All of this trying is setting up a mess on my settings and still, I can`t make it work as I want.
This is what my settings.json looks like for the moment
{
"python.jediEnabled": false,
"miramac.node.terminalMode": false,
"python.pythonPath": "/usr/local/bin/python3",
"workbench.colorTheme": "Dracula",
"workbench.startupEditor": "newUntitledFile",
"workbench.editor.labelFormat": "short",
"terminal.integrated.fontSize": 12,
"editor.fontFamily": "Fira Code",
"editor.lineHeight": 19,
"editor.fontLigatures":true,
"editor.suggestSelection": "first",
"editor.renderLineHighlight": "gutter",
"editor.detectIndentation": true,
"editor.insertSpaces": false,
"editor.tabSize": 2,
"editor.autoIndent": "full",
"eslint.alwaysShowStatus": true,
"eslint.debug": true,
"eslint.format.enable": true,
"eslint.options": {
},
"python.languageServer": "Microsoft",
"liveServer.settings.donotVerifyTags": true,
"[html]": {
"editor.tabSize": 2,
"editor.codeActionsOnSave": {
"source.fixAll": true,
},
},
"liveServer.settings.donotShowInfoMsg": true,
"prettier.tabWidth": 2,
"[javascript]":{
"editor.codeActionsOnSave": {
"source.fixAll": true,
}
},
"[javascriptreact]":{
"editor.codeActionsOnSave": {
"source.fixAll": true,
}
},
"[typescript]":{
"editor.codeActionsOnSave": {
"source.fixAll": true,
},
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
"[typescriptreact]":{
"editor.codeActionsOnSave": {
"source.fixAll": true,
},
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
"[python]": {
"editor.tabSize": 4,
"editor.codeActionsOnSave": {
// "source.fixAll": true,
},
},
"extensions.ignoreRecommendations": true,
"explorer.compactFolders": false,
//perguntar se vc confirma delete e drag and drops
"explorer.confirmDragAndDrop": false,
"explorer.confirmDelete": false,
//mostra o caminho completo do arquivo
"breadcrumbs.enabled": true,
"javascript.updateImportsOnFileMove.enabled": "never",
"typescript.updateImportsOnFileMove.enabled": "never",
"python.linting.pylintArgs": [
"--extension-pkg-whitelist=pygame"
],
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
//set zsh theme to my terminal
//"terminal.integrated.shell.osx": "/bin/bash",
"terminal.integrated.shell.osx": "/bin/bash",
//"terminal.integrated.cwd": "",
"editor.renderControlCharacters": false,
"window.zoomLevel": -1,
"git.path": "/usr/local/git/bin/git",
"gitlens.views.repositories.files.layout": "list",
"gitlens.views.compare.files.layout": "tree",
"emmet.syntaxProfiles": {"javascript": "jsx"},
"emmet.includeLanguages": {"javascript": "javascriptreact"},
"typescript.tsserver.log": "verbose",
"javascript.suggest.autoImports": true,
"git.enableCommitSigning": true,
"git.enableSmartCommit": true,
"git.rebaseWhenSync": true,
"git.showPushSuccessNotification": true,
"workbench.sideBar.location": "left",
"workbench.activityBar.visible": true,
"terminal.integrated.automationShell.osx": "",
// "editor.defaultFormatter": "vscode.python",
// "editor.tokenColorCustomizationsExperimental": {},
"workbench.preferredDarkColorTheme": "Dracula",
"workbench.preferredHighContrastColorTheme": "Visual Studio Dark",
"material-icon-theme.activeIconPack": "nest",
"workbench.iconTheme": "material-icon-theme",
"material-icon-theme.folders.associations": {
"infra": "app",
"entities": "class",
"schemas": "class",
"typeorm": "database",
"repositories": "mappings",
"http": "container",
"migrations": "tools",
"modules": "components",
"implementations": "core",
"dtos": "typescript",
"fakes": "mock",
"coverage_reports": "tools",
},
"material-icon-theme.files.associations": {
"ormconfig.json": "database",
"routes.tsx": "routing",
"routes.ts": "routing",
"*.html": "html",
},
"sqlite.databaseExtensions": [
"db",
"db3",
"sdb",
"s3db",
"sqlite",
"sqlite3",
"ts"
],
}
Would there be anyone who can help in this issue?
I believe option + control + "B" should work
It is also a right click on the document and you should see a "format document" option.
It works for me