添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
玩篮球的香槟  ·  GitHub - ...·  1 周前    · 
暴走的毛衣  ·  PHP 8 error: ...·  1 周前    · 
有胆有识的鼠标垫  ·  PHP: ...·  1 周前    · 
心软的夕阳  ·  PHP: shuffle - Manual·  1 周前    · 
呐喊的槟榔  ·  Ruby regex guide | ...·  7 月前    · 
失眠的猕猴桃  ·  begin - cpprefjp ...·  7 月前    · 
  • 转载请注明出处
  • 最高效的码字方式,一定有一个特点,那就是手指离开键盘的次数尽可能的少。 并且手指码字的时候的在键盘的跨度尽可能的短, 这也是我认识不少老牌程序员用Vim也不用ESC, 而是使用ctrl+[, 甚至还有这:
    从而避免手指在键盘上的跨越幅度太大。

    我一直用MacBook做工作用机,也一直用iTerm2来登陆远程服务器开发,因为PHP是一个比较巨大的工程,编译速度很慢,自己的笔记本再高配,也是做不到make -j不卡死的。

    言归正传, 在mac上有一个很有用的命令pbcopy, 它能让我们避免去使用鼠标选择文本,复制到剪贴板。从而让我们的双手可以一直在键盘上,但很可惜的是,pbcopy只能在本机使用,而我大量的时间都是使用远程机。

    最近发现了一个很有趣的OSC 52,也就是 ANSI escape code 中的 ESC ] (Operating System Command), 中的52, 它提供了访问访问本地剪贴板的能力。

    它的形式为:

    echo -e "\e]52;c;$(base64 <<< php)\a"

    也就是,以\e]52;c;开头,然后是base64 encode后的内容,以\a结尾, 如果terminal支持,那么上面例子中的文字“php”就会进入到你的剪贴板了,你就可以使用command + V粘贴了。

    对于我常用的iTerm2来说, 只要打开这个选项即可:

    有了这个,那么我们就可以很容写出一个支持远程服务器的pbcopy了, 以PHP为例(
    你也可以直接下载: OSC52.php ):

    #!/bin/env php $data = trim(file_get_contents("php://stdin")); echo "\033]52;c;", base64_encode($data), "\007";

    然后给这个文件增加执行权限, 重命名成pbcopy,试试:

    echo "osc52 codes" | ./pbcopy

    然后command+v粘贴下试试?

    这下就香很多了,避免了需要用鼠标来选择复制一些text。 让手可以一直在键盘上,极大提升生产力!
    然而,我现在开始用iPad办公了, 目前为止还没有发现iPad下的terminal App有支持OSC 52的。 大家要是发现哪个App支持,一定留言告诉我哈。 :)

    Related Posts

    个人主页开张 最近发生了一些很重要的事情 Thanksgiving 服务器搬到国外主机 博客迁移到腾讯云

    Welcome to Tattvam on the Beach, One of the top Yoga Resorts in Goa , your gateway to a blissful seaside retreat. Located in the picturesque coastal town, invites you to explore a world where luxury, tranquility, and rejuvenation converge. With its pristine beaches, stunning ocean views, and a serene atmosphere, Tattvam on the Beach is a sanctuary designed to awaken your senses and nourish your soul.

    Welcome to Gudlu Resort, a hidden gem nestled amidst the picturesque hills of Mudigere in Chikmagalur. If you are looking for a Chikmagalur resorts , Gudlu Resort is the place to be. Surrounded by acres of lush greenery, Gudlu Resort offers a range of luxurious accommodations that are perfect for couples, families, and groups. Each room is well-appointed with modern amenities and offers breathtaking views of the surrounding hills and valleys.

    Welcome to Tattvamretreat Resort, Bangalore – a serene and tranquil wellness resorts in bangalore that offers a holistic approach to wellness through Ayurveda and Yoga. Tucked away amidst lush greenery and rolling hills, Tattvamretreat Resort is a perfect getaway for those seeking a peaceful and rejuvenating experience.

    Godrej splendor whitefield revie Developed by Godrej splendor of Tumkur Road, Bangalore. Jindal City is a great experience including home, work, school for kids, good hospitals, entertainment venues, favorite restaurants, shopping malls, etc. Everything is preferably within the shortest distance. Godrej Splendor Whitefield consists of 3,571 smart sized residential units built on 32 acres with a variety of amenities that are close to everything you need. Godrej Splendor Whitefield offers 2 BHK, 3 BHK and 4 BHK sophisticated apartments in 15 blocks on G+30 floors.

    Sobha Neopolis consists of residential apartments of various sizes. The unit area available for this project is 38 acres. This area is part of the Bannerghatta Road suburb. It consists of 1 BHK, 2 BHK and 3 BHK apartments. located in Bangalore. Locals have easy access to city facilities such as classrooms, colleges, clinics, recreation centers and parks. Inside the building, the building is specifically planned.

    echo -ne "\eP\e]52;c;$t\a\e\\"
    elif [ ! -z ${TMUX+x} ]; then
    echo -ne "\ePtmux;\e\e]52;c;$t\a\e\\"
    echo -ne "\e]52;c;$t\a"

    不知道贴代码会不会格式错乱。。

    开源项目

    Yaf :  PHP Framework in PHP extension
    Yar :  Light, concurrent RPC framework
    Yac :  PHP Contents cache
    Yaconf :  PHP Configurations Container
    Taint :  XSS code sniffer
    Lua :  Embedded lua interpreter
    MsgPack :  MessagePack in PHP extension
    Couchbase :  Libcouchbase wrapper
    See also: laruence@github

    最新评论

    个人公众号

    标签

    分类