This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, sublime_plugin | |
class CmdCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
file_name=self.view.file_name() | |
path=file_name.split("\\") | |
current_driver=path[0] | |
path.pop() | |
current_directory="\\".join(path) | |
command= "cd "+current_directory+" & "+current_driver+" & start cmd" | |
os.system(command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
"save_on_focus_lost": true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"highlight_line": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cmd": ["gcc", "$file", "-o", "$file_base_name"], | |
"selector": "source.c", | |
"working_dir": "${file_path}", | |
"variants": | |
[ | |
{ | |
"name": "Run", | |
"cmd" : ["$file_path/${file_base_name}"], | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cmd": ["lua", "$file"], | |
"file_regex": "^(...*?):([0-9]*):?([0-9]*)", | |
"selector": "source.lua" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [status, result] = git(varargin) | |
cmd = '"c:\Program Files\Git\cmd\git.cmd"'; | |
for i = 1:numel(varargin) | |
cmd = [cmd ' ' varargin{i}]; | |
end | |
switch nargout | |
case 0, system(cmd); | |
case 1, [status] = system(cmd); | |
case 2, [status, result] = system(cmd); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test = load('test.mat'); | |
fn = fieldnames(test); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Run matlab as administrator | |
% solve the problem opening a new matlab after double click m-file. | |
cwd = pwd; | |
cd([matlabroot '\toolbox\matlab\winfun\private']); | |
fileassoc('add','.m') ; | |
cd(cwd); | |
disp('Changed Windows file association. M-files are now associated with MATLAB.'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime, getpass | |
import sublime, sublime_plugin | |
class InsertDatetimeCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
self.view.run_command("insert_snippet", { "contents": "%s" % datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") } ) | |
# self.view.run_command("insert_snippet", { "contents": "%s" % datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S %a") } ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# modify etc/profile | |
# normalize HOME to unix path | |
HOME="/e/GitRep" | |
HOME="$(cd "$HOME" ; pwd)" | |
cd | |
export PATH="$HOME/bin:$PATH" |
OlderNewer