一半君的总结纸

听话只听一半君

sublime里怎么把abcDef替换成abc_def(PEP8风格)

有个很长的文件要改,regex搜试了半天无果,sublime macro录制录不了search and replace.

需要的工具有

  1. sublime package Case Conversion
  2. sublime package ImprovedMacros
  3. 自己定义个macro + hotkey
    ~/.config/sublime-text-3/Packages/User/Default (Linux).sublime-keymap

    {
        "keys": ["super+1"],
        "command": "run_multiple_commands",
        "args": {
            "commands": [{
                "context": "window",
                "command": "find_all_under"
            }, {
                "context": "view",
                "command": "convert_to_snake",
                "#delay": 100
            }]
        }
    }
    

    delay是为了提升逼格,目前没有开…

最终效果图:

脑残法

Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: