.


HD Mp4 3gp Video
Direct Video Video
Play/Download
Live 3D App
Search.Pencarian Menu

Add text send email to rh3252705.adda@blogger.com or Click this (Text porn Will delete) | Tambah teks kirim email ke rh3252705.adda@blogger.com atau Klik ini (Teks porno akan dihapus)
Total pos : 18773+

[Go Make Things] How to add links with a keyboard shortcut in Sublime Text

Last week, I wrote about my Sublime Text setup.

I write in markdown a lot. And one thing that's been missing for me from Sublime is the ability to add a link to my markdown files using the command + K keyboard shortcut (or control + K for my Windows folks).

Last week, I found this solution comes from devcarlos over on the Sublime Text forums, and wanted to share how it works for archive purposes.

The Overview

It involves two parts…

  1. Create a new Snippet that wraps selected text in a link.
  2. Map a keyboard shortcut to the snippet.

Step 1. Create a snippet

To create a snippet in Sublime Text, select Tools > Developer > New Snippet... from the navigation menu.

The original snippet from devcarlos adds a proper link element with href, like this…

<snippet>  	<content><![CDATA[  <a href="${1}">${SELECTION}</a>  ]]></content>  </snippet>

Because I use this exclusively in markdown, I chose to output a markdown link instead…

<snippet>  	<content><![CDATA[  [${SELECTION}](${1})  ]]></content>  </snippet>

Save the file to the snippets directory inside the User directory, and give it the name markdown_link.sublime-snippet.

Step 2. Map the keyboard shortcut

Select Sublime Text > Settings... > Key Bindings from the navigation menu.

In the user bindings settings in the panel on the right, copy/paste the following JSON property…

{ "keys": ["super+k"], "command": "insert_snippet", "args": {"name": "Packages/User/link.sublime-snippet"} },

The super key binds to command on macOS and control on Windows, without having to specify different things for different operating systems.

When you're done, save the file and close it.

Using it

In your markdown files, you can press command+k or control+k to generate a []().

If you highlight some text, then press the keys, the selected text gets wrapped in the square brackets automatically, like this…

[your selected text]()

I apparently could have done this years, and wish I had!

Like this? A Go Make Things membership is the best way to support my work and help me create more free content.

Cheers,
Chris

Want to share this with others or read it later? View it in a browser.

Share :

Facebook Twitter Google+ Lintasme

Related Post:

0 Komentar untuk "[Go Make Things] How to add links with a keyboard shortcut in Sublime Text"

Back To Top