DEV Community

Jian Z'car Esteban
Jian Z'car Esteban

Posted on

How to use 📔FuzPad!

Wiki Here

Introduction

FuzPad is designed to provide a straightforward and minimalistic note management solution using a Bash script. It allows you to create, open, search, and delete notes efficiently. FuzPad also supports version control by automatically committing changes to your notes.

Features

  • New: Create a new note with the current date and time as the filename.
  • Open: Open an existing note.
  • Search: Search within notes for specific content.
  • Delete: Delete selected notes.
  • Version control: Automatically commits changes to your notes.

Installation

Using Homebrew

brew install JianZcar/packages/fuzpad
Enter fullscreen mode Exit fullscreen mode

Using curl

Ensure ~/.local/bin is in your PATH:

curl -s https://gist.githubusercontent.com/JianZcar/df050e108b462e469f413f0eec229143/raw | bash
Enter fullscreen mode Exit fullscreen mode

Manual Installation

  1. Clone the repository:
git clone https://github.com/JianZcar/FuzPad.git
cd FuzPad
Enter fullscreen mode Exit fullscreen mode
  1. Make the script executable:
chmod +x bin/fuzpad
Enter fullscreen mode Exit fullscreen mode
  1. Run the script:
./bin/fuzpad
Enter fullscreen mode Exit fullscreen mode

Configuration

You can configure FuzPad by setting environment variables in your ~/.bashrc file or directly modifying the script.

Default Directory

Change the default directory for notes:

export FUZPAD_DIR="$HOME/Documents/.notes"
Enter fullscreen mode Exit fullscreen mode

Text Editor

Change the text editor:

export EDITOR="nano"
Enter fullscreen mode Exit fullscreen mode

Text Format

Change the text format:

export FUZPAD_TEXT_FORMAT="txt"
Enter fullscreen mode Exit fullscreen mode

Date Time Format

Change the date and time format used for note filenames:

export FUZPAD_DATE_TIME_FORMAT="%Y-%m-%d-%H-%M-%S"
Enter fullscreen mode Exit fullscreen mode

BAT Theme

Change the theme used by bat for previewing notes:

export FUZPAD_BAT_THEME="OneHalfLight"
Enter fullscreen mode Exit fullscreen mode

Reverse List

Set to true to reverse the order of the list when opening or deleting notes:

export REVERSE_LIST="false"
Enter fullscreen mode Exit fullscreen mode

Sort Format

Change the sorting format for listing notes (T@ for creation date, Y for modified date):

export SORT_FORMAT="T@"
Enter fullscreen mode Exit fullscreen mode

Preview Size

Change the size of the preview window for fzf:

export PREVIEW_SIZE="70%"
Enter fullscreen mode Exit fullscreen mode

Start Line Search Preview

Set the starting line number for the search preview:

export START_LINE_SEARCH_PREVIEW="5"
Enter fullscreen mode Exit fullscreen mode

End Line Search Preview

Set the ending line number for the search preview:

export END_LINE_SEARCH_PREVIEW="9999"
Enter fullscreen mode Exit fullscreen mode

After adding the necessary variables to your ~/.bashrc file, remember to source it to apply the changes:

source ~/.bashrc
Enter fullscreen mode Exit fullscreen mode

Usage

Creating a New Note

To create a new note, select the "New" option from the menu. The note will be created with the current date and time as the filename.

Opening an Existing Note

To open an existing note, select the "Open" option from the menu. You will be presented with a list of notes to choose from.

Searching Within Notes

To search within notes, select the "Search" option from the menu. Enter your search query, and FuzPad will display the matching results.

Deleting Notes

To delete notes, select the "Delete" option from the menu. You can select multiple notes to delete by pressing the tab key to multi-select.

FAQ

How do I change the default text editor?

You can change the default text editor by setting the EDITOR variable in your ~/.bashrc file:

export EDITOR="nano"
Enter fullscreen mode Exit fullscreen mode

Can I use FuzPad without Git?

Yes, you can use FuzPad without Git. However, version control features that automatically commit changes to your notes will not be available.

Contributing

We welcome contributions from the community! Please refer to the Contributing Guidelines for more details on how to get started.

Feel free to fork the repository and submit pull requests. Contributions are welcome!

License

This project is licensed under the terms of the GNU General Public License v3.0. For more details, see the LICENSE file in the repository.

Top comments (0)