Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to start using vimside #23

Open
chungonn opened this issue Jul 28, 2013 · 22 comments
Open

How to start using vimside #23

chungonn opened this issue Jul 28, 2013 · 22 comments

Comments

@chungonn
Copy link

Hi,
I have used SublimeText2 (ST2)with Ensime briefly sometime back. Currently I am using Eclipse ScalaIDE to do my development. However I am keen to try using vimside.

I understand while using ST2, the ensime workflow is as such - start the Ensime server, then create an ensime configuration for the project that I'm working on. I may have the sequence wrong though. Also I have very basic knowledge using Vim, and hence the I did struggle going through Vim help docs.

My environment is MacVim, java 7, scala 2.10.2. I used NeoBundle to installed Vimside dependencies. I have setup option_user.vim file.

I tried to test the simple project but failed, the problem is I do not know how to start ensime.

I found the key mapping in the file plugin/vimside.vim, I tried using both 'command-x' keys and '\vs' keys but neither start ensime.

" Start Vimside
" M-x ensime
if has("gui_running")
nmap :call vimside#command#StartEnsime()
else
nmap vs :call vimside#command#StartEnsime()
endif
" Stop Vimside
nmap vS :call vimside#command#StopEnsime()

Any help to point me to the right direction is greatly appreciated

@megaannum
Copy link
Owner

First, enable logging

call owner.Set("ensime-log-enabled", 1)
call owner.Set("vimside-log-enabled", 1)

and see whats in the log file.

On 07/27/2013 11:48 PM, Cheong Chung Onn wrote:

Hi,
I have used SublimeText2 (ST2)with Ensime briefly sometime back.
Currently I am using Eclipse ScalaIDE to do my development. However I am
keen to try using vimside.

I understand while using ST2, the ensime workflow is as such - start the
Ensime server, then create an ensime configuration for the project that
I'm working on. I may have the sequence wrong though. Also I have very
basic knowledge using Vim, and hence the I did struggle going through
Vim help docs.

My environment is MacVim, java 7, scala 2.10.2. I used NeoBundle to
installed Vimside dependencies. I have setup option_user.vim file.

I tried to test the simple project but failed, the problem is I do not
know how to start ensime.

I found the key mapping in the file plugin/vimside.vim, I tried using
both 'command-x' keys and '\vs' keys but neither start ensime.

" Start Vimside
" M-x ensime
if has("gui_running")
nmap :call vimside#command#StartEnsime()
else
nmap vs :call vimside#command#StartEnsime()
endif
" Stop Vimside
nmap vS :call vimside#command#StopEnsime()

Any help to point me to the right direction is greatly appreciated


Reply to this email directly or view it on GitHub
#23.

Quis custodiet ipsos custodes

@chungonn
Copy link
Author

Hi Richard,

I enabled logging as per your suggestion. Also I ran the start ensime command manually - vimside#StartEnsime(). Ensime does not seems to able to find the Ensime server port file. Below is the output from vim, VIMSIDE_LOG file and a snippet of options_user.vim

I looked through the past issue #18 which reported a similar situation however the problem disappears after he enabled logging.

I am using the Simple project $HOME/.vim/bundle/vimside/data/vimside/projects/simple.

Thanks for looking into my problem.

Error from Vim

Starting Ensime Engine ...
Error detected while processing function vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime..vimside#GetPor
tEnsime:
line 26:
Vimside Failed to start Ensime Server port file does not exists
line 27:
E605: Exception not caught: Vimside Failed to start Ensime Server port file does not exists
Error detected while processing function vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime:
line 36:
E170: Missing :endwhile

VIMSIDE_LOG

INFO: 20130729-111050: vimside#StartEnsime after vimside#PreStart
INFO: 20130729-111050: vimside#StartEnsimeServer portfile=/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port
INFO: 20130729-111050: vimside#StartEnsimeServer portFileExists=0
INFO: 20130729-111050: vimside#StartEnsimeServer Ensime launched
INFO: 20130729-111050: vimside#StartEnsime had_to_start=1
INFO: 20130729-111054: vimside#GetPortEnsime TOP
INFO: 20130729-111054: vimside#GetPortEnsime max_cnt=5
INFO: 20130729-111105: ShutdownServer TOP
INFO: 20130729-111105: vimside#ensime#swank#dispatch callmsg=(swank:shutdown-server)
INFO: 20130729-111105: vimside#ensime#swank#asynchronous response=0
INFO: 20130729-111105: vimside#ensime#swank#asynchronous waiting for id=1
INFO: 20130729-111105: vimside#ensime#swank#ping_info_set_expecting_rpc_response
INFO: 20130729-111105: vimside#scheduler#SetUpdateTime: value=200
INFO: 20130729-111105: vimside#ensime#swank#ping_info_set_expecting_rpc_response
INFO: 20130729-111105: vimside#scheduler#SetUpdateTime: value=200
INFO: 20130729-111105: ShutdownServer BOTTOM
INFO: 20130729-111108: TimeTrigger: TOP [sec,msec]=[1375067468,39]
INFO: 20130729-111108: TimeTrigger: TOP2 len(s:jobs)=0
INFO: 20130729-111108: s:do_queued_remove_jobs: TOP
INFO: 20130729-111108: s:do_queued_add_job: TOP
INFO: 20130729-111108: TimeTrigger: BOTTOM len(s:jobs)=0
INFO: 20130729-111108: TimeTrigger: TOP [sec,msec]=[1375067468,245]
INFO: 20130729-111108: TimeTrigger: TOP2 len(s:jobs)=0
INFO: 20130729-111108: s:do_queued_remove_jobs: TOP
INFO: 20130729-111108: s:do_queued_add_job: TOP
INFO: 20130729-111108: TimeTrigger: BOTTOM len(s:jobs)=0
INFO: 20130729-111108: TimeTrigger: TOP [sec,msec]=[1375067468,462]
INFO: 20130729-111108: TimeTrigger: TOP2 len(s:jobs)=0
INFO: 20130729-111108: s:do_queued_remove_jobs: TOP
INFO: 20130729-111108: s:do_queued_add_job: TOP
INFO: 20130729-111108: TimeTrigger: BOTTOM len(s:jobs)=0
INFO: 20130729-111108: TimeTrigger: TOP [sec,msec]=[1375067468,674]
INFO: 20130729-111108: TimeTrigger: TOP2 len(s:jobs)=0
INFO: 20130729-111108: s:do_queued_remove_jobs: TOP
INFO: 20130729-111108: s:do_queued_add_job: TOP
INFO: 20130729-111108: TimeTrigger: BOTTOM len(s:jobs)=0
INFO: 20130729-111108: TimeTrigger: TOP [sec,msec]=[1375067468,886]
INFO: 20130729-111108: TimeTrigger: TOP2 len(s:jobs)=0
INFO: 20130729-111108: s:do_queued_remove_jobs: TOP
INFO: 20130729-111108: s:do_queued_add_job: TOP
INFO: 20130729-111108: TimeTrigger: BOTTOM len(s:jobs)=0
INFO: 20130729-111109: vimside#StartEnsime after vimside#PreStart
INFO: 20130729-111109: vimside#StartEnsimeServer portfile=/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port
INFO: 20130729-111109: vimside#StartEnsimeServer portFileExists=0
INFO: 20130729-111109: vimside#StartEnsimeServer Ensime launched
INFO: 20130729-111109: vimside#StartEnsime had_to_start=1
INFO: 20130729-111113: vimside#GetPortEnsime TOP
INFO: 20130729-111113: vimside#GetPortEnsime max_cnt=5

Snippet of options_user.vim file

" ============================================================================
" This file, example_options_user.vim will NOT be read by the Vimside
" code.
" To adjust option values, copy this file to a file called 'options_user.vim'
" in the same dirctory (or into a directory "data/vimside/" in the
" runtime-path (see :runtimepath),
" and then make changes. A file with this name will only be sourced once
" even if it appears in multiple location, local directory and runtime path.
" ============================================================================

" full path to this file
let s:full_path=expand(':p')

" full path to this file's directory
let s:full_dir=fnamemodify(s:full_path, ':h')

function! g:VimsideOptionsUserLoad(owner)
let owner = a:owner

"--------------
" Enable logging
call owner.Set("ensime-log-enabled", 1)
call owner.Set("vimside-log-enabled", 1)
"--------------

"--------------
" Output logs and ensime port file to local dir
" If you start Vim is some project sub-directory, this will place
" things in that directory (which may not be what you want).
" call owner.Set("vimside-use-cwd-as-output-dir", 0)
"--------------

"--------------
" Also load project specific options
" call owner.Set("vimside-project-options-enabled", 1)
" call owner.Set("vimside-project-options-file-name", "options_project.vim")
"--------------

"--------------
" Defined Java versions: '1.5', '1.6', '1.7'
" Defined Scala versions: '2.9.2', '2.10.0'
" Minor version numbers not needed
" Scala version MUST match 'ensime-dist-dir' used.
call owner.Set("vimside-java-version", "1.7")
call owner.Set("vimside-scala-version", "2.10.0")
"--------------

"--------------
" Where is Ensime installed
call owner.Set("ensime-install-path", $HOME . "/.vim/vim-addons/ensime")
" call owner.Set("ensime-install-path", $HOME . "/vimfiles/vim-addons/ensime")

" Which build version of Ensime to use.
" Must be directory under 'ensime-install-path' directory
" call owner.Set("ensime-dist-dir", "ensime_2.9.2-0.9.8.9")
call owner.Set("ensime-dist-dir", "ensime_2.10.0-0.9.8.9")

" Or, full path to Ensime build version
" call owner.Set("ensime-dist-path", "SOME_PATH_TO_ENSIME_BUILD_DIR")
"--------------

"--------------
" The Ensime Config information is in a file called 'ensime_config.vim'
call owner.Set("ensime-config-file-name", "ensime_config.vim")
"--------------

