sublime Text Pastry使用
来源: https://github.com/duydao/Text-Pastry/wiki/Examples
- Using a text list
- Using the Clipboard
- Clipboard Data - Example 2
- From 1 to 3
- From 1000 to 1300
- From 100 to 50
- Insert Nums Syntax
- Insert Nums Syntax - Example 2
Using a text list
Assuming we have selected every ocurence of null
and Text Pastry was called by pressing CMD + ALT + N:
Enter a list of words, separated by one space, into the command line:
INPUT SELECT TEXTAREA DIV P A
Text
var a = document.getElementsByTagName('null');
var b = document.getElementsByTagName('null');
var c = document.getElementsByTagName('null');
var d = document.getElementsByTagName('null');
var e = document.getElementsByTagName('null');
var f = document.getElementsByTagName('null');
Result
var a = document.getElementsByTagName('INPUT');
var b = document.getElementsByTagName('SELECT');
var c = document.getElementsByTagName('TEXTAREA');
var d = document.getElementsByTagName('DIV');
var e = document.getElementsByTagName('P');
var f = document.getElementsByTagName('A');
Using the Clipboard
The same as above, but this time we copy the list of words into our clipboard:
Clipboard Data
INPUT SELECT TEXTAREA DIV P A
Command
Insert this into the input panel:
\p
Text
var a = document.getElementsByTagName('null');
var b = document.getElementsByTagName('null');
var c = document.getElementsByTagName('null');
var d = document.getElementsByTagName('null');
var e = document.getElementsByTagName('null');
var f = document.getElementsByTagName('null');
Result
var a = document.getElementsByTagName('INPUT');
var b = document.getElementsByTagName('SELECT');
var c = document.getElementsByTagName('TEXTAREA');
var d = document.getElementsByTagName('DIV');
var e = document.getElementsByTagName('P');
var f = document.getElementsByTagName('A');
Note
This command will use any whitespace as delimiter. If we copy following list, we will get the same result:
INPUT
SELECT
TEXTAREA
DIV
P
A
Clipboard Data - Example 2
Lets assume we want to paste some test data into our code:
71602 White Hall
71603 Pine Bluff
71611 Pine Bluff
71612 White Hall
71613 Pine Bluff
71630 Arkansas City
71631 Banks
71635 Crossett
71638 Dermott
71639 Dumas
Command
This command will tell Text Pastry to split up our clipboard data by using the newline character as separator:
\p(\n)
Text
var a = load('null');
var b = load('null');
var c = load('null');
var d = load('null');
var e = load('null');
var f = load('null');
Result
var a = load('71602 White Hall');
var b = load('71603 Pine Bluff');
var c = load('71611 Pine Bluff');
var d = load('71612 White Hall');
var e = load('71613 Pine Bluff');
var f = load('71630 Arkansas City');
Note
Each line of the clipboard data will be stripped/trimmed, so there won't be any leading spaces. The following list would therefore give us the same result when we use \p(\n) as command:
Data without leading/trailing whitespace
INPUT
SELECT
TEXTAREA
DIV
P
A
is equal to data with leading whitespace:
INPUT
SELECT
TEXTAREA
DIV
P
A
We can change this behaviour in the <Packages>/Text Pastry/TextPastry.sublime-settings file:
"clipboard_strip_newline": false
From 1 to 3
Start at 1, adding 1 for each selection:
\i
Text
var a = null;
var b = null;
var c = null;
Result
var a = 1;
var b = 2;
var c = 3;
From 1000 to 1300
Start at 1000, adding 100 for each selection:
\i(1000,100)
Text
var a = null;
var b = null;
var c = null;
Result
var a = 1000;
var b = 1100;
var c = 1200;
From 100 to 50
You can also use negative numbers to create a negative sequence:
\i(100,-10)
Text
var a = null;
var b = null;
var c = null;
var d = null;
var e = null;
var f = null;
Result
var a = 100;
var b = 90;
var c = 80;
var d = 70;
var e = 60;
var f = 50;
Insert Nums Syntax
Text Pastry supports the Insert Nums syntax:
1 100 1
Note: The last argument (padding) is optional, negative values are supported.
Text
var a = null;
var b = null;
var c = null;
var d = null;
var e = null;
var f = null;
Result
var a = 1;
var b = 101;
var c = 201;
var d = 301;
var e = 401;
var f = 501;
Insert Nums Syntax - Example 2
5 5 3
Text
var a = null;
var b = null;
var c = null;
var d = null;
var e = null;
var f = null;
Result
var a = 005;
var b = 010;
var c = 015;
var d = 020;
var e = 025;
var f = 030;
sublime Text Pastry使用的更多相关文章
- Sublime Text 3中文乱码解决方法以及安装包管理器方法
一般出现乱码是因为文本采用了GBK编码格式,Sublime Text默认不支持GBK编码. 安装包管理器 简单安装 使用Ctrl+`快捷键或者通过View->Show Console菜单打开命令 ...
- 在Sublime Text 3上安装代码格式化插件CodeFormatter
1.了解CodeFormatter插件 在Sublime Text 3中编写代码,为了能让我们的代码格式变得漂亮整洁,需要一个能自动格式代码的插件.这里发现CodeFormatter插件不错,它能支持 ...
- sublime text 3 + python配置,完整搭建及常用插件安装
四年的时间,一直使用EmEditor编辑器进行Python开发,之前是做面向过程,只需要将一个单独的py文件维护好即可,用着也挺顺手,但是最近在做面向对象的开发,不同的py文件中相互关联较多,感觉单纯 ...
- 前端工程师手中的Sublime Text
原文地址:http://css-tricks.com/sublime-text-front-end-developers/ 我的Blog:http://cabbit.me/sublime-text-f ...
- Sublime Text 全程指引 by Lucida
作者:Lucida 微博:@peng_gong 豆瓣:@figure9 博客园:@figure9 原文链接:http://zh.lucida.me/blog/sublime-text-complete ...
- 自定义Sublime Text的图标
sublime text很赞,windows上最接近mac逼格的轻量编辑器,对于我这样比较喜欢格调的人来说,简直不二之选啊. 美中不足的是,看久了觉得它的图标似乎不是很上心.现在都流行扁平化了而它还停 ...
- 如何优雅地使用Sublime Text
Sublime Text:一款具有代码高亮.语法提示.自动完成且反应快速的编辑器软件,不仅具有华丽的界面,还支持插件扩展机制,用她来写代码,绝对是一种享受.相比于难于上手的Vim,浮肿沉重的Eclip ...
- 为 Sublime Text 3059 配置 PHP 编译环境
关于 Sublime Text 3059 的安装及汉化 请参看 http://www.xiumu.org/note/sublime-text-3.shtml 为 sublime Text 配置 PH ...
- 杂谈:用 Sublime Text 2 写 ActionScript3
Sublime Text这是程序员最喜爱的编辑器,说说在win7下使用Sublime Text来编写as文件以及编译与运行swf. 准备工作 1.Sublime Text 2 2.Java 的JDK( ...
随机推荐
- 下载python标准库--python
#coding:utf-8 import urllib2 import os,sys from BeautifulSoup import BeautifulSoup # For processing ...
- select 练习4
21.查询score中选学多门课程的同学中分数不是所有成绩中最高分成绩的记录. select * from score where cno in(select cno from score grou ...
- 黑客们的故事(连载六):IT世界里的理想主义者
一头疏于梳理的长发和一把肆意生长的大胡子,往往可能是人们对于理查德马修斯托曼的第一印象.这位马上就要过60岁生日的自由软件基金会主席不用手机.不买房.没有汽车,看起来像是个流浪汉,但是却是美国工程院院 ...
- React Native填坑之旅--LayoutAnimation篇
比较精细的动画可以用Animated来控制.但是,在一些简单的界面切换.更新的时候所做的动画里再去计算开始值.结束值和插值器如何运作绝对是浪费时间. RN正好给我们提供了LayoutAnimation ...
- linux 禁ping本机方法
linux 禁ping本机方法 禁ping执行:echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all 恢复ping 执行:echo 0 > /p ...
- JS 将字符串转换成日期类型
将字符串形式的日期转换成日期对象 var strTime="2011-04-16"; //字符串日期格式 var date= new Date(Date.par ...
- JAVA的JNI调用
由于JNI调用C和调用C++差不多,而且C++中可以混合写C代码,所以这里主要是写关于JNI调用C++的部分. 一般步骤: 先是写普通的Java类,其中包括本地方法调用. 然后编译这个Java类,调 ...
- 【转发】Cross-thread operation not valid: Control 'progressBar1' accessed from a thread other than the thread it was created on
当您试图从单独的线程更新一个win form时,您将得到如下错误信息: "Cross-thread operation not valid: Control 'progressBar1' ...
- Android开发学习总结(五)——Android应用目录结构分析
一.手动创建android项目 手动创建一个Android项目,命名为HelloWorld,命令如下: android create project -n HelloWorld -t -p E:/An ...
- [C++] 几行代码生成漂亮图片,数学家就是牛!
信息获得处:http://news.cnblogs.com/n/501488/ 分形:http://baike.baidu.com/subview/83243/11213590.htm?fr=alad ...