Enable Package Control to Sublimetext-2 - sublimetext

My Question is regarding to sublime text2 editor. I need to install Package Controller on it. And i want to enable sublime-terminal. I am very confused. please help me to resolve it.
Thanks,
Shamith c

The Sublime Console is triggered with CTRL+`.
The instructions to install Package Control can be found here: http://wbond.net/sublime_packages/package_control/installation.

I've noticed that Ctrl+' does it sometimes (on Windows, at any rate)

The comibation ctrl+` never worked for me (Linux AND Windows :-/ ) So I pasted the following into the user specific key bindings:
[
{ "keys": ["ctrl+#"], "command": "show_panel", "args": {"panel": "console", "toggle": true} }
]
An alternative would be the menu: View >> Show console

Related

Go: vim autocomplete <ENTER> command don't works

autocomplete in vim doesn't work when I hit ENTER and the cursor go to the next line.
this is my .vimrc configuration: https://github.com/marcosvidolin/dotfiles/blob/master/.vimrc
Popup example:
Thanks
you need to add this to your .vimrc
inoremap <silent><expr> <cr> coc#pum#visible() ? coc#_select_confirm() : "\<C-g>u\<CR>"
source : Completion with sources
I am using vim and using Coc module for language server configuration.
Try to run these following steps:
Install gopls GO111MODULE=on go get golang.org/x/tools/gopls#latest
Open you vim and type :CocConfig and setting up go language configuration like the following bellow. (note: feel free to customize the value, especially in field rootPatterns)
{
"languageserver": {
"golang": {
"command": "gopls",
"rootPatterns": ["go.mod", "main.go", ".vim/", ".git/", ".hg/"],
"filetypes": ["go"],
"initializationOptions": {
"usePlaceholders": true
}
}
}
}
Save File and Reload your vim configuration

Error Received when using liveserver for VSCode

I was wondering if anyone possibly know the solution for this error
Error: connect ECONNREFUSED 127.0.0.1:80
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
I'm trying to run a live server while working on my html file but it's not letting me . I restarted my pc..same issue... restarted program...same issue... used localhost... same issue ...switched setting to chrome browser....same issue..
I also added (code below) to my JSON Settings file...Still running to the same issues. It was running fine last night and this morning it completely stopped working.
"liveServer.settings.CustomBrowser": "chrome"
I had the same issue.
I changed my settings in settings.json(live server extension settings)
to this .
It started working again !!!
I hope it's useful
{
"workbench.colorTheme": "Default Dark+",
"liveServer.settings.port": 5500,
"liveServer.settings.https": {
"enable": false,
"key": "",
"passphrase": "",
"cert": " "
},
"liveServer.settings.proxy": {
"enable": true,
"baseUri": "http://127.0.0.1:80",
"proxyUri": "http://127.0.0.1:80"
},
"liveServer.settings.CustomBrowser": "chrome",
"liveServer.settings.donotShowInfoMsg": true,
"liveServer.settings.host": "127.0.0.1:80",
"liveServer.settings.useLocalIp": true
}
ok so i had this same problem today and what i did was to go into file>setting look up live server and edit json and delete the settings there and saved and reloaded and it seem to start to work again.
Open VSCode and click File, Preferences, Settings than type in search settings Liveserver port The LiveServer Settings Port option will appear, click Edit in settings.json.
And set "liveServer.settings.port": 5500, save and close settings.json.
And If you have a .vscode directory in your project directory then remove it.
Restart VSCode and run Liveserver and keep on Coding! :-) Now it's should up and running;-)
Helpful screenshot:
I typed exactly same URLs in these two boxes and Viola! The issue was resolved.

The option formatting.local in vscode-go its working?

I'm using vscode-go extension and reading the options I see than exist the formatting.local option but this option seems not be working Im trying to configure like this...
settings.json
"go.formatTool": "goimports",
"go.formatting.local": "github.com/mycompany/my_app"
What could be wrong?
"formatting.local" is a gopls setting. https://github.com/golang/vscode-go/blob/master/docs/settings.md#settings-for-gopls So, please add it inside the "gopls" block for now.
"gopls": {
"formatting.local": "github.com/mycompany/my_app"
}

How to set vscode format golang code on save?