@megaannum
Copy link
Owner

Vimside calls the Ensime start script called
server or server.bat located in the directory where
Ensime is installed. The script takes one
argument, the full path to the port file.

Try to start the Ensime server by had, i.e.:

server
Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port

and see if the port file is created.

Also, in the plugin/vimside.vim file near the bottom
is the line:

let g:Vimside_Enable_Pre_Initialization_Logging = 0

If you change this to:

let g:Vimside_Enable_Pre_Initialization_Logging = 1

then a log file called "VIMSIDE_EARLY_LOG" is
created (in the current directory (if I remember
correctly)) which records information from the
system as it is loading the various Option files.
Normal logging can not happen until all of the
Option files are processed, so the "early log" is
not very configurable and is a quick/dirty way of
seeing some early Vimside information. You ought to
see information concerning what option files are
being read.

Richard

On 07/28/2013 10:17 PM, Cheong Chung Onn wrote:

Hi Richard,

I enabled logging as per your suggestion. Also I ran the start ensime
command manually - vimside#StartEnsime(). Ensime does not seems to able
to find the Ensime server port file. Below is the output from vim,
VIMSIDE_LOG file and a snippet of options_user.vim

I looked through the past issue #18
#18 which reported a
similar situation however the problem disappears after he enabled logging.

I am using the Simple project
$HOME/.vim/bundle/vimside/data/vimside/projects/simple.

Thanks for looking into my problem.

Error from Vim

Starting Ensime Engine ...
Error detected while processing function
vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime..vimside#GetPor
tEnsime:
line 26:
Vimside Failed to start Ensime Server port file does not exists
line 27:
E605: Exception not caught: Vimside Failed to start Ensime Server port
file does not exists
Error detected while processing function
vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime:
line 36:
E170: Missing :endwhile

VIMSIDE_LOG

INFO: 20130729-111050: vimside#StartEnsime after vimside#PreStart
INFO: 20130729-111050: vimside#StartEnsimeServer
portfile=/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port
INFO: 20130729-111050: vimside#StartEnsimeServer portFileExists=0
INFO: 20130729-111050: vimside#StartEnsimeServer Ensime launched
INFO: 20130729-111050: vimside#StartEnsime had_to_start=1
INFO: 20130729-111054: vimside#GetPortEnsime TOP
INFO: 20130729-111054: vimside#GetPortEnsime max_cnt=5
INFO: 20130729-111105: ShutdownServer TOP
INFO: 20130729-111105: vimside#ensime#swank#dispatch
callmsg=(swank:shutdown-server)
INFO: 20130729-111105: vimside#ensime#swank#asynchronous response=0
INFO: 20130729-111105: vimside#ensime#swank#asynchronous waiting for id=1
INFO: 20130729-111105:
vimside#ensime#swank#ping_info_set_expecting_rpc_response
INFO: 20130729-111105: vimside#scheduler#SetUpdateTime: value=200
INFO: 20130729-111105:
vimside#ensime#swank#ping_info_set_expecting_rpc_response
INFO: 20130729-111105: vimside#scheduler#SetUpdateTime: value=200
INFO: 20130729-111105: ShutdownServer BOTTOM
INFO: 20130729-111108: TimeTrigger: TOP [sec,msec]=[1375067468,39]
INFO: 20130729-111108: TimeTrigger: TOP2 len(s:jobs)=0
INFO: 20130729-111108: s:do_queued_remove_jobs: TOP
INFO: 20130729-111108: s:do_queued_add_job: TOP
INFO: 20130729-111108: TimeTrigger: BOTTOM len(s:jobs)=0
INFO: 20130729-111108: TimeTrigger: TOP [sec,msec]=[1375067468,245]
INFO: 20130729-111108: TimeTrigger: TOP2 len(s:jobs)=0
INFO: 20130729-111108: s:do_queued_remove_jobs: TOP
INFO: 20130729-111108: s:do_queued_add_job: TOP
INFO: 20130729-111108: TimeTrigger: BOTTOM len(s:jobs)=0
INFO: 20130729-111108: TimeTrigger: TOP [sec,msec]=[1375067468,462]
INFO: 20130729-111108: TimeTrigger: TOP2 len(s:jobs)=0
INFO: 20130729-111108: s:do_queued_remove_jobs: TOP
INFO: 20130729-111108: s:do_queued_add_job: TOP
INFO: 20130729-111108: TimeTrigger: BOTTOM len(s:jobs)=0
INFO: 20130729-111108: TimeTrigger: TOP [sec,msec]=[1375067468,674]
INFO: 20130729-111108: TimeTrigger: TOP2 len(s:jobs)=0
INFO: 20130729-111108: s:do_queued_remove_jobs: TOP
INFO: 20130729-111108: s:do_queued_add_job: TOP
INFO: 20130729-111108: TimeTrigger: BOTTOM len(s:jobs)=0
INFO: 20130729-111108: TimeTrigger: TOP [sec,msec]=[1375067468,886]
INFO: 20130729-111108: TimeTrigger: TOP2 len(s:jobs)=0
INFO: 20130729-111108: s:do_queued_remove_jobs: TOP
INFO: 20130729-111108: s:do_queued_add_job: TOP
INFO: 20130729-111108: TimeTrigger: BOTTOM len(s:jobs)=0
INFO: 20130729-111109: vimside#StartEnsime after vimside#PreStart
INFO: 20130729-111109: vimside#StartEnsimeServer
portfile=/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port
INFO: 20130729-111109: vimside#StartEnsimeServer portFileExists=0
INFO: 20130729-111109: vimside#StartEnsimeServer Ensime launched
INFO: 20130729-111109: vimside#StartEnsime had_to_start=1
INFO: 20130729-111113: vimside#GetPortEnsime TOP
INFO: 20130729-111113: vimside#GetPortEnsime max_cnt=5

Snippet of options_user.vim file

"

" This file, example_options_user.vim will NOT be read by the Vimside
" code.
" To adjust option values, copy this file to a file called
'options_user.vim'
" in the same dirctory (or into a directory "data/vimside/" in the
" runtime-path (see :runtimepath),
" and then make changes. A file with this name will only be sourced once
" even if it appears in multiple location, local directory and runtime path.

"

" full path to this file
let s:full_path=expand(':p')

" full path to this file's directory
let s:full_dir=fnamemodify(s:full_path, ':h')

function! g:VimsideOptionsUserLoad(owner)
let owner = a:owner

"--------------
" Enable logging
call owner.Set("ensime-log-enabled", 1)
call owner.Set("vimside-log-enabled", 1)
"--------------

"--------------
" Output logs and ensime port file to local dir
" If you start Vim is some project sub-directory, this will place
" things in that directory (which may not be what you want).
" call owner.Set("vimside-use-cwd-as-output-dir", 0)
"--------------

"--------------
" Also load project specific options
" call owner.Set("vimside-project-options-enabled", 1)
" call owner.Set("vimside-project-options-file-name", "options_project.vim")
"--------------

"--------------
" Defined Java versions: '1.5', '1.6', '1.7'
" Defined Scala versions: '2.9.2', '2.10.0'
" Minor version numbers not needed
" Scala version MUST match 'ensime-dist-dir' used.
call owner.Set("vimside-java-version", "1.7")
call owner.Set("vimside-scala-version", "2.10.0")
"--------------

"--------------
" Where is Ensime installed
call owner.Set("ensime-install-path", $HOME . "/.vim/vim-addons/ensime")
" call owner.Set("ensime-install-path", $HOME .
"/vimfiles/vim-addons/ensime")

" Which build version of Ensime to use.
" Must be directory under 'ensime-install-path' directory
" call owner.Set("ensime-dist-dir", "ensime_2.9.2-0.9.8.9")
call owner.Set("ensime-dist-dir", "ensime_2.10.0-0.9.8.9")

" Or, full path to Ensime build version
" call owner.Set("ensime-dist-path", "SOME_PATH_TO_ENSIME_BUILD_DIR")
"--------------

"--------------
" The Ensime Config information is in a file called 'ensime_config.vim'
call owner.Set("ensime-config-file-name", "ensime_config.vim")
"--------------


Reply to this email directly or view it on GitHub
#23 (comment).

Quis custodiet ipsos custodes

@chungonn
Copy link
Author

HI Richard,

Thanks for the tip.

Please find my response below.

On Jul 30, 2013, at 7:47 AM, Richard Emberson wrote:

Vimside calls the Ensime start script called
server or server.bat located in the directory where
Ensime is installed. The script takes one
argument, the full path to the port file.

Try to start the Ensime server by had, i.e.:

server
Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port

and see if the port file is created.

I need to run the server in the installed folder instead of the bin folder else I will get an error. I managed to start the server and the _ensime_port file is created in the simple project folder, here is the command - bin/server /Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port

Output from the console

Starting up Ensime...
Environment:
OS : Mac OS X
Java : Java HotSpot(TM) 64-Bit Server VM 23.6-b04, Java(TM) SE Runtime Environment 1.7.0_11-b21
Scala : version 2.10.0
Ensime : 0.9.8.9
Server listening on 49391..
Wrote port 49391 to /Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port.
Project waiting for init...

I think that my options_user.vim is not properly set, here is my options_user.vim file setup. I have to invoke the ensime server using bin/server, how do I set that in the options_user.vim file?

"--------------
" Defined Java versions: '1.5', '1.6', '1.7'
" Defined Scala versions: '2.9.2', '2.10.0'
" Minor version numbers not needed
" Scala version MUST match 'ensime-dist-dir' used.
call owner.Set("vimside-java-version", "1.7")
call owner.Set("vimside-scala-version", "2.10.0")
"--------------

