Giter VIP home page Giter VIP logo

sublime-font-cycler's Introduction

FontCycler

Quickly cycle between your favorite fonts in Sublime Text with the press of a key. Some research says that this makes you productive. wink wink

Installation

The simplest method of installation is through Package Control, which can be found at this site: https://packagecontrol.io/installation

Just install Package Control, and select FontCycler in the list of available packages.

Usage

You can cycle through the fonts by pressing the F10 key, and cycle backwards with Shift+F10.

You need to set the fonts_list key in the Preferences.sublime-settings file to a list of fonts you want to cycle within. The fonts need to be pre-installed on the system.

You can specify just a font name or an object with the properties font_face, font_size, line_padding_bottom, line_padding_top, word_wrap and wrap_width. font_face is a required property on the object.

{
  "fonts_list":
    [
      "Andale Mono",
      "Consolas",
      "Courier",
      "Courier New",
      "Envy Code R",
      "Inconsolata",
      "Lucida Console",
      "Menlo",
      "Meslo LG S",
      "Meslo LG M",
      "Meslo LG L",
      "Monaco",
      "ProFontX",
      "Source Code Pro",
      "Ubuntu Mono"
    ]
}
{
  "fonts_list":
  [
    {
      "font_face": "JetBrains Mono",
      "font_size": 12,
      "line_padding_bottom": 1,
      "line_padding_top": 1,
      "word_wrap": "auto",
      "wrap_width": 80
    },
    {
      "font_face": "Georgia",
      "font_size": 15,
      "line_padding_bottom": 3,
      "line_padding_top": 3,
      "word_wrap": true,
      "wrap_width": 50
    }, 
    {
      "font_face": "Verdana",
      "font_size": 12,
      "line_padding_bottom": 3,
      "line_padding_top": 3,
      "word_wrap": true,
      "wrap_width": 50
    },
    {
      "font_face": "Roboto",
      "font_size": 13,
      "line_padding_bottom": 2,
      "line_padding_top": 2,
      "word_wrap": true,
      "wrap_width": 50
    }
  ]
}

Or even a mixed approach:

{
  "fonts_list":
  [
    "Consolas",
    {
      "font_face": "Courier",
      "font_size": 12
    },
    {
      "font_face": "Menlo",
      "font_size": 10,
      "line_padding_bottom": 1,
      "line_padding_top": 0
    }
  ]
}

Configuration

To change the keyboard shortcut for next and previous font, bind the next_font and previous_font commands respectively to the desired keys.

sublime-font-cycler's People

Contributors

akshaykumar90 avatar curtishumphrey avatar evandrocoan avatar jobedom avatar marcovirtual avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sublime-font-cycler's Issues

support for changing font size only

I hacked this script and with the latest update realized I never contributed my patch, but let's discuss.

I changed this line: https://github.com/akshaykumar90/sublime-font-cycler/blob/master/FontCycler.py#L30

To read:

if fonts_list[index]["font_face"] == current_font_face and fonts_list[index]["font_size"] == current_font_size:

So above that I may have defined current_font_size = settings.get("font_size")

This works good for me but I'm not sure about all use cases, every font in my list has a size defined. That may be why I never contributed the patch. Maybe the new logic should only trigger if fonts_list[index]["font_size"] was defend.

Feature: Allow the same font to appear in the font list twice at a different size, and still detect the current index in the font list.

I suppose the problem is why stop there, maybe other properties should key as unique indexes too, identifying the current index is a tricky problem unless there is an easy way to track and increment the setting.

I realize the whole point may be to change font face but I find that zooming in 5+ levels lags my many open editors way too much and reducing this to one keypress was a godsend yielding instant results. I don't like any other fonts I tried nearly as much as the default one, especially when doubled!

Add font-chooser menu

Would be nice if the plugin had the ability to let the user chose a font/preset from a drop-down menu.

Add option to set wrap_width

It would be nice to add the ability to also set a different wrap_width for each font. Would make this plugin even better. Thank you!

Plugin is compatible with ST3

You should update your plugin metadata so it appears as ST3 compatible in Package Control. I've just installed it cloning this Git repo and it works just fine.

Reset padding

Thanks for this very useful plugin.I really like it.

I was wondering if there is any option to define paddings only once and apply to every font in the list?

Configuration for a different syntax

I had this working at some point, but then it stopped, not sure what happened.
I can get font-cycler to work fine in my Preferences.sublime-settings, however, I want it to work in my Markdown.sublime-settings. There, I want the first, default font face to be of variable width, but want to cycle into a fixed width face when editing tables.

I even feel I might've asked about this in the past, but I can't find a record of it!

So, is it possible to have settings specific to a file type/syntax? I'm using Sublime 3114.

Cycle algo a bit presumptious

I've added the same fonts two times for some, with different size only - because sublime fucks up when I change sizes with ctrl +/- and use font-cycler together for some reason (might be another thing to look into...) - anyway - the cycle algo jumps to the first instance in the hash with the font name, completely ignoring font-size, etc. properties, as part of "identification key" for active choice.

Thanks for a must-have utility btw!

Hope you understand what I mean X-D

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.