ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Code​Counter

by absop ST3 WinLinux

A Code Counting plugin for Sublime Text.

Details

  • 3.6.0
  • github.​com
  • github.​com
  • 6 months ago
  • 27 minutes ago
  • 8 months ago

Installs

  • Total 137
  • Win 107
  • Mac 0
  • Linux 30
Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12 Jun 11 Jun 10 Jun 9 Jun 8 Jun 7 Jun 6 Jun 5 Jun 4 Jun 3 Jun 2 Jun 1
Windows 1 1 0 0 2 0 1 0 0 3 0 0 0 0 0 0 1 0 0 1 0 1 0 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 1 2 0 2 0 0 0 1
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

License Downloads

CodeCounter

中文

What is this plugin for?

This is a plugin written for Sublime Text, its jobs as its name suggests.

How to install?

Download the repository and unzip it into your packages path of Sublime Text, or direct clone it with the help of git tools.

Of course, you can also use Package Control to help you if you have installed it before.

Features overview

  • three sidebar Menu items

    • Files Size
    • Code Counter
    • Code Counter Filtered
  • two practical commands

    • CodeCounter: count dir
    • CodeCounter: count dir filtered

Usage

Sidebar menu items are suitable for folders that have been mounted in the sidebar and for people who like to use a mouse. Enter ctrl+shift+p to show a command_palette to input and run sublime-commands is considered a very powerful and convenient feature of Sublime Text.

  • Sidebar menu items' feature explaination

    • Files Size will count the size of that folder or file, the result is highlighting shown in a Panel as below. Files size
    • Code Counter shows you some statistic infomation of that folder. counting result is shown in a View as below. Overview
    • Code Counter Filtered is like Code Counter, but will request you to input a list of pattern(More on that later) before it works.
  • commands' feature explaination

    • CodeCounter: count dir asks you to input a file path exists in you OS, then do the same job of Code Counter.
    • CodeCounter: count dir filtered asks you to input a file path exists in you OS, then do the same job of Code Counter Filtered.

View operations

In a overview view, double-clicking a language name will open a new View to show the detail statistic result of that language, you can also move cursor into the name region of the language you want to know more about, then press down d or enter to view it. We call the new entered view as detail view, it look like this. Detail

In a detail view, double-clicking file paths will open their corresponding file. hotkeys o and enter can also help you doing jobs.

Pattern inputting

Pattern is used to filter files that you do not wish them appear in the result. Files whose absolute path contains the pattern will not be counted in the result.

Example

Consider there a directory structure as below

/root/a/...
     /b/...
     /c/...
     /d.txt

You want to count code under the directory root but don't want the b subdirctory is counted in, so you want to input a pattern to rule out it, Code Counter Filtered can help you doing this.

After you have buttoned down the menu item Code Counter Filtered or entered command CodeCounter: count dir filtered and inputed a file path, the plugin will ask you to input a pattern, you shoud input a pattern /b/(On all platforms) or \b\(On windows) to achieve your goal. If you want to exclude /b/ and d.txt, consider input /b/;d.txt.

Pattern specific

Some characters are escaped to generate a appropriate regular expression. - ; is used to separate patterns, can be replaced by a | character. - * is considered as .* in a regular expression. - file.ext just file.ext.

Settings

{
    "encoding": "utf-8",
}

Please set a right encoding to recognize paths on your OS properly.

Other settings

{
    "extensions": {
        "language's name": ["language's extensions1", ]
    },

    "fullnames": {
        "Make" : ["Makefile" , ]
    }
}

Problems

  • double-clicking language names will always create a new view, even if there is same one has exists.

Issue