Skip to content

yarso-su/lates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code templates - lates 🔧

Crates.io License Downloads

A minimal code template manager. Register and use code templates with ease.

Note

This binary is primarily a learning project. While it works for my use case, its main purpose is educational.

Motivation

I often find myself copying and pasting complete files from different projects into new ones. Usually because the file or component is not large enough to justify its own repository or package. There are times when the module I need to reuse is self-contained enough to be useful in a different project, but always requires modifications to suit the new specific requirements.

Code templates (lates binary) aims to provide the minimal solution to this problem. A tool to manage code templates without complex rules, with the simplest interface possible.

Installation

Cargo

cargo install lates

AUR

yay -S lates

Usage

Run the binary without arguments to start the TUI. Use --register, -r to register a new template.

Note

Supports vim-like keybindings.

TUI Mode

  • Quick exit pressing q
  • Copy template to current directory pressing Enter
  • / Search mode
  • : Commands mode
    • :version — print current version
    • :remove — remove the selected template
    • :quit — exit the TUI
  • Navigate command suggestions with Tab and Shift+Tab

Register Mode (--register, -r)

  • --force, -f to overwrite an existing template
  • --name, -n to specify a different name

Templates are stored in ~/.config/lates/templates/.

Limitations

This is a custom implementation tailored to my own workflow, so there is plenty of room for improvement. Feel free to fork the project, open issues, or contribute suggestions.

Contributing

This is primarily a learning project, but contributions are welcome! Feel free to:

  • Open issues for bugs or feature requests
  • Submit pull requests
  • Share feedback on the code

Acknowledgments

Built with:

  • clap - Command line argument parsing
  • crossterm - Terminal manipulation

License

MIT License

About

A minimal code template manager. Register and use code templates with ease.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages