GithubHelp home page GithubHelp logo

josephtlyons / change-line-length Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 404 KB

An Atom text editor package that allows you to cycle through different user-defined Preferred Line Length settings.

License: MIT License

JavaScript 100.00%
atom-package atom package adjust preferred line length

change-line-length's Introduction

change-line-length

change-line-length download badge

change-line-length version badge

change-line-length stars badge

An Atom text editor package that lets you cycle through different user-defined Preferred Line Length settings

change-line-length in Action:

Focus on the wrap guide. Action

History:

Because I frequently switch my Preferred Line Length between 80 characters (for documentation) and 100 characters (for code), I often spend too much time navigating to the editor settings panel, scrolling down, and manually adjusting this setting. There exists some packages that allow you to insert multiple wrap guides, but I've found this solution to be somewhat of a distraction. Also, many packages, such as autoflow and text-align are dependent upon the Preferred Line Length setting; having multiple wrap guides can be confusing when using these packages as only one of the wrap guides will represent the true Preferred Line Length value being used. So I decided it would be best to make a package that allows the user to set as many Preferred Line Length settings as they want and give them the option to cycle through them quickly, with key commands.

Instructions:

Atom doesn't seem to provide a way for the user to input values into an array in the package settings in the same way one can input integers (correct me if I'm wrong!), so you must edit the config.cson to add your own custom preferred line length values. Find the settings section for change-line-length in the config.cson file (Atom > Config...) and add your preferred values:

"change-line-length":
  preferredLineLengthValues: [
    80
    100
    120
    ...
  ]

After you've saved you config.cson file, you'll need to restart Atom for the settings to take effect (this is intentional as capturing the array values on the fly during each run is inefficient). You should be able to use the package to quickly change between your Preferred Line Length settings.

Note:

There seems to be "bugginess" associated with running this package if the settings tab is open and set to the editor (the location of the Preferred Line Length setting). So if you are experiencing any sort of strange flickering when running the package, try exiting out of the settings tab. I can't seem to fix this as this seems like a bug with Atom. I've experienced many bugs when trying to set settings via the settings tab; these bugs include the setting not actually being recognized or settings "flickering" between an older and newer value when trying to update a value. These bugs existed for me long before creating this package and I think they are the root cause for the strange flickering that occurs when this package is ran while the settings tab is open. If anyone has any sort of ideas for a fix, please let me know, as stability is always a priority for me.

Thank You

Thanks to both @Aerijo and @DamnedScholar for helping me here and here when I ran into bugs putting this package together.

change-line-length's People

Contributors

josephtlyons avatar

Stargazers

 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.