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

Code​Counter

by absop ST3 WinLinux

A Code Counting plugin for Sublime Text.

Details

Installs

  • Total 62
  • Win 50
  • Mac 0
  • Linux 12
Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10 Jan 9 Jan 8 Jan 7 Jan 6 Jan 5 Jan 4 Jan 3 Jan 2 Jan 1 Dec 31 Dec 30 Dec 29 Dec 28 Dec 27 Dec 26 Dec 25 Dec 24 Dec 23 Dec 22 Dec 21 Dec 20 Dec 19 Dec 18 Dec 17 Dec 16 Dec 15 Dec 14 Dec 13 Dec 12 Dec 11 Dec 10 Dec 9 Dec 8 Dec 7 Dec 6
Windows 0 0 0 2 0 0 1 1 1 0 0 1 1 0 0 0 0 2 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 1 0 0 0 3 2 0 2 1 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 1 0 0 0 0 2 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 2 0 0 0 1 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