I wanna make git bash but my default terminal but I'm getting an error because of another settings inside - bash

Im trying to make git bash my main terminal but couldn't because of the sass live server compiler. Here is the code
terminal.integrated.profiles.windows":{"Git Bash":{"path":"C:\\Program Files\\Git\\bin\\bash.exe"}, },
"terminal.integrated.defaultProfile.windows": "Git Bash"
{
"liveSassCompile.settings.formats": [
// This is Default.
{
"format": "expanded",
"extensionName": ".css",
"savePath": "/css"
}
],
"explorer.confirmDelete": false,
"powershell.powerShellDefaultVersion": "Windows PowerShell (x86)",
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 500
}
The error Im getting is Expected a JSON object, array or literal.

VS Code is complaining that its settings file is not valid JSON, which it is indeed not. Try the following:
{
"liveSassCompile.settings.formats": [
// This is Default.
{
"format": "expanded",
"extensionName": ".css",
"savePath": "/css"
}
],
"explorer.confirmDelete": false,
"powershell.powerShellDefaultVersion": "Windows PowerShell (x86)",
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 500,
"terminal.integrated.profiles.windows": {
"Git Bash": {
"path": "C:\\Program Files\\Git\\bin\\bash.exe"
},
},
"terminal.integrated.defaultProfile.windows": "Git Bash"
}

Related

Open directly PDF file in Skim from Visual Studio Code (macOS)

I am trying to open my PDF document with Skim from Visual Studio Code. I would like the View LaTeX PDF file command to open in Skim my PDF document and update it automatically. Unfortunately, when I click on the View LaTeX PDF file button, it does not open Skim.
I am forced :
To open Skim myself;
And then to open the PDF file;
When I do this, everything works fine. The file updates correctly each time I save the LaTeX file.
So I would like to be able to open Skim with the PDF document directly from Visual Studio Code. As I try to do at the beginning of the video.
Note that I have already read these questions SyncTex with Skim pdf viewer?, PDF Preview in Visual Studio Code and the documentation.
My configuration is the following:
macOS (12.1)
Visual Studio Code (1.63.0)
LaTeX Workshop plug-in (v8.22.0).
Skim 1.6.7 (137)
pdfTeX 3.141592653-2.6-1.40.22 (TeX Live 2021) kpathsea version 6.3.3
Latexmk, John Collins, 29 September 2020. Version 4.70b
settings.json
{
"workbench.colorTheme": "Cobalt2",
"editor.formatOnSave": true,
"[javascript]": {
"editor.formatOnSave": true
},
"[javascriptreact]": {
"editor.formatOnSave": true
},
"prettier.disableLanguages": [
"javascript",
"javascriptreact"
],
"workbench.startupEditor": "newUntitledFile",
"latex-workshop.intellisense.package.enabled": true,
"latex-workshop.intellisense.unimathsymbols.enabled": true,
"latex-workshop.latex.recipes": [
{
"name": "latexmk 🔃",
"tools": [
"latexmk"
]
},
{
"name": "pdflatex ➞ bibtex ➞ pdflatex`×2",
"tools": [
"pdflatex",
"bibtex",
"pdflatex",
"pdflatex"
]
}
],
"latex-workshop.latex.tools": [
{
"name": "latexmk",
"command": "latexmk",
"args": [
"-shell-escape",
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"-outdir=%OUTDIR%",
"%DOC%"
],
"env": {}
},
{
"name": "pdflatex",
"command": "pdflatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
],
"env": {}
},
{
"name": "bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
],
"env": {}
},
{
"name": "latexmk",
"command": "latexmk",
"args": [
"-xelatex",
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
]
}
],
"latex-workshop.latex.clean.subfolder.enabled": true,
"git.autofetch": true,
"terminal.integrated.fontFamily": "Inconsolata for Powerline",
"latex-workshop.view.pdf.viewer": "external",
"editor.minimap.enabled": false,
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"files.exclude": {
"**/.classpath": true,
"**/.project": true,
"**/.settings": true,
"**/.factorypath": true
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"workbench.iconTheme": "material-icon-theme",
"prolog.executablePath": "/Applications/SWI-Prolog.app/Contents/MacOS/swipl",
"python.languageServer": "Microsoft",
"editor.wordWrap": "on",
"latex-workshop.view.pdf.zoom": "page-fit",
"latex-workshop.view.pdf.external.viewer.args": [
"0",
"%PDF%"
],
"latex-workshop.view.pdf.external.viewer.command": "/Applications/Skim.app/Contents/SharedSupport/displayline",
"latex-workshop.view.pdf.external.synctex.command": "/Applications/Skim.app/Contents/SharedSupport/displayline",
"latex-workshop.view.pdf.external.synctex.args": [
"-r",
"-b",
"%LINE%",
"%PDF%",
"%TEX%"
],
"latex-workshop.latex.autoBuild.cleanAndRetry.enabled": true,
"latex-workshop.latex.autoClean.run": "onBuilt",
"latex-workshop.latex.clean.fileTypes": [
"*.aux",
"*.bbl",
"*.blg",
"*.idx",
"*.ind",
"*.lof",
"*.lot",
"*.out",
"*.toc",
"*.acn",
"*.acr",
"*.alg",
"*.glg",
"*.glo",
"*.gls",
"*.ist",
"*.fls",
"*.log",
"*.fdb_latexmk",
"*.snm",
"*.nav",
"*.synctex.gz",
"*.run.xml",
"*.bcf",
"__latexindent_temp.tex"
],
"explorer.confirmDelete": false,
"latex-workshop.latexindent.path": "/usr/local/texlive/2021/bin/universal-darwin/latexindent",
"security.workspace.trust.untrustedFiles": "open",
"editor.fontSize": 16
}
So...In fact, the problem does not come from the setting file. It is well formed and valid. The problem is a scripting support bug in Monterey12.1. The sdef parser can't handle synonyms. This has been documented here.
A workaround while waiting for an update is to edit the file /Applications/Skim.app/Contents/Resources/Skim.sdef and comment these lines of code
<!-- <synonym name="selection for"/> -->
<!-- <synonym name="get preferences"/> -->
It's not the kind of solution I like, but, in the meantime, it does the job here at first.

