Giter Site home page Giter Site logo

vimhome's Issues

常用格式化功能支持

在写代码的时候,会经常遇到数据结构内元素无法对齐的情况,让代码看起来有点乱。。需要一个可以格式化常用结构的插件。比如,列表,元组,字典,等常见数据结构的内部展示,一个预估样例为:

["12cbf5e90d92806bcdc2260527e85fa0","0xc67c","arm","32","le"],
["4b713ac4ca6646c7941e609e770f8dc8","0x40239e","x8664","64","le"],
["0b5e05bd8c4acd10b570839ae5dcfae7","0x1bdd4","arm","32","le"],

格式化为

["12cbf5e90d92806bcdc2260527e85fa0","0xc67c"  ,"arm"  ,"32","le"],
["4b713ac4ca6646c7941e609e770f8dc8","0x40239e","x8664","64","le"],
["0b5e05bd8c4acd10b570839ae5dcfae7","0x1bdd4" ,"arm"  ,"32","le"],

实现逻辑:分析多个选中的行中,每个成员的字符长度,并以列为单位,选择最长的元素作为当前列的长度。每一列长度确定后,按照列长度分别格式化每个行。

暂定:元素间隔用 ,[]{}() 等界定符 作为区分依据,以便保证元素类型可以兼容数字和字串。如有其他更好的实现思路也可以一并加入考量。

暂定: 先不考虑元素嵌套的每行元素个数不同的情况,以相同元素个数为默认选项。

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.