Sublime Forum

Atom's C++ autocomplete in Sublime?

#1

Hello,

I’m a pretty novice coder but I’ve been using sublime-text. I’ve tested Atom and sublime-text seems to be better than it in pretty much everything but one thing: Atom’s auto-complete is pretty good, imo.

For example, in Sublime, the “cout” autocomplete gives:

“std::cout”

It atom it completes to:

“std::cout << “/* message */” << std::endl;”

Perhaps to an advance coder this is nit-picking but I like the way Atom manages it. So, is there an easy way to have atom’s C++ auto-complete in sublime text?

0 Likes

#2

Snippets are found here. https://github.com/atom/language-c/blob/master/snippets/language-c.cson

Maybe, someone can write a converter that converts a .cson to several .sublime-snippets.
It looks not that hard. .sublime-snippet format is shown as below.

<snippet>
    <description>Hello World</description>
    <content><![CDATA[#include <iostream>

using namespace std;

int main (int argc, char *argv[]) {
    ${1:cout << "hello world!" << endl;}
    return 0;
}

]]></content>
    <tabTrigger>helloworld</tabTrigger>
    <scope>source.c, source.objc, source.c++, source.c++11, source.objc++</scope> 
</snippet>
1 Like

#3

https://packagecontrol.io/packages/Atomizr

1 Like

#4

Thank you for this @FichteFoll. Though I can’t seem to find it using Package-Control… No idea why.

Has anyone managed to install this?

I think some repositories might be offline? Because I can’t find other extensions that as well…

EDIT: I was able to install it now.

0 Likes

#5

How do I use this Atomizr though?

After installing it and doing ctrl+shift+p I do see “Convert Atom snippets into sublime-text completions”, but nothing happens. I’m obviously missing a step…

0 Likes

#6

From looking at the source (I never used the package), you have to open a .cson file with Atom snippets, run the command and then save the new file contents in a ST package path (e.g. the User package) as something.sublime-completions.

1 Like

#7

What I did:

  1. Copied the snippets from https://github.com/atom/language-c/blob/master/snippets/language-c.cson to a .cson file.
  2. Opened the file above using ST.
  3. Ctrl+Shift+P and “Convert Atom snippets into SublimeText completions”.

Sadly, nothing happened. There is no new file contents…

0 Likes

#8

Are you still experiencing problems? Conversion works fine for me using Atomizr v0.11.1!

0 Likes