Coder Social home page Coder Social logo

zzxcodeformat's Introduction

ZZXcodeFormat

更新后特色

支持OC与swift代码格式化,支持xcode9,10。

安装方法

下载ZZXcodeFormat,直接运行one_key_install,so easy。

one_key_install为您做了什么?

  1. 添加.clang-format配置文件到个人文件夹~,clang-format脚本的规则配置在这里,当然您可以个性化配置,参考这里
  2. 检查并添加Xcode的UUID
  3. 编译插件
  4. 检查您的gem源,统一修改为最新https://gems.ruby-china.com/
  5. 检查update_xcode_plugins是否安装,未安装则安装
  6. 执行unsign

执行过后,重启Xcode,如果弹框就选LoadBundle,您就可以在Xcode->Edit栏中看到ZZXcodeFormat了。

功能介绍

ZZXcodeFormat包含下面功能:

  1. 格式化当前Focus窗口:FocusFile
  2. 格式化多个选中文件:SelectFiles
  3. 格式化当前选中文本区域:SelectText

额外配置

目前我已经为上面三项添加了快捷键i/o/p,辅助键为control+option+command。当然您可以自定义配置快捷键。 例如,为FocusFile添加快捷键:

系统设置->键盘->快捷键->应用快捷键->点击添加->应用程序选择Xcode,菜单标题输入FocusFile,键盘快捷键设置shift+command+L.

打开Xcode,点开ZZXcodeForamt,就会发现显示在我们添加的菜单中了。

附一张format FocusFile效果

Focus


遇到问题总结

1.unsign后show in finder失效问题?

最近发现一个bug,就是当执行unsign后,我在新的10.14系统(黑色主题那个)上,执行showinfiner时,无限转圈。

解决方法:

  1. 关闭Xcode

  2. 打开钥匙串,创建自签名证书: Keychain Access -> 左上角钥匙串访问 -> 证书助理 -> 创建证书。 创建证书

  3. 打开terminal使用此证书签名(会等待很长一段时间):

sudo codesign -f -s XcodeSigner /Applications/Xcode.app

XcodeSigner为你刚才的命名

  1. 重签成功后,打开Xcode,编译一下插件的工程文件就可以了。重启Xcode,看到弹框时,允许加载插件。

参考自:https://github.com/XVimProject/XVim/blob/master/INSTALL_Xcode8.md

2.the codesign_allocate helper tool cannot be found or used重签失败?

解决方法:

查看当前这个命令所在的位置

locate codesign_allocate

如果提示does not exist,则

cp /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate /usr/bin
cp命令已失效

原因见:Operation not permitted

那就手动复制,手动打开两个finder窗口,分别前往文件夹/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate与/usr/bin,把前者的codesign_allocate拷贝到/usr/bin下。

再执行下面语句是不是不一样了?

locate codesign_allocate

然后再重新签

sudo codesign -f -s XcodeSigner /Applications/Xcode.app

等待,等待。。。过会就ok了

参考自:https://www.jianshu.com/p/a62c9efb1e53

zzxcodeformat's People

Contributors

v5zhou avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.