Autocorrect or advanced snippets how do I?


#1

I have about 500 documents to create and at the bottom of each I put a collection of standard hashtags based on type, source and content.

I have three long lists of available hashtags and so I am looking for a cute way of either typing #t and seeing the available type hashtags or even better a panel of my tags that I can click and insert into the document.

For the record all documents are markdown.

Is there something in atom or a package that can help with this use case?


#2

The package that generates autocomplete suggestions is autocomplete-plus, and it has an API for packages to add additional lists of words. It would also be possible (and slightly easier, but with less flexibility for the finished product) to load all of your hashtags into snippets. In either case, you could automate most of the formatting with a script.


#3

Thanks but what I can’t get my head around is that I want for example to key #t and see a list of all type hashtags or #s to see a list of all source hashtags.

How would I achieve that?


#4

By “type hashtags”, do you mean "hashtags starting with the string #type"?


#5

not quite.

i have type hastags, content hashtags and source hashtags.

they are currently arranged in a tree like so

-type
#tag1
#tag2
etc
-content
#tag3
#tag4

so they dont begin #type or #content

The end result is the below markdown appears in each document at the end.

Metadata

- Path : 
- Created : 
- Tags Type : #note
- Tags Source : #developer, #uk
- Tags Content : #source-code, #application, #name

#6

I’ve tested, and it doesn’t work with # in the prefix. Not sure why. This does work:

'.text.md':
  'Type 1':
    prefix: 'type1'
    body: '#tag1'
  'Type 2':
    prefix: 'type2'
    body: '#tag2'

Make sure you have the autocomplete-snippets package enabled.