NOTICE: This extensions is outdated and not needed anymore, since core Liquid has vim-like keybindings as default now.
This extension adds vim like features for Liquid Text Editor
The extension is in experimental state, for exploration of the possibilities.
Feel free to add more features and create pull requests. Take a look at the code base. It is not that big, as much can be build on top of existing functionality in Liquid.
In this experimental phase I aim for functionality matching vim. Making pretty, adjusting details and doing autocompletion, I know will be possible later. So right now, either a command works or nothing happens.
For a general introduction to installing Liquid extensions take a look at Basic Setup.
It is possible to make an "easier" installation than descibed below, but I prefer to encourage the most general and flexible way, so you will be rewarded understanding the setup. Feel free the adjust the suggested folders and to skip cloning projects that are already cloned.
The procedure will work on Linux and probably Mac. I will assume you already have installed
- Java
- Git
- Clojure 1.9 with clj command. See clojure.org
Execute the commands below in ~/proj
:
git clone https://github.com/mogenslund/liquid.git
git clone https://github.com/mogenslund/liquid-vim.git
Now Liquid and Liquid-vim extensions are installed.
Following the convensions in Basic Setup I assume you have have folder ~/liq
as your own entry point for starting Liquid.
Add releative links to liquid and liquid-vim in the ~/liq/deps.edn
file, so it looks like
{:deps {org.clojure/data.json {:mvn/version "0.2.6"}
org.clojure/core.async {:mvn/version "0.3.465"}}
:paths ["src"
"../proj/liquid/src"
"../proj/liquid/resources"
"../proj/liquid-vim/src"]}
With some extra dependencies for illustration. (Of cause if you have other extensions they should stay in the file.)
Again I will assume, like in Basic Setup, that you have a file ~/liq/src/liana/core.clj
.
Adjust this file to use the new extension. It might look like:
(ns liana.core
(:require [dk.salza.liquid-vim.core :as vimcore])
(:gen-class))
(defn -main
[& args]
(apply vimcore/-main args))
In ~/liq/src
execute:
clj -m liquid.core
There is a Dockerfile for running the demo project. It can be used as just demo, but also for experimenting.
To build the container execute
docker build -t liquid-vim .
To boot the container afterwards execute
docker run -i -t --rm=true liquid-vim /bin/bash
To start Liquid with the vim extension run the following inside the container
clj -m liana.core