Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
8 lines (8 sloc) 33 KB
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>How to get current … in Sublime Text</title><meta content="Tutorial, how to get some variable parameters for your Sublime Text" name="description"><meta content="width=device-width,initial-scale=1" name="viewport"><meta content="IE=edge" http-equiv="X-UA-Compatible"><meta content="How to get current … in Sublime Text" property="og:title"><meta content="article" property="og:type"><meta content="https://i.imgur.com/nwNgLkR.png" property="og:image"><meta content="https://kristinita.netlify.com/IT-articles/How-to-get-current-…-in-Sublime-Text.html" property="og:url"><meta content="Tutorial, how to get some variable parameters for your Sublime Text" property="og:description"><meta content="Поиск Кристиниты" property="og:site_name"><meta content="2018-04-05" property="article:published_time"><meta content="2019-06-14" property="article:modified_time"><meta content="IT-articles" property="article:section"><meta content="sublime-text" property="article:tag"><script type="application/ld+json">{ "@context": "https://schema.org", "@type": "HowTo", "name": "How to get current … in Sublime Text", "description": "Tutorial, how to get some variable parameters for your Sublime Text", "headline": "How to get current … in Sublime Text", "datePublished": "2018-04-05 07:30:14+03:00", "dateModified": "2019-06-14 21:25:18+03:00", "author": { "@type": "Person", "name": "Sasha Chernykh" }, "image": "https://i.imgur.com/nwNgLkR.png", "url": "https://kristinita.netlify.com/IT-articles/How-to-get-current-…-in-Sublime-Text.html" }</script><link href="https://kristinita.netlify.com/favicon.ico" rel="shortcut icon"><link href="https://kristinita.netlify.com/feeds/all.atom.xml" rel="alternate" type="application/atom+xml"><link href="https://kristinita.netlify.com/feeds/it-articles.atom.xml" rel="alternate" type="application/atom+xml"><script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js" defer></script><script src="https://kristinita.netlify.com/theme/js/target-blank/target-blank.min.e11e5105efa99a3d.js" defer></script><script src="https://cdn.jsdelivr.net/npm/gemini-scrollbar/index.min.js" defer></script><script src="https://kristinita.netlify.com/theme/js/Gemini/GeminiAndJQueryLazy.min.6e0d649a835b799d.js" defer></script><script src="https://cdn.jsdelivr.net/jquery.lazy/latest/jquery.lazy.min.js" defer></script><script src="https://cdn.jsdelivr.net/jquery.lazy/latest/jquery.lazy.plugins.min.js" defer></script><script src="https://kristinita.netlify.com/theme/js/Browser-Update/browser-update.min.e45fe54cc9cb8588.js" defer></script><script src="https://cdn.jsdelivr.net/npm/typo-reporter/lib/TypoReporter.min.js" defer></script><script src="https://kristinita.netlify.com/theme/js/typo-reporter/typo-reporter-en.min.f4d148db23221baf.js" defer></script><script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox/dist/jquery.fancybox.min.js" defer></script><script src="https://kristinita.netlify.com/theme/js/Fancybox/fancybox.min.eb8f09c393877937.js" defer></script><script src="https://cdn.jsdelivr.net/jquery.tooltipster/latest/js/tooltipster.bundle.min.js" defer></script><style>body,html{height:100%;overflow:hidden}.SashaBottomAside,a,ol>li{overflow-wrap:break-word;word-break:break-all}ol>li{margin-left:1rem}body{font-family:Arial,Helvetica,sans-serif;font-size:1.1875rem;margin:0;padding:0}a{text-decoration:none}noscript{color:#fff;font-family:sans-serif;font-weight:700;text-align:center;padding:1rem 0;background:rgba(0,0,0,.9);position:fixed;top:0;z-index:1}img{max-width:100%;margin:0 auto}.SashaVersion{font-size:.9rem;font-weight:700}div.a2a_floating_style{padding:.0625rem;top:30%}.SashaBottomAside,h1{font-family:Play,sans-serif}.SashaBottomAside,h1{font-size:1.9375rem;font-weight:lighter;font-style:normal}a{font-style:italic}a{font-family:El Messiri,sans-serif;font-size:1.3rem;font-weight:700}.SashaIconAside{background-size:cover;height:100%;top:0}.SashaBottomAside{font-size:2rem;line-height:2rem;text-align:center;position:absolute;bottom:7%;left:10%;width:80%}@media screen and (orientation:portrait){.SashaIconAside{width:100%;position:relative}noscript{width:100%}}@media screen and (orientation:landscape){.SashaIconAside{width:35%;position:fixed}main,noscript{width:65%}}@media screen and (orientation:landscape){article{margin-right:1rem;margin-left:2rem}.SashaIconAside{right:0}}@media screen and (orientation:portrait){article{margin-right:1rem;margin-left:3rem}}.a2a_floating_style{left:0}body{background:#87e1be;color:#465550}a{color:#dc3f17}img{box-shadow:0 0 2rem #000}.SashaPageLoading{box-shadow:none}.SashaBottomAside{color:#fff;bottom:8%}@font-face{font-family:'El Messiri';font-style:normal;font-weight:400;font-display:swap;src:local('El Messiri'),local('ElMessiri-Regular'),url(https://fonts.gstatic.com/s/elmessiri/v6/K2F0fZBRmr9vQ1pHEey6MomABw.ttf) format('truetype')}@font-face{font-family:Play;font-style:normal;font-weight:700;font-display:swap;src:local('Play Bold'),local('Play-Bold'),url(https://fonts.gstatic.com/s/play/v11/6ae84K2oVqwItm4TCpQy3w.ttf) format('truetype')}</style><link href="https://cdn.jsdelivr.net/jquery.tooltipster/latest/css/tooltipster.bundle.min.css" rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'"><noscript><link href="https://cdn.jsdelivr.net/jquery.tooltipster/latest/css/tooltipster.bundle.min.css" rel="stylesheet"></noscript><link href="https://cdn.jsdelivr.net/npm/tooltipster/dist/css/plugins/tooltipster/sideTip/themes/tooltipster-sideTip-punk.min.css" rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'"><noscript><link href="https://cdn.jsdelivr.net/npm/tooltipster/dist/css/plugins/tooltipster/sideTip/themes/tooltipster-sideTip-punk.min.css" rel="stylesheet"></noscript><script src="https://kristinita.netlify.com/theme/js/Tooltipster/tooltip.min.25ef24827c8d23a2.js" defer></script><script src="https://cdn.jsdelivr.net/clipboard.js/latest/clipboard.min.js" defer></script><script src="https://kristinita.netlify.com/theme/js/Clipboard-js/Clipboard.min.13347deb67c2a82a.js" defer></script><script src="https://static.addtoany.com/menu/page.js" defer></script><script src="https://kristinita.netlify.com/theme/js/AddToAny/addtoany.min.27de59cb13b5ac52.js" async></script><script src="https://kristinita.netlify.com/theme/js/Wildfire/wildfire.min.8244a84c73913d2e.js" async></script><script src="https://cdn.jsdelivr.net/npm/wildfire/dist/wildfire.auto.js" defer></script><link href="https://cdn.jsdelivr.net/npm/gemini-scrollbar/gemini-scrollbar.min.css" rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'"><noscript><link href="https://cdn.jsdelivr.net/npm/gemini-scrollbar/gemini-scrollbar.min.css" rel="stylesheet"></noscript><link href="https://kristinita.netlify.com/theme/css/script-colors/Gemini/gemini.min.32c3d46b921839e9.css" rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'"><noscript><link href="https://kristinita.netlify.com/theme/css/script-colors/Gemini/gemini.min.32c3d46b921839e9.css" rel="stylesheet"></noscript><link href="https://kristinita.netlify.com/theme/css/general/basic.min.681a7bf2ace60968.css" rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'"><noscript><link href="https://kristinita.netlify.com/theme/css/general/basic.min.681a7bf2ace60968.css" rel="stylesheet"></noscript><link href="https://kristinita.netlify.com/theme/css/general/fonts.min.5159f9ebf5d3de35.css" rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'"><noscript><link href="https://kristinita.netlify.com/theme/css/general/fonts.min.5159f9ebf5d3de35.css" rel="stylesheet"></noscript><link href="https://kristinita.netlify.com/theme/css/general/aside.min.5363eb891d9658ee.css" rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'"><noscript><link href="https://kristinita.netlify.com/theme/css/general/aside.min.5363eb891d9658ee.css" rel="stylesheet"></noscript><script src="https://kristinita.netlify.com/theme/js/Modernizr/modernizr-custom.min.03944c2c1dc0413e.js" defer></script><style>.webp .SashaIconAside{background-image:url(https://kristinita.netlify.com/theme/images/aside/SashaGreenSweater.webp)}.no-webp .SashaIconAside{background-image:url(https://kristinita.netlify.com/theme/images/aside/SashaGreenSweater.jpg)}</style><link href="https://kristinita.netlify.com/theme/css/general/image_right.min.11d2439bdd90072b.css" rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'"><noscript><link href="https://kristinita.netlify.com/theme/css/general/image_right.min.11d2439bdd90072b.css" rel="stylesheet"></noscript><link href="https://kristinita.netlify.com/theme/css/sections/it-articles.min.7646e7d4a34c26df.css" rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'"><noscript><link href="https://kristinita.netlify.com/theme/css/sections/it-articles.min.7646e7d4a34c26df.css" rel="stylesheet"></noscript><link href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox/dist/jquery.fancybox.min.css" rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'"><noscript><link href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox/dist/jquery.fancybox.min.css" rel="stylesheet"></noscript><link href="https://kristinita.netlify.com/theme/css/script-colors/typo-reporter/typo-reporter.min.667472c6a558afee.css" rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'"><noscript><link href="https://kristinita.netlify.com/theme/css/script-colors/typo-reporter/typo-reporter.min.667472c6a558afee.css" rel="stylesheet"></noscript><link href="https://kristinita.netlify.com/theme/css/script-colors/Admonition/admonition.min.cb53ef4d77a61632.css" rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'"><noscript><link href="https://kristinita.netlify.com/theme/css/script-colors/Admonition/admonition.min.cb53ef4d77a61632.css" rel="stylesheet"></noscript><link href="https://fonts.googleapis.com/css?family=Play:700%7CEl+Messiri%7CScada:700i%7CFira+Mono%7CMaterial+Icons%7CMarck+Script&amp;subset=cyrillic&amp;display=swap" rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'"><noscript><link href="https://fonts.googleapis.com/css?family=Play:700%7CEl+Messiri%7CScada:700i%7CFira+Mono%7CMaterial+Icons%7CMarck+Script&amp;subset=cyrillic&amp;display=swap" rel="stylesheet"></noscript></head><body><div role="alert"><noscript><p>Sorry, this site doesn't work, if JavaScript disabled. Please, <a href="http://activatejavascript.org/en/instructions">enable JavaScript for your browser</a>.</p><p>This site is open source; you can view <a href="https://github.com/Kristinita/Kristinita.github.io/blob/master/IT-articles/How-to-get-current-%E2%80%A6-in-Sublime-Text.html">source of this page</a>, to make sure that it's not dangerous for your computer.</p>Owner of this site think that <a href="https://stackoverflow.com/a/17073999/5951529">JavaScript disabling — is obsolete action in 2019</a> and <a href="https://www.reddit.com/r/webdev/comments/48z7jz/do_you_take_into_account_those_who_disable/d0nxftd/">will not support users who did this</a>. Probably, <a href="https://www.howtogeek.com/138865/htg-explains-should-you-disable-javascript/">you don't need turn off JavaScript</a>.</noscript><script>!function(n){"use strict";n.loadCSS||(n.loadCSS=function(){});var o=loadCSS.relpreload={};if(o.support=function(){var e;try{e=n.document.createElement("link").relList.supports("preload")}catch(t){e=!1}return function(){return e}}(),o.bindMediaToggle=function(t){var e=t.media||"all";function a(){t.addEventListener?t.removeEventListener("load",a):t.attachEvent&&t.detachEvent("onload",a),t.setAttribute("onload",null),t.media=e}t.addEventListener?t.addEventListener("load",a):t.attachEvent&&t.attachEvent("onload",a),setTimeout(function(){t.rel="stylesheet",t.media="only x"}),setTimeout(a,3e3)},o.poly=function(){if(!o.support())for(var t=n.document.getElementsByTagName("link"),e=0;e<t.length;e++){var a=t[e];"preload"!==a.rel||"style"!==a.getAttribute("as")||a.getAttribute("data-loadcss")||(a.setAttribute("data-loadcss",!0),o.bindMediaToggle(a))}},!o.support()){o.poly();var t=n.setInterval(o.poly,500);n.addEventListener?n.addEventListener("load",function(){o.poly(),n.clearInterval(t)}):n.attachEvent&&n.attachEvent("onload",function(){o.poly(),n.clearInterval(t)})}"undefined"!=typeof exports?exports.loadCSS=loadCSS:n.loadCSS=loadCSS}("undefined"!=typeof global?global:this);</script></div><aside role="presentation"><div class="a2a_floating_style a2a_kit a2a_kit_size_17 a2a_vertical_style"><a class="a2a_button_mastodon"></a> <a class="a2a_button_diaspora"></a> <a class="a2a_button_telegram"></a> <a class="a2a_button_care2_news"></a> <a class="a2a_button_printfriendly"></a> <a class="a2a_dd"></a></div></aside><aside class="SashaIconAside"><div class="SashaBottomAside">How to get current … in Sublime Text</div></aside><main><article><header><h1 class="SashaTopHeader">How to get current … in Sublime Text</h1><img alt="Page loading, please, little wait" class="SashaPageLoading" src="https://2no.co/1vWK5.png"><div class="SashaVersion">Version 0.2.0</div><div class="SashaVersion">Posted — 2018-04-05T07:30:14+0300</div><div class="SashaVersion">Last modified — 2019-06-14T21:25:18+0300</div></header><section><ol><li><a href="#Overview">Overview</a></li><li><a href="#Audience">Audience</a></li><li><a href="#Relevance">Relevance</a></li><li><a href="#Features">Features</a></li><li><a href="#Sublime-Text-console">Sublime Text console</a><ol><li><a href="#Console-actions">Console actions</a></li></ol></li><li><a href="#How-to-get-current-%E2%80%A6">How to get current …</a><ol><li><a href="#Packages-directory">Packages directory</a><ol><li><a href="#What-is-it">What is it?</a></li><li><a href="#What-should-you-do">What should you do?</a></li><li><a href="#Method">Method</a></li><li><a href="#Not-recommended">Not recommended</a></li></ol></li><li><a href="#Syntax">Syntax</a><ol><li><a href="#What-is-it-1">What is it?</a></li><li><a href="#What-should-you-do-1">What should you do?</a></li><li><a href="#Method-1">Method</a></li></ol></li><li><a href="#Theme">Theme</a><ol><li><a href="#What-is-it-2">What is it?</a></li><li><a href="#What-should-you-do-2">What should you do?</a></li><li><a href="#Method-2">Method</a></li></ol></li><li><a href="#Color-scheme">Color scheme</a><ol><li><a href="#What-is-it-3">What is it?</a></li><li><a href="#What-should-you-do-3">What should you do?</a></li><li><a href="#Method-3">Method</a></li></ol></li><li><a href="#Scope">Scope</a><ol><li><a href="#What-is-it-4">What is it?</a></li><li><a href="#What-should-you-do-4">What should you do?</a></li><li><a href="#Method-4">Method</a></li><li><a href="#Not-recommended-1">Not recommended</a></li></ol></li><li><a href="#Syntax-scope">Syntax scope</a><ol><li><a href="#What-is-it-5">What is it?</a></li><li><a href="#What-should-you-do-5">What should you do?</a></li><li><a href="#Method-5">Method</a></li></ol></li></ol></li><li><a href="#External-links">External links</a></li></ol><p><a id="Overview"></a></p><h2>1. Overview <a href="#Overview" class="headerlink" title="Permanent link">¶</a></h2><p>Article, how you can get some variable parameters for your Sublime Text. I wrote about the most common variable parameters, that you can found in my answers and comments in Stack Overflow.</p><p><a id="Audience"></a></p><h2>2. Audience <a href="#Audience" class="headerlink" title="Permanent link">¶</a></h2><p>Sublime Text users:</p><ul><li>Inexperienced</li><li>Which help inexperienced users</li></ul><p><a id="Relevance"></a></p><h2>3. Relevance <a href="#Relevance" class="headerlink" title="Permanent link">¶</a></h2><p>This article is relevant for April 2018. In the future, the data in this article may be obsolete.</p><p><a id="Features"></a></p><h2>4. Features <a href="#Features" class="headerlink" title="Permanent link">¶</a></h2><ul><li>Data of this article cross platform. They are relevance for Windows, macOS and Linux users.</li></ul><p><a id="Sublime-Text-console"></a></p><h2>5. Sublime Text console <a href="#Sublime-Text-console" class="headerlink" title="Permanent link">¶</a></h2><ul><li><a href="http://docs.sublimetext.info/en/latest/basic_concepts.html#sublime-text-is-programmable">“Sublime Text is Programmable”</a></li><li><a href="https://softwareengineering.stackexchange.com/q/164225/264224">“What is the purpose of Console in Sublime Text editor?”</a></li></ul><p><a id="Console-actions"></a></p><h3>5.1. Console actions <a href="#Console-actions" class="headerlink" title="Permanent link">¶</a></h3><ul><li><code class="SashaInlineHighlight"><span class="nv">$parameter</span></code> — parameter, which you want to know.</li></ul><p><strong>Example</strong>: <strong>if</strong> you want to know your syntax, <code class="SashaInlineHighlight"><span class="nv">$parameter</span></code> is <em>Syntax</em>; <strong>else</strong> theme, <code class="SashaInlineHighlight"><span class="nv">$parameter</span></code> is <em>Theme</em> and so on.</p><ol><li>open Sublime Text</li><li>open file whose <code class="SashaInlineHighlight"><span class="nv">$parameter</span></code> you want to know</li><li><p>place your caret before symbol whose <code class="SashaInlineHighlight"><span class="nv">$parameter</span></code> you want to know</p><div class="admonition caution"><p class="admonition-title">Caution</p><p>Please, do not confuse <a href="https://www.computerhope.com/jargon/t/textcurs.htm">caret</a> and <a href="https://www.computerhope.com/jargon/m/mouspoin.htm">mouse pointer</a>.</p></div></li><li><p>open <a href="https://stackoverflow.com/q/13965877/5951529">Sublime Text console</a></p></li><li>paste method from <code class="SashaInlineHighlight"><span class="nv">$parameter</span></code> section to Sublime Text console input area → <kbd>Enter</kbd></li></ol><p>You should get console output, <strong>example</strong>:</p><p><a href="https://i.imgur.com/cQbwDkM.png" class="fancybox"><img alt="Example Sublime Text console output" class="SashaLazy" src="https://kristinita.netlify.com/theme/images/interface-images/transparent-one-pixel.png" data-src="https://i.imgur.com/cQbwDkM.png"></a></p><p><a id="How-to-get-current-…"></a></p><h2>6. How to get current … <a href="#How-to-get-current-%E2%80%A6" class="headerlink" title="Permanent link">¶</a></h2><p><a id="Packages-directory"></a></p><h3>6.1. Packages directory <a href="#Packages-directory" class="headerlink" title="Permanent link">¶</a></h3><p><a id="What-is-it"></a></p><h4>6.1.1. What is it? <a href="#What-is-it" class="headerlink" title="Permanent link">¶</a></h4><p><a href="http://docs.sublimetext.info/en/sublime-text-3/basic_concepts.html#the-packages-directory">Packages directory</a> — <em>Data/Packages</em> — path, where stored:</p><ol><li><a href="http://docs.sublimetext.info/en/latest/extensibility/packages.html#types-of-packages">“user packages” except “installed packages”</a> in Sublime Text terminology</li><li><em>User</em> folder, where stored <a href="https://www.sublimetext.com/docs/3/settings.html">user settings</a></li></ol><p><a id="What-should-you-do"></a></p><h4>6.1.2. What should you do? <a href="#What-should-you-do" class="headerlink" title="Permanent link">¶</a></h4><p><a href="#Console-actions">Actions 1, 4, 5</a>.</p><p><a id="Method"></a></p><h4>6.1.3. Method <a href="#Method" class="headerlink" title="Permanent link">¶</a></h4><div class="SashaBlockHighlight"><pre><button class="SashaButton SashaTooltip"><img alt="Clipboard button" class="SashaNotModify" src="https://kristinita.netlify.com/theme/images/interface-images/clippy.svg"></button><span class="n">sublime</span><span class="o">.</span><span class="n">packages_path</span><span class="p">()</span>
</pre></div><div class="admonition note"><p class="admonition-title">Note</p><p>That get directory of <a href="http://docs.sublimetext.info/en/latest/extensibility/packages.html#types-of-packages">“installed packages”</a>, use this method:</p><div class="SashaBlockHighlight"><pre><button class="SashaButton SashaTooltip"><img alt="Clipboard button" class="SashaNotModify" src="https://kristinita.netlify.com/theme/images/interface-images/clippy.svg"></button><span class="n">sublime</span><span class="o">.</span><span class="n">installed_packages_path</span><span class="p">()</span>
</pre></div></div><p><a id="Not-recommended"></a></p><h4>6.1.4. Not recommended <a href="#Not-recommended" class="headerlink" title="Permanent link">¶</a></h4><p>In some sources (<a href="https://stackoverflow.com/a/19158010/5951529">example</a>) you can read similar answers:</p><blockquote><p>For Sublime 3, the locations are the following:</p><p>Windows: <em>%APPDATA%Sublime Text 3</em>,</p><p>OS X: <em>~/Library/Application Support/Sublime Text 3</em>,</p><p>Linux: <em>~/.config/sublime-text-3</em>.</p></blockquote><p>I'm not recommend this, arguments:</p><ol><li>it less simple</li><li>in new versions of Sublime Text and/or operating systems paths may be change</li><li>it <a href="http://docs.sublimetext.info/en/sublime-text-3/basic_concepts.html#the-data-directory">doesn't take</a> portable Sublime Text on Windows</li></ol><p><a id="Syntax"></a></p><h3>6.2. Syntax <a href="#Syntax" class="headerlink" title="Permanent link">¶</a></h3><p><a id="What-is-it-1"></a></p><h4>6.2.1. What is it? <a href="#What-is-it-1" class="headerlink" title="Permanent link">¶</a></h4><ul><li><a href="https://www.computerhope.com/jargon/s/syntax.htm">“Syntax” definition</a>.</li></ul><p><a id="What-should-you-do-1"></a></p><h4>6.2.2. What should you do? <a href="#What-should-you-do-1" class="headerlink" title="Permanent link">¶</a></h4><p><a href="#Console-actions">Actions 1, 2, 4, 5</a>.</p><p><a id="Method-1"></a></p><h4>6.2.3. Method <a href="#Method-1" class="headerlink" title="Permanent link">¶</a></h4><div class="SashaBlockHighlight"><pre><button class="SashaButton SashaTooltip"><img alt="Clipboard button" class="SashaNotModify" src="https://kristinita.netlify.com/theme/images/interface-images/clippy.svg"></button><span class="n">view</span><span class="o">.</span><span class="n">settings</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;syntax&#39;</span><span class="p">)</span>
</pre></div><p><a id="Theme"></a></p><h3>6.3. Theme <a href="#Theme" class="headerlink" title="Permanent link">¶</a></h3><p><a id="What-is-it-2"></a></p><h4>6.3.1. What is it? <a href="#What-is-it-2" class="headerlink" title="Permanent link">¶</a></h4><p>Please, do not confuse theme and color scheme:</p><ol><li><strong>color scheme</strong> — file, that design your Sublime Text <a href="#Syntax">syntaxes</a>; it zone — area of your opened files</li><li><strong>theme</strong> — file, that design your Sublime Text UI; almost everyone else, that not highlight color scheme</li></ol><p>In image below:</p><ul><li>color scheme design area in a pink rectangle</li><li>theme — another area, blue rectangle</li></ul><p><a href="https://i.imgur.com/nwNgLkR.png" class="fancybox"><img alt="Color scheme and theme" class="SashaLazy" src="https://kristinita.netlify.com/theme/images/interface-images/transparent-one-pixel.png" data-src="https://i.imgur.com/nwNgLkR.png"></a></p><div class="admonition hint"><p class="admonition-title">Hint</p><p>Also, some parameters has in <a href="https://www.sublimetext.com/docs/3/settings.html"><em>Preferences.sublime-settings</em></a> and <em>stTheme</em> files. <a href="https://stackoverflow.com/a/19582360/5951529"><em>stTheme</em></a> highlight and stylize regular expressions and another elements in input areas of your <a href="https://www.sublimetext.com/docs/3/themes.html#elements-panels">“Find”, “Find in Files” and “Replace panels”</a>.</p><p><a href="https://i.imgur.com/icfjatQ.png" class="fancybox"><img alt="stTheme" class="SashaLazy" src="https://kristinita.netlify.com/theme/images/interface-images/transparent-one-pixel.png" data-src="https://i.imgur.com/icfjatQ.png"></a></p></div><p><a id="What-should-you-do-2"></a></p><h4>6.3.2. What should you do? <a href="#What-should-you-do-2" class="headerlink" title="Permanent link">¶</a></h4><p><a href="#Console-actions">Actions 1, 2, 4, 5</a>.</p><p><a id="Method-2"></a></p><h4>6.3.3. Method <a href="#Method-2" class="headerlink" title="Permanent link">¶</a></h4><div class="SashaBlockHighlight"><pre><button class="SashaButton SashaTooltip"><img alt="Clipboard button" class="SashaNotModify" src="https://kristinita.netlify.com/theme/images/interface-images/clippy.svg"></button><span class="n">view</span><span class="o">.</span><span class="n">settings</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;theme&#39;</span><span class="p">)</span>
</pre></div><p><a id="Color-scheme"></a></p><h3>6.4. Color scheme <a href="#Color-scheme" class="headerlink" title="Permanent link">¶</a></h3><p><a id="What-is-it-3"></a></p><h4>6.4.1. What is it? <a href="#What-is-it-3" class="headerlink" title="Permanent link">¶</a></h4><ul><li><a href="#Theme">#theme</a>.</li></ul><p><a id="What-should-you-do-3"></a></p><h4>6.4.2. What should you do? <a href="#What-should-you-do-3" class="headerlink" title="Permanent link">¶</a></h4><p><a href="#Console-actions">Actions 1, 2, 4, 5</a>.</p><p><a id="Method-3"></a></p><h4>6.4.3. Method <a href="#Method-3" class="headerlink" title="Permanent link">¶</a></h4><div class="SashaBlockHighlight"><pre><button class="SashaButton SashaTooltip"><img alt="Clipboard button" class="SashaNotModify" src="https://kristinita.netlify.com/theme/images/interface-images/clippy.svg"></button><span class="n">view</span><span class="o">.</span><span class="n">settings</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;color_scheme&#39;</span><span class="p">)</span>
</pre></div><div class="admonition hint"><p class="admonition-title">Hint</p><p>You can get your another <a href="http://docs.sublimetext.info/en/latest/customization/settings.html">settings</a>, use <code class="SashaInlineHighlight"><span class="n">view</span><span class="o">.</span><span class="n">settings</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">()</span></code>. <strong>Example</strong>: that get your current font face, you need <code class="SashaInlineHighlight"><span class="n">view</span><span class="o">.</span><span class="n">settings</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;font_face&#39;</span><span class="p">)</span></code>.</p></div><p><a id="Scope"></a></p><h3>6.5. Scope <a href="#Scope" class="headerlink" title="Permanent link">¶</a></h3><div class="admonition caution"><p class="admonition-title">Caution</p><p>“Scope”, “syntax scope”, “syntax type scope” unconventional, not official terms. Please, read <a href="#What-is-it-4">links below</a> for more detailed information.</p></div><p><a id="What-is-it-4"></a></p><h4>6.5.1. What is it? <a href="#What-is-it-4" class="headerlink" title="Permanent link">¶</a></h4><div class="justtable"><table><thead><tr><th>“scope”</th><th>“syntax scope”</th><th>“syntax type scope”</th></tr></thead><tbody><tr><td>source.css meta.property-list.css meta.property-name.css support.type.property-name.css</td><td>source.css</td><td>source</td></tr><tr><td>text.html.basic source.css meta.property-list.css meta.property-name.css</td><td>text.html.basic</td><td>text</td></tr><tr><td>kira.genius kira.error</td><td>kira.genius</td><td>kira</td></tr></tbody></table></div><ul><li><a href="https://forum.sublimetext.com/t/question-terminology-scope-vs-scope-selector/36039?u=sasha_chernykh">Scope vs. scope selector</a></li><li><a href="http://blog.macromates.com/2005/introduction-to-scopes/">Introduction to scopes</a></li><li><a href="http://manual.macromates.com/en/scope_selectors.html">“Scope selector” definition</a></li></ul><p><a id="What-should-you-do-4"></a></p><h4>6.5.2. What should you do? <a href="#What-should-you-do-4" class="headerlink" title="Permanent link">¶</a></h4><p><a href="#Console-actions">Actions 1, 2, 3, 4, 5</a>.</p><p><a id="Method-4"></a></p><h4>6.5.3. Method <a href="#Method-4" class="headerlink" title="Permanent link">¶</a></h4><div class="SashaBlockHighlight"><pre><button class="SashaButton SashaTooltip"><img alt="Clipboard button" class="SashaNotModify" src="https://kristinita.netlify.com/theme/images/interface-images/clippy.svg"></button><span class="n">view</span><span class="o">.</span><span class="n">scope_name</span><span class="p">(</span><span class="n">view</span><span class="o">.</span><span class="n">sel</span><span class="p">()[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">begin</span><span class="p">())</span>
</pre></div><p><a id="Not-recommended-1"></a></p><h4>6.5.4. Not recommended <a href="#Not-recommended-1" class="headerlink" title="Permanent link">¶</a></h4><p>In some sources (<a href="https://stackoverflow.com/a/15911198/5951529">example</a>) you can read similar answers:</p><blockquote><p>Windows — <kbd>Ctrl+Alt+Shift+P</kbd>,</p><p>macOS — <kbd>Ctrl+Shift+P</kbd>.</p></blockquote><p>I not recommend it, arguments:</p><ol><li>Hotkeys conflict; one or more your plugins may use same hotkeys.</li></ol><p><a id="Syntax-scope"></a></p><h3>6.6. Syntax scope <a href="#Syntax-scope" class="headerlink" title="Permanent link">¶</a></h3><p><a id="What-is-it-5"></a></p><h4>6.6.1. What is it? <a href="#What-is-it-5" class="headerlink" title="Permanent link">¶</a></h4><p>Syntax scope — for <a href="#Syntax">syntax</a>: part of any <a href="#Scope">scope</a> before first space symbol. Details <a href="#What-is-it-4">read above</a>.</p><p><a id="What-should-you-do-5"></a></p><h4>6.6.2. What should you do? <a href="#What-should-you-do-5" class="headerlink" title="Permanent link">¶</a></h4><p><a href="#Console-actions">Actions 1, 2, 4, 5</a>.</p><p><a id="Method-5"></a></p><h4>6.6.3. Method <a href="#Method-5" class="headerlink" title="Permanent link">¶</a></h4><div class="SashaBlockHighlight"><pre><button class="SashaButton SashaTooltip"><img alt="Clipboard button" class="SashaNotModify" src="https://kristinita.netlify.com/theme/images/interface-images/clippy.svg"></button><span class="n">view</span><span class="o">.</span><span class="n">scope_name</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span><span class="o">.</span><span class="n">split</span><span class="p">()[</span><span class="mi">0</span><span class="p">]</span>
</pre></div><p><a id="External-links"></a></p><h2>7. External links <a href="#External-links" class="headerlink" title="Permanent link">¶</a></h2><ul><li><a href="https://www.sublimetext.com/docs/3/api_reference.html">Sublime Text 3 API Reference</a></li><li><a href="https://leanpub.com/writing-sublime-plugins">“Writing Sublime Plugins”</a> book</li></ul></section><footer><div class="clearfix"><span class="SashaPreviousNeighbor"><a href="https://kristinita.netlify.com/IT-articles/typo-reporter.html" title="typo-reporter">← Previous article</a></span> <span class="SashaHeadPageRight"><a href="https://kristinita.netlify.com" title="Kristinita's Search">Kristinita's Search</a></span></div><div class="SashaClearBoth"></div><div class="SashaEmNoColorBottom"><p><a id="Like"></a></p><h2>Like? <a href="#Like" class="headerlink" title="Permanent link">¶</a></h2><ol><li>Share this web-page in your preferred social network, use share buttons on the side of page.</li><li><p>Subcsribe to all articles or specific tag/category, use your preferred RSS Reader. I use <a href="http://quiterss.org">QuiteRSS</a> for Windows.</p></li></ol><p><a id="Problems"></a></p><h2>Problems? <a href="#Problems" class="headerlink" title="Permanent link">¶</a></h2><ol><li>(PC only, not for mobile devices). If you find in this article typo or small error, please, report about it use <a href="https://kristinita.netlify.com/IT-articles/typo-reporter">typo-reporter</a>. Select text with typo → press <kbd>Ctrl+Enter</kbd> (<kbd>⌘Enter</kbd> for Mac) → write comment → send typo report.</li><li>If you find more serious errors in this article and/or site, <a href="https://github.com/Kristinita/KristinitaPelican/issues/new">create GitHub issue</a>.</li><li>You can also <a href="https://github.com/Kristinita/KristinitaPelican/edit/master/content/IT-articles/How-to-get-current-%E2%80%A6-in-Sublime-Text.md">edit this page yourself</a> and send <a href="http://ru.stackoverflow.com/a/598162/199934">pull request</a>.</li><li>Or write comment here. <a href="https://github.github.com/gfm/">Markdown GFM support in comments</a>. You can use <a href="https://github.com/GhostText/GhostText">GhostText</a>, that write issue in your preferred editor.<div class="wildfire_thread"></div></li></ol><p>I hate private communication, solely open support.</p><p>If you write in the style of <a href="https://kristinita.netlify.com/Smert-svobode/%D0%9D%D0%BE%D0%B2%D1%8B%D0%B5-%D0%BD%D0%B5%D0%B4%D0%BE%D0%B2%D0%BE%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5-%D1%80%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B5">new disgruntled Russian</a> I reserve the right to dispose of my own discretion.</p><p>All rights reserved ©.</p></div><div class="WorkOnYourself">Работайте над собой</div></footer></article></main></body></html>
You can’t perform that action at this time.