How do I setup REPL on vim?

后端 未结 11 1679
花落未央
花落未央 2021-02-06 12:14

I have installed vimclojure to make it easier to start learning clojure. But, I haven\'t been able to setup REPL inside vim. This is essentially because I was not able to write

相关标签:
11条回答
  • 2021-02-06 12:42

    I don't have a mapping for sr in my .vimrc, but it works for me.

    Have you checked that your Nailgun server is running, and that you have turned on Gorilla?

    E.g.,

    let clj_want_gorilla = 1
    let vimclojure#NailgunClient = "/Users/foo/vimclojure-2.1.0/ng"
    
    0 讨论(0)
  • 2021-02-06 12:44

    Most likely there is an error occurring in the plugin before the VimClojure mappings are fully defined.

    One likely scenario that I have run into several times occurs when the Clojure source file has syntax errors when it's loaded into the Vim buffer.

    There's something going on in the plugin during the load of the source file (syntax highlighting or something) that errors out and prevents the mappings from getting defined.

    This is probably just an unfortunate issue with VimClojure and should be reported, but I haven't had time to dig enough and log an intelligent bug report/patch.

    To troubleshoot, with a Clojure source file open in current buffer, try doing this:

    :call vimclojure#Repl.New()
    

    This invokes the function inside the plugin that is mapped to \sr. It's not a recommended way of launching the Repl, but since we're just troubleshooting your configuration, hopefully it will reveal something meaningful to you.

    Also, do this to see if there happen to be any helpful messages getting logged.

    :messages
    
    0 讨论(0)
  • 2021-02-06 12:44

    <LocalLeader> uses value from maplocalleader variable or it is backslash by default. If you do not set maplocalleader variable try \sr

    0 讨论(0)
  • 2021-02-06 12:44

    Getting VimClojure setup with a Nailgun server is how I've done it. I use leiningen to help manage the classpath. It's a fairly complicated process, but nice once you've got it set up.

    0 讨论(0)
  • 2021-02-06 12:47

    I solved the E10 problem with :set nocompatible. Then the \sr etc. commands worked OK.

    0 讨论(0)
提交回复
热议问题