• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

editor

Install latest Sublime Text

December 31, 2021

How to install the latest version of the Sublime Text editor on Ubuntu or Mint.

wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
sudo apt-get install apt-transport-https
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo apt-get update
sudo apt-get install sublime-text

wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add - sudo apt-get install apt-transport-https echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list sudo apt-get update sudo apt-get install sublime-text

It will add the sublime-text.list file in /etc/apt/sources.list.d directory.

Filed Under: Linux Tagged With: editor, install, sublme text 4, update

Disable Gutenberg

February 27, 2021

Two years ago, WordPress introduced Gutenberg block editor together with the release of WordPress version 5.0. Gutenberg essentially became the default editor starting with WordPress version 5.0. While many people love the Gutenberg editor, some people hate it. If you’re one of the many people who hate the Gutenberg editor, you can simply disable it by installing a plugin called Disable Gutenberg. This plugin will revert back to the classic editor.

Once installed, you should be able to see the Classic editor.

After working with Gutenberg for so long, I forgot the speed and agility of the classic editor. It’s much faster.

Filed Under: WP Tagged With: classic, disable, editor, gutenberg, wordpress

Change Default Editor

July 28, 2020

Ubuntu and Linux Mint use nano as their default editor. You’ll see it if you try to edit crontab or visudo. Now, there’s nothing wrong with nano, but I prefer using vim instead. Here’s how to change the default editor.

sudo update-alternatives --config editor

sudo update-alternatives --config editor

You’ll be prompted to change the default editor.

There are 4 choices for the alternative editor (providing /usr/bin/editor).
 
  Selection    Path                Priority   Status
------------------------------------------------------------
  0            /bin/nano            40        auto mode
  1            /bin/ed             -100       manual mode
  2            /bin/nano            40        manual mode
* 3            /usr/bin/vim.basic   30        manual mode
  4            /usr/bin/vim.tiny    15        manual mode
 
Press <enter> to keep the current choice[*], or type selection number:

There are 4 choices for the alternative editor (providing /usr/bin/editor). Selection Path Priority Status ------------------------------------------------------------ 0 /bin/nano 40 auto mode 1 /bin/ed -100 manual mode 2 /bin/nano 40 manual mode * 3 /usr/bin/vim.basic 30 manual mode 4 /usr/bin/vim.tiny 15 manual mode Press <enter> to keep the current choice[*], or type selection number:

Type 3 to choose vim basic.

Filed Under: Linux Tagged With: change, default, editor, set

Crontab Editor

June 16, 2019

If you want to change the crontab editor, run the following:

$ select-editor

$ select-editor

Choose one.

Filed Under: Linux Tagged With: change, crontab, editor

Change VIM Colors

March 20, 2019

Vim is a text editor. Edit the ~.vimrc

# vim ~.vimrc
colo desert
syntax on

# vim ~.vimrc colo desert syntax on

Filed Under: Linux Tagged With: colors, desert, editor, terminal, vim

Building A Custom Block

December 26, 2018

I found a new WordPress plugin that allows you to add custom blocks within the Gutenberg editor. You can create any block that you want by using the same templating code you’re already familiar with in WordPress. You can work with CSS, PHP, plugin shortcodes, etc. It’s a beautiful plugin with endless possibilities. The plugin is called Block Lab.

Filed Under: WP Tagged With: block lab, custom blocks, editor, gutenberg, wordpress

Sublime Text Comment Multiple Lines

December 26, 2018

If you need to comment out multiple lines in Sublime Text 2 or 3, there’s a short keystroke that you can use. First, you need to highlight the block (multiple lines) that you want to comment out, then press Ctrl + /. You can press it again to toggle on and off.

Line 1
Line 2
Line 3

Line 1 Line 2 Line 3

Pressing Ctrl + / will comment out the highlighted block.

#Line 1
#Line 2
#Line 3

#Line 1 #Line 2 #Line 3

Press Ctrl + / again to toggle it back.

Filed Under: Misc Tagged With: comments, editor, sublime text

Sublime Text 2

December 16, 2013

Sublime Text 2 is a sophisticated text editor built for writing code, markup and prose. It has a slick user interface with extraordinary features and amazing performance. Sublime Text 2 is available multiple platforms including Windows, Mac OS and Linux OS. After 4 months of heavy use, I now use Sublime Text 2 exclusively. I stopped using other text editors altogether.

Since I work mostly from the Terminal, I wanted to be able to launch Sublime Text 2 directly from the command line. In order to make this possible, I needed to create a symbolic link for easier access. The reason for this is because the Sublime Text 2 command is located in a directory that is hard to remember. So, here’s the command to create a symbolic link called ‘/bin/subl‘ for Sublime Text 2.

sudo ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /bin/subl

sudo ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /bin/subl

From this point on, every time I needed to edit a file, I simply type the following in the commands from the Terminal:

$ subl archives.php
$ subl /etc/hosts
$ subl archives.php footer.php

$ subl archives.php $ subl /etc/hosts $ subl archives.php footer.php

I gave 3 examples above.

In the first example, Sublime Text 2 will launch and open a file from the current directory. The second example will open a file from its full path. The third will open multiple files separated by spaces.

Filed Under: Linux Tagged With: editor, sublime text 2

  • Home
  • About
  • Archives

Copyright © 2023