Categorygithub.com/hfmrow/sandreplace
modulepackage
1.8.0
Repository: https://github.com/hfmrow/sandreplace.git
Documentation: pkg.go.dev

# README

Search and Replace v1.8

Last update 2020-08-06

This program is designed to find and replace a text pattern in one or more files stored in one or more directories, sub-directories. Search and replace in the clipboard is allowed. Drag and drop can be used. You can use it to search multiple files to find definitions of specific functions in a development environment for example.

Take a look at H.F.M repositories for others useful Linux software.

  • If you just want to use it, simply download the compiled version under the Releases tab. You can check at the Right way to install H.F.M's softwares page to integrate this software in your Debian environment.

  • Notice, ".desktop" file is made to work into the "/opt" directory, if you want to put main folder in an other place, please adjust the ".desktop" file to match the desired directory. Remember, all resources used are embedded in the executable. An ".opt" file is made at the first launch it's used to store used options.

  • Otherwise, if you plan to play inside the source code, see below "How to compile" section.

  • All suggestions, contributions and ideas to improve software usability will be greatly appreciated.

How it's made

  • Programmed with go language: golang
  • GUI provided by Gotk3, GUI library for Go (minimum required v3.16).
  • I use home-made software: "Gotk3ObjHandler" to embed images/icons, UI-information and manage/generate gtk3 objects code from glade ui designer. and "Gotk3ObjTranslate" to generate the language files and the assignment of a tool-tip on the gtk3 objects (both are not published at the moment, in fact, they need documentations and, for the moment, I have not had the time to do them).

Functionalities

  • Search and replace text based on pattern (contained in text file(s)).
  • Search and replace text pattern into clipboard.
  • Allow the displaying of preview with highlighted patterns before modification.
  • Source code highlighting for multiple languages.
  • Wildcard, regex, case sensitive, character classes can be used.
  • Whole word functionality, Escape character can be used.
  • Drag and drop capacity.
  • Files can be sorted by extension or using a mask for filename.
  • Options (top right) to filter text files analysis behavior (text detection) and to limit depth of directories where files will be searched.
  • Backup function available.
  • Each function have his tool-tip for explanations.

This is the main screen, and children

whole.jpg

How to compile

  • Be sure you have golang installed in right way. Go installation.

  • Open terminal window and at command prompt, type: go get github.com/hfmrow/sAndReplace

  • See Gotk3 Installation instructions for gui installation instruction.

  • To change gtk3 interface you need to use the devMode = true to disable embedding assets. see below ...

  • To change language file you need to use another home made software, (not published actually). So don't change language file ...

  • To Produce a stand-alone executable, you must change inside "main.go" file:

    func main() {
        devMode = true
    ...    

into

    func main() {
        devMode = false
    ...

This operation indicate that externals data (Image/Icons) must be embedded into the executable file.

Os information (build using)

NameVersion / Info / Name
GOLANGV1.14.6 -> GO111MODULE="off", GOPROXY="direct"
DISTRIBLinuxMint Xfce
VERSION20
CODENAMECODENAME=ulyana
RELEASE#46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020
UBUNTU_CODENAMEfocal
KERNEL5.4.0-42-generic
HDWPLATFORMx86_64
GTK+ 33.24.20
GLIB 22.64.3
CAIRO1.16.0
  • The compilation have not been tested under Windows or Mac OS, but all file access functions, line-end manipulations or charset implementation are made with OS portability in mind.

You got an issue ?

  • Go to this page: Issues hfmrow/sAndReplace on GitHub and start a new problem report.
  • Give the information (as above), concerning your working environment as well as the version of the operating system used.
  • Provide a method to reproduce the problem.

Used libraries

Visit

GitHub repository
Website H.F.M's Linux softwares

# Packages

No description provided by the author

# Functions

BringToFront: Set window position to be over all others windows without staying on top whether another window come to be selected.
Convert Entry to list of extensions.
GetPixBuf: Get gdk.PixBuf from filename or []byte, depending on type size: resize height keeping porportions.
GetPixBufAnimation: Get gdk.PixBufAnimation from filename or []byte, depending on type.
HexToBytes: Convert Gzip Hex to []byte used for embedded binary in source code.
MainButtonOptionsClicked:.
MainTranslateNew: Initialise new translation structure and assign language file content to GtkObjects.
NormalizeSize: compute new size with kept proportions based on defined format.
OptionButtonDoneClicked.
OptionsEntryFileSizeFocusOutEvent:.
No description provided by the author
ScanDirDepth: retrieve files in a specific directory and his sub-directory depending on depth argument.
************************************************/ Images functions, used to initialize objects */ You can use it to load your own embedded */ images, icons ..

# Variables

Highlight chroma.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Error handling.
No description provided by the author
No description provided by the author
App infos.
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

*****************************/ Main structure Declaration */*****************************/.
No description provided by the author
Translations structure with methods.