# Text editor

# Sublime-text

# Preparing package installation

Before, you can download and install awesome packages, you first have to install the Package Control package. It's dumb, but it's not included in sublime-text installation...

The simplest method of installation is through the Sublime Text console. The console is accessed via the ctrl+` shortcut or the View > Show Console menu. Once open, paste the appropriate Python code for your version of Sublime Text into the console.

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)
1

official sourceopen in new window This code creates the Installed Packages folder for you (if necessary), and then downloads the Package Control.sublime-package into it. The download will be done over HTTP instead of HTTPS due to Python standard library limitations, however the file will be validated using SHA-256.

# Install a package (insp)

Open commande palette

ctrl + shift + p
1

Then, open sublime-text package manager, select Package Control: Install package by shortname insp

insp
1

Then, enter

# My packages

NameUsageinsp nameURL
Markdown PreviewTo see a preview of your README.md files before commit themMarkdownPreviewhttps://facelessuser.github.io/MarkdownPreview/install/
Compare Side-By-SideCompares two tabsCompare Side-By-Sidehttps://packagecontrol.io/packages/Compare%20Side-By-Side
Generic ConfigSyntax generic config colorization
PowerCursorsmultiple cursors placements
MaterializeSeveral beautiful color scheme
MarkdownPreviewPreview your .md file
MarkdownTOCGenerate your Table of content of MarkDown files

# MarkdownTOC

To generate a TableOfContent Insert this piece of code

<!-- MarkdownTOC levels="1,2" autolink="true" -->

<!-- /MarkdownTOC -->
1
2
3

Then, place your cursor in the middle of 2 lines, ctrl + Maj + p : Insert TOC

# Manuall plugin installation

If you don't find your desired plugin with the package installer. You can right your own code !

Tools > Developer > New Plugin...
1

# Absolute cursor position

By default the status bar only gives you Line and Column, but if you get a json error like SyntaxError: /builds/baptiste-dauphin/doc/book.json: Unexpected token / in JSON at position 765 it's not fancy.

Paste and save this code

import sublime_plugin


class PositionListener(sublime_plugin.EventListener):

    def on_selection_modified(self, view):
        text = "Position: "
        sels = view.sel()
        for s in sels:
            text += " " + str(s.begin())
            if not s.empty():
                text += "-" + str(s.end()) + " "
        view.set_status('exact_pos', text)
1
2
3
4
5
6
7
8
9
10
11
12
13

Et voilĂ 

git_cheat

sourceopen in new window

# Shortcut

Nameshortcut
Do anything (command palet)Ctrl + Shirt + P
Switch previous / next tabctrl + shift + page_up \ ctrl + shift + page_down
Switch to a specific tabctrl + p, and write name of your tab (file)
Move a line or a block of linectrl + shift + arrow up \ ctrl + shift + arrow down
Switch upper caseCtrl + k and then Ctrl + u
Switch lower caseCtrl + k and then Ctrl + l
Sort LinesF9 (Edit > Sort Lines)
Goto anywhereCtrl + R
Open any fileCtrl + P
Goto line numberctrl + G
Spell checkF6
New cursor above/belowalt+shift+arrow

# Tips / Troubleshooting

# How to show the menu back?

The easiest way, which works on all platforms, is to use the command pallete: on Windows ctrl+shift+p followed by vmen (short for View Menu).

# Current settings

Preferences -> Settings

{
    "always_show_minimap_viewport": true,
    "bold_folder_labels": true,
    "color_scheme": "Packages/Materialize/schemes/Material Cobalt.tmTheme",
    "font_options":
    [
        "gray_antialias"
    ],
    "font_size": 12,
    "ignored_packages":
    [
        "Vintage"
    ],
    "indent_guide_options":
    [
        "draw_normal",
        "draw_active"
    ],
    "line_padding_bottom": 3,
    "line_padding_top": 3,
    "overlay_scroll_bars": "enabled",
    "theme": "Material Cobalt.sublime-theme"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

# Vim

how-do-you-paste-with-vim-without-code-being-commented Before you paste, type this in normal mode:

:set paste
1

Then enter insert mode. You will see the status bar say insert (paste). Paste your code. Hit ESC to return to normal mode, and:

:set nopaste
1

You are no longer in paste mode.

# Nice my vim

https://gitlab.com/baptiste-dauphin-tool/vimrc#how-to-install-the-awesome-version
For currenty user

git clone --depth=1 https://github.com/amix/vimrc.git ~/.vim_runtime
sh ~/.vim_runtime/install_awesome_vimrc.sh
1
2