Sublime Text 3 Sexiest editing history

Source: Internet
Author: User
Tags gtk sublime text



↑↑↑↑↑ See folder ↑↑↑↑↑


Download/install Windows/mac OS

Download the website. Double-click on the installation, this will go ~

Linux

Installed under Linux. One way is to download tar.bz from the official website. Manual installation.

Here is an introduction to using Apt-get's own active installation method:

sudo add-apt-repository ppa:webupd8team/sublime-text-2 
sudo apt-get update
sudo apt-get install sublime-text-dev

When the order is over, everything is done!


See if the application list is a friendly chart? (although this icon is not at all cordial.)

。 )


Change Siderbar color


Windows
Change theme file: /pristine packages/theme-default.sublime-package/default.sublime-theme

Background Color
{
        "class": "sidebar_tree",
        "row_padding": [8, 3],
        "indent": 12,
        "indent_offset": 17,
        "indent_top_level": false,
        "layer0.tint": [30, 30, 30],
        "layer0.opacity": 1.0,
        "dark_content": false
},
text
{
        "class": "sidebar_label",
        "color": [150, 150, 150],
        "font.bold": false
        // , "shadow_color": [250, 250, 250], "shadow_offset": [0, 0]
},
Cutting Line
{
        "class": "sidebar_container",
        "layer0.tint": [10, 10, 10],
        "layer0.opacity": 1.0,
        "layer0.draw_center": false,
        "layer0.inner_margin": [0, 0, 1, 0],
        "content_margin": [0, 0, 1, 0]
},

In fact, the RGB color is clear to everyone. Be able to change to the way you like it.




PS: When backing up the original thing must change the type name, because sublime will be loaded into all the packages.

Another: Thanks also Xiang Encyclopedia to give very big help


Linux
Note that the location of the sublime storage is able to:/usr/lib/sublime-text-2
assume that the installation package is installed. is usually under/OPT.
attached: Linux folder Resolution


MAC OS X
os some trouble, can not directly change, need to key tools to read and write files, I was in win under change and then cover over.


Installing Plugins

Like Vim, sublime itself is just an editor. If you want to convert it into an IDE, you need to install a variety of plugins, of course, even if you do not need the plug-in its own powerful can bring you unexpected surprises!





Get the plug-in manager done first
As the name implies is the tool used to manage plugins. It is convenient to install it first and then make other plugins.


Installation method: Select Menu View->show Console and you will be able to see the console form below. (Show box + input box) here to run Python code enter the code below. You can install the plug-In Manager (package control) plug a sentence: Very many places the code for import Urllib2,os; This is python2.x code, in python3.x has been replaced by import Urllib.request,os; If you are Sublime2.0 and the following version number, please change the code yourself.