"--------------
" Where is Ensime installed
call owner.Set("ensime-install-path", $HOME . "/.vim/vim-addons/ensime")
" call owner.Set("ensime-install-path", $HOME . "/vimfiles/vim-addons/ensime")

" Which build version of Ensime to use.
" Must be directory under 'ensime-install-path' directory
" call owner.Set("ensime-dist-dir", "ensime_2.9.2-0.9.8.9")
call owner.Set("ensime-dist-dir", "ensime_2.10.0-0.9.8.9")

" Or, full path to Ensime build version
" call owner.Set("ensime-dist-path", "SOME_PATH_TO_ENSIME_BUILD_DIR")
"--------------

"--------------
" The Ensime Config information is in a file called 'ensime_config.vim'
call owner.Set("ensime-config-file-name", "ensime_config.vim")
"--------------

"--------------
" To run against one of your own projects
" The Ensime Config information is in a file called '_ensime'
" Emacs Ensime calls the file '.ensime' - you can call it
" whatever you want as long as you set its name here.
" call owner.Set("ensime-config-file-name", "_ensime")
"--------------

Also, in the plugin/vimside.vim file near the bottom
is the line:

let g:Vimside_Enable_Pre_Initialization_Logging = 0

If you change this to:

let g:Vimside_Enable_Pre_Initialization_Logging = 1

then a log file called "VIMSIDE_EARLY_LOG" is
created (in the current directory (if I remember
correctly)) which records information from the
system as it is loading the various Option files.
Normal logging can not happen until all of the
Option files are processed, so the "early log" is
not very configurable and is a quick/dirty way of
seeing some early Vimside information. You ought to
see information concerning what option files are
being read.

Will try this later.

Thanks for the help. Much appreciated.

Regards
chungonn

@chungonn
Copy link
Author

Hi Richard,

Here's the VIM_EARLY_LOG file. Btw, I am now starting ensime using "\vs", I commented out as I believe is because of the conflict in MacVIM key mapping.

INFO: vimside#options#manager: s:full_path=/Users/chungonn/.vim/bundle/vimside/autoload/vimside/options/manager.vim
INFO: vimside#options#manager: s:full_dir=/Users/chungonn/.vim/bundle/vimside/autoload/vimside/options
INFO: vimside#options#manager: s:data_vimside_dir=/Users/chungonn/.vim/bundle/vimside/data/vimside
INFO: vimside#options#manager#Load: TOP
INFO: vimside#options#manager#Load: tailor-browser-unix-commands =['xdg-open', 'firefox', 'opera']
INFO: vimside#options#manager#LoadUser: TOP
INFO: vimside#options#manager#LoadUser: l:tmpfile=/Users/chungonn/.vim/bundle/vimside/data/vimside/options_user.vim
INFO: vimside#options#manager#LoadUser: sourcing=/Users/chungonn/.vim/bundle/vimside/data/vimside/options_user.vim
INFO: vimside#options#manager#LoadUser: l:tmpfile=/Users/chungonn/.vim/bundle/vimside/data/vimside/vimside_user.properties
INFO: vimside#options#manager#LoadUser: l:files=[]
INFO: vimside#options#manager#LoadUser: BOTTOM
INFO: vimside#options#manager#LoadProject: TOP
INFO: vimside#options#manager#LoadProject: look_local
INFO: vimside#options#manager#LoadProject: l:file_name=options_project.vim
INFO: vimside#options#manager#LoadProject: dir=/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple
INFO: vimside#options#manager#LoadProject: l:tmp_file=/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/options_project.vim
INFO: vimside#options#manager#LoadProject: l:option_file=/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/options_project.vim
INFO: vimside#options#manager#LoadProject: BOTTOM
INFO: vimside#options#manager#Load: ensime-config-file-name=ensime_config.vim
INFO: vimside#options#manager#Load: dir=/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple
INFO: vimside#options#manager#Load: l:tmp_config_file=/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/ensime_config.vim
INFO: vimside#options#manager#Load: l:ensime_config_file=/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/ensime_config.vim
INFO: vimside#options#manager#Load: l:ensime_config_dir=/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple
INFO: vimside#options#manager#Load: got_ensime_dir=0
INFO: vimside#options#manager#Load: ensime-install-path=/Users/chungonn/.vim/vim-addons/ensime
INFO: vimside#options#manager#Load: ensime-dist-dir=ensime_2.10.0-0.9.8.9
INFO: vimside#options#manager#Load: l:ensime_scala_version=2.10.0
INFO: vimside#options#manager#Load: l:vimside_scala_version=2.10.0
INFO: vimside#options#manager#Load: l:ensime_java_version=1.7
INFO: vimside#options#manager#Load: l:vimside_java_version=1.7
INFO: vimside#options#manager#Load: ensime-port-file-path=/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port
INFO: vimside#options#manager#Load: ensime-host-name=localhost
INFO: vimside#options#manager#Load: ensime-log-file-path=/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/ENSIME_LOG
INFO: vimside#options#manager#Load: vimside-log-file-path=/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/VIMSIDE_LOG
INFO: vimside#options#manager#Load: BOTTOM

On Jul 30, 2013, at 7:47 AM, Richard Emberson wrote:

Vimside calls the Ensime start script called
server or server.bat located in the directory where
Ensime is installed. The script takes one
argument, the full path to the port file.

Try to start the Ensime server by had, i.e.:

server
Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port

and see if the port file is created.

Also, in the plugin/vimside.vim file near the bottom
is the line:

let g:Vimside_Enable_Pre_Initialization_Logging = 0

If you change this to:

let g:Vimside_Enable_Pre_Initialization_Logging = 1

then a log file called "VIMSIDE_EARLY_LOG" is
created (in the current directory (if I remember
correctly)) which records information from the
system as it is loading the various Option files.
Normal logging can not happen until all of the
Option files are processed, so the "early log" is
not very configurable and is a quick/dirty way of
seeing some early Vimside information. You ought to
see information concerning what option files are
being read.

Richard

On 07/28/2013 10:17 PM, Cheong Chung Onn wrote:

Hi Richard,

I enabled logging as per your suggestion. Also I ran the start ensime
command manually - vimside#StartEnsime(). Ensime does not seems to able
to find the Ensime server port file. Below is the output from vim,
VIMSIDE_LOG file and a snippet of options_user.vim

I looked through the past issue #18
#18 which reported a
similar situation however the problem disappears after he enabled logging.

I am using the Simple project
$HOME/.vim/bundle/vimside/data/vimside/projects/simple.

Thanks for looking into my problem.

Error from Vim

Starting Ensime Engine ...
Error detected while processing function
vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime..vimside#GetPor
tEnsime:
line 26:
Vimside Failed to start Ensime Server port file does not exists
line 27:
E605: Exception not caught: Vimside Failed to start Ensime Server port
file does not exists
Error detected while processing function
vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime:
line 36:
E170: Missing :endwhile

VIMSIDE_LOG

INFO: 20130729-111050: vimside#StartEnsime after vimside#PreStart
INFO: 20130729-111050: vimside#StartEnsimeServer
portfile=/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port
INFO: 20130729-111050: vimside#StartEnsimeServer portFileExists=0
INFO: 20130729-111050: vimside#StartEnsimeServer Ensime launched
INFO: 20130729-111050: vimside#StartEnsime had_to_start=1
INFO: 20130729-111054: vimside#GetPortEnsime TOP
INFO: 20130729-111054: vimside#GetPortEnsime max_cnt=5
INFO: 20130729-111105: ShutdownServer TOP
INFO: 20130729-111105: vimside#ensime#swank#dispatch
callmsg=(swank:shutdown-server)
INFO: 20130729-111105: vimside#ensime#swank#asynchronous response=0
INFO: 20130729-111105: vimside#ensime#swank#asynchronous waiting for id=1
INFO: 20130729-111105:
vimside#ensime#swank#ping_info_set_expecting_rpc_response
INFO: 20130729-111105: vimside#scheduler#SetUpdateTime: value=200
INFO: 20130729-111105:
vimside#ensime#swank#ping_info_set_expecting_rpc_response
INFO: 20130729-111105: vimside#scheduler#SetUpdateTime: value=200
INFO: 20130729-111105: ShutdownServer BOTTOM
INFO: 20130729-111108: TimeTrigger: TOP [sec,msec]=[1375067468,39]
INFO: 20130729-111108: TimeTrigger: TOP2 len(s:jobs)=0
INFO: 20130729-111108: s:do_queued_remove_jobs: TOP
INFO: 20130729-111108: s:do_queued_add_job: TOP
INFO: 20130729-111108: TimeTrigger: BOTTOM len(s:jobs)=0
INFO: 20130729-111108: TimeTrigger: TOP [sec,msec]=[1375067468,245]
INFO: 20130729-111108: TimeTrigger: TOP2 len(s:jobs)=0
INFO: 20130729-111108: s:do_queued_remove_jobs: TOP
INFO: 20130729-111108: s:do_queued_add_job: TOP
INFO: 20130729-111108: TimeTrigger: BOTTOM len(s:jobs)=0
INFO: 20130729-111108: TimeTrigger: TOP [sec,msec]=[1375067468,462]
INFO: 20130729-111108: TimeTrigger: TOP2 len(s:jobs)=0
INFO: 20130729-111108: s:do_queued_remove_jobs: TOP
INFO: 20130729-111108: s:do_queued_add_job: TOP
INFO: 20130729-111108: TimeTrigger: BOTTOM len(s:jobs)=0
INFO: 20130729-111108: TimeTrigger: TOP [sec,msec]=[1375067468,674]
INFO: 20130729-111108: TimeTrigger: TOP2 len(s:jobs)=0
INFO: 20130729-111108: s:do_queued_remove_jobs: TOP
INFO: 20130729-111108: s:do_queued_add_job: TOP
INFO: 20130729-111108: TimeTrigger: BOTTOM len(s:jobs)=0
INFO: 20130729-111108: TimeTrigger: TOP [sec,msec]=[1375067468,886]
INFO: 20130729-111108: TimeTrigger: TOP2 len(s:jobs)=0
INFO: 20130729-111108: s:do_queued_remove_jobs: TOP
INFO: 20130729-111108: s:do_queued_add_job: TOP
INFO: 20130729-111108: TimeTrigger: BOTTOM len(s:jobs)=0
INFO: 20130729-111109: vimside#StartEnsime after vimside#PreStart
INFO: 20130729-111109: vimside#StartEnsimeServer
portfile=/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port
INFO: 20130729-111109: vimside#StartEnsimeServer portFileExists=0
INFO: 20130729-111109: vimside#StartEnsimeServer Ensime launched
INFO: 20130729-111109: vimside#StartEnsime had_to_start=1
INFO: 20130729-111113: vimside#GetPortEnsime TOP
INFO: 20130729-111113: vimside#GetPortEnsime max_cnt=5