VSCode error in settings when trying to set Git Bash as default profile for terminal

I tried to set Git Bash as the default terminal in VSCode, but I can't do it successfully. I've tried following the next articles:
How do I use Bash on Windows from the Visual Studio Code integrated terminal?
How to Add Git Bash to VsCode
But they haven't resolved my issue.
I managed to generate profiles in settings.json, but Git Bash doesn't work for some reason unknown to me and VsCode shows an error.
My settings.json:
{
"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",
"path": "C:\\git-sdk-64\\git-bash.exe",
"args": [
"--login",
"-i"
]
},
"Cygwin": {
"path": "C:\\cygwin64\\bin\\bash.exe",
"args": [
"--login"
]
}
},
"terminal.integrated.defaultProfile.windows": "Git Bash"
}
The error:
Does anyone know how to fix this?
My VsCode version:
Version: 1.57.1 (user setup)
Commit: 507ce72a4466fbb27b715c3722558bb15afa9f48
Date: 2021-06-17T13:28:07.755Z
Electron: 12.0.7
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Windows_NT x64 10.0.19042
Edit:
I use git SDK, which is like git-bash but not exactly. Maybe this is the problem?
this finally worked for me
"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"
},
"GitBash": {
"path": ["C:\\Program Files\\Git\\bin\\bash.exe"],
"args": [],
"icon": "terminal-bash"
}
},
"terminal.integrated.defaultProfile.windows": "GitBash"
}
I just met a same problem. And the solution on my VS Code 1.60.0 is also to rename Git Bash into GitBash.
During debugging using Developer Tools, I found VS Code always "merge" object values with the default values of a same key, so:
in VS Code, the Git Bash key has a default value of { source: "Git Bash" }
I once wrote {..., "Git Bash": { "path": "D:\\Git\\usr\\bin\\bash.exe", ... }}
and then the merged value is {..., "Git Bash": { "source": "Git Bash", "path": "...", ... }}
during a function named showProfileQuickPick, VS Code calls _detectProfiles
this function sends values of terminal.integrated.profiles.windows and terminal.integrated.defaultProfile.windows to its _primaryOffProcessTerminalService
the value of profiles is just the merged one
as a result, the object of Git Bash is somehow "illegal" and then ignored
On the contrary, GitBash means to declare a new profile object, so it should work.

