eklitzke / leetcode-emacs-layer

This is a spacemacs layer based on the leetcode-emacs project to interact with leetcode from within Emacs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Leetcode Emacs Layer

This layer adds the functionality to use leetcode from within Emacs. This layer uses the wonderful package available at leetcode.el. The package depends on the following, which in turn makes the layer depend on the following:

Dependencies

  1. request.el
  2. request-deferred.el
  3. graphql.el
  4. spinner.el

This layer depends in the following packages. They are automatically included and installed when this layer is included for installation.

External Dependencies

  1. cURL

This package needs the curl package to make calls to the leetcode API for interactions.

Installation

To install the layer, clone it into the private repo:

git clone https://github.com/anmoljagetia/leetcode-emacs-layer.git ~/.emacs.d/private/myleetcode

Once the layer has been cloned, add it to the dotspacemacs-configuration-layers like the following:

dotspacemacs-configuration-layers
  '(
    myleetcode
    .
    .
    .
    

Usage

The first time you enter M-x leetcode, Emacs will prompt you to input account and password. If login successful, Emacs will save it into a file. If you are interested in what happend here, you can check auth-source.el.

You can set your preferred LeetCode programming language and SQL by setting leetcode-prefer-language and leetcode-prefer-sql:

(setq leetcode-prefer-language "python3")
(setq leetcode-prefer-sql "mysql")

Keymap

keymapcommandeffect
a L lleetcodeThis starts the leetcode application
a L dleetcode-show-current-problemShows the problem description in a new buffer.
This can also be accessed using the TAB key or the RET key in the leetcode-buffer
a L rleetcode-refreshRefreshed the problem buffer
a L tleetcode-tryTries the code with the test input
a L uleetcode-submitSubmits the code in the buffer for submission

About

This is a spacemacs layer based on the leetcode-emacs project to interact with leetcode from within Emacs.

License:MIT License


Languages

Language:Emacs Lisp 100.0%