Problems with autocomplete in SublimeText 3 and Ubuntu

1

I am using SublimeText 3 on Ubuntu and not "autocomplete" correctly. For example, typing lorem150 and pressing [TAB] should generate a lorem of 150 words but it does not work well. It only generates lorem when I write it without numbers. The same thing happens to me whenever I want to autocomplete something that carries numbers. html: 5 does not work only html works. AL also putting classes happens to me. When using chains of type div.col-md-6 does not work either, it only works if I put div.col-md- and then I put the 6 after pressing [TAB]. I hope to explain myself correctly. Thanks:)

    
asked by Jaume 11.06.2016 в 09:50
source

1 answer

2

You need to install the emmet package in Sublime Text. In order to install packages you need to install Package Control .

Open the Sublime Text console (View -> Show Console) and paste the following:

import urllib.request,os,hashlib; h = '2915d1851351e5ee549c20394736b442' + '8bc59f460fa1548d1514676163dafc88'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)

Hit enter and wait for it to install. Once done, restart Sublime Text. To install packages, open the command palette (Tools -> Command Palette ... or use the shortcut ctrl + shift + p). Write install , select the first option, and then write the package you want to install, in this case emmet :

Once installed, you will have the autocompletion you want to obtain. But now, by default, the emmet autocomplete is configured to work with the%% shortcut%. If you want to change it by ctrl+e you just need to add this in your personal shortcuts (Preferences -> Keybindings - User):

[
  {
    "keys": [
      "tab"
    ], 
    "args": {
      "action": "expand_abbreviation"
    }, 
    "command": "run_emmet_action", 
    "context": [
      {
        "key": "emmet_action_enabled.expand_abbreviation"
      }
    ]
  }, 
]

Restart Sublime Text one more time, and you have already configured the autocomplete of tab in the% key% of Sublime Text.

Greetings.

    
answered by 11.06.2016 / 12:30
source