sublimetext3

How to run a lua file in cmd from Sublime Text 3?

独自空忆成欢 提交于 2019-12-08 03:06:27
I want to run lua files in cmd (for a reason I can't use build system). How can I do this? r-stein Since you just want to call a cmd command you can easily write your own plugin. Just open your user directory and create a python file (e.g. run_lua.py ). Or just go with Tools >> New Plugin. This plugin runs the command lua $file and afterwards pauses until the user pressed a key: import subprocess import sublime_plugin class RunLuaCommand(sublime_plugin.WindowCommand): def run(self): view = self.window.active_view() subprocess.Popen(["cmd", "/c", "lua", view.file_name(), "&", "pause"]) Add the

Can Sublime SFTP remember an SSH key passphrase?

筅森魡賤 提交于 2019-12-08 01:41:19
问题 When I use Sublime SFTP to connect to a server via the SFTP protocol, it always prompts for my SSH key passphrase the first time I connect during a given editing session. Since I work with many sites and use strong passwords, memorizing these passphrases isn't an option. So I have to open a customer's reference document to copy/paste their passphrase each time. Is there any way to let the plugin remember a passphrase, or to specify it in the .json config file? Or would that be dangerous for

Sublime Text 3: Set Environment Variable for plugin_host

霸气de小男生 提交于 2019-12-08 00:05:22
问题 Sublime Text 3 on OSX. I am writing a plugin that loads up a particularly poorly-written 3rd-party Python module that relies on the value of an Environment Variable to function properly (in particular, DYLD_LIBRARY_PATH ). Of course, I could set this globally, but I would love for the Sublime Plugin to be self-contained. I notice that plugins run in a child process of Sublime itself - is there any way to tell Sublime to provide the plugin_host process with a particular Environment Variable

Installing sublime text 3 on AWS Ubuntu 14.04.1 LTS

淺唱寂寞╮ 提交于 2019-12-07 23:51:20
问题 Sublime-text is a fast editor for Windows and Linux. I failed to install sublime text 3 on AWS Ubuntu 14.04.1 LTS using the following commands: sudo add-apt-repository ppa:webupd8team/sublime-text-3 sudo apt-get update sudo apt-get install sublime-text-installer Results in following error message: p: cannot create regular file "/usr/share/icons/hicolor/16x16/apps/": No such file or directory dpkg: error processing package sublime-text-installer (--configure): subprocess installed post

Sublime Text MySQL Build System variable substitution issue

我与影子孤独终老i 提交于 2019-12-07 21:48:43
问题 I'm trying to configure Sublime text to do MySQL build, following is the script: { "cmd": ["mysql", "--default-character-set=utf8", "-uuser", "-ppwd", "-hlocalhost", "-v", "db_mine", "-e source main.sql"], "selector": "source.sql" } As it is, it works for file main.sql , as presented in the script. Obviously that should be changed, I see people using $file there. The problem is that here (Windows 7) it's not working. If I change it to $file , then I get: ERROR at line 1: Unknown command '\U'.

How to make build system for PostgreSQL

ε祈祈猫儿з 提交于 2019-12-07 20:15:09
问题 Making build system for MS SQL Server is easy: { "cmd": ["sqlcmd", "-S", ".", "-i", "$file"], "selector": "source.sql", "shell": true } and for PostgreSQL I tried this: { "env": {"PGPASSWORD": "password"}, "cmd": ["C:/PostgreSQL/9.3/bin/psql.exe", "-U", "postgres", "-f", "$file"], "selector": "source.postgresql", "shell": true } But, while with MS SQL I can reference database from the script with USE keyword, there is no such feature in Postgre so above build can't work, and it seems to me I

get current file name from sublime_plugin.WindowCommand

╄→гoц情女王★ 提交于 2019-12-07 20:14:43
问题 I develop plugin for sublime text 3 . And want to get currently opened file path ... absolute1 = self.window.view.file_name() ... where self is sublime_plugin.WindowCommand But fail: AttributeError: 'Window' object has no attribute 'view' Full code of plugin: import sublime, sublime_plugin import re, os, os.path class OpenrelCommand(sublime_plugin.WindowCommand): def run(self): relative = sublime.get_clipboard() absolute1 = self.window.view.file_name() absolute2 = os.path.normpath(os.path

Regex to find strings separated by comma, and then add quotes?

两盒软妹~` 提交于 2019-12-07 18:48:32
问题 I'm using Sublime Text 3 and have a CSV file with 1200 tax rates in this format: Code,Country,State,Zip/Post Code,Rate,default US-NY-10001-Rate 1,US,NY,10001,0.08875, .... I need a regex to find each value separated by a comma so I can then wrap quotes around it. Is this possible? 回答1: Find the following regular expression (using capturing group and backreference): ([^,\n]+) and replace it with: "\1" 来源: https://stackoverflow.com/questions/24741214/regex-to-find-strings-separated-by-comma-and

Type of regex used by Sublime Text 3?

做~自己de王妃 提交于 2019-12-07 15:18:40
问题 What type of Regex is Sublime Text 3 using? Posix? Posix Extended? 回答1: Sublime's Search and Search and Replace functions, along with snippets, are powered by Boost's pcre (Perl-Compatible Regular Expressions) engine, while the syntax highlighting language definitions ( .tmLanguage or .sublime-syntax files) use the oniguruma engine, which Ruby also uses. 回答2: Well this is odd. On regex101.com with it set to pcre , I have a substitution that works perfectly. Yet in sublime text 3, it does not.

Sublime Text and Hypens vs Underscores

荒凉一梦 提交于 2019-12-07 11:00:27
问题 I'm running into an issue with hyphens in sublime text 3 and I was looking for some help. I'd like them work the same way that underscores do. With underscores, double clicking on word_one selects the whole thing while using the keyboard with ctrl-right hops to the underscore. With hypens, double clicking on word-two selects the whole thing but using the keyboard with ctrl-right skips the entire word. If I add the hyphen to the "word separators" then the behavior is switched (double clicking