Snippet of options_user.vim file

"

" This file, example_options_user.vim will NOT be read by the Vimside
" code.
" To adjust option values, copy this file to a file called
'options_user.vim'
" in the same dirctory (or into a directory "data/vimside/" in the
" runtime-path (see :runtimepath),
" and then make changes. A file with this name will only be sourced once
" even if it appears in multiple location, local directory and runtime path.

"

" full path to this file
let s:full_path=expand(':p')

" full path to this file's directory
let s:full_dir=fnamemodify(s:full_path, ':h')

function! g:VimsideOptionsUserLoad(owner)
let owner = a:owner

"--------------
" Enable logging
call owner.Set("ensime-log-enabled", 1)
call owner.Set("vimside-log-enabled", 1)
"--------------

"--------------
" Output logs and ensime port file to local dir
" If you start Vim is some project sub-directory, this will place
" things in that directory (which may not be what you want).
" call owner.Set("vimside-use-cwd-as-output-dir", 0)
"--------------

"--------------
" Also load project specific options
" call owner.Set("vimside-project-options-enabled", 1)
" call owner.Set("vimside-project-options-file-name", "options_project.vim")
"--------------

"--------------
" Defined Java versions: '1.5', '1.6', '1.7'
" Defined Scala versions: '2.9.2', '2.10.0'
" Minor version numbers not needed
" Scala version MUST match 'ensime-dist-dir' used.
call owner.Set("vimside-java-version", "1.7")
call owner.Set("vimside-scala-version", "2.10.0")
"--------------

"--------------
" Where is Ensime installed
call owner.Set("ensime-install-path", $HOME . "/.vim/vim-addons/ensime")
" call owner.Set("ensime-install-path", $HOME .
"/vimfiles/vim-addons/ensime")

" Which build version of Ensime to use.
" Must be directory under 'ensime-install-path' directory
" call owner.Set("ensime-dist-dir", "ensime_2.9.2-0.9.8.9")
call owner.Set("ensime-dist-dir", "ensime_2.10.0-0.9.8.9")

" Or, full path to Ensime build version
" call owner.Set("ensime-dist-path", "SOME_PATH_TO_ENSIME_BUILD_DIR")
"--------------

"--------------
" The Ensime Config information is in a file called 'ensime_config.vim'
call owner.Set("ensime-config-file-name", "ensime_config.vim")
"--------------


Reply to this email directly or view it on GitHub
#23 (comment).

Quis custodiet ipsos custodes

Reply to this email directly or view it on GitHub.

@megaannum
Copy link
Owner

Can you compare the output from Ensime when you
start it by hand versus what is logged in the
ENSIME_LOG file. Ought to be the same.

Vimside give Ensime a certain time before it
figures that Ensime did not start.

When Vimside announces that Ensime did not start
can you look to see if the Ensime process did in
fact start?

There is a property "ensime-port-file-max-wait" which
is how many seconds to wait for Ensime to start.
Actually, it tries and then wait a second and does this
ensime-port-file-max-wait times. If on your system it
takes longer than 5 second, then Vimside will give up
before Ensime comes up.
So, if Ensime does start, but Vimside says that it
did not 1) the port file should have been created
by Ensime and 2) you could set the value of
ensime-port-file-max-wait to something larger than 5.

Richard

On 07/29/2013 05:21 PM, Cheong Chung Onn wrote:

Hi Richard,

Here's the VIM_EARLY_LOG file. Btw, I am now starting ensime using
"\vs", I commented out as I believe is because of the conflict in
MacVIM key mapping.

INFO: vimside#options#manager:
s:full_path=/Users/chungonn/.vim/bundle/vimside/autoload/vimside/options/manager.vim

INFO: vimside#options#manager:
s:full_dir=/Users/chungonn/.vim/bundle/vimside/autoload/vimside/options
INFO: vimside#options#manager:
s:data_vimside_dir=/Users/chungonn/.vim/bundle/vimside/data/vimside
INFO: vimside#options#manager#Load: TOP
INFO: vimside#options#manager#Load: tailor-browser-unix-commands
=['xdg-open', 'firefox', 'opera']
INFO: vimside#options#manager#LoadUser: TOP
INFO: vimside#options#manager#LoadUser:
l:tmpfile=/Users/chungonn/.vim/bundle/vimside/data/vimside/options_user.vim
INFO: vimside#options#manager#LoadUser:
sourcing=/Users/chungonn/.vim/bundle/vimside/data/vimside/options_user.vim
INFO: vimside#options#manager#LoadUser:
l:tmpfile=/Users/chungonn/.vim/bundle/vimside/data/vimside/vimside_user.properties

INFO: vimside#options#manager#LoadUser: l:files=[]
INFO: vimside#options#manager#LoadUser: BOTTOM
INFO: vimside#options#manager#LoadProject: TOP
INFO: vimside#options#manager#LoadProject: look_local
INFO: vimside#options#manager#LoadProject: l:file_name=options_project.vim
INFO: vimside#options#manager#LoadProject:
dir=/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple
INFO: vimside#options#manager#LoadProject:
l:tmp_file=/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/options_project.vim

INFO: vimside#options#manager#LoadProject:
l:option_file=/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/options_project.vim

INFO: vimside#options#manager#LoadProject: BOTTOM
INFO: vimside#options#manager#Load:
ensime-config-file-name=ensime_config.vim
INFO: vimside#options#manager#Load:
dir=/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple
INFO: vimside#options#manager#Load:
l:tmp_config_file=/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/ensime_config.vim

INFO: vimside#options#manager#Load:
l:ensime_config_file=/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/ensime_config.vim

INFO: vimside#options#manager#Load:
l:ensime_config_dir=/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple

INFO: vimside#options#manager#Load: got_ensime_dir=0
INFO: vimside#options#manager#Load:
ensime-install-path=/Users/chungonn/.vim/vim-addons/ensime
INFO: vimside#options#manager#Load: ensime-dist-dir=ensime_2.10.0-0.9.8.9
INFO: vimside#options#manager#Load: l:ensime_scala_version=2.10.0
INFO: vimside#options#manager#Load: l:vimside_scala_version=2.10.0
INFO: vimside#options#manager#Load: l:ensime_java_version=1.7
INFO: vimside#options#manager#Load: l:vimside_java_version=1.7
INFO: vimside#options#manager#Load:
ensime-port-file-path=/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port

INFO: vimside#options#manager#Load: ensime-host-name=localhost
INFO: vimside#options#manager#Load:
ensime-log-file-path=/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/ENSIME_LOG

INFO: vimside#options#manager#Load:
vimside-log-file-path=/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/VIMSIDE_LOG

INFO: vimside#options#manager#Load: BOTTOM

On Jul 30, 2013, at 7:47 AM, Richard Emberson wrote:

Vimside calls the Ensime start script called
server or server.bat located in the directory where
Ensime is installed. The script takes one
argument, the full path to the port file.

Try to start the Ensime server by had, i.e.:

server

Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port

and see if the port file is created.

Also, in the plugin/vimside.vim file near the bottom
is the line:

let g:Vimside_Enable_Pre_Initialization_Logging = 0

If you change this to:

let g:Vimside_Enable_Pre_Initialization_Logging = 1

then a log file called "VIMSIDE_EARLY_LOG" is
created (in the current directory (if I remember
correctly)) which records information from the
system as it is loading the various Option files.
Normal logging can not happen until all of the
Option files are processed, so the "early log" is
not very configurable and is a quick/dirty way of
seeing some early Vimside information. You ought to
see information concerning what option files are
being read.

Richard

On 07/28/2013 10:17 PM, Cheong Chung Onn wrote:

Hi Richard,

I enabled logging as per your suggestion. Also I ran the start ensime
command manually - vimside#StartEnsime(). Ensime does not seems to
able
to find the Ensime server port file. Below is the output from vim,
VIMSIDE_LOG file and a snippet of options_user.vim

I looked through the past issue #18
#18 which reported a
similar situation however the problem disappears after he enabled
logging.

I am using the Simple project
$HOME/.vim/bundle/vimside/data/vimside/projects/simple.

Thanks for looking into my problem.

Error from Vim

Starting Ensime Engine ...
Error detected while processing function

vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime..vimside#GetPor

tEnsime:
line 26:
Vimside Failed to start Ensime Server port file does not exists
line 27:
E605: Exception not caught: Vimside Failed to start Ensime Server port
file does not exists
Error detected while processing function

vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime:

line 36:
E170: Missing :endwhile

VIMSIDE_LOG

INFO: 20130729-111050: vimside#StartEnsime after vimside#PreStart
INFO: 20130729-111050: vimside#StartEnsimeServer

portfile=/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port

