Skip to content

gost-serb/vscode-filter-line

 
 

Repository files navigation

VSCode Extension Filter Line

Filter line for current opening file by strings/regular expressions, generating the result in a new file.

Features

  1. Filter line by input string (or not contain input string).
  2. Filter line by input regular expression (or not match input regular expression).
  3. Filter line by config file filterline.json(or filterline.eoml) in corresponding .vscode directory.

Articles

Install

  1. Marketplace
  2. Search Filter Line in vscode extensions.

search

Usage

list

Filter line by input string.

  1. Open command palette (⇧⌘p) and type filterline, select Filter Line By Input String in the list.
  2. Type a string and hit <Enter>.
  3. The extension will output matching lines in a new file with postfix .filterline.$(ext) (e.g. 1.log will generate file 1.log.filterline.log).

bystring

Filter line by input regex.

  1. Open Command Palette (⇧⌘P) and type FilterLine, select Filter Line By Input Regex in the list.
  2. Type a regular expression and hit <Enter>.
  3. The extension will output matching lines in a new file with postfix .filterline.$(ext) (e.g. 1.log will generate file 1.log.filterline.log).

byregex

Filter line by config file

  1. Create config file in .vscode directory (e.g. .vscode/filterline.json or .vscode/filterline.eoml).
  2. Edit the filterline.json/.eoml file to desired format.
  3. Open command palette (⇧⌘p) and type filterline, select Filter Line By Config File in the list.

byconfigfile

Filter from Explorer file's context menu

Filter files without opening from Explorer file's context menu. Especially useful for large files (>= 50MB) due to vscode's limitation.

explorer_ctx

Filter from Title context menu

Same as with Explorer context menu. Also can help with large files (>= 50MB) (vscode's limitation)

title_ctx

Filters history

Each "Input by..." filter option has history of N last patterns (configurable in extension settings)

filter_hist

Large file mode

Since vscode's limitation, when filter large files (e.g. >= 50MB), vscode extension can not get the current open document. As a workaround you can filter these files from context menu (both Title and Explorer).

Configurable saving of filtering results

Extension settings has option for saving filtering result (disabled by default).

Config file type

  1. There are 2 file types filterline.json and filterline.eoml.
  2. eoml is a simple config file format that created by me(everettjf), only for this project(vscode-filter-line) at present. For more information, please visit eoml.

Config file format type

There are 3 format types. As they are so simple, I will not describe them here. Please visit the demo directly :

  1. stringlist: String list json or eoml
  2. regexlist: Regular expressions list json or eoml
  3. general: This is default if type is not specified. json or eoml

Replacement

Command line replacement for this extension : filterline

Enjoy!

About

vscode extension for filter line by strings or regular expressions

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 99.9%
  • Shell 0.1%