cft

Creating and Sharing Code Snippets with Codiga

When developing an application, programmers are expected to work smarter, not harder. One of the greatest methods to achieve this is utilizing the best tools to enhance your performance and productivity. One of them is a tool you may use to share code samples when developing. If you work in a team, code snippets make the development process simpler for new team members who are developers in your field. This post will teach us how to write and distribute our code snippets.


user

Ezekiel Lawson

2 years ago | 4 min read

Codiga is a new generation of code analysis software that manages productivity and helps us write code faster. Codiga offers features such as automating code reviews on Github and creating and sharing code snippets. Aside from that, you can use code snippets created by other developers to work on your project. In this article, we will learn how to create and share smart code snippets and how we can use the snippets of other developers.

Now let's begin. Installing Codiga in our VS code is the first step.

Step 1

Go to the Microsoft visual studio website, where you can find all the plugins search for “Codiga Smart Code Snippets” and Click on the "install" button.

Step 2: Install Codiga in VS Code

Click the “install”  button to be taken to the page where you will install it on your VS code. However, you must ensure that you have installed your VS Code software before accessing this part; otherwise, you will need to do so. If you have the Vs Code software installed, you will be instantly redirected there.

Step 3: Redirect to Dashboard

If you want to return to the codiga documentation after installation, click the "open" option on the pop-up message page. You will be taken there, where you can read more about the various capabilities they provide.

Step 4: Create Code Snippet

The purpose of this tutorial is to build a code snippet, therefore, let's go to our Visual Studio code and do that.

Go to the file you want to create a snippet for, highlight it and click on the "create codiga snippet" in this article. I selected the Javascript file as that is the file I want to create and share a snippet

When you click that, you will see a pop-up message asking if you want to open it on an external website. Click on the option "open"

Now, let's create our snippet. The first step is to give it a name and save it

Step 5: Share Snippet

Now that our snippet has been successfully created, let's share it. We have various sharing options with Codiga, including HTML, Direct, Markdown, and Social Media. We are free to select any alternative we desire.

One of the unique differences I love about this tool is that it has other unique features such as searching for code snippets, inline snippet auto-completion, and using shortcuts to access a snippet which makes everything easier for you as a developer. Now let’s check out how they work

How to search for code snippets using the Codiga panel in VS Code

Go to your Vs code, open the file you want to work with, and use the commands below to access the Codiga panel, search the snippets using any keyword of your choice

If you're using Mackbook, use the command below to launch Codiga Coding Assistant to locate snippets based on a search similar to a google search.

CMD + SHIFT + C 

If you're using windows, use the command below to launch Codiga Coding Assistant to locate snippets based on a search similar to a google search.

CTRL + SHIFT + C 

This command opens a list of all the shortcuts for Mackbook and Windows users,

Mac users

CMD + SHIFT + S  

Window users

CTRL + ALT + S 

Let’s see an example of how it works

In the above example, when we search for the snippet using the keyword “array”, it brings out a list of snippets with the name array, we have to option to preview the snippet and implement it into our code instantly.

How to Search for snippets using inline completion

We can search for the inline snippets by going to the file we want to work with, typing “.” or “/” go through the list of the recommended snippets, choose the one you want, and hit the enter button when you see the snippets you want

Codiga has this auto-complete feature when we search for a particular snippet, we can also preview before we click enter just like Github Copilot. 

Using shortcuts to Access a Snippet

We can access snippets using the Codiga shortcut command, open the search bar with the command below, and search for any keyword of your choice it will suggest the list of snippets with the keyword you searched; you can choose the snippets you want to work with. Let’s see an example of how we can search for a snippet using the shortcut

Use the command below to open the shortcuts, and choose the snippet you want

Mac users

CMD + SHIFT + S  

Window users

CTRL + ALT + S 

Codiga offers some of the javascript snippets such as Reverse array, create new array, Chain promises, and Fetch Post if you are a developer and you don’t need to go through the process of going to google to search for those snippets. Just install Codiga in your VS code and get started.

Codiga is one of the best tools I use for my productivity, and it allows me to create code snippets, share the code snippet or work with snippets created by other developers. Aside from that, it supports some of the languages we work with, such as C, C++, CSS, HTML, Java, Javascript, Typescript, Python, Dart, Ruby, PHP, Scala, Apex, Terraform, Docker, Go, Rust, Shell, Solidity, YAML. 

Before you integrate the tool in your preffered coding language, go through the language rules

You can checkout the Codiga documentation to see the other features it has and how you can get started with the tool

Conclusion

Sharing your code snippets is essential for documenting your coding process and assisting other developers in becoming more productive and efficient. The idea of developers producing code snippets is one that most companies adopt because it makes it easier for team members to work together without having to go through the laborious process of establishing software from start. In this tutorial, we learned how to use the Codiga software to create and share code snippets and how to use the snippets created by other developers

Upvote


user
Created by

Ezekiel Lawson

I'm a software developer with experience in web technologies like Javascript, Vue.js, HTML, and CSS. I love teaching and sharing my technical ideas through articles.


people
Post

Upvote

Downvote

Comment

Bookmark

Share


Related Articles