Skip to content

A simple script to open templates from command line in sublime

Notifications You must be signed in to change notification settings

Ankit-22/Sublime_Template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sublime Template

This is a tool that can be installed and used in linux to create and load templates in sublime text.

Installation:

Just execute the install.sh script with root permissions

sudo ./install.sh

Usage:

To create a template just use:

sublime create <template_name> <template_file>

# Eg sublime create cpp file.cpp

To load templates:

sublime --<template_name> files....

# All given files will be loaded with the template

#Eg. sublime --cpp 1.cpp 2.cpp 3.cpp {5..8}.cpp

To make multiple files with executable permissions:

sublime +x files....

# All files will be created with executable permissions

# Eg. sublime +x 1.sh 2.sh 3.sh

To modify already made template:

sublime modify < template_name > < modification_type > < value >

template_name = name of the template

modification_type:

-f : Modify the template file.
   Value is path to the new file
   Eg. sublime modify cpp -f new_template.cpp
   Changes the contents of template cpp to contents of new_template file

-j : Jump to a certain line when the file is opened in sublime.
   Value is line:character jump to given 'character' number in given 'line'
   Eg. sublime modify cpp -j 42:2 jumps to 2nd character in 42nd line

To show all the templates:

sublime list

To delete a template:

sublime delete < template_name >

Updation:

To update your script download the new files and execute

sudo ./update.sh

Uninstall:

To uninstall temlate for a user, execute

./uninstall.sh

To remove for all users, execute

sudo rm /usr/local/bin/sublime

About

A simple script to open templates from command line in sublime

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages