2013-12-20 46 views
0

我刚安装了VIM和一些插件,其中一个是vim壁炉。我遇到的一个问题是,壁炉找不到我的clojure代码。我把我的clojure代码放在vimfiles/bundle下(我正在运行windows)。设置vim壁炉,连接clojure代码

我按照以上说明:

http://kevinmccarthy.org/blog/2013/10/12/setting-up-vim-for-clojure/

当运行在命令行的示例的Clojure函数(我去使用CQC),我得到以下错误:

Error detected while processing function <SNR>20_inputeval... foreplay#echo_session_eval..foreplay#session_eval...<SNR>20_eval...6: 
line 38 
E605: Exception not caught: Error running clojure:Error:Could not find or load main class clojure.main^@ 
Error detected while processing function <SNR>20_inputeval: 
line 4 
E71:missing :endif 

这是我的.vimrc:

set nocompatible 
source $VIMRUNTIME/vimrc_example.vim 
source $VIMRUNTIME/mswin.vim 
behave mswin 

syntax on 
filetype plugin indent on 
execute pathogen#infect() 
set nobackup 
set nowritebackup 

set diffexpr=MyDiff() 
function MyDiff() 
    let opt = '-a --binary ' 
    if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif 
    if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif 
    let arg1 = v:fname_in 
    if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif 
    let arg2 = v:fname_new 
    if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif 
    let arg3 = v:fname_out 
    if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif 
    let eq = '' 
    if $VIMRUNTIME =~ ' ' 
    if &sh =~ '\<cmd' 
     let cmd = '""' . $VIMRUNTIME . '\diff"' 
     let eq = '"' 
    else 
     let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"' 
    endif 
    else 
    let cmd = $VIMRUNTIME . '\diff' 
    endif 
    silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq 
endfunction 

回答

1

壁炉不能设置classpath,这可能是因为你没有使用lein项目。但这不是必需的,您可以始终连接到正在运行的nrepl(可通过lein repl启动),并使用:Connect nrepl://localhost:port从vim连接到它。

+0

当我输入“lein nrep”时,出现同样的错误。另外,由于计算机上的安全限制,我无法确定我的端口。 – animalcroc

+0

请尝试“lein repl”关注它的REPL而不是NREPL。此外,端口在repl启动时打印。 – FUD

+0

我试过“lein repl”,但得到相同的错误。之前你写过“lein nrep”,这就是为什么我尝试过。 – animalcroc