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

Code​Counter

by absop ST3 WinLinux New

A Code Counting plugin for Sublime Text.

Details

Installs

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

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.

  • In a Overview view, after you have double-clicked a language name and got into a new view, back into the Overview view, you will meet some problems of moving cursor by keyboard. I think this is probably a little bug of Sublime Text itself. If you have more knowledge about this, please let me know (zlang0@163.com), thanks!

Issue