Vim + Clojure
Tatsuhiro Ujihisa @ VimConf2015
2015-11-21 Tokyo, Japan
Expected types of audiences
Expected types of audiences
Difficulty: ★☆☆ (Easy)
Vim + Clojure
Tatsuhiro Ujihisa @ VimConf2015
2015-11-21 Tokyo, Japan
Clojure
A programming language
Clojure
Clojure
Challenges
Vim plugins
For Clojure
Vim plugins
paredit.vim
http://www.vim.org/scripts/script.php?script_id=3998
Maintain the balanced state of matched chars.
Similar to paredit.el for Emacs
y}
dd
Pros: at almost every moment ()s match
Parenthesis as first citizens
Cons (½):
Vim’s features as second-class citizens
Cons (2/2):
Vim’s features as second-class citizens
Last update:
2 years ago
slimv.vim
http://www.vim.org/scripts/script.php?script_id=2531
https://github.com/kovisoft/slimv
Similar to SLIME for Emacs
IDE for Lisps
Contains
SWANK
A TCP server / Common Lisp, Clojure, or Scheme
Evaluating, Compiling, Debugging, or Profiling
Backend for SLIME
Last update:
5 days ago
sexp
https://github.com/guns/vim-sexp
S-Espression editing
<Plug>(sexp.*)
Last update:
9 months ago
Vim plugins
-
Tatsuhiro Ujihisa
@ujm
http://github.com/ujihisa
Scala at Hootsuite
PHP, Scala, Bash
Ansible, ZeroMQ, RabbitMQ, Kafka, MySQL, MongoDB, Memcached, Consul, etc
Software Developer
Not Software Engineer
It’s illegal in British Columbia, Canada
Travelling Japan w/ JRP
2015-11-14 to 2015-11-24
Vancouver->Tokyo->Hakata->Nagasaki->Shimonoseki->Kokura->Hiroshima->�Kure->Hiroshima->Osaka->Kyoto->Nara->Kyoto->Nagoya->Tokyo->Vancouver
Minecraft
Since 2010
Bukkit, Spigot
Clojure, JRuby, Scala, Rhino, Groovy
Civilization 5
Since 2013
1438hrs
http://www.nicovideo.jp/user/2809370
Zenbook + Gentoo + Vim
MacBook Pro + OSX + Vim
Tried IntelliJ
-
Vim + Clojure
Tatsuhiro Ujihisa @ VimConf2015
2015-11-21 Tokyo, Japan
VimClojure
http://www.vim.org/scripts/script.php?script_id=2501
“filetype, syntax, indent plugin’’
i.e. everything
(no parenthesis match editing something)
Use with paredit, slimv, or sexp.
optional: SLIME like interface
REPL, doc lookup, omni completion(!), evaluation from buffer
Last update:
3 years ago
clojure-static
https://github.com/guns/vim-clojure-static
indent / syntax
It also contains ftplugin to set some options, but not for key mappings.
autoload/clojurecomplete.vim
Predefined keywords.
...why not syntax complete or dictionary complete…?
Comes with Vim
Try `locate clojurecomplete` on your computer
Extracted from VimClojure
Last update:
5 months ago
ft-clojure
https://github.com/thinca/vim-ft-clojure
thinca
syntax / indent
syntax/clojure.vim
autoload/clojure/syntax.vim
Rainbow
Vim plugins
fireplace
https://github.com/tpope/vim-fireplace
Tim Pope
REPL + many
backend: cider-nrepl
nrepl
A Clojure Network REPL
The new standard
`lein repl` or use from Clojure programs
if_python
or
python as external command
Inconsistent commands/functions
Inconsistent commands/functions
:Source :Doc
:FindDoc :Connect
no ftplugin dir
completion
fireplace#omnicomplete
Automatic
Last update:
7 days ago
neoclojure
https://github.com/ujihisa/neoclojure.vim
completion
quickrun
ref
unite-outline
ujm
No REPL
quickrun is what you want.
No state
Why do we human still have to manage connections to the active Clojure processes?
quickrun
runner/neoclojure
Persistent process, managed by neoclojure,
using vital’s ConcurrentProcess module
You can kill the process at any time
ConcurrentProcess manages the internal state.
It’ll run slow when there’s no existing process,
but it won’t block Vim
Completions
Java class names `java.lang.String`
Static methods `(String/format)`
based on `(ns (:import …))`
Synchronous completion
neoclojure#complete#omni
It blocks Vim, but always available
Asynchronous completion
omnifunc=neoclojure#complete#omni_auto
It runs only when it’s already available immediately, but�it’s guaranteed not to block Vim
“Simplicity”
Clojure’s philosophy
Avoid incidental complexity, but�admit essential complexity
No network connection
Just use STDIN/STDOUT
Assume Clojure processes belong to a Vim,�not many-to-many
vim-ref
unite-outline
Only if you already have them
Last update:
0 days ago
-
Vim plugins
Vim plugins that I’m actively using
-
How to I code Clojure usually
Vim + Clojure
Tatsuhiro Ujihisa @ VimConf2015
2015-11-21 Tokyo, Japan
-
(FAQ) What’s the name of the programming langugage for Vim?
“Vim script”
not VimL nor VimScript
They are just typos
(FAQ) vim-sexp key mappings
(FAQ) what do you think about the Vim plugin names that contain objective adjectives such as simple or easy?
oh…
Don’t use them without clarifying what they really mean.
Simple implementation for yourself or for people who makes plugins for that? Easy to start using or easy to debug problems?
(FAQ) Where can I find your Civ5 play videos?
(FAQ) Where can I join your Minecraft server?