Import urllib.request,os;pf= ' package control.sublime-package '; Ipp=sublime.installed_packages_path (); Os.makedirs ( IPP) if not os.path.exists (IPP) Else None;open (Os.path.join (IPP,PF), ' WB '). Write (Urllib.request.urlopen (' http:// sublime.wbond.net/' +pf.replace (', '%20 '). Read ())
Next you must remember to restart the software first!


Hold Ctrl+shift+p


To be able to install the plugins you like.




Once you have installed the plugin manager, you will be able to find the plugin you need and install it.

Some sites will summarize some good plug-ins. You can go and try.


Of course I would prefer you to read what I have written first.

High-Speed Encoding class

Emmet: Just like Zen coding. But ST3 no longer support Zen, this is the same, but to pay attention to the first sublime itself to remove the active complement function. Added in Setting-user, Preferens

Code Formatting
Code formatting includes various languages, here are a few: (all plugins can be directly searched in the package control)
C/c++:sublimeastyleformathtml:tag
List:

Looks like a good summary.

Some of the indispensable ST plugins

20 Powerful plugins


Configuring the compilation Environment


Console input (for example in C + +)

The principle is very easy. is to create a bat on the outside to run the file, and then call it. Note that the need to use start to open a new form, the same time to pause to see the results, the very egg is the sublime default run your start, assuming that your pause and start placed in a file pause on start%1 File is invalid, so it is actually necessary to create two documents.

Note the environment variables.

。。 (about what is an environment variable.) 32 sentence explanation is not clear, it is best to Baidu a bit. )

After the personal feeling console input meaning is not very large, do the words are read from the document, do not need to read the development of Basic. So~, you are cautious.


Mycrun.bat


@echo off
%1
echo.
echo -------------------
pause
exit

Mycallrun.bat


@start  mycrun%1

The configuration file is in Sublime Text 3\packages\c++.sublime-package. Back up a bit first.

Change the inside of the C++.sublime-build for


{
	"shell_cmd": "g++ \"${file}\" -o \"${file_path}/${file_base_name}\"",
	"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:?
		

(.*)$", "working_dir": "${file_path}", "selector": "source.c, source.c++", "variants": [ { "name": "Run", "shell_cmd": "g++ \"${file}\" -o \"${file_path}/${file_base_name}\" && MyCallRun \"${file_path}/${file_base_name}.exe\"" // 事实上就是这里加了个MyCallRun } ] }




C + +

Sublime Text 3 is configured by default for C + +. But you need to add the GCC folder into the environment variable
.

Java
Sublime Text 3 By default only executes the Javac, you need to join the execution.
@ECHO OFF  
cd %~dp1  
ECHO Compiling %~nx1...  
IF EXIST %~n1.class (  
DEL %~n1.class  
)  
javac %~nx1  
IF EXIST %~n1.class (  
ECHO Running...
ECHO ----------------------OUTPUT----------------------
java %~n1  
)
Note that you cannot use the CLS.
Modify the Java compilation options (back up the original). Folder: Packages/java.sublime-package/javac.sublime-build
{" shell_cmd ":" Myjru
{
	"shell_cmd": "myJRun.bat \"$file\"",
	"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
	"selector": "source.java"
}
the Java code point Build that was written later will be executed on its own initiative. Such an approach can not cross the platform, and then study sublime own way.




Go

Using Sublime to develop Golang environment is very easy, just need to install a gosublime is almost the same.



Ubuntu input Chinese reference to organize here
Need to compile a file yourself to load the execution. So we need to use some compilation environment
Step 1: Install the GTK environment
sudo apt-get install Libgtk2.0-dev pkg-config

Also seemingly do not support IBUs, I use the Fcitx+sogou
Step 2: Save the following file to Sublime_imfix.c
/*
sublime-imfix.c
Use LD_PRELOAD to interpose some function to fix sublime input method support for linux.
By Cjacker Huang <jianzhong.huang at i-soft.com.cn>

gcc -shared -o libsublime-imfix.so sublime_imfix.c  `pkg-config --libs --cflags gtk+-2.0` -fPIC
LD_PRELOAD=./libsublime-imfix.so sublime_text
*/
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
typedef GdkSegment GdkRegionBox;

struct _GdkRegion
{
  long size;
  long numRects;
  GdkRegionBox *rects;
  GdkRegionBox extents;
};

GtkIMContext *local_context;

void
gdk_region_get_clipbox (const GdkRegion *region,
            GdkRectangle    *rectangle)
{
  g_return_if_fail (region != NULL);
  g_return_if_fail (rectangle != NULL);

  rectangle->x = region->extents.x1;
  rectangle->y = region->extents.y1;
  rectangle->width = region->extents.x2 - region->extents.x1;
  rectangle->height = region->extents.y2 - region->extents.y1;
  GdkRectangle rect;
  rect.x = rectangle->x;
  rect.y = rectangle->y;
  rect.width = 0;
  rect.height = rectangle->height; 
  //The caret width is 2; 
  //Maybe sometimes we will make a mistake, but for most of the time, it should be the caret.
  if(rectangle->width == 2 && GTK_IS_IM_CONTEXT(local_context)) {
        gtk_im_context_set_cursor_location(local_context, rectangle);
  }
}

//this is needed, for example, if you input something in file dialog and return back the edit area
//context will lost, so here we set it again.

static GdkFilterReturn event_filter (GdkXEvent *xevent, GdkEvent *event, gpointer im_context)
{
    XEvent *xev = (XEvent *)xevent;
    if(xev->type == KeyRelease && GTK_IS_IM_CONTEXT(im_context)) {
       GdkWindow * win = g_object_get_data(G_OBJECT(im_context),"window");
       if(GDK_IS_WINDOW(win))
         gtk_im_context_set_client_window(im_context, win);
    }
    return GDK_FILTER_CONTINUE;
}

void gtk_im_context_set_client_window (GtkIMContext *context,
          GdkWindow    *window)
{
  GtkIMContextClass *klass; 
  g_return_if_fail (GTK_IS_IM_CONTEXT (context));大
  klass = GTK_IM_CONTEXT_GET_CLASS (context);
  if (klass->set_client_window)
    klass->set_client_window (context, window);

  if(!GDK_IS_WINDOW (window))
    return;
  g_object_set_data(G_OBJECT(context),"window",window);
  int width = gdk_window_get_width(window);
  int height = gdk_window_get_height(window);
  if(width != 0 && height !=0) {
    gtk_im_context_focus_in(context);
    local_context = context;
  }
  gdk_window_add_filter (window, event_filter, context); 
}

Step 3: Compile the
Gcc-shared-o libsublime-imfix.so sublime_imfix.c  ' pkg-config--libs--cflags gtk+-2.0 '-fPIC

Step 4: Perform
In fact, it can be done here. Give it a try
Ld_preload=./libsublime-imfix.so Sublime_text

It's going to be a success, but not every time you lose the command, that's what I'm dealing with.

-Put sublime_imfix.so in Sublime installation folder (my in/opt/sublime_text/)

-Create a new file under/usr/local/bin or other path Subl write:


Ld_preload=/opt/sublime_text/libsublime-imfix.so/opt/sublime_text/sublime_text
-Create a new Launcher command for/USR/LOCAL/BIN/SUBL (uppercase is only used to differ from the General command)


It's done
!


About the thing that cracked it.
Online about sublime crack method, a search a lot of. But I have not been to crack, the reason is very easy, assuming an indefinite trial of the software you have the heart to crack words.


。 Everyone is the same as the developer, assuming that they are going to crack the unscrupulous. Who else would you expect to pay for the software? (I'm a friend of mechanical learning, said)





Cond.




Sublime Text 3 Sexiest editing history


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.