Joydeep

Author
Joydeep

Blogs
Joydeep is a former product marketer with a love for growth loops and developer communities. Now, they decode hiring challenges with the same curiosity they brought to GTM plans.
author’s Articles

Insights & Stories by Joydeep

Joydeep's content is built for talent leaders who want results—fast. Actionable, relevant, and packed with real-world learnings from the frontlines of growth.
Clear all
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Filter
Filter

Introducing VIM and EMACS with HackerEarth

We receive many valuable suggestions from our users on how to improve their coding experience on HackerEarth. One frequent request was support for Vim and Emacs in the code editor. We’re excited to announce that our code editor now supports both modes!

With a single settings button, you can instantly switch to Vim or Emacs mode.

Select Vim or Emacs

Here’s a short tutorial on how you can perform common actions in Vim and Emacs.

1. Delete All Lines

In Vim, place the cursor at the start of the file and press d⇧G. In Emacs, select everything and press Delete.

Delete all lines

2. Remove a Single Line

In Vim, press dd to delete the current line. Undo with u. In Emacs, use Ctrl-x u to undo.

Remove one line

To delete words in Emacs, use Ctrl+Delete.

Delete word

3. Edit Characters

In Vim, move to the character and press x to delete. Enter insert mode with i to type. In Emacs, use Delete to remove characters and type to insert new ones.

Edit characters

4. Word Replace

In Vim, use :%s/old/new/g to replace all occurrences of "old" with "new". This supports regular expressions too.

Word replace

5. Cursor Movement

In Vim, use ^ to go to the beginning of a line and $ to go to the end. In Emacs, use Ctrl-a to move to the start and Ctrl-e to move to the end.

Cursor movement

In the next post, we’ll talk about creating a more comprehensive development experience on your local machine using Vim and Emacs.

Starting with Python

Thinking about starting with Python but unsure where to begin? Maybe you’re wondering if your current system setup is enough to get started.

Before choosing where to code, ask yourself two essential questions:

  • What environment are you most comfortable with—Mac, Windows, or Linux?
  • What is your end goal—building desktop apps, web apps, or something else?

Let’s look at the available options from these perspectives:

Linux

Python was originally developed for Linux and runs seamlessly on it. Working with multiple Python versions is easier due to PEP 394.

  • Ubuntu: Python 2.7 and 3.5 are available by default on Ubuntu 16.04. For older versions, refer to this guide to install newer versions.
  • Arch: Comes with Python 3.5 by default, accessible via the python command.
  • RedHat/CentOS: Ships with Python 2.7. For minimal Unix distributions, Python can be compiled from source.

Common Editors: Vim and Emacs are popular in Unix/Linux environments.

Windows

Download Python from the official website. After installation, set the system path to access Python via the command line.

Thanks to Steve Dower’s efforts, Python on Windows now supports pip and virtualenv very well. Multiple Python versions can be handled using batch scripts. Refer to this article for more info.

Popular Editor: PyCharm

Mac

Mac OS X 10.8+ comes with Python 2.7 pre-installed. GUI execution may have some quirks but command-line execution and editing with Vim or Emacs works well.

Anaconda

If you're into data science, Anaconda provides a streamlined Python setup with “conda” for managing packages and environments.

PyPy

PyPy is a fast alternative to CPython, using a Just-in-Time compiler. It supports various systems and is great for performance-heavy applications.

Starting the Python Interpreter

To start coding, install Python and open a terminal. Type python and press Enter. You’ll see a prompt like this:

Python prompt

At the prompt, type:

print("Hello World.")
Print Hello World

Congratulations! You’ve written your first Python program.

Python on Raspberry Pi and Microcontrollers

If you're into hardware, explore MicroPython or PyMite.

Python is the primary language for Raspberry Pi. Example: Check if a button is pressed using Python on Raspberry Pi. See example here.

Whichever system you use—Windows, Linux, or Mac—Python has you covered.

References and Further Reading: