Skip to end of metadata
Go to start of metadata

Quickstart

  1. Download Vimclojure from http://www.vim.org/scripts/script.php?script_id=2501
  2. Unzip the zip file into ~/.vim (Unix) resp. vimfiles (Windows).
  3. Ensure that the following is in your .vimrc resp. _vimrc:
    set nocompatible
    filetype plugin indent on
    syntax on
    
  4. Edit a Clojure file.

Disclaimer
If you don't know Vim, Vimclojure might be not the right tool for you. Vim's learning curve can be as steep as Emacs, Eclipse + CCW, Netbeans + Enclojure, or Textmate (on OS X) are probably more suitable in this case.

Labels:
  1. Feb 01, 2012

    Clojure and Vim can be used with Conque. I'm not able to update above page, so here is quick start.

    The easiest way is to download Vimball from (http://code.google.com/p/conque/downloads/list), and unpack it with:

    •    run vim
    •    :vim <path>/conque_2.3.vmb
    •    :so %

    (commands starting with ':' are meant to be executed as ex commands). After this step, vim will unpack archive and install things at appropriate places.

    To start repl, start vim and execute in as ex command:

       :ConqueTerm <path-to-lein>/lein

    or

       :ConqueTerm bash (then manualy run clojure jar)

    To evaluate your code, select region and press F9; conque will send it to running buffer and execute command.

  2. Feb 12, 2012

    I recommend using Screen.vim (it also works with Tmux).

    It gives the ability to open a shell prompt or any repl in a Screen/Tmux window (or pane) and send messages to it via commands, which can be bound to convenient shortcuts:

     

    let g:ScreenImpl='Tmux' " I use tmux
    noremap <leader>S :ScreenShell " Open a shell/repl
    vnoremap <leader>s :ScreenSend<CR> " send current visual selection to a shell/repl
    noremap <leader>s :ScreenSend<CR> " send a whole buffer to shell/repl
     
    It's much better solution than ConqueTerm which has a lot of quirks and isn't as performant as a native terminal
    1. Feb 29, 2012

      True. However, if you are using Screen.vim with GNU Screen, you are limited to 256 bytes transferred between screen buffers. Hoping tmux removes this limit.

  3. Feb 19, 2012

    Łukasz Korecki: Using Screen.vim seems to be very similar to vim-slime, what I use. You can grab some text with it and send it to a screen/REPL session using C-c, C-c. So far it's been a pretty simple setup with VimClojure and vim-slime for me.

  4. Feb 29, 2012

    Also, for Vim users who are not afraid to try Emacs but are not eager to learn Emacs shortcuts, Evil mode implements major Vim's commands and shortcuts in all buffers. Requires some time to get used to Emacs philosophy, especially if you are die hard Vi/Vim user.

  5. Mar 28, 2012

    There is also Slimv by Tamas Kovacs. "Slimv is a SWANK client for Vim, similarly to SLIME for Emacs."

    It has a lot of functionality, more than most of the screen-based approaches, but its syntax and indenting is not quite as nice as vimclojure's.

    Also it comes with an (optional) paredit mode!

    Setup

          $ mkdir -p ~/.vim
    $ hg clone https://bitbucket.org/kovisoft/slimv
    $ cd slimv/
    $ cp -R * ~/.vim

    Run vim and refresh the help cache:
    :helptags ~/.vim/doc

    Now you can use
    :help slimv
    to get the Slimv manual

    Use it with leiningen

          :cd ~/path/to/leinigen/project

         Hit ,c (that is comma followed by a "c") to start a REPL via "lein repl"

     

    Common keybindings - see :help slimv for full list

          ,d  - eval top-level expression under cursor
    ,b - eval the whole buffer
    ,s - get the documentation for the symbol under the cursor

     

    Useful configurations in .vimrc

          "this makes slimv autodetect the namespace of the buffer you are currently editing.
    "Eval'ing forms will be evaled in their namespace without changing the REPL namespace.
    let g:slimv_package = 1

    "This will activate paredit mode!
    "It's Vim's version of Emacs's paredit minor mode.
    "Look at :help paredit to learn the keybindings. Highly recommended!
    let g:paredit_mode = 1