I have a C++ project with one very large C file (the excellent lightweight mongoose web server) which really canes cppcheck. Is there a way to disable the automatic lint for this file alone?
Or failing that, how can I switch off automatic linting for all C files, but keeping it on for C++?
You can edit this file
/Library/Application Support/Sublime Text 2/Packages/SublimeLinter/SublimeLinter.sublime-settings
and add languages that SublimeLinter will ignore:
// An array of linter names to disable. Names should be lowercase.
"sublimelinter_disable":
[
],
You might also map this command to a key/combination:
{
"caption": "SublimeLinter: Disable Linting",
"command": "sublimelinter_disable",
"args": {"action": "off"}
},
Related
I'm currently tasked with building 2 UI's for a service I've constructed.
The output from both of these UI's will need to end up in the same root folder.
I found the section that names the basic bundles in the "aurelia.json" file, and renamed the bundles created for my project, when built, my project as expected created 2 new bundles in the scripts directory with the new names.
However, upon running my project, I then found that index.html was getting a 404 trying to load the "vendor-bundle" (Which I had renamed to 'service-vendor-bundle').
No problem there, I just edited index.html to reference the new file, and bingo, 404 resolved.
The problem is however, that "service-vendor-bundle" can now not load "service-app-bundle".
I assumed (Probably incorrectly) that, when I renamed the bundles in my aurelia.json file, that the build output would also be configured appropriately to load the files in.
I need to be able to customize this beacuse once the 2 aurelia apps are finished, they will need to share a scripts folder, so I'll need
uione.html to load "scripts\uione-vendor-bundle.js" and "scripts\uione-app-bundle.js"
and I'll need
uitwo.html to load "scripts\uitwo-vendor-bundle.js" and "scripts\uitwo-app-bundle.js"
The final file layout once on the server will look something like the following:
root
uione.html
uitwo.html
scripts
uione-vendor-bundle.js
uione-app-bundle.js
uitwo-vendor-bundle.js
uitwo-app-bundle.js
images
*.png
Both client apps have to be developed separate from each other and be stand alone, so I can't combine them into one app, and I cant put them into seperate folders as the service that will be serving them is a custom in house built service, specifically configured to only serve from a single folder, with a single scripts and images folder.
My aurelia.json file currently looks like this:
.........
"plugins": [
{
"name": "text",
"extensions": [
".html",
".css"
],
"stub": true
}
]
},
"options": {
"minify": "stage & prod",
"sourcemaps": "dev & stage"
},
"bundles": [
{
"name": "uione-app-bundle.js",
"source": [
"[**/*.js]",
"**/*.{css,html}"
]
},
{
"name": "uione-vendor-bundle.js",
"prepend": [
"node_modules/bluebird/js/browser/bluebird.core.js",
"node_modules/requirejs/require.js"
],
..........
and I'm using the Aurelia cli tool (au ...) for my Aurelia based tasks.
Any pointers on how to achieve this would be great.
I think you're on the right track by customizing the bundle names.
What you can do is manually load both the vendor bundle and the app bundle. That way the app modules are already downloaded and ready to use, instead of letting the vendor bundle try to download it manually.
index.html
<body aurelia-app="main">
<script src="scripts/my-special-vendor-bundle.js" data-main="aurelia-bootstrapper"></script>
<script src="scripts/my-special-app-bundle.js"></script>
</body>
I have tested this and it is working fine for me. I am using this manual loading technique in my own project to allow ASP.Net script versioning to provide cache-busting (see my answer here).
In Sublime Text 2 or 3 (I use both, and the answer is probably the same for both), how do you change the hotkey of an installed plugin/package? (on Windows or Linux / Ubuntu)
I already know how to change the key bindings of built-in Sublime commands (Preferences > Key Bindings). For instance, one binding I already have is:
{"keys": ["ctrl+super+b"], "command": "show_panel", "args": {"panel": "output.exec"}}
But in the case of a plugin, how do I know what string to use for "command"? Is there an easy way to find out what the "command" is for an arbitrary function in Sublime?
I would like a general answer that applies to any plugin one could install. Though as an example, today I'm trying to change the hotkey for a plugin called SimpleClone, which has assigned Ctrl+Shift+Right to Split Right. Ctrl+Shift+Right is a rather poor hotkey choice by the maker of the plugin since it already has a use in the operating system: when typing it selects the word to the right. Hence I want to change the assigned key binding.
If plugin has some shortcuts defined, they will be in the *.sublime-keymap files. So if you want to find some shortcut I guess you could grep through all the *.sublime-keymap files in Packages directories, but if you roughly know which plugin uses that shortcut you want to change that shouldn't be necessary :)
For example the Emmet plugin has keybindings defined in: Packages/Emmet/Default (Platform).sublime-keymap.
You can copy the keybinding definitions from these files to your user keybindings file (Packages/User/Default (platform).sublime-keymap) and modify them as you want.
You can open Packages list by pressing Cmd-Shift-P (on Windows should be Ctrl-Shift-P), choosing Package Control: list packages then select the package you neeed and press Enter. Sublime will open package directory where you can find all desired *.sublime-keymap files.
You can do the following:
Go to "Menu->Preferences->Browse packages..."
Find the directory of the interested package.
Find file with ".sublime-commands" extension.
Get command name from file.
Use "Menu->Preferences->Key bindings" for add key binding.
Ex (StringUtilities):
[
{ "keys": ["ctrl+b"], "command": "convert_to_base64" },
{ "keys": ["ctrl+shift+b"], "command": "convert_from_base64" },
{ "keys": ["ctrl+u"], "command": "url_encode" },
{ "keys": ["ctrl+shift+u"], "command": "url_decode" }
]
TL;DR: SourceTree for Windows recently added the "commit text links" feature, but it appears that the replacements must be set up per-repository. Is there a way to apply them globally or a config file that could be modified programmatically to set them?
Long version: The "commit text links" feature looks incredibly useful but I have a bit of a problem: We have about a dozen JIRA projects and over 25 repositories that each of them could be related to (none of them are 1-to-1 mappings). While I could set up a single regular expression to match each of the JIRA projects, it's a bit much to ask all of my developers to set it up through the UI for each and every repository. To really take advantage of this I ideally need to be able to give them instructions on a single file to modify or I need to generate a setup script that I can distribute to our developers.
Is there a config file that this setting is saved in? I was expecting to see it in something like .hg/hgrc but I couldn't find anything. I also couldn't find any relevant settings in the SourceTree Program Files folder.
Alternatively, is there a global or default setting that can be applied across all repositories? That plus the regex version could make setup significantly less painful if still manual.
Thanks!
(Note: I'm in version 1.3.3.0 of SourceTree for Windows, which I believe is the most recent stable version)
May be a bit late, but I've found a relatively easy way to do this.
Underneath your .hg/.git folder within your repository should exist a file called 'sourcetreeconfig.' This is where the links live and can be manually edited.
First make sure that you have closed all of the existing repository tabs within sourcetree, and additionally close sourcetree afterwards. Then, (assuming you have already configured a repository) copy the block from the respective repository's sourcetreeconfig and do a replace across all of your sourcetreeconfig files. This would be if you have multiple tied to the same project. It should be relatively easy to throw something together that can configure for different projects, just replace the url/project within the config.
Upon reopening sourcetree, each of your repositories should reflect this change.
This was performed using version 1.6.5.0 of sourcetree.
Programmatic Solution
Here in late 2019, the ability to globally configure commit text links in Sourcetree 3.2.6 for Windows still does not exist. Since this question was one of the few hits with a decent answer, I figured I would add an automated solution to the answers. I'm not a programmer, and I know the RegEx isn't the best, but this simple PowerShell script I cobbled together gets the job done. Make sure Sourcetree is closed before you run the script.
Copy the sourcelinker script into a Notepad++ or similar text editor application.
In order get the specific string for your setup, configure one of your Git repos with one or more commit text links specific to your organization.
A. Launch Sourcetree, select a Git repo, and click Settings.
B. In the Repository Settings window, click the Advanced tab.
C. In the Commit text links area, click Add.
D. From the Replacement type drop-down list, select Other.
E. Enter the Regex pattern and Link to URL for your specific setup, and click OK.
F. In the Repository Settings window, click OK.
G. Close Sourcetree.
Navigate to the .git sub-directory of the repo you configured, and open sourcetreesonfig.json.
Copy everything starting with "CommitTextLinks": [ through the closing bracket and comma ],. For example:
"CommitTextLinks": [
{
"$id": "11",
"LinkType": 99,
"Regex": "[fF][bB][#\\s]*(\\d+)",
"LinkToUrl": "https://companyname.fogbugz.com/f/cases/$1",
"Project": null,
"RootUrl": null,
"Description": "[fF][bB][#\\s]*(\\d+) => https://companyname.fogbugz.com/f/cases/$1"
}
],
Paste the copied content into your sourcelinker script between the single quotes that follow $New1 =.
Save the script as sourcelinker.ps1.
Copy sourcelinker.ps1 to the root folder where your Git repos reside.
Right-click the script, and select Run with PowerShell.
Launch Sourcetree, and check the Commit text links for your other Git repos.
Sourcelinker script
This script example contains Regex examples that link to Fogbugz and handles variations such as:
case12345
fb12345
bugzid12
Script
# Sourcelinker script
$InputFiles = Get-Item ".\*\.git\sourcetreeconfig.json"
$Old1 = '"CommitTextLinks": null,'
$New1 = '"CommitTextLinks": [
{
"$id": "9",
"LinkType": 99,
"Regex": "[bB][Uu][gG][sSzZ]\\s*[Ii][Dd]s?\\s*[#:; ]+(\\d+)",
"LinkToUrl": "https://companyname.fogbugz.com/f/cases/$1",
"Project": null,
"RootUrl": null,
"Description": "[bB][Uu][gG][sSzZ]\\s*[Ii][Dd]s?\\s*[#:; ]+(\\d+) => https://companyname.fogbugz.com/f/cases/$1"
},
{
"$id": "10",
"LinkType": 99,
"Regex": "[cC][aA][Ss][Ee]+\\s*(\\d+)",
"LinkToUrl": "https://companyname.fogbugz.com/f/cases/$1",
"Project": null,
"RootUrl": null,
"Description": "[cC][aA][Ss][Ee]+\\s*(\\d+) => https://companyname.fogbugz.com/f/cases/$1"
},
{
"$id": "11",
"LinkType": 99,
"Regex": "[fF][bB][#\\s]*(\\d+)",
"LinkToUrl": "https://companyname.fogbugz.com/f/cases/$1",
"Project": null,
"RootUrl": null,
"Description": "[fF][bB][#\\s]*(\\d+) => https://companyname.fogbugz.com/f/cases/$1"
}
],'
$InputFiles | ForEach {
(Get-Content -Path $_.FullName).Replace($Old1,$New1) | Set-Content -Path $_.Fullname
}
Solution inspired thanks to suggestion by Andrew Pearce from this thread.
(Running ST2 on Win7)
Just looking into ST2 as an ide for WebDev. I've introduced a few packages, but have got a bit lost in the configuration of them! I've a couple of problems.
Firstly I've got ST2 configured to open the browser on file save, but unfortunately it opens all files rather than just .html files. Ideally I'd like it to live refresh if the js is already in use, but in the worst case, just open .html files and ignore .js files
Secondly when it opens a .html file it opens it as a file rather than via SublimeServer which is running. I've followed this link and believe SublimeServer is running on the same port.
Here's the SublimeServer config:
{
"attempts": 5,
"autorun": true,
"interval": 500,
"mimetypes":
{
"": "application/octet-stream",
".c": "text/plain",
".h": "text/plain",
".py": "text/plain"
},
"port": 8000
}
and the proj config
{
"folders":
[
{
"path": "/E/Projects/MyProjects/My.Web/My.Web.App/My.Web.App.Designer"
}
],
"settings":
{
"sublime-view-in-browser":
{
"baseUrl": "http://localhost:8000/",
"basePath": "E:\\Projects\\MyProjects\\My.Web\\My.Web.App\\My.Web.App.Designer"
}
}
}
So where do I need to look in the config to modify this behaviour?
EDIT:
The packages I currently have installed are:
Bracket Highlighter
Browser Refresh
DocBlockr
Emmet
Git
Grunt
JSLint
Nodejs
Package Control
Side Bar
SublimeCodeIntel
SublimeLinter
View in Browser
Web Inspector
(and SublimeServer)
I pretty much got them all from Package Control.
As I newbie, I may need to pair some of these back.
Many thx IA
Simon
The code completion feature works really well when I type Java code, but I've recently made a build system for Modula-2, and while the auto-complete works when I press ctrl+space, it doesn't suggest the words on it's own. I have to hit ctrl+space every time, which (kind of) defeats the purpose.
I realize that modula-2 is not a very popular language, but sublimetext has a nice feature which remembers every word the user writes, and uses it in the code-completion. This is why the ctrl+space combo works in the first place. Does anyone know how to enable the suggestions?
What triggers the pop up is controlled by the auto_complete_selector setting. You will need to add the proper scope to that. If you are not using a syntax highlighter for those files, I believe this will apply the source scope to the file, which will then lead the pop up to show.
{
"name": "Modula-2",
"scopeName": "source.modula-2",
"fileTypes": [""],
"patterns": [
],
"uuid": "f8005a03-62cf-460b-84be-1184508464ed"
}
This is the JSON form, you can use PlistJsonConverter to convert to a plist. Then save that as a .tmLanguage file in the packages folder, probably the User Directory, or maybe a Modula-2 directory if you have other stuff associated with those types of files.
You should try Modula-2 Language Sintax it is a new package. You can install it using Package Control or simply by git clone git://github.com/harogaston/Sublime-Modula-2.git