Visual Studio Code new config setting in terminal profiles using Cmder

I am trying to integrate cmder into visual studio code as the default terminal, I used to configure like this in my settings.json.
{
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
"terminal.integrated.shellArgs.windows": [
"/k",
"C:\\Program Files\\cmder\\vendor\\init.bat"
],
}
But now visual code is telling me this configuration is deprecated.
So, I started to investigate VSC documentation, and it is saying I should import like this:
{
"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"
},
"Cmder": {
"path": "C:\\Program Files\\cmder\\vendor\\init.bat"
}
},
"terminal.integrated.defaultProfile.windows": "Cmder"
}
But it is not working... is starts opening the terminal but closes immediately. Is there something I am missing?
You could try like this (leave the rest unchanged):
...
"Cmder": {
"path": "C:\\WINDOWS\\SysWOW64\\cmd.exe",
"args": ["/k", "C:\\Program Files\\Cmder\\vendor\\init.bat"]
}
...
Alternatively, you can also try with:
these paths:
"C:\\Windows\\Sysnative\\cmd.exe"
"C:\\Windows\\System32\\cmd.exe"
these args:
["/k", "C:\\PROGRA~2\\Cmder\\vendor\\init.bat"]
["/k", "C:\\Program Files^ (x86)\\Cmder\\vendor\\init.bat"]
one of the above in a single string instead of two

How to setup output path to compiled css files using 'vscode live sass compiler extension'

I would like the compiled file in folder 'RWD/homework/css', not in 'RWD/css', how can I set?
This is my setup:
{
"liveSassCompile.settings.formats":[
{
"format": "expanded",
"extensionName": ".css",
"savePath": "./css"
}
],
"[c]": {},
"[bat]": {},
"editor.fontSize": 16
}
My target path

How to setup output path to compiled css files using `vscode live sass compiler extension` in windows10?