INFO: 20130729-111050: vimside#StartEnsimeServer portFileExists=0
INFO: 20130729-111050: vimside#StartEnsimeServer Ensime launched
INFO: 20130729-111050: vimside#StartEnsime had_to_start=1
INFO: 20130729-111054: vimside#GetPortEnsime TOP
INFO: 20130729-111054: vimside#GetPortEnsime max_cnt=5
INFO: 20130729-111105: ShutdownServer TOP
INFO: 20130729-111105: vimside#ensime#swank#dispatch
callmsg=(swank:shutdown-server)
INFO: 20130729-111105: vimside#ensime#swank#asynchronous response=0
INFO: 20130729-111105: vimside#ensime#swank#asynchronous waiting
for id=1
INFO: 20130729-111105:
vimside#ensime#swank#ping_info_set_expecting_rpc_response
INFO: 20130729-111105: vimside#scheduler#SetUpdateTime: value=200
INFO: 20130729-111105:
vimside#ensime#swank#ping_info_set_expecting_rpc_response
INFO: 20130729-111105: vimside#scheduler#SetUpdateTime: value=200
INFO: 20130729-111105: ShutdownServer BOTTOM
INFO: 20130729-111108: TimeTrigger: TOP [sec,msec]=[1375067468,39]
INFO: 20130729-111108: TimeTrigger: TOP2 len(s:jobs)=0
INFO: 20130729-111108: s:do_queued_remove_jobs: TOP
INFO: 20130729-111108: s:do_queued_add_job: TOP
INFO: 20130729-111108: TimeTrigger: BOTTOM len(s:jobs)=0
INFO: 20130729-111108: TimeTrigger: TOP [sec,msec]=[1375067468,245]
INFO: 20130729-111108: TimeTrigger: TOP2 len(s:jobs)=0
INFO: 20130729-111108: s:do_queued_remove_jobs: TOP
INFO: 20130729-111108: s:do_queued_add_job: TOP
INFO: 20130729-111108: TimeTrigger: BOTTOM len(s:jobs)=0
INFO: 20130729-111108: TimeTrigger: TOP [sec,msec]=[1375067468,462]
INFO: 20130729-111108: TimeTrigger: TOP2 len(s:jobs)=0
INFO: 20130729-111108: s:do_queued_remove_jobs: TOP
INFO: 20130729-111108: s:do_queued_add_job: TOP
INFO: 20130729-111108: TimeTrigger: BOTTOM len(s:jobs)=0
INFO: 20130729-111108: TimeTrigger: TOP [sec,msec]=[1375067468,674]
INFO: 20130729-111108: TimeTrigger: TOP2 len(s:jobs)=0
INFO: 20130729-111108: s:do_queued_remove_jobs: TOP
INFO: 20130729-111108: s:do_queued_add_job: TOP
INFO: 20130729-111108: TimeTrigger: BOTTOM len(s:jobs)=0
INFO: 20130729-111108: TimeTrigger: TOP [sec,msec]=[1375067468,886]
INFO: 20130729-111108: TimeTrigger: TOP2 len(s:jobs)=0
INFO: 20130729-111108: s:do_queued_remove_jobs: TOP
INFO: 20130729-111108: s:do_queued_add_job: TOP
INFO: 20130729-111108: TimeTrigger: BOTTOM len(s:jobs)=0
INFO: 20130729-111109: vimside#StartEnsime after vimside#PreStart
INFO: 20130729-111109: vimside#StartEnsimeServer

portfile=/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port

INFO: 20130729-111109: vimside#StartEnsimeServer portFileExists=0
INFO: 20130729-111109: vimside#StartEnsimeServer Ensime launched
INFO: 20130729-111109: vimside#StartEnsime had_to_start=1
INFO: 20130729-111113: vimside#GetPortEnsime TOP
INFO: 20130729-111113: vimside#GetPortEnsime max_cnt=5

Snippet of options_user.vim file

"

" This file, example_options_user.vim will NOT be read by the Vimside
" code.
" To adjust option values, copy this file to a file called
'options_user.vim'
" in the same dirctory (or into a directory "data/vimside/" in the
" runtime-path (see :runtimepath),
" and then make changes. A file with this name will only be sourced
once
" even if it appears in multiple location, local directory and
runtime path.
"

" full path to this file
let s:full_path=expand(':p')

" full path to this file's directory
let s:full_dir=fnamemodify(s:full_path, ':h')

function! g:VimsideOptionsUserLoad(owner)
let owner = a:owner

"--------------
" Enable logging
call owner.Set("ensime-log-enabled", 1)
call owner.Set("vimside-log-enabled", 1)
"--------------

"--------------
" Output logs and ensime port file to local dir
" If you start Vim is some project sub-directory, this will place
" things in that directory (which may not be what you want).
" call owner.Set("vimside-use-cwd-as-output-dir", 0)
"--------------

"--------------
" Also load project specific options
" call owner.Set("vimside-project-options-enabled", 1)
" call owner.Set("vimside-project-options-file-name",
"options_project.vim")
"--------------

"--------------
" Defined Java versions: '1.5', '1.6', '1.7'
" Defined Scala versions: '2.9.2', '2.10.0'
" Minor version numbers not needed
" Scala version MUST match 'ensime-dist-dir' used.
call owner.Set("vimside-java-version", "1.7")
call owner.Set("vimside-scala-version", "2.10.0")
"--------------

"--------------
" Where is Ensime installed
call owner.Set("ensime-install-path", $HOME .
"/.vim/vim-addons/ensime")
" call owner.Set("ensime-install-path", $HOME .
"/vimfiles/vim-addons/ensime")

" Which build version of Ensime to use.
" Must be directory under 'ensime-install-path' directory
" call owner.Set("ensime-dist-dir", "ensime_2.9.2-0.9.8.9")
call owner.Set("ensime-dist-dir", "ensime_2.10.0-0.9.8.9")

" Or, full path to Ensime build version
" call owner.Set("ensime-dist-path", "SOME_PATH_TO_ENSIME_BUILD_DIR")
"--------------

"--------------
" The Ensime Config information is in a file called
'ensime_config.vim'
call owner.Set("ensime-config-file-name", "ensime_config.vim")
"--------------


Reply to this email directly or view it on GitHub

#23 (comment).

Quis custodiet ipsos custodes

Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
#23 (comment).

Quis custodiet ipsos custodes

@chungonn
Copy link
Author

Hi Richard,

When I start the server manually, I can see the _ensime_port file created immediately on the project folder and I can see the "Server" process running. However, I am not able to start the server from VIM, also I have increased the wait time to 15 secs.

I added a 2 diagnostic messages in autoload/vimside.vim to print out the command for invoking Ensime server and waiting for the Ensime server (see output below). The command seeks ok, and I tried to execute it manually in a terminal and it works, however it does not seems to be able to invoke within VIM. Below is the output from the VIM console

Starting Ensime Engine ...
cd /Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 && ./bin/server '/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port' << added extra message here
sleep to wait for ensime << added extra message here
Get ensime port
Error detected while processing function vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime..vimside#GetPortEnsime:
line 26:
Vimside Failed to start Ensime Server port file does not exists
line 27:
E605: Exception not caught: Vimside Failed to start Ensime Server port file does not exists
Error detected while processing function vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime:
line 40:
E170: Missing :endwhile

@megaannum
Copy link
Owner

Try this.
Run Vim but do not start Vimside.

Enter the following on the command line:

:execute 'silent ! cd
/Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server
/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

See if Ensime starts.
I Note that you say that the command you record is:

cd /Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server
'/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

The port file argument should NOT be in qoutes!

Richard

On 07/29/2013 11:01 PM, Cheong Chung Onn wrote:

Hi Richard,

When I start the server manually, I can see the _ensime_port file
created immediately on the project folder and I can see the "Server"
process running. However, I am not able to start the server from VIM,
also I have increased the wait time to 15 secs.

I added a 2 diagnostic messages in autoload/vimside.vim to print out the
command for invoking Ensime server and waiting for the Ensime server
(see output below). The command seeks ok, and I tried to execute it
manually in a terminal and it works, however it does not seems to be
able to invoke within VIM. Below is the output from the VIM console

Starting Ensime Engine ...
cd /Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server
'/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'
<< added extra message here
sleep to wait for ensime << added extra message here
Get ensime port
Error detected while processing function
vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime..vimside#GetPortEnsime:

line 26:
Vimside Failed to start Ensime Server port file does not exists
line 27:
E605: Exception not caught: Vimside Failed to start Ensime Server port
file does not exists
Error detected while processing function
vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime:

line 40:
E170: Missing :endwhile


Reply to this email directly or view it on GitHub
#23 (comment).

Quis custodiet ipsos custodes

@chungonn
Copy link
Author

Hi Richard,

Thanks for helping out on this. I followed your instructions and it seems that the ensime server can't write to the file

:!cd /Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 && ./bin/server /User/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port
java -Xbootclasspath/a:scala-library.jar:scala-reflect.jar:scala-compiler.jar:scala-actors.jar -classpath lib/asm-3.3.jar:lib/asm-commons-3.3.jar:lib/asm-tree-3.3.jar:lib/asm-util-
3.3.jar:lib/critbit-0.0.4.jar:lib/ensime_2.10-0.9.8.9.jar:lib/json-simple-1.1.jar:lib/lucene-core-3.5.0.jar:lib/org.eclipse.jdt.core-3.6.0.v_A58.jar:lib/org.scala-refactoring_2.10.
0-SNAPSHOT-0.6.1-20130201.063851-55.jar:lib/scala-actors-2.10.0.jar:lib/scala-compiler.jar:lib/scala-library.jar:lib/scala-reflect-2.10.0.jar:lib/scalariform_2.10-0.1.4-SNAPSHOT.ja
r:/Library/Java/JavaVirtualMachines/jdk1.7.0_11.jdk/Contents/Home/lib/tools.jar -Xms256M -Xmx1512M -XX:PermSize=128m -Xss1M -Dfile.encoding=UTF-8 org.ensime.server.Server /User/chu
ngonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port
Starting up Ensime...
Environment:
OS : Mac OS X
Java : Java HotSpot(TM) 64-Bit Server VM 23.6-b04, Java(TM) SE Runtime Environment 1.7.0_11-b21
Scala : version 2.10.0
Ensime : 0.9.8.9
Project waiting for init...
Server listening on 49925..
Could not write port to /User/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port.

