Create (touch) and open a file
to [-c] [-e extension] [filename]
-c
: Create the file at current directory. Default directory is~/Desktop
-e
: Specify the file extenson. Default extention istxt
filename
: Specify the filename. Default filename isuntitled
. If duplicated, the default filename isuntitled-{numbers}
.
If filename contains file extension, the-e
flag will be ignored.
-
Clone the repo
git clone https://github.com/dingyiyi0226/to.git ~/.to
-
Modify
.bashrc
echo "source ~/.to/to" >> ~/.bashrc
-
Restart the shell
exec $SHELL
-
Change the default extension by modify
DEFAULT_EXTENSION
in to file
to # create and open ~/Desktop/untitled.txt
to note # create and open ~/Desktop/note.txt
to -e md # create and open ~/Desktop/untitled.md
to note.md # create and open ~/Desktop/note.md
to -c test.cpp # create and open <current directory>/test.cpp