Closed susam closed 4 years ago
I have tested that this change works fine on Debian, macOS, and Windows.
Install Maven.
# On Debian, Ubuntu, etc.
apt-get update
apt-get install maven
# On macOS
brew install openjdk maven
export JAVA_HOME=/usr/local/opt/openjdk
export PATH="$JAVA_HOME/bin:$PATH"
Install Clojure.
git clone https://github.com/clojure/clojure.git ~/clojure
git -C ~/clojure checkout clojure-1.10.1
mvn -f ~/clojure/pom.xml -Plocal -Dmaven.test.skip=true package
java -jar ~/clojure/clojure.jar -e '(clojure-version)'
Install Slimv.
git clone https://github.com/kovisoft/slimv.git ~/.vim/bundle/slimv
echo 'set runtimepath^=~/.vim/bundle/slimv' >> ~/.vimrc
vim +'helptags ~/.vim/bundle/slimv/doc' +q
Run Vim within tmux, GNU Screen, or a desktop environment to create a new Clojure source file.
vim foo.clj
Press ,c to start Swank server with Clojure. Without this change, Swank server fails to start.
Apply this change.
cd ~/.vim/bundle/slimv
git checkout -b clojure-classpath
git pull https://github.com/susam/slimv clojure-classpath
Repeat steps 4 and 5 again. Swank server should start successfully now and the REPL buffer should appear.
Install 64-bit Vim using 64-bit installer available at https://github.com/vim/vim-win32-installer/releases.
Install 64-bit Python 3.7 using Windows x86-64 executable installer available at https://www.python.org/downloads/release/python-375/. Note: It is important that the Python version be 3.7 because the latest Vim available at the previous URL at this time is compiled with support for Python 3.7.
Install 64-bit Git from https://git-scm.com/download/win.
Install JDK from https://jdk.java.net/13/.
Install Maven from https://maven.apache.org/download.cgi.
Add the paths to Vim, Python, Git, JDK, and Maven binaries to PATH
environment variable.
Install Clojure.
git clone https://github.com/clojure/clojure.git C:\clojure
git -C C:\clojure checkout clojure-1.10.1
mvn -f C:\clojure\pom.xml -Plocal -Dmaven.test.skip=true package
java -jar C:\clojure\clojure.jar -e "(clojure-version)"
Install Slimv.
git clone https://github.com/kovisoft/slimv.git %HOMEPATH%\.vim\bundle\slimv
echo set runtimepath^^=~/.vim/bundle/slimv >> %HOMEPATH%\.vimrc
vim +"helptags ~\.vim\bundle\slimv\doc" +q
Create a new Clojure source file with Vim.
vim foo.clj
Press ,c to start Swank server with Clojure. It should start successfully even without this change. This issue did not affect Windows.
Now we need to ensure that we can start Swank server even after applying this change.
cd %HOMEPATH%\.vim\bundle\slimv
git checkout -b clojure-classpath
git pull https://github.com/susam/slimv clojure-classpath
Kill Swank server running in a separate console window. Then repeat steps 9 and 10 again. Swank server should start successfully again.
Prior to this change, even if Clojure is available at one of the auto-detected paths on Linux or Unix, e.g.,
~/clojure/clojure.jar
, the normal mode command ,c fails to start Swank server with Clojure. This issue occurs because semicolon (;
) is used as the delimiter in the classpath value forjava -cp
option. Here is an example classpath value that is used prior to this change:Semicolon (
;
) is the right delimiter for Java running on Windows but it should be colon (:
) on a Linux or Unix system. This change ensures that the correct delimiter is chosen as per the current operating system.