shell returned 255

On Jul 30, 2013, at 8:21 PM, Richard Emberson wrote:

Try this.
Run Vim but do not start Vimside.

Enter the following on the command line:

:execute 'silent ! cd
/Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server
/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

See if Ensime starts.
I Note that you say that the command you record is:

cd /Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server
'/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

The port file argument should NOT be in qoutes!

Richard

On 07/29/2013 11:01 PM, Cheong Chung Onn wrote:

Hi Richard,

When I start the server manually, I can see the _ensime_port file
created immediately on the project folder and I can see the "Server"
process running. However, I am not able to start the server from VIM,
also I have increased the wait time to 15 secs.

I added a 2 diagnostic messages in autoload/vimside.vim to print out the
command for invoking Ensime server and waiting for the Ensime server
(see output below). The command seeks ok, and I tried to execute it
manually in a terminal and it works, however it does not seems to be
able to invoke within VIM. Below is the output from the VIM console

Starting Ensime Engine ...
cd /Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server
'/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'
<< added extra message here
sleep to wait for ensime << added extra message here
Get ensime port
Error detected while processing function
vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime..vimside#GetPortEnsime:

line 26:
Vimside Failed to start Ensime Server port file does not exists
line 27:
E605: Exception not caught: Vimside Failed to start Ensime Server port
file does not exists
Error detected while processing function
vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime:

line 40:
E170: Missing :endwhile


Reply to this email directly or view it on GitHub
#23 (comment).

Quis custodiet ipsos custodes

Reply to this email directly or view it on GitHub.

@chungonn
Copy link
Author

Hi Richard,

Goto ensime running, please find the output below. There was a typo in the script earlier.

:!cd /Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 && ./bin/server /Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port
java -Xbootclasspath/a:scala-library.jar:scala-reflect.jar:scala-compiler.jar:scala-actors.jar -classpath lib/asm-3.3.jar:lib/asm-commons-3.3.jar:lib/asm-tree-3.3.jar:lib/asm-util-
3.3.jar:lib/critbit-0.0.4.jar:lib/ensime_2.10-0.9.8.9.jar:lib/json-simple-1.1.jar:lib/lucene-core-3.5.0.jar:lib/org.eclipse.jdt.core-3.6.0.v_A58.jar:lib/org.scala-refactoring_2.10.
0-SNAPSHOT-0.6.1-20130201.063851-55.jar:lib/scala-actors-2.10.0.jar:lib/scala-compiler.jar:lib/scala-library.jar:lib/scala-reflect-2.10.0.jar:lib/scalariform_2.10-0.1.4-SNAPSHOT.ja
r:/Library/Java/JavaVirtualMachines/jdk1.7.0_11.jdk/Contents/Home/lib/tools.jar -Xms256M -Xmx1512M -XX:PermSize=128m -Xss1M -Dfile.encoding=UTF-8 org.ensime.server.Server /Users/ch
ungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port
Starting up Ensime...
Environment:
OS : Mac OS X
Java : Java HotSpot(TM) 64-Bit Server VM 23.6-b04, Java(TM) SE Runtime Environment 1.7.0_11-b21
Scala : version 2.10.0
Ensime : 0.9.8.9
Project waiting for init...
Server listening on 50141..
Wrote port 50141 to /Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port.

On Jul 30, 2013, at 8:21 PM, Richard Emberson wrote:

Try this.
Run Vim but do not start Vimside.

Enter the following on the command line:

:execute 'silent ! cd
/Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server
/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

See if Ensime starts.
I Note that you say that the command you record is:

cd /Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server
'/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

The port file argument should NOT be in qoutes!

Richard

On 07/29/2013 11:01 PM, Cheong Chung Onn wrote:

Hi Richard,

When I start the server manually, I can see the _ensime_port file
created immediately on the project folder and I can see the "Server"
process running. However, I am not able to start the server from VIM,
also I have increased the wait time to 15 secs.

I added a 2 diagnostic messages in autoload/vimside.vim to print out the
command for invoking Ensime server and waiting for the Ensime server
(see output below). The command seeks ok, and I tried to execute it
manually in a terminal and it works, however it does not seems to be
able to invoke within VIM. Below is the output from the VIM console

Starting Ensime Engine ...
cd /Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server
'/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'
<< added extra message here
sleep to wait for ensime << added extra message here
Get ensime port
Error detected while processing function
vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime..vimside#GetPortEnsime:

line 26:
Vimside Failed to start Ensime Server port file does not exists
line 27:
E605: Exception not caught: Vimside Failed to start Ensime Server port
file does not exists
Error detected while processing function
vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime:

line 40:
E170: Missing :endwhile


Reply to this email directly or view it on GitHub
#23 (comment).

Quis custodiet ipsos custodes

Reply to this email directly or view it on GitHub.

@chungonn
Copy link
Author

Hi Richard,

I tried remove shellEscape(portfile) and it removed the single quote from the portfile path, however it still could not start the ensime server.

However, if i manually invoke this path in either VIM and in the terminal it works.

Regards
chungonn

On Jul 30, 2013, at 8:21 PM, Richard Emberson wrote:

Try this.
Run Vim but do not start Vimside.

Enter the following on the command line:

:execute 'silent ! cd
/Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server
/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

See if Ensime starts.
I Note that you say that the command you record is:

cd /Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server
'/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

The port file argument should NOT be in qoutes!

Richard

On 07/29/2013 11:01 PM, Cheong Chung Onn wrote:

Hi Richard,

When I start the server manually, I can see the _ensime_port file
created immediately on the project folder and I can see the "Server"
process running. However, I am not able to start the server from VIM,
also I have increased the wait time to 15 secs.

I added a 2 diagnostic messages in autoload/vimside.vim to print out the
command for invoking Ensime server and waiting for the Ensime server
(see output below). The command seeks ok, and I tried to execute it
manually in a terminal and it works, however it does not seems to be
able to invoke within VIM. Below is the output from the VIM console

Starting Ensime Engine ...
cd /Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server
'/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'
<< added extra message here
sleep to wait for ensime << added extra message here
Get ensime port
Error detected while processing function
vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime..vimside#GetPortEnsime:

line 26:
Vimside Failed to start Ensime Server port file does not exists
line 27:
E605: Exception not caught: Vimside Failed to start Ensime Server port
file does not exists
Error detected while processing function
vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime:

line 40:
E170: Missing :endwhile


Reply to this email directly or view it on GitHub
#23 (comment).

Quis custodiet ipsos custodes

Reply to this email directly or view it on GitHub.

@chungonn
Copy link
Author

Hi Richard,

I found the source of the problem. It is because of the syntax error in the autoloa/vimside.vim script in line 394, see below. It should be &> instead of &>>

  execute " !" . cmd . " &> " . l:logfile . " &"

Regards
chungonn.

On Jul 30, 2013, at 8:21 PM, Richard Emberson wrote:

Try this.
Run Vim but do not start Vimside.

Enter the following on the command line:

:execute 'silent ! cd
/Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server
/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

See if Ensime starts.
I Note that you say that the command you record is:

cd /Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server
'/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

The port file argument should NOT be in qoutes!

Richard

On 07/29/2013 11:01 PM, Cheong Chung Onn wrote:

Hi Richard,

When I start the server manually, I can see the _ensime_port file
created immediately on the project folder and I can see the "Server"
process running. However, I am not able to start the server from VIM,
also I have increased the wait time to 15 secs.

I added a 2 diagnostic messages in autoload/vimside.vim to print out the
command for invoking Ensime server and waiting for the Ensime server
(see output below). The command seeks ok, and I tried to execute it
manually in a terminal and it works, however it does not seems to be
able to invoke within VIM. Below is the output from the VIM console

Starting Ensime Engine ...
cd /Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server
'/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'
<< added extra message here
sleep to wait for ensime << added extra message here
Get ensime port
Error detected while processing function
vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime..vimside#GetPortEnsime:

line 26:
Vimside Failed to start Ensime Server port file does not exists
line 27:
E605: Exception not caught: Vimside Failed to start Ensime Server port
file does not exists
Error detected while processing function
vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime:

line 40:
E170: Missing :endwhile


Reply to this email directly or view it on GitHub
#23 (comment).

Quis custodiet ipsos custodes

Reply to this email directly or view it on GitHub.

@megaannum
Copy link
Owner

What shell do you use?

echo "hi" &>> XXX

works with bash.

On 07/30/2013 07:56 AM, Cheong Chung Onn wrote:

Hi Richard,

I found the source of the problem. It is because of the syntax error in
the autoloa/vimside.vim script in line 394, see below. It should be &>
instead of &>>

execute " !" . cmd . " &> " . l:logfile . " &"

Regards
chungonn.

On Jul 30, 2013, at 8:21 PM, Richard Emberson wrote:

Try this.
Run Vim but do not start Vimside.

Enter the following on the command line:

:execute 'silent ! cd
/Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server

/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

See if Ensime starts.
I Note that you say that the command you record is:

cd /Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server

'/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

The port file argument should NOT be in qoutes!

Richard

On 07/29/2013 11:01 PM, Cheong Chung Onn wrote:

Hi Richard,

When I start the server manually, I can see the _ensime_port file
created immediately on the project folder and I can see the "Server"
process running. However, I am not able to start the server from VIM,
also I have increased the wait time to 15 secs.

