This command will prompt you to enter a REPL port number and a host address as seen here:Ĭonnecting VS Code to the running REPL using a port number and host address. Press ⇧-⌘-p on OSX or shift-ctrl-p on Windows to bring up the list of available commands, type “Connect,” and press ENTER to select the “Clojure: Connect to nREPL” command. Now that the REPL is running, we need to connect it to VS Code. With the terminal open, you can start the REPL by typing lein repl and pressing ENTER. To open the terminal, press ctrl+` for both OSX and Windows. You can use this shell to start your Clojure REPL (since this extension requires a REPL connection), or you can use your standard terminal. If you would prefer having all your tools running in a single application, VS Code has a built-in terminal emulator that uses your system’s default shell. If you need to connect to the REPL manually, this option is still viable. Note: As of version 0.7.0 the extension automatically connects to the REPL and pulls any necessary dependencies when you open a Clojure file. Once the extension is installed, you should have everything you need! But here are a few tips to help you get started: Connecting to the REPL
![lighttable no autocomplete lighttable no autocomplete](https://www.team-bhp.com/forum/attachments/modifications-accessories/614297d1316850884-auto-lighting-thread-post-all-queries-about-automobile-lighting-here-comparo.jpg)
This extension can be installed from the Extensions tab in VS Code, which you can open by pressing ⇧-⌘-x on OSX or shift-ctrl-x on Windows. Under the assumption that you already have Clojure and Leiningen installed on your system, you will need to install the Clojure extension for VS Code. If you are a fan of Sublime Text and want to learn Clojure, I would recommend reading Greg’s post about his Clojure setup for Sublime Text instead. The rest of this post is dedicated to setting up VS Code for Clojure development.
![lighttable no autocomplete lighttable no autocomplete](https://pplware.sapo.pt/wp-content/uploads/2012/04/autocomplete_2.jpg)
That’s when I decided to try out Visual Studio Code (VS Code) for Clojure Development. Learning Emacs while also attempting to learn Clojure was too much all at once. When I am learning a new subject, I tend to leverage the tools I already know instead of learning to use new tools along the way. I was excited to dive into Clojure, but I would spend my time fixing issues I was experiencing with Emacs (definitely user error).
![lighttable no autocomplete lighttable no autocomplete](https://i.stack.imgur.com/xiBnR.png)
Be that as it may, if you’re new to Clojure AND Emacs, you’re going to have an unpleasant experience. Every resource I tried to learn from suggested that I use Emacs as a text editor.ĭon’t get me wrong, Emacs is a great tool, and there was a time when I used Spacemacs as my main text editor. Why couldn’t I get excited about learning Clojure? Why Clojure is Difficult to LearnĮvery time I decided I would learn Clojure and master the art of parentheses (it is a LISP after all), a pattern emerged. After all, I had watched countless conference talks on the benefits of immutability and persistent data structures. The problem was that no matter how motivated I felt on any given day, I didn’t seem to put in the time and effort required to actually learn it. Over the past couple of months, I have expressed much interest in learning Clojure.