All Projects → drgarcia1986 → sif

drgarcia1986 / sif

Licence: MIT license
A minimal (and experimental) ACK written in Go

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects
Makefile
30231 projects

Labels

Projects that are alternatives of or similar to sif

vim-agriculture
🚜 Vim plugin to improve project searching with tools like ag and rg
Stars: ✭ 119 (+495%)
Mutual labels:  ag, ack
The silver searcher
A code-searching tool similar to ack, but faster.
Stars: ✭ 23,030 (+115050%)
Mutual labels:  ag
ngp
Ncurses code parsing tool
Stars: ✭ 52 (+160%)
Mutual labels:  ag
Ack2
**ack 2 is no longer being maintained. ack 3 is the latest version.**
Stars: ✭ 1,504 (+7420%)
Mutual labels:  ack
Kcp
⚡ KCP - A Fast and Reliable ARQ Protocol
Stars: ✭ 10,473 (+52265%)
Mutual labels:  ack
vim-bettergrep
A better way to grep in vim.
Stars: ✭ 15 (-25%)
Mutual labels:  ack
Find-String
A PowerShell script to provide functionality similar to grep or ack with highlighting.
Stars: ✭ 56 (+180%)
Mutual labels:  ack
funboost
pip install funboost,python全功能分布式函数调度框架,。支持python所有类型的并发模式和全球一切知名消息队列中间件,python函数加速器,框架包罗万象,一统编程思维,兼容50% python编程业务场景,适用范围广。只需要一行代码即可分布式执行python一切函数。旧名字是function_scheduling_distributed_framework
Stars: ✭ 351 (+1655%)
Mutual labels:  ack
config
holy cow, wholly config! Vim, Zshell, Ack, & the rest of my dot-files.
Stars: ✭ 21 (+5%)
Mutual labels:  ack

SIF

Build Status Go Report Card codecov

Search In Files
An experimental ack written in Go.

Installation

If you have a Golang environment setup, you can simply run:

$ go get -u github.com/drgarcia1986/sif/cmd/sif

Or get binaries on releases

For windows users: Colors works only in PowerShell

Example

Run against repo dir:

$ sif better
_tests/golang.txt
9: A little copying is better than a little dependency.
14: Clear is better than clever.

_tests/python.txt
3: Beautiful is better than ugly.
4: Explicit is better than implicit.
5: Simple is better than complex.
6: Complex is better than complicated.
7: Flat is better than nested.
8: Sparse is better than dense.
17: Now is better than never.
18: Although never is often better than *right* now.

sif_test.go
14:             {"python.txt", "better", []int{3, 4, 5, 6, 7, 8, 17, 18}},

Same search with ack, grep and sif, time comparison:

$ time ack better
...
        0.11 real         0.07 user         0.01 sys
$ time grep better -rn *
...
        0.04 real         0.03 user         0.00 sys
$ time sif better
...
        0.01 real         0.00 user         0.00 sys

Library Usage Example

package main

import (
	"fmt"

	"github.com/drgarcia1986/sif"
)

func main() {
	s, _ := sif.New("fmt", sif.Options{CaseInsensitive: false})
	fm, err := s.ScanFile("./main.go")
	if err != nil {
		panic(err)
	}
	if fm != nil {
		for _, m := range fm.Matches {
			fmt.Printf("Line: %d, Text: %s\n", m.Line, m.Text)
		}
	}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].