I added a 2 diagnostic messages in autoload/vimside.vim to print
out the
command for invoking Ensime server and waiting for the Ensime server
(see output below). The command seeks ok, and I tried to execute it
manually in a terminal and it works, however it does not seems to be
able to invoke within VIM. Below is the output from the VIM console

Starting Ensime Engine ...
cd /Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server

'/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

<< added extra message here
sleep to wait for ensime << added extra message here
Get ensime port
Error detected while processing function

vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime..vimside#GetPortEnsime:

line 26:
Vimside Failed to start Ensime Server port file does not exists
line 27:
E605: Exception not caught: Vimside Failed to start Ensime Server port
file does not exists
Error detected while processing function

vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime:

line 40:
E170: Missing :endwhile


Reply to this email directly or view it on GitHub

#23 (comment).

Quis custodiet ipsos custodes

Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
#23 (comment).

Quis custodiet ipsos custodes

@chungonn
Copy link
Author

Am using bash. I suppose Macvim spawns a bash shell. I will confirm it later

Sent from Samsung Galaxy Note

-------- Original message --------
From: Richard Emberson notifications@github.com
Date: 31/07/2013 07:04 (GMT+08:00)
To: megaannum/vimside vimside@noreply.github.com
Cc: Cheong Chung Onn chungonn@gmail.com
Subject: Re: [vimside] How to start using vimside (#23)

What shell do you use?

echo "hi" &>> XXX

works with bash.

On 07/30/2013 07:56 AM, Cheong Chung Onn wrote:

Hi Richard,

I found the source of the problem. It is because of the syntax error in
the autoloa/vimside.vim script in line 394, see below. It should be &>
instead of &>>

execute " !" . cmd . " &> " . l:logfile . " &"

Regards
chungonn.

On Jul 30, 2013, at 8:21 PM, Richard Emberson wrote:

Try this.
Run Vim but do not start Vimside.

Enter the following on the command line:

:execute 'silent ! cd
/Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server

/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

See if Ensime starts.
I Note that you say that the command you record is:

cd /Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server

'/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

The port file argument should NOT be in qoutes!

Richard

On 07/29/2013 11:01 PM, Cheong Chung Onn wrote:

Hi Richard,

When I start the server manually, I can see the _ensime_port file
created immediately on the project folder and I can see the "Server"
process running. However, I am not able to start the server from VIM,
also I have increased the wait time to 15 secs.

I added a 2 diagnostic messages in autoload/vimside.vim to print
out the
command for invoking Ensime server and waiting for the Ensime server
(see output below). The command seeks ok, and I tried to execute it
manually in a terminal and it works, however it does not seems to be
able to invoke within VIM. Below is the output from the VIM console

Starting Ensime Engine ...
cd /Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server

'/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

<< added extra message here
sleep to wait for ensime << added extra message here
Get ensime port
Error detected while processing function

vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime..vimside#GetPortEnsime:

line 26:
Vimside Failed to start Ensime Server port file does not exists
line 27:
E605: Exception not caught: Vimside Failed to start Ensime Server port
file does not exists
Error detected while processing function

vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime:

line 40:
E170: Missing :endwhile


Reply to this email directly or view it on GitHub

#23 (comment).

Quis custodiet ipsos custodes

Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
#23 (comment).

Quis custodiet ipsos custodes

Reply to this email directly or view it on GitHub.

@chungonn
Copy link
Author

I ran within macvim - using => read !echo "hi" &>> XXX

and I got this. HTH

/bin/bash: -c: line 0: syntax error near unexpected token >' /bin/bash: -c: line 0:(echo "hi" &>> XXX) >/var/folders/xr/74pt47tx18g1f0kdtv575yl40000gp/T/vAIxaXS/1 2>&1'

shell returned 2

E485: Can't read file /var/folders/xr/74pt47tx18g1f0kdtv575yl40000gp/T/vAIxaXS/1

On Jul 31, 2013, at 7:04 AM, Richard Emberson wrote:

What shell do you use?

echo "hi" &>> XXX

works with bash.

On 07/30/2013 07:56 AM, Cheong Chung Onn wrote:

Hi Richard,

I found the source of the problem. It is because of the syntax error in
the autoloa/vimside.vim script in line 394, see below. It should be &>
instead of &>>

execute " !" . cmd . " &> " . l:logfile . " &"

Regards
chungonn.

On Jul 30, 2013, at 8:21 PM, Richard Emberson wrote:

Try this.
Run Vim but do not start Vimside.

Enter the following on the command line:

:execute 'silent ! cd
/Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server

/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

See if Ensime starts.
I Note that you say that the command you record is:

cd /Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server

'/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

The port file argument should NOT be in qoutes!

Richard

On 07/29/2013 11:01 PM, Cheong Chung Onn wrote:

Hi Richard,

When I start the server manually, I can see the _ensime_port file
created immediately on the project folder and I can see the "Server"
process running. However, I am not able to start the server from VIM,
also I have increased the wait time to 15 secs.

I added a 2 diagnostic messages in autoload/vimside.vim to print
out the
command for invoking Ensime server and waiting for the Ensime server
(see output below). The command seeks ok, and I tried to execute it
manually in a terminal and it works, however it does not seems to be
able to invoke within VIM. Below is the output from the VIM console

Starting Ensime Engine ...
cd /Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server

'/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

<< added extra message here
sleep to wait for ensime << added extra message here
Get ensime port
Error detected while processing function

vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime..vimside#GetPortEnsime:

line 26:
Vimside Failed to start Ensime Server port file does not exists
line 27:
E605: Exception not caught: Vimside Failed to start Ensime Server port
file does not exists
Error detected while processing function

vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime:

line 40:
E170: Missing :endwhile


Reply to this email directly or view it on GitHub

#23 (comment).

Quis custodiet ipsos custodes

Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
#23 (comment).

Quis custodiet ipsos custodes

Reply to this email directly or view it on GitHub.

@megaannum
Copy link
Owner

The intent is to append to the existing log file
if it exists.
How would you recommend I do that on macvim?
I can always test for macvim (or add an Option
allowing one to set their "unix" flavor).

On 07/30/2013 04:48 PM, Cheong Chung Onn wrote:

I ran within macvim - using => read !echo "hi" &>> XXX

and I got this. HTH

/bin/bash: -c: line 0: syntax error near unexpected token >' /bin/bash: -c: line 0:(echo "hi" &>> XXX)

/var/folders/xr/74pt47tx18g1f0kdtv575yl40000gp/T/vAIxaXS/1 2>&1'

shell returned 2

E485: Can't read file
/var/folders/xr/74pt47tx18g1f0kdtv575yl40000gp/T/vAIxaXS/1

On Jul 31, 2013, at 7:04 AM, Richard Emberson wrote:

What shell do you use?

echo "hi" &>> XXX

works with bash.

On 07/30/2013 07:56 AM, Cheong Chung Onn wrote:

Hi Richard,

I found the source of the problem. It is because of the syntax
error in
the autoloa/vimside.vim script in line 394, see below. It should be &>
instead of &>>

execute " !" . cmd . " &> " . l:logfile . " &"

Regards
chungonn.

On Jul 30, 2013, at 8:21 PM, Richard Emberson wrote:

Try this.
Run Vim but do not start Vimside.

Enter the following on the command line:

:execute 'silent ! cd
/Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server

/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

See if Ensime starts.
I Note that you say that the command you record is:

cd /Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server

'/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

The port file argument should NOT be in qoutes!

Richard

On 07/29/2013 11:01 PM, Cheong Chung Onn wrote:

Hi Richard,

When I start the server manually, I can see the _ensime_port file
created immediately on the project folder and I can see the
"Server"
process running. However, I am not able to start the server
from VIM,
also I have increased the wait time to 15 secs.

I added a 2 diagnostic messages in autoload/vimside.vim to print
out the
command for invoking Ensime server and waiting for the Ensime
server
(see output below). The command seeks ok, and I tried to
execute it
manually in a terminal and it works, however it does not seems
to be
able to invoke within VIM. Below is the output from the VIM
console

Starting Ensime Engine ...
cd /Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server

'/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

<< added extra message here
sleep to wait for ensime << added extra message here
Get ensime port
Error detected while processing function

vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime..vimside#GetPortEnsime:

line 26:
Vimside Failed to start Ensime Server port file does not exists
line 27:
E605: Exception not caught: Vimside Failed to start Ensime
Server port
file does not exists
Error detected while processing function

vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime:

line 40:
E170: Missing :endwhile


Reply to this email directly or view it on GitHub

#23 (comment).

Quis custodiet ipsos custodes

Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub

#23 (comment).

Quis custodiet ipsos custodes

Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
#23 (comment).

Quis custodiet ipsos custodes

@chungonn
Copy link
Author

I did thought about having a switch to accommodate 'macvim' problem however I managed to find this which has the same problem i encountered and with the solution :) http://stackoverflow.com/questions/876239/bash-redirect-and-append-both-stdout-and-stderr

On Jul 31, 2013, at 7:56 AM, Richard Emberson wrote:

The intent is to append to the existing log file
if it exists.
How would you recommend I do that on macvim?
I can always test for macvim (or add an Option
allowing one to set their "unix" flavor).

On 07/30/2013 04:48 PM, Cheong Chung Onn wrote:

I ran within macvim - using => read !echo "hi" &>> XXX

and I got this. HTH

/bin/bash: -c: line 0: syntax error near unexpected token >' /bin/bash: -c: line 0:(echo "hi" &>> XXX)

/var/folders/xr/74pt47tx18g1f0kdtv575yl40000gp/T/vAIxaXS/1 2>&1'

shell returned 2

E485: Can't read file
/var/folders/xr/74pt47tx18g1f0kdtv575yl40000gp/T/vAIxaXS/1

On Jul 31, 2013, at 7:04 AM, Richard Emberson wrote:

What shell do you use?

echo "hi" &>> XXX

works with bash.

On 07/30/2013 07:56 AM, Cheong Chung Onn wrote:

