Instantly create pre-formatted files.
Wiki »
Getting Started
·
Report Bug
·
Request Feature
Current version: 0.0.3
.
A brand-new version of NewFormattedFile, re-written in Nim.
nff
creates a new file with the format specified by its matching
config file. For example, a file ending in .py
will be created with
the contents of nff
’s py.tmpl
. The *.tmpl
files are simply plain
text. You can create any *.tmpl
files for any file types you like, as
long as the config file’s name matches the file extension of the target
file type (hpp.tmpl
for *.hpp
files, etc.)
Nim has become a very powerful, clean, and efficient language. It combines run-time speed with ease of development; I was able to write, from scratch, NimFormattedFile in one day, while NewFormattedFile took 3-4 days. Nim deserves to be used more widely– and in an effort to further this cause, I have re-written NewFormattedFile in Nim, with an exciting roadmap of new features to come.
nff
has templates added frequently. Raise an Issue if you would like support added for one or more file types.
- C
- C++
- JavaScript
- Python3
- Ruby
- Sh(ell)
NimFormattedFile works as a drop-in replacement to the old NewFormattedFile.
The easiest way to install Nim is to use choosenim. This will also install nimble, which can be used to install clapfn (see clapfn’s Installation instructions).
- Clone this repo.
git clone https://github.com/oliverdelancey/NimFormattedFile.git
cd
into the cloned directory and runinstall.sh
.
cd nimformattedfile
chmod +x install.sh # IMPORTANT. Give the script executable permissions.
./install.sh
Run the provided uninstall script.
chmod +x uninstall.sh
./uninstall.sh
- Clone this repo.
git clone https://github.com/oliverdelancey/NimFormattedFile.git
- Enter the directory, and compile
nff
.
cd NimFormattedFile
nim c -d:release nff.nim
- Copy the executable to
/usr/local/bin
. - If you have never installed any version of
nff
before, create the config directory in your default config directory ($XDG_CONFIG_HOME
or$HOME/.config
) and copy thetemplates
folder there.
mkdir ~/.config/nff
cp templates ~/.config/nff
Otherwise, if you have previously installed nff
, the C++ or Nim
version, copy any .tmpl
files you may not have to your templates
folder.
Just run nff my_file.ext
. For example:
nff awesome_program.cpp
cat awesome_program.cpp
#include <iostream>
int main(int argc, char** argv) {
std::cout << "C++ file generated by nff" << std::endl;
}
Run nff --help
for complete help.
NimFormattedFile v0.0.3 Create a new file designated by the input file's extension. Usage: nff [-h] [-v] file Required arguments: file The file to create. Optional arguments: -h, --help Show this help message and exit. -v, --version Show version number and exit.
See the wiki for the roadmap.
This project uses the MIT License.
Raise an Issue! I’ll see you there.
Project link: https://github.com/oliverdelancey/NimFormattedFile