go-tsgrep

command module
v0.0.0-...-62138a1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2021 License: MIT Imports: 17 Imported by: 0

README

go-tsgrep

go-tsgrep is grep for Vim. This considers tabstop and modeline each file.

There are following lines as abc.txt:

// vi: set ts=4 :
This tabstop is 4.
--->This tabstop is 4.
--->--->This tabstop is 4.

And execute go-tsgrep is abc.txt:

Install

# go install github.com/rbtnn/go-tsgrep

Usage

>go-tsgrep.exe -h
go-tsgrep.exe [OPTIONS] {PATTERN} [{PATH}]

OPTIONS:
  -color
        color matched text
  -detect int
        bytes of filetype detection (default 100)
  -ignore-dir string
        ignore directories (default ".git,.gh,.hg,.svn,_svn,node_modules")
  -ignore-ext string
        ignore extensions (default ".exe,.dll,.obj,.mp3,mp4")
  -regex
        deal with {pattern} as regex
  -tabstop int
        default tabstop (default 8)

PATH:
  This default value is "*".

EXAMPLE:
  >go-tsgrep -color -tabstop 4 set **/*
Using Vim

If you use this in Vim, you put following code in your .vimrc:

if executable('go-tsgrep')
	set grepprg=go-tsgrep
	set grepformat=%f(%l\\,%v):%m
endif

We recommend to use -tabstop option if &tabstop in your Vim is not 8.

set grepprg=go-tsgrep\ -tabstop\ 4

License

Distributed under MIT License. See LICENSE.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL