C-Mate : Your companion for C in Sublime Text

What is C-Mate ?

When it comes to writing code then either we choose an IDE like codeblocks or ecllipse, OR we use some text editor like notepad++ or sublime text. Sublime text is a very powerful, flexible and free text editor. You can install any package you want in sublime which help you writing codes easily. C-Mate is also such a sublime package which will help you write C code efficiently on ubuntu. It consists of many useful snippets, pre-coded functions and a powerful build system.



Why C-Mate

Although there is a pre-installed c++ sublime package which helps you writing c as well as c++ codes but the feature it lags is the code running in the terminal. People like writing code in sublime but when it comes to build and run the code then they need to go the directory containing the code file and then build and run it from there. It gets so annoying when we debug the code. No sublime package allows to run the code within the sublime. Here C-Mate makes the exception. Its build system is capable of running the code in terminal from within the sublime.

Also it comes with some pre-coded functions which noone wants to write again and again but need to write them unwillingly. These functions are min(int *), swap(int, int) and much more. You all just need to start typing the name of the function and it will write the function declaration and function body of that function.

C-Mate also consists many useful shortcuts/snippets which speed up you writing. Like include, for loop, while loop, main function, structure, typedef and many more.



How to get it ?

It has not come to the sublime package install yet but it will be there soon. Till that time, you'll need to install it manually. Don't worry, you just need to follow 2 steps.

  1. Download the C-Mate from here. Download C-Mate
  2. Copy the downloaded file to /home/.config/sublime-text-3/Installed Packages/. Thats it
  3. Now just type your c code and press ctrl+b and select C-Mate.



How to use it ?

After the installation, just start typing your code and C-Mate will start helping you. When you are finished your code, just press ctrl+b and select C-Mate. You wont have to select C-Mate every time. Its just for the first time.

Associated keys

  1. ctrl+b : Build the code
  2. ctrl+shift+b : Run the code in the terminal.

Some snippets keywords

  1. main : for main() function
  2. inc : include statement
  3. for : for loop
  4. while : while loop
  5. type : typedef
  6. .......and many more

Note : It is to note that the application file of your code will be create in the same directory in which the code file reside. And its name will be the same as of the code file but without the .c extension. This means that you can create multiple application files in the same directory without the fear of losing the previous one.

In the near future, i'll try to incorporate auto function declaration feature in C-Mate. If you want to contribute to C-Mate then you can visit its github repo. If you have any doubt regarding its functionality then just comment it out below and i'll be happy to solve your query.

Comments

Popular posts from this blog

Search box for blog or website

Image Search Engine Using Python

8 Amazing Animal's Sleep Facts