Ways to add code snippet

Share your favorite FastKeys commands
Post Reply
Krisz
Posts: 1
Joined: Apr 13th, ’21, 15:22

Post by Krisz » Apr 13th, ’21, 16:08

I have this created for other users doing any sort of coding. I was looking for this on the forum and surprisingly found quite limited information. I feel Fastkeys is really missing a large chunk of potential users who could benefit from such tool.

What I did to add a snippet is:
- Created an expand text
- Set top right to 'Send'
- Pasted my code in along with trigger string and description.
- Add your custom inputs in code if you wish (like popup input for classname)
The issues come here.

I tried this in Visual Studio Code (VSCode) and found that it's adding all kind of autoformatting as Fastkeys is typing rather than pasting. The solution for this is to use clipboard instead (I think it's a better idea anyway) :
- Preferences => Text Expander => Advanced: Use clipboard if text length exceeds (char). Set this to 1
- Exit Fastkeys. Restart. (otherwise it won't work)

Another issue I found is brackets not used properly `(` and `)`
The solution for this was to go to:
- Preferences => Text Expander => Ending Characters => remove `(` and `)`

Not sure if I broke anything with this, but doing this finally made it work. If your custom input is within a bracket, it won't highlight it in Fastkeys when you write up your code, but it does work as per usual.

Hope it helped someone! If you have any other tricks for code, please add it below.
mr9bitbyte
Posts: 21
Joined: Apr 25th, ’23, 17:20

Post by mr9bitbyte » Apr 27th, ’23, 02:32

Krisz wrote: Apr 13th, ’21, 16:08 I have this created for other users doing any sort of coding. I was looking for this on the forum and surprisingly found quite limited information. I feel Fastkeys is really missing a large chunk of potential users who could benefit from such tool.

What I did to add a snippet is:
- Created an expand text
- Set top right to 'Send'
- Pasted my code in along with trigger string and description.
- Add your custom inputs in code if you wish (like popup input for classname)
The issues come here.

I tried this in Visual Studio Code (VSCode) and found that it's adding all kind of autoformatting as Fastkeys is typing rather than pasting. The solution for this is to use clipboard instead (I think it's a better idea anyway) :
- Preferences => Text Expander => Advanced: Use clipboard if text length exceeds (char). Set this to 1
- Exit Fastkeys. Restart. (otherwise it won't work)

Another issue I found is brackets not used properly `(` and `)`
The solution for this was to go to:
- Preferences => Text Expander => Ending Characters => remove `(` and `)`

Not sure if I broke anything with this, but doing this finally made it work. If your custom input is within a bracket, it won't highlight it in Fastkeys when you write up your code, but it does work as per usual.

Hope it helped someone! If you have any other tricks for code, please add it below.
Can you explain where you pasted your code ?
Post Reply