Hi Richard,

I found the source of the problem. It is because of the syntax
error in
the autoloa/vimside.vim script in line 394, see below. It should be &>
instead of &>>

execute " !" . cmd . " &> " . l:logfile . " &"

Regards
chungonn.

On Jul 30, 2013, at 8:21 PM, Richard Emberson wrote:

Try this.
Run Vim but do not start Vimside.

Enter the following on the command line:

:execute 'silent ! cd
/Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server

/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

See if Ensime starts.
I Note that you say that the command you record is:

cd /Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server

'/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

The port file argument should NOT be in qoutes!

Richard

On 07/29/2013 11:01 PM, Cheong Chung Onn wrote:

Hi Richard,

When I start the server manually, I can see the _ensime_port file
created immediately on the project folder and I can see the
"Server"
process running. However, I am not able to start the server
from VIM,
also I have increased the wait time to 15 secs.

I added a 2 diagnostic messages in autoload/vimside.vim to print
out the
command for invoking Ensime server and waiting for the Ensime
server
(see output below). The command seeks ok, and I tried to
execute it
manually in a terminal and it works, however it does not seems
to be
able to invoke within VIM. Below is the output from the VIM
console

Starting Ensime Engine ...
cd /Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server

'/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

<< added extra message here
sleep to wait for ensime << added extra message here
Get ensime port
Error detected while processing function

vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime..vimside#GetPortEnsime:

line 26:
Vimside Failed to start Ensime Server port file does not exists
line 27:
E605: Exception not caught: Vimside Failed to start Ensime
Server port
file does not exists
Error detected while processing function

vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime:

line 40:
E170: Missing :endwhile


Reply to this email directly or view it on GitHub

#23 (comment).

Quis custodiet ipsos custodes

Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub

#23 (comment).

Quis custodiet ipsos custodes

Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
#23 (comment).

Quis custodiet ipsos custodes

Reply to this email directly or view it on GitHub.

@chungonn
Copy link
Author

I am surprised that my bash is version 3.2.48(1)-release and that is the problem... I am using OSX Lion upgraded from Snow Leopard

On Jul 31, 2013, at 7:56 AM, Richard Emberson wrote:

The intent is to append to the existing log file
if it exists.
How would you recommend I do that on macvim?
I can always test for macvim (or add an Option
allowing one to set their "unix" flavor).

On 07/30/2013 04:48 PM, Cheong Chung Onn wrote:

I ran within macvim - using => read !echo "hi" &>> XXX

and I got this. HTH

/bin/bash: -c: line 0: syntax error near unexpected token >' /bin/bash: -c: line 0:(echo "hi" &>> XXX)

/var/folders/xr/74pt47tx18g1f0kdtv575yl40000gp/T/vAIxaXS/1 2>&1'

shell returned 2

E485: Can't read file
/var/folders/xr/74pt47tx18g1f0kdtv575yl40000gp/T/vAIxaXS/1

On Jul 31, 2013, at 7:04 AM, Richard Emberson wrote:

What shell do you use?

echo "hi" &>> XXX

works with bash.

On 07/30/2013 07:56 AM, Cheong Chung Onn wrote:

Hi Richard,

I found the source of the problem. It is because of the syntax
error in
the autoloa/vimside.vim script in line 394, see below. It should be &>
instead of &>>

execute " !" . cmd . " &> " . l:logfile . " &"

Regards
chungonn.

On Jul 30, 2013, at 8:21 PM, Richard Emberson wrote:

Try this.
Run Vim but do not start Vimside.

Enter the following on the command line:

:execute 'silent ! cd
/Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server

/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

See if Ensime starts.
I Note that you say that the command you record is:

cd /Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server

'/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

The port file argument should NOT be in qoutes!

Richard

On 07/29/2013 11:01 PM, Cheong Chung Onn wrote:

Hi Richard,

When I start the server manually, I can see the _ensime_port file
created immediately on the project folder and I can see the
"Server"
process running. However, I am not able to start the server
from VIM,
also I have increased the wait time to 15 secs.

I added a 2 diagnostic messages in autoload/vimside.vim to print
out the
command for invoking Ensime server and waiting for the Ensime
server
(see output below). The command seeks ok, and I tried to
execute it
manually in a terminal and it works, however it does not seems
to be
able to invoke within VIM. Below is the output from the VIM
console

Starting Ensime Engine ...
cd /Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server

'/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

<< added extra message here
sleep to wait for ensime << added extra message here
Get ensime port
Error detected while processing function

vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime..vimside#GetPortEnsime:

line 26:
Vimside Failed to start Ensime Server port file does not exists
line 27:
E605: Exception not caught: Vimside Failed to start Ensime
Server port
file does not exists
Error detected while processing function

vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime:

line 40:
E170: Missing :endwhile


Reply to this email directly or view it on GitHub

#23 (comment).

Quis custodiet ipsos custodes

Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub

#23 (comment).

Quis custodiet ipsos custodes

Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
#23 (comment).

Quis custodiet ipsos custodes

Reply to this email directly or view it on GitHub.

@chungonn
Copy link
Author

Hi Richard,

I am trying to upgrade my bash to version 4.2 now. I suggest you stay with your current implementation and put a cautionary note to this issue.

Regards
chungonn

On Jul 31, 2013, at 7:56 AM, Richard Emberson wrote:

The intent is to append to the existing log file
if it exists.
How would you recommend I do that on macvim?
I can always test for macvim (or add an Option
allowing one to set their "unix" flavor).

On 07/30/2013 04:48 PM, Cheong Chung Onn wrote:

I ran within macvim - using => read !echo "hi" &>> XXX

and I got this. HTH

/bin/bash: -c: line 0: syntax error near unexpected token >' /bin/bash: -c: line 0:(echo "hi" &>> XXX)

/var/folders/xr/74pt47tx18g1f0kdtv575yl40000gp/T/vAIxaXS/1 2>&1'

shell returned 2

E485: Can't read file
/var/folders/xr/74pt47tx18g1f0kdtv575yl40000gp/T/vAIxaXS/1

On Jul 31, 2013, at 7:04 AM, Richard Emberson wrote:

What shell do you use?

echo "hi" &>> XXX

works with bash.

On 07/30/2013 07:56 AM, Cheong Chung Onn wrote:

Hi Richard,

I found the source of the problem. It is because of the syntax
error in
the autoloa/vimside.vim script in line 394, see below. It should be &>
instead of &>>

execute " !" . cmd . " &> " . l:logfile . " &"

Regards
chungonn.

On Jul 30, 2013, at 8:21 PM, Richard Emberson wrote:

Try this.
Run Vim but do not start Vimside.

Enter the following on the command line:

:execute 'silent ! cd
/Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server

/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

See if Ensime starts.
I Note that you say that the command you record is:

cd /Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server

'/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

The port file argument should NOT be in qoutes!

Richard

On 07/29/2013 11:01 PM, Cheong Chung Onn wrote:

Hi Richard,

When I start the server manually, I can see the _ensime_port file
created immediately on the project folder and I can see the
"Server"
process running. However, I am not able to start the server
from VIM,
also I have increased the wait time to 15 secs.

I added a 2 diagnostic messages in autoload/vimside.vim to print
out the
command for invoking Ensime server and waiting for the Ensime
server
(see output below). The command seeks ok, and I tried to
execute it
manually in a terminal and it works, however it does not seems
to be
able to invoke within VIM. Below is the output from the VIM
console

Starting Ensime Engine ...
cd /Users/chungonn/.vim/vim-addons/ensime/ensime_2.10.0-0.9.8.9 &&
./bin/server

'/Users/chungonn/.vim/bundle/vimside/data/vimside/projects/simple/_ensime_port'

<< added extra message here
sleep to wait for ensime << added extra message here
Get ensime port
Error detected while processing function

vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime..vimside#GetPortEnsime:

line 26:
Vimside Failed to start Ensime Server port file does not exists
line 27:
E605: Exception not caught: Vimside Failed to start Ensime
Server port
file does not exists
Error detected while processing function

vimside#command#StartEnsime..vimside#command#ensime#Start..vimside#StartEnsime:

line 40:
E170: Missing :endwhile


Reply to this email directly or view it on GitHub

#23 (comment).

Quis custodiet ipsos custodes

Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub

#23 (comment).

Quis custodiet ipsos custodes

Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
#23 (comment).

Quis custodiet ipsos custodes

Reply to this email directly or view it on GitHub.

@justinmk
Copy link

@chungonn , I don't think that's necessary. Rather, the echo "hi" &>> XXX syntax just needs to be changed to echo "hi" >> XXX 2>&1. I just verified that this works on MacVim with bash 3.2.

And yes, Mac OS is notorious for having older unix tools. Homebrew helps, but upgrading bash is not something most people are going to want to do. It would hurt vimside adoption to require bash 4.x.

BTW, &> works just fine in bash 3.2. Only &>> requires bash 4.x, strangely.

@chungonn
Copy link
Author

Yes I have upgraded to bash 4.2. I have suggested that a cautionary note be placed to alert the unwary ones esp. those using macvim.

On Jul 31, 2013, at 10:01 AM, justinmk wrote:

@chungonn , I don't think that's necessary. Rather, the echo "hi" &>> XXX syntax just needs to be changed to echo "hi" >> XXX 2>&1. I just verified that this works on MacVim.

And yes, Mac OS is notorious for having older unix tools. Homebrew helps, but upgrading bash is not something most people are going to want to do. It would hurt vimside adoption to require bash 4.x.

BTW, &> works just fine in bash 3.2. Only &>> requires bash 4.x, strangely.


Reply to this email directly or view it on GitHub.

@justinmk
Copy link

Again, upgrading to bash 4.x is not necessary. See my previous comment. It just requires that bash 3.x-compatible syntax be used in vimside's code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants