Infrastructure simplifying engineer
Date: 2018-09-21
It’s better configure VS Code because sublime plugins for ansible is out of date.
Download sublime text 3
please visit packagecontrol.io:
ctrl+`)import urllib.request,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaee' + 'ebe013ee18cced0ef93d5f746d80ef60'; 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)
cmd + shift + p for mac or ctr + shift + p for windowsPackage Control: Install Packagecmd + shift + p for mac or ctr + shift + p for windowsPackage Control: Remove Packagectrl + shift + p or cmd + shift + pctrl + shift + p or cmd + shift + pfor mac os or linux
sudo gem install rubocop
for windows
gem install rubocop --http-proxy=http://some.proxy.example.com:3128
ctrl + shift + p or cmd + shift + phttps://github.com/koalaman/shellcheck
brew install shellcheckyum -y install epel-release ; yum install ShellCheckctrl + shift + p or cmd + shift + pctrl + shift + p or cmd + shift + pgem install yaml-lint
it is needed for ansible lint
ctrl + shift + p or cmd + shift + pSublime Text -> Preferences -> Package Settings -> ApplySyntax -> Settings - User
"syntaxes": [{
"name": "Ansible/Ansible",
"rules": [
{"file_name": ".*/tasks/.*.yml$"},
{"file_name": ".*/handler/.*.yml$"},
{"file_name": ".*/*_vars/.*.yml$"},
{"file_name": ".*/roles/.*.yml$"},
{"file_name": ".*/playbooks/.*.yml$"},
{"file_name": ".*/.*ansible.*/.*.yml$"},
{"file_name": ".*/.*explotation.*/.*.yml$"},
{"file_name": ".*/.*provision.*/.*.yml$"}
]
}]
install yaml lint
pip install yamllint --proxy http://some.proxy.example.com:3128
ctrl + shift + p or cmd + shift + phttps://github.com/mliljedahl/SublimeLinter-contrib-ansible-lint
pip install ansible-lint --proxy http://some.proxy.example.com:3128
ctrl + shift + p or cmd + shift + pinstall pylint
pip install pylint --proxy http://some.proxy.example.com:3128
ctrl + shift + p or cmd + shift + pBy default Sublime text has only EN dictionary. For other languages you need dictionaries. You can download it here
Press F6 for enable/disable spell checking
Sublime text 3 has it by default. however I advise to improve it.
*.md files
ctrl + shift + p or cmd + shift + pPreferences/Settings - Syntax Specific, add:{
"word_wrap": true,
"wrap_width": 120,
"color_scheme": "Packages/MarkdownEditing/MarkdownEditor.tmTheme"
}
cmd + ,)preferences -> settings{
"color_scheme": "Packages/User/SublimeLinter/Monokai (SL).tmTheme",
"default_encoding": "UTF-8",
"default_line_ending": "unix",
"dictionary": "Packages/Russian-English Bilingual.dic",
"ensure_newline_at_eof_on_save": true,
"font_size": 11,
"ignored_packages":
[
"Markdown",
"SublimeLinter-pyyaml",
"Vintage"
],
"rulers":
[
80
],
"spell_check": true,
"tab_size": 2,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
"word_wrap": "true"
}
Goto anything (Cmd+p or ctrl + p) you can fast switch throw:
@ navigate by headers: line numberEnable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux .helpers dir from the repo to the PATH variable.sudo install_me.sh from the repo inside WSL.