Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add custom snippets? #2481

Closed
gpk2000 opened this issue Apr 21, 2020 · 3 comments
Closed

How to add custom snippets? #2481

gpk2000 opened this issue Apr 21, 2020 · 3 comments
Labels

Comments

@gpk2000
Copy link

gpk2000 commented Apr 21, 2020

Hi I am a competitive programmer and I like to reuse parts of the code but I find adding snippets in snippets.conf to be a bit tedious. Does a simple way exist?

@elextr
Copy link
Member

elextr commented Apr 21, 2020

That is the simple way 😁

@gpk2000
Copy link
Author

gpk2000 commented Apr 21, 2020

😢
i have found a way i.e type my custom code like this

print(repr('''ll pow(int a, int b){
  ll res = 1;
  a %= mod;
  while(b){
    if(b & 1){
      res = res * a;
      res %= mod;
    }
    a = a * a;
    b >>= 1;
  }
  return res % mod
}'''))

output : 'll pow(int a, int b){\n ll res = 1;\n a %= mod;\n while(b){\n if(b & 1){\n res = res * a;\n res %= mod;\n }\n a = a * a;\n b >>= 1;\n }\n return res % mod\n}'

@mega-bots
Copy link

mega-bots commented Jun 14, 2023

SOLVED :: THANKS A LOT FOR @gpk2000

For some one looking for the solution just copy your code and paste in the python code format mentioned by @gpk2000
and paste the output under the section of the language in the conf file which is at /usr/share/geany/snippets.conf.
like this may be
hi=the op you got from the python

now when you use the word hi in geany type hi and then press tab to autocomplete the snippet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants