           type: 'function'
           latexType: 'command'
           chainComplete: chainComplete
+          counts: 1
+      else
+        items[result[1]].counts += 1
     return items
 
   suggestions:

          replacementPrefix: prefix
          type: 'function'
          latexType: 'command'
    return suggestions

  getCommands: (tex) ->

          item.replacementPrefix = prefix
          suggestions.push item
      suggestions.sort((a, b) ->
        if a.displayText.indexOf(prefix) isnt b.displayText.indexOf(prefix)
          return a.displayText.indexOf(prefix) - b.displayText.indexOf(prefix)
        else
          return b.counts - a.counts
      )
      return suggestions
    if !@latex.manager.findAll()
      return suggestions