I failed to run node-sass(node module), where I was able to setup path for input extensions.scss files and output files generated after compiling to dist/ folder.
Now, I am using vscode extension live sass compiler,
at bottom bar, when I clicked Watched Sass then it compiled automatically scss file to css but in same folder.
main.scss is compiled to main.css.
problem is that I wanted to create that compiled css file in other folder .i.e. in output folder ./dist/.
I have manually created main.css file in ./dist/folder.
How can I setup path to source and destination files in that extension?
I have had the same issue when I started implementing SMACSS methodology to my projects. This is the solution I have tried. hope it will help you.
Go to VScode User Settings --> Select "Live Sass Compiler Config --> add
"liveSassCompile.settings.formats": [{
"format": "expanded",
"extensionName": ".css",
"savePath": "./css"
}]
Go to VScode menu- file>preferences>settings>extension>live sass copile config>edit in settings.json
and paste it code >>
"liveSassCompile.settings.formats": [
{
"format": "expanded",
"extensionName": ".css",
"savePath": "~/../css/"
}
]
You can go to VSCode Setting.json file and add following lines after the existing configuration.
Example:
"liveSassCompile.settings.formats": [
{
"format": "expanded",
"extensionName": ".css",
"savePath": "~/../dist/css/"
}
]
Not sure if this will help anyone since it's been a long time it was posted but I had multiple folders opened in VSCode recently and everytime I tried to use live sass compiler it would go to the folder that was on top of the list and create the css/styles.css file(s) inside that directory.
I saw this solution on the Live Sass Compiler creators website:
https://ritwickdey.github.io/vscode-live-sass-compiler/docs/faqs.html
What you do is simple, lets say you have a folder architecture
like my one here. (image link)
All you have to do is make a folder named .vscode and add a settings.json file inside that folder.
Inside settings.json paste the following code:
{
"liveSassCompile.settings.formats": [
{
"format": "expanded",
"extensionName": ".css",
"savePath": "/Parallax/css"
},
{
"extensionName": ".min.css",
"format": "compressed",
"savePath": "/Parallax/dist/css"
}
],
"liveSassCompile.settings.excludeList": [
"**/node_modules/**",
".vscode/**"
],
"liveSassCompile.settings.generateMap": true,
"liveSassCompile.settings.autoprefix": [
"> 1%",
"last 2 versions"
]
}
Notice how my liveSassCompile.settings.formats is formatted: I've written the save paths as /Parallax/css/ and /Parallax/dist/css. This goes to the project root and saves the css files inside the folders called css and dist which are inside the Parallax directory. (image link)
In conclusion each time you want to change the save path all you have to do is modify the settings.json file inside the .vscode folder rather than modifying the user settings which is tedious in my opinion.
Final structure should look like this once you edited the main.scss file.
Inside your Project Create a (.vscode) Directory. In the .vscode folder create a json file named settings.json. Inside of the settings.json, type the following key-value pairs. By the way you'll get intelli-sense. I hope this will work
{
"liveSassCompile.settings.formats":[
{
"format": "expanded",
"extensionName": ".css",
"savePath": "/css"
},
{
"extensionName": ".min.css",
"format": "compressed",
"savePath": "/dist/css"
}
],
"liveSassCompile.settings.excludeList": [
"**/node_modules/**",
".vscode/**"
],
"liveSassCompile.settings.generateMap": true,
"liveSassCompile.settings.autoprefix": [
"> 1%",
"last 2 versions"
]
}
Go to live SassCompiler extension settings and enter below code setting in JSON file and save.
"liveSassCompile.settings.autoprefix": [],
"liveSassCompile.settings.formats": [
{
"format": "expanded",
"extensionName": ".css",
"savePath": "~/../dist/css/"
}
None of above methods worked for me until I used the code below in the settings.json.
{
"liveSassCompile.settings.formats": [
{
"format": "expanded",
"extensionName": ".css",
"savePath": "~/../../css/"
}
],
"editor.minimap.enabled": true,
"liveSassCompile.settings.generateMap": false
}
On the savePath line you have to keep the "~" or else it wont work.
On "editor.minimap.enabled": and "liveSassCompile.settings.generateMap":
These lines are for if you want to generate a map.css file, put "false" for no, or "true" for yes.
Add this to generate .css files in a css folder in the project root directory:
"liveSassCompile.settings.formats": [
{
"format": "expanded",
"extensionName": ".css",
"savePath": "/css"
}
],
Or to generate in dist/css:
"liveSassCompile.settings.formats": [
{
"format": "expanded",
"extensionName": ".css",
"savePath": "/dist/css"
}
]
This can either be in VS Code global settings.json to apply to all projects (look for "liveSassCompile.settings.formats" and change the "savePath" line; the provided "format" and "extensionName" are already the defaults), or if you want to limit the settings to the current project, place the settings in a settings.json file within a folder named .vscode.
Refer to the Live Sass Compiler settings doc for more information: https://github.com/ritwickdey/vscode-live-sass-compiler/blob/master/docs/settings.md
Open your vs.code and go to settings then search Sass and see below Live Sass Compiler click here and see right side Live Sass Compile > Settings: Formats then edit this Settings and change only your SavePath Like example below this code.
{
"scss.format.enable": true,
"liveSassCompile.settings.autoprefix": [
],
"liveSassCompile.settings.watchOnLaunch": false,
"liveSassCompile.settings.formats": [
{
"format": "expanded",
"extensionName": ".css",
"savePath": "/assets/css", // you can change this path
"savePathReplacementPairs": null
}
]
}
Do everything as Sulara said. When you open the settings.json file, it may look like this.
{
"window.zoomLevel": 0
}
So, you need to apply the recommended settings like the following.
{
"window.zoomLevel": 0,
"liveSassCompile.settings.formats": [{
"format": "expanded",
"extensionName": ".css",
"savePath": "./css"
}]
}
You can go to VSCode Setting.json file and add following lines after the existing configuration.
Example:
src path- project_folder/sass/style.scss
output path - project_folder/css/style.css
"liveSassCompile.settings.formats": [{
"format": "expanded",
"extensionName": ".css",
"savePath": "/css/"
}]

Resources