I'm using vscode with Go extensions to edit golang source code. Each time I want to format code, I have to press Ctrl-Shift-i on linux, Shift-Alt-F on Windows, or Ctrl-Shift-p and type format. Is it possible to set format on save, that is, when I press ctrl-s, it format the code automatically using go.fmt (or something alike)?
From my visual code version, i cannot use config go.formatOnSave": false.
Then I can turn them off in settings as below:
Build (Turn off using go.buildOnSave setting)
Lint (Turn off using go.lintOnSave setting)
Vet (Turn off using go.vetOnSave setting)
Format (Turn off by adding the below in your settings):
"[go]": {
"editor.formatOnSave": false
}
You should install this plugin: https://github.com/golang/vscode-go. One of the options is to set "auto format" on save: go.formatOnSave": false. It uses the Golang tooling for formatting.
For me, none of the answers worked. My Go version is 1.17.1, VSCode version is 1.60.1 and I'm using Linux Pop!_os.
After some digging online found this in the official VSCode documentation for Go. https://code.visualstudio.com/docs/languages/go#_formatting
My settings.json looks like this
"[go]": {
"editor.insertSpaces": true,
"editor.formatOnSave": true,
"editor.defaultFormatter": "golang.go"
},
Note: You need to install the required extensions for the go lang in VS code. Check the bottom left bar after opening a *.go file and you should see the go version. If you see an exclamation icon click on it and install the suggested extensions.
For me the followed settings worked. I disabled the annoying import refactoring.
"[go]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": false
},
}

How to run `go fmt` on save, in Visual Studio Code?

How to make Visual Studio Code (or Go Programming Language Extension) to run go fmt (or other tools/commands) on save? Even auto save?
Update:
It is working now perfectly inside VSCode, at this time; just need to add some config files inside .vscode directory (I use these).
Update 2019:
This question is old. The VSCode Go extension has all you need to develop in Go, now.
Last Update 2019
BTW It worth mentioning that right above the package declaration inside your test files appears a run package tests. If you click it, you can see your code coverage of your code. The covered and not-covered parts are highlighted in different colors.
Update 2020
And now, the Go Extension for VSCode, is under the supervision of Go Team! 🎉
Now, the feature has been implemented, you can enable format on save:
Open Settings (Ctrl + ,)
Search for editor.formatOnSave and set it to true
Your Go code will be formatted automatically on Ctrl + s
Its not possible at the moment but its being worked on https://github.com/Microsoft/vscode-go/issues/14
I'm not familiar with 'go fmt' specifically, but you can create a simple vscode extension to handle on save event and execute any arbitrary command passing the file path as an argument.
Here's a sample that just calls echo $filepath:
import * as vscode from 'vscode';
import {exec} from 'child_process';
export function activate(context: vscode.ExtensionContext) {
vscode.window.showInformationMessage('Run command on save enabled.');
var cmd = vscode.commands.registerCommand('extension.executeOnSave', () => {
var onSave = vscode.workspace.onDidSaveTextDocument((e: vscode.TextDocument) => {
// execute some child process on save
var child = exec('echo ' + e.fileName);
child.stdout.on('data', (data) => {
vscode.window.showInformationMessage(data);
});
});
context.subscriptions.push(onSave);
});
context.subscriptions.push(cmd);
}
And the package file:
{
"name": "Custom onSave",
"description": "Execute commands on save.",
"version": "0.0.1",
"publisher": "Emeraldwalk",
"engines": {
"vscode": "^0.10.1"
},
"categories": [
"Other"
],
"activationEvents": [
"onCommand:extension.executeOnSave"
],
"main": "./out/src/extension",
"contributes": {
"commands": [{
"command": "extension.executeOnSave",
"title": "Execute on Save"
}]
},
"scripts": {
"vscode:prepublish": "node ./node_modules/vscode/bin/compile",
"compile": "node ./node_modules/vscode/bin/compile -watch -p ./"
},
"devDependencies": {
"typescript": "^1.6.2",
"vscode": "0.10.x"
}
}
The extension is enabled via cmd+shift+p then typing "Execute on Save", but it could be reconfigured to start via another command including "*" which would cause it to load any time VSCode loads.
Once the extension is enabled, the event handler will fire whenever a file is saved (NOTE: this doesn't appear to work when file is first created or on Save as...)
This is just a minor modification of a yo code scaffolded extension as outlined here: https://code.visualstudio.com/docs/extensions/example-hello-world
Update
Here's a Visual Studio Code extension I wrote for running commands on file save. https://marketplace.visualstudio.com/items/emeraldwalk.RunOnSave.
I was using CTRL+S for saving the file manually (this is habitual for me). However, I had a different binding in VS Code that would start with CTRL+S (e.g. swagger extension has a chord where pressing CTRL+S CTRL+W would generate the swagger annotation). This resulted in VS Code waiting for me to press the second chord (CTRL+W) and as such it ignored the save part altogether. I reconfigured all the keybinding chords which had CTRL+S as the first chord to a different combination. After this, pressing CTRL+S formatted my file with gofmt properly.

Resources