Add eclim
This commit is contained in:
parent
41d88859c6
commit
000e1a1263
210 changed files with 31990 additions and 0 deletions
339
.vim/bundle/eclim/eclim/autoload/eclim.vim
Normal file
339
.vim/bundle/eclim/eclim/autoload/eclim.vim
Normal file
|
|
@ -0,0 +1,339 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" Plugin that integrates vim with the eclipse plugin eclim (ECLipse
|
||||
" IMproved).
|
||||
"
|
||||
" This plugin contains shared functions that can be used regardless of the
|
||||
" current file type being edited.
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Global Variables {{{
|
||||
if !exists("g:EclimShowErrors")
|
||||
let g:EclimShowErrors = 1
|
||||
endif
|
||||
" }}}
|
||||
|
||||
" Script Variables {{{
|
||||
let s:command_ping = '-command ping'
|
||||
let s:command_settings = '-command settings'
|
||||
let s:command_settings_update = '-command settings_update -s "<settings>"'
|
||||
let s:command_shutdown = "-command shutdown"
|
||||
let s:connect= '^connect: .*$'
|
||||
|
||||
" list of commands that may fail using system() call, so using a temp file
|
||||
" instead.
|
||||
let s:exec_commands = ['java_complete']
|
||||
|
||||
let g:eclimd_running = 1
|
||||
" }}}
|
||||
|
||||
function! eclim#Execute(command, ...) " {{{
|
||||
" Optional args:
|
||||
" options {
|
||||
" One of the following to determine the eclimd instance to use, honored in
|
||||
" the order shown here:
|
||||
" instance: dictionary representing an eclimd instance.
|
||||
" project: project name
|
||||
" workspace: workspace path
|
||||
" dir: directory path to use as the current dir
|
||||
" exec: 1 to execute the command using execute instead of system.
|
||||
" raw: 1 to get the result without evaluating as json
|
||||
" }
|
||||
|
||||
if exists('g:EclimDisabled')
|
||||
return
|
||||
endif
|
||||
|
||||
" eclimd appears to be down, so exit early if in an autocmd
|
||||
if !g:eclimd_running && expand('<abuf>') != ''
|
||||
" check for file created by eclimd to signal that it is running.
|
||||
if !eclim#EclimAvailable()
|
||||
return
|
||||
endif
|
||||
endif
|
||||
|
||||
let g:eclimd_running = 1
|
||||
|
||||
let command = '-editor vim ' . a:command
|
||||
|
||||
" encode special characters
|
||||
" http://www.w3schools.com/TAGS/ref_urlencode.asp
|
||||
let command = substitute(command, '\*', '%2A', 'g')
|
||||
let command = substitute(command, '\$', '%24', 'g')
|
||||
let command = substitute(command, '<', '%3C', 'g')
|
||||
let command = substitute(command, '>', '%3E', 'g')
|
||||
|
||||
" determine the eclimd instance to use
|
||||
let options = a:0 ? a:1 : {}
|
||||
let instance = get(options, 'instance', {})
|
||||
if len(instance) == 0
|
||||
let workspace = ''
|
||||
|
||||
let project = get(options, 'project', '')
|
||||
if project != ''
|
||||
let workspace = eclim#project#util#GetProjectWorkspace(project)
|
||||
endif
|
||||
if workspace == ''
|
||||
let workspace = get(options, 'workspace', '')
|
||||
endif
|
||||
|
||||
let dir = workspace != '' ? workspace : get(options, 'dir', '')
|
||||
let chosen = eclim#client#nailgun#ChooseEclimdInstance(dir)
|
||||
if type(chosen) != g:DICT_TYPE
|
||||
return
|
||||
endif
|
||||
let instance = chosen
|
||||
endif
|
||||
|
||||
let exec = get(options, 'exec', 0)
|
||||
let [retcode, result] = eclim#client#nailgun#Execute(instance, command, exec)
|
||||
let result = substitute(result, '\n$', '', '')
|
||||
|
||||
" not sure this is the best place to handle this, but when using the python
|
||||
" client, the result has a trailing ctrl-m on windows. also account for
|
||||
" running under cygwin vim.
|
||||
if has('win32') || has('win64') || has('win32unix')
|
||||
let result = substitute(result, "\<c-m>$", '', '')
|
||||
endif
|
||||
|
||||
" an echo during startup causes an annoying issue with vim.
|
||||
"call eclim#util#Echo(' ')
|
||||
|
||||
" check for errors
|
||||
let error = ''
|
||||
if result =~ '^[^\n]*Exception:\?[^\n]*\n\s\+\<at\> ' ||
|
||||
\ result =~ '^[^\n]*ResourceException(.\{-})\[[0-9]\+\]:[^\n]*\n\s\+\<at\> '
|
||||
if g:EclimLogLevel < 10
|
||||
let error = substitute(result, '\(.\{-}\)\n.*', '\1', '')
|
||||
else
|
||||
let error = result
|
||||
endif
|
||||
elseif retcode
|
||||
let error = result
|
||||
endif
|
||||
|
||||
if retcode || error != ''
|
||||
if g:EclimShowErrors
|
||||
if error =~ s:connect
|
||||
" eclimd is not running, disable further eclimd calls
|
||||
let g:eclimd_running = 0
|
||||
|
||||
" if we are not in an autocmd or the autocmd is for an acwrite buffer,
|
||||
" alert the user that eclimd is not running.
|
||||
if expand('<abuf>') == '' || &buftype == 'acwrite'
|
||||
call eclim#util#EchoWarning(
|
||||
\ "unable to connect to eclimd (port: " . instance.port . ") - " . error)
|
||||
endif
|
||||
else
|
||||
let error = error . "\n" .
|
||||
\ 'while executing command (port: ' . instance.port . '): ' . command
|
||||
" if we are not in an autocmd or in a autocmd for an acwrite buffer,
|
||||
" echo the error, otherwise just log it.
|
||||
if expand('<abuf>') == '' || &buftype == 'acwrite'
|
||||
call eclim#util#EchoError(error)
|
||||
else
|
||||
call eclim#util#EchoDebug(error)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
return
|
||||
endif
|
||||
|
||||
let raw = get(options, 'raw', 0)
|
||||
return result != '' && !raw ? eval(result) : result
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#Disable() " {{{
|
||||
if !exists('g:EclimDisabled')
|
||||
let g:EclimDisabled = 1
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#Enable() " {{{
|
||||
if exists('g:EclimDisabled')
|
||||
unlet g:EclimDisabled
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#EclimAvailable() " {{{
|
||||
let instances = eclim#UserHome() . '/.eclim/.eclimd_instances'
|
||||
return filereadable(instances)
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#PingEclim(echo, ...) " {{{
|
||||
" If echo is non 0, then the result is echoed to the user.
|
||||
" Optional args:
|
||||
" workspace
|
||||
|
||||
let workspace = a:0 ? a:1 : ''
|
||||
if a:echo
|
||||
let result = eclim#Execute(s:command_ping, {'workspace': workspace})
|
||||
if type(result) == g:DICT_TYPE
|
||||
call eclim#util#Echo(
|
||||
\ 'eclim ' . result.eclim . "\n" .
|
||||
\ 'eclipse ' . result.eclipse)
|
||||
endif
|
||||
else
|
||||
let savedErr = g:EclimShowErrors
|
||||
let savedLog = g:EclimLogLevel
|
||||
let g:EclimShowErrors = 0
|
||||
let g:EclimLogLevel = 0
|
||||
|
||||
let result = eclim#Execute(s:command_ping, {'workspace': workspace})
|
||||
|
||||
let g:EclimShowErrors = savedErr
|
||||
let g:EclimLogLevel = savedLog
|
||||
|
||||
return type(result) == g:DICT_TYPE
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#ParseSettingErrors(errors) " {{{
|
||||
let errors = []
|
||||
for error in a:errors
|
||||
let setting = substitute(error, '^\(.\{-}\): .*', '\1', '')
|
||||
let message = substitute(error, '^.\{-}: \(.*\)', '\1', '')
|
||||
let line = search('^\s*' . setting . '\s*=', 'cnw')
|
||||
call add(errors, {
|
||||
\ 'bufnr': bufnr('%'),
|
||||
\ 'lnum': line > 0 ? line : 1,
|
||||
\ 'text': message,
|
||||
\ 'type': 'e'
|
||||
\ })
|
||||
endfor
|
||||
return errors
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#SaveSettings(command, project) " {{{
|
||||
" don't check modified since undo seems to not set the modified flag
|
||||
"if &modified
|
||||
let tempfile = substitute(tempname(), '\', '/', 'g')
|
||||
|
||||
" get all lines, filtering out comments and blank lines
|
||||
let lines = filter(getline(1, line('$')), 'v:val !~ "^\\s*\\(#\\|$\\)"')
|
||||
|
||||
" convert lines into a settings dict
|
||||
let index = 0
|
||||
let settings = {}
|
||||
let pattern = '^\s*\([[:alnum:]_.-]\+\)\s*=\s*\(.*\)'
|
||||
while index < len(lines)
|
||||
if lines[index] =~ pattern
|
||||
let name = substitute(lines[index], pattern, '\1', '')
|
||||
let value = substitute(lines[index], pattern, '\2', '')
|
||||
while value =~ '\\$'
|
||||
let index += 1
|
||||
let value = substitute(value, '\\$', '', '')
|
||||
let value .= substitute(lines[index], '^\s*', '', '')
|
||||
endwhile
|
||||
let settings[name] = value
|
||||
endif
|
||||
let index += 1
|
||||
endwhile
|
||||
call writefile([string(settings)], tempfile)
|
||||
|
||||
if has('win32unix')
|
||||
let tempfile = eclim#cygwin#WindowsPath(tempfile)
|
||||
endif
|
||||
|
||||
let command = a:command
|
||||
let command = substitute(command, '<project>', a:project, '')
|
||||
let command = substitute(command, '<settings>', tempfile, '')
|
||||
|
||||
if exists('b:eclimd_instance')
|
||||
let result = eclim#Execute(command, {'instance': b:eclimd_instance})
|
||||
else
|
||||
let result = eclim#Execute(command)
|
||||
endif
|
||||
|
||||
if type(result) == g:LIST_TYPE
|
||||
call eclim#util#EchoError
|
||||
\ ("Operation contained errors. See location list for details.")
|
||||
call eclim#util#SetLocationList(eclim#ParseSettingErrors(result))
|
||||
else
|
||||
call eclim#util#ClearLocationList()
|
||||
call eclim#util#Echo(result)
|
||||
endif
|
||||
|
||||
setlocal nomodified
|
||||
"endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#Settings(workspace) " {{{
|
||||
let instance = eclim#client#nailgun#ChooseEclimdInstance(a:workspace)
|
||||
if type(instance) != g:DICT_TYPE
|
||||
return
|
||||
endif
|
||||
|
||||
let settings = eclim#Execute(s:command_settings, {'instance': instance})
|
||||
if type(settings) != g:LIST_TYPE
|
||||
return
|
||||
endif
|
||||
|
||||
let content = ['# Global settings for workspace: ' . instance.workspace, '']
|
||||
let path = ''
|
||||
for setting in settings
|
||||
if setting.path != path
|
||||
if path != ''
|
||||
let content += ['# }', '']
|
||||
endif
|
||||
let path = setting.path
|
||||
call add(content, '# ' . path . ' {')
|
||||
endif
|
||||
let description = split(setting.description, '\n')
|
||||
let content += map(description, "'\t# ' . v:val")
|
||||
call add(content, "\t" . setting.name . '=' . setting.value)
|
||||
endfor
|
||||
if path != ''
|
||||
call add(content, '# }')
|
||||
endif
|
||||
|
||||
call eclim#util#TempWindow("Eclim_Global_Settings", content)
|
||||
setlocal buftype=acwrite
|
||||
setlocal filetype=jproperties
|
||||
setlocal noreadonly
|
||||
setlocal modifiable
|
||||
setlocal foldmethod=marker
|
||||
setlocal foldmarker={,}
|
||||
let b:eclimd_instance = instance
|
||||
|
||||
augroup eclim_settings
|
||||
autocmd! BufWriteCmd <buffer>
|
||||
exec 'autocmd BufWriteCmd <buffer> ' .
|
||||
\ 'call eclim#SaveSettings(s:command_settings_update, "")'
|
||||
augroup END
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#ShutdownEclim() " {{{
|
||||
call eclim#Execute(s:command_shutdown)
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#UserHome() " {{{
|
||||
let home = expand('$HOME')
|
||||
if has('win32unix')
|
||||
let home = eclim#cygwin#WindowsHome()
|
||||
elseif has('win32') || has('win64')
|
||||
let home = expand('$USERPROFILE')
|
||||
endif
|
||||
return substitute(home, '\', '/', 'g')
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
195
.vim/bundle/eclim/eclim/autoload/eclim/client/nailgun.vim
Normal file
195
.vim/bundle/eclim/eclim/autoload/eclim/client/nailgun.vim
Normal file
|
|
@ -0,0 +1,195 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" License: {{{
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Global Variables {{{
|
||||
if !exists("g:EclimNailgunKeepAlive")
|
||||
" keepAlive flag - can be re-defined in the user ~/.vimrc .
|
||||
" Read once, on client initialization. Subsequent changes of
|
||||
" this flag in run-time has no effect.
|
||||
let g:EclimNailgunKeepAlive = 0
|
||||
endif
|
||||
" }}}
|
||||
|
||||
function! eclim#client#nailgun#ChooseEclimdInstance(...) " {{{
|
||||
" Function which prompts the user to pick the target workspace and returns
|
||||
" their choice or if only one workspace is active simply return it without
|
||||
" prompting the user. If the optional 'dir' argument is supplied and that dir
|
||||
" is a subdirectory of one of the workspaces, then that workspace will be
|
||||
" returned.
|
||||
" Option args:
|
||||
" dir
|
||||
|
||||
let instances = eclim#client#nailgun#GetEclimdInstances()
|
||||
if type(instances) == g:NUMBER_TYPE
|
||||
call eclim#util#Echo(printf(
|
||||
\ 'No eclimd instances found running (eclimd created file not found %s)',
|
||||
\ eclim#UserHome() . '/.eclim/.eclimd_instances'))
|
||||
return
|
||||
endif
|
||||
|
||||
if len(instances) == 1
|
||||
return instances[keys(instances)[0]]
|
||||
endif
|
||||
|
||||
if len(instances) > 1
|
||||
let path = a:0 && a:1 != '' ? a:1 : expand('%:p')
|
||||
if path == ''
|
||||
let path = getcwd() . '/'
|
||||
endif
|
||||
let path = substitute(path, '\', '/', 'g')
|
||||
|
||||
" when we are in a temp window, use the initiating filename
|
||||
if &buftype != '' && exists('b:filename')
|
||||
let path = b:filename
|
||||
endif
|
||||
|
||||
" project inside of a workspace dir
|
||||
for workspace in keys(instances)
|
||||
if path =~ '^' . workspace
|
||||
return instances[workspace]
|
||||
endif
|
||||
endfor
|
||||
|
||||
" project outside of a workspace dir
|
||||
let project = eclim#project#util#GetProject(path)
|
||||
if len(project) > 0
|
||||
return get(instances, project.workspace, 0)
|
||||
endif
|
||||
|
||||
let workspaces = keys(instances)
|
||||
let response = eclim#util#PromptList(
|
||||
\ 'Muliple workspaces found, please choose the target workspace',
|
||||
\ workspaces, g:EclimInfoHighlight)
|
||||
|
||||
" user cancelled, error, etc.
|
||||
if response < 0
|
||||
return
|
||||
endif
|
||||
|
||||
return instances[workspaces[response]]
|
||||
endif
|
||||
|
||||
call eclim#util#Echo('No eclimd instances found running.')
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#client#nailgun#GetEclimdInstances() " {{{
|
||||
let instances = {}
|
||||
let dotinstances = eclim#UserHome() . '/.eclim/.eclimd_instances'
|
||||
if filereadable(dotinstances)
|
||||
let lines = readfile(dotinstances)
|
||||
for line in lines
|
||||
if line !~ '^{'
|
||||
continue
|
||||
endif
|
||||
let values = eval(line)
|
||||
let instances[values.workspace] = values
|
||||
endfor
|
||||
return instances
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#client#nailgun#Execute(instance, command, ...) " {{{
|
||||
let exec = a:0 ? a:1 : 0
|
||||
|
||||
if !exec
|
||||
if !exists('g:EclimNailgunClient')
|
||||
call s:DetermineClient()
|
||||
endif
|
||||
|
||||
if g:EclimNailgunClient == 'python' && has('python')
|
||||
return eclim#client#python#nailgun#Execute(a:instance.port, a:command)
|
||||
endif
|
||||
endif
|
||||
|
||||
let eclim = eclim#client#nailgun#GetEclimCommand(a:instance.home)
|
||||
if string(eclim) == '0'
|
||||
return [1, g:EclimErrorReason]
|
||||
endif
|
||||
|
||||
let command = a:command
|
||||
if exec
|
||||
let command = escape(command, '%#')
|
||||
endif
|
||||
|
||||
" on windows/cygwin where cmd.exe is used, we need to escape any '^'
|
||||
" characters in the command args.
|
||||
if has('win32') || has('win64') || has('win32unix')
|
||||
let command = substitute(command, '\^', '^^', 'g')
|
||||
endif
|
||||
|
||||
let eclim .= ' --nailgun-port ' . a:instance.port . ' ' . command
|
||||
if exec
|
||||
let eclim = '!' . eclim
|
||||
endif
|
||||
|
||||
let result = eclim#util#System(eclim, exec, exec)
|
||||
return [v:shell_error, result]
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#client#nailgun#GetEclimCommand(home) " {{{
|
||||
" Gets the command to exexute eclim.
|
||||
let command = a:home . 'bin/eclim'
|
||||
|
||||
if has('win32') || has('win64') || has('win32unix')
|
||||
let command = command . (has('win95') ? '.bat' : '.cmd')
|
||||
endif
|
||||
|
||||
if !filereadable(command)
|
||||
let g:EclimErrorReason = 'Could not locate file: ' . command
|
||||
return
|
||||
endif
|
||||
|
||||
if has('win32unix')
|
||||
" in cygwin, we must use 'cmd /c' to prevent issues with eclim script +
|
||||
" some arg containing spaces causing a failure to invoke the script.
|
||||
return 'cmd /c "' . eclim#cygwin#WindowsPath(command) . '"'
|
||||
endif
|
||||
return '"' . command . '"'
|
||||
endfunction " }}}
|
||||
|
||||
function! s:DetermineClient() " {{{
|
||||
" at least one ubuntu user had serious performance issues using the python
|
||||
" client, so we are only going to default to python on windows machines
|
||||
" where there is an actual potential benefit to using it.
|
||||
if has('python') && (has('win32') || has('win64'))
|
||||
let g:EclimNailgunClient = 'python'
|
||||
else
|
||||
let g:EclimNailgunClient = 'external'
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#client#nailgun#CommandCompleteWorkspaces(argLead, cmdLine, cursorPos) " {{{
|
||||
" Custom command completion for available workspaces.
|
||||
|
||||
let cmdLine = strpart(a:cmdLine, 0, a:cursorPos)
|
||||
let args = eclim#util#ParseCmdLine(cmdLine)
|
||||
let argLead = cmdLine =~ '\s$' ? '' : args[len(args) - 1]
|
||||
|
||||
let instances = eclim#client#nailgun#GetEclimdInstances()
|
||||
let workspaces = sort(keys(instances))
|
||||
if cmdLine !~ '[^\\]\s$'
|
||||
call filter(workspaces, 'v:val =~ "^' . argLead . '"')
|
||||
endif
|
||||
|
||||
return workspaces
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
214
.vim/bundle/eclim/eclim/autoload/eclim/client/python/nailgun.py
Normal file
214
.vim/bundle/eclim/eclim/autoload/eclim/client/python/nailgun.py
Normal file
|
|
@ -0,0 +1,214 @@
|
|||
"""
|
||||
Copyright (C) 2005 - 2011 Eric Van Dewoestine
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
@author: Anton Sharonov
|
||||
@author: Eric Van Dewoestine
|
||||
"""
|
||||
import socket
|
||||
|
||||
try:
|
||||
from cStringIO import StringIO
|
||||
except:
|
||||
from StringIO import StringIO
|
||||
|
||||
class Nailgun(object):
|
||||
"""
|
||||
Client used to communicate with a nailgun server.
|
||||
"""
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
self.socket = None
|
||||
self.port = kwargs.get('port')
|
||||
self.keepAlive = int(kwargs.get('keepAlive', 0))
|
||||
self.reconnectCounter = 0
|
||||
|
||||
def send(self, cmdline):
|
||||
"""
|
||||
Sends a complete command to the nailgun server. Handles connecting to the
|
||||
server if not currently connected.
|
||||
@param cmdline command, which is sent to server, for instance
|
||||
"-command ping".
|
||||
@return tuple consisting of:
|
||||
- retcode from server (0 for success, non-0 for failure)
|
||||
- string response from server
|
||||
"""
|
||||
if not self.isConnected():
|
||||
# with keepAlive do only first reconnect
|
||||
if not self.keepAlive or self.reconnectCounter == 0:
|
||||
(retcode, result) = self.reconnect()
|
||||
if retcode:
|
||||
return (retcode, result)
|
||||
|
||||
if not self.isConnected(): # Only for keepAlive
|
||||
return (-1, "connect: ERROR - socket is not connected (nailgun.py)")
|
||||
|
||||
try: # outer try for pre python 2.5 support.
|
||||
try:
|
||||
for arg in self.parseArgs(cmdline):
|
||||
self.sendChunk("A", arg)
|
||||
|
||||
if self.keepAlive:
|
||||
self.sendChunk("K")
|
||||
|
||||
self.sendChunk("C", "org.eclim.command.Main")
|
||||
|
||||
(retcode, result) = self.processResponse()
|
||||
if self.keepAlive and retcode:
|
||||
# force reconnect on error (may not be necessary)
|
||||
self.reconnect()
|
||||
|
||||
return (retcode, result)
|
||||
except socket.error, ex:
|
||||
args = ex.args
|
||||
if len(args) > 1:
|
||||
retcode, msg = args[0], args[1]
|
||||
elif len(args):
|
||||
retcode, msg = 1, args[0]
|
||||
else:
|
||||
retcode, msg = 1, 'No message'
|
||||
return (retcode, 'send: %s' % msg)
|
||||
finally:
|
||||
if not self.keepAlive:
|
||||
try:
|
||||
self.close()
|
||||
except:
|
||||
# don't let an error on close mask any previous error.
|
||||
pass
|
||||
|
||||
def connect(self, port=None):
|
||||
"""
|
||||
Establishes the connection to specified port or if not supplied,
|
||||
uses the default.
|
||||
"""
|
||||
port = port or self.port
|
||||
try:
|
||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
sock.connect(('localhost', port))
|
||||
except socket.error, ex:
|
||||
args = ex.args
|
||||
if len(args) > 1:
|
||||
retcode, msg = args[0], args[1]
|
||||
elif len(args):
|
||||
retcode, msg = 1, args[0]
|
||||
else:
|
||||
retcode, msg = 1, 'No message'
|
||||
return (retcode, 'connect: %s' % msg)
|
||||
|
||||
self.socket = sock
|
||||
return (0, '')
|
||||
|
||||
def reconnect(self):
|
||||
if self.socket != None:
|
||||
self.close()
|
||||
self.reconnectCounter += 1
|
||||
return self.connect()
|
||||
|
||||
def close(self):
|
||||
self.socket.close()
|
||||
self.socket = None
|
||||
|
||||
def isConnected(self):
|
||||
return self.socket != None
|
||||
|
||||
def parseArgs(self, cmdline):
|
||||
# FIXME: doesn't handle escaping of spaces/quotes yet (may never need to)
|
||||
args = []
|
||||
arg = ''
|
||||
quote = ''
|
||||
for char in cmdline:
|
||||
if char == ' ' and not quote:
|
||||
if arg:
|
||||
args.append(arg)
|
||||
arg = ''
|
||||
elif char == '"' or char == "'":
|
||||
if quote and char == quote:
|
||||
quote = ''
|
||||
elif not quote:
|
||||
quote = char
|
||||
else:
|
||||
arg += char
|
||||
else:
|
||||
arg += char
|
||||
|
||||
if arg:
|
||||
args.append(arg)
|
||||
|
||||
return args
|
||||
|
||||
def sendChunk(self, chunkType, text=''):
|
||||
"""
|
||||
Sends a nailgun 'chunk' to the server.
|
||||
"""
|
||||
#print("sendChunk " + chunkType + " " + text)
|
||||
length = len(text)
|
||||
str = "%c%c%c%c%c" % (
|
||||
(length / (65536*256)) % 256,
|
||||
(length / 65536) % 256,
|
||||
(length / 256) % 256,
|
||||
length % 256,
|
||||
chunkType)
|
||||
nbytes = self.socket.sendall(str)
|
||||
nbytes = self.socket.sendall(text)
|
||||
|
||||
def processResponse(self):
|
||||
result = StringIO()
|
||||
exit = 0
|
||||
exitFlag = 1 # expecting 1 times exit chunk
|
||||
while exitFlag > 0:
|
||||
answer = self.recvBlocked(5)
|
||||
if len(answer) < 5:
|
||||
print("error: socket closed unexpectedly\n")
|
||||
return None
|
||||
lenPayload = ord(answer[0]) * 65536 * 256 \
|
||||
+ ord(answer[1]) * 65536 \
|
||||
+ ord(answer[2]) * 256 \
|
||||
+ ord(answer[3])
|
||||
#print("lenPayload detected : %d" % lenPayload)
|
||||
chunkType = answer[4]
|
||||
if chunkType == "1":
|
||||
# STDOUT
|
||||
result.write(self.recvToFD(1, answer, lenPayload))
|
||||
elif chunkType == "2":
|
||||
# STDERR
|
||||
result.write(self.recvToFD(2, answer, lenPayload))
|
||||
elif chunkType == "X":
|
||||
exitFlag = exitFlag - 1
|
||||
exit = int(self.recvToFD(2, answer, lenPayload))
|
||||
else:
|
||||
print("error: unknown chunk type = %d\n" % chunkType)
|
||||
exitFlag = 0
|
||||
|
||||
return [exit, result.getvalue()]
|
||||
|
||||
def recvBlocked(self, lenPayload):
|
||||
"""
|
||||
Receives until all data is read - necessary because usual recv sometimes
|
||||
returns with number of bytes read less then asked.
|
||||
"""
|
||||
received = ""
|
||||
while (len(received) < lenPayload):
|
||||
received = received + self.socket.recv(lenPayload - len(received))
|
||||
return received
|
||||
|
||||
def recvToFD(self, destFD, buf, lenPayload):
|
||||
"""
|
||||
This function just mimics the function with the same name from the C
|
||||
client. We don't really care which file descriptor the server tells us to
|
||||
write to - STDOUT and STDERR are the same on VIM side (see eclim.bat,
|
||||
"2>&1" at the end of command).
|
||||
"""
|
||||
received = self.recvBlocked(lenPayload)
|
||||
return received
|
||||
115
.vim/bundle/eclim/eclim/autoload/eclim/client/python/nailgun.vim
Normal file
115
.vim/bundle/eclim/eclim/autoload/eclim/client/python/nailgun.vim
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
" Author: Anton Sharonov
|
||||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2010 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Script Variables {{{
|
||||
let s:python_dir = expand("<sfile>:h")
|
||||
" }}}
|
||||
|
||||
" Execute(port, command) {{{
|
||||
" Sends to the eclimd server command, supplied as argument string.
|
||||
" Returns server's respond.
|
||||
function! eclim#client#python#nailgun#Execute(port, command)
|
||||
call s:InitClient(a:port)
|
||||
let result_viml = ""
|
||||
let retcode = 0
|
||||
|
||||
let begin = localtime()
|
||||
try
|
||||
python << PYTHONEOF
|
||||
command = vim.eval('a:command')
|
||||
(retcode, result) = client.send(command)
|
||||
vim.command('let retcode = %i' % retcode)
|
||||
vim.command("let result = '%s'" % result.replace("'", "''"))
|
||||
PYTHONEOF
|
||||
finally
|
||||
call eclim#util#EchoTrace(
|
||||
\ 'nailgun.py (port: ' . a:port . '): ' . a:command, localtime() - begin)
|
||||
endtry
|
||||
|
||||
return [retcode, result]
|
||||
endfunction " }}}
|
||||
|
||||
" Reconnect(port) {{{
|
||||
" Does unconditional reconnect of the python_if
|
||||
" (useful to manual recover from errors in the python_if)
|
||||
function! eclim#client#python#nailgun#Reconnect(port)
|
||||
call s:InitClient(a:port)
|
||||
python << PYTHONEOF
|
||||
client.reconnect()
|
||||
PYTHONEOF
|
||||
endfunction " }}}
|
||||
|
||||
" SetKeepAlive(port, value) {{{
|
||||
" Updates the in runtime value of the keepAlive flag.
|
||||
function! eclim#client#python#nailgun#SetKeepAlive(port, value)
|
||||
call s:InitClient(a:port)
|
||||
python << PYTHONEOF
|
||||
client.keepAlive = int(vim.eval('a:value'))
|
||||
PYTHONEOF
|
||||
endfunction " }}}
|
||||
|
||||
" GetKeepAlive(port) {{{
|
||||
" Retrieves the value of the keepAlive flag.
|
||||
function! eclim#client#python#nailgun#GetKeepAlive(port)
|
||||
call s:InitClient(a:port)
|
||||
let result = 0
|
||||
python << PYTHONEOF
|
||||
vim.command("let result = %s" % client.keepAlive)
|
||||
PYTHONEOF
|
||||
return result
|
||||
endfunction " }}}
|
||||
|
||||
" GetReconnectCounter(port) {{{
|
||||
" Retrieves the value of the reconnect counter.
|
||||
function! eclim#client#python#nailgun#GetReconnectCounter(port)
|
||||
call s:InitClient(a:port)
|
||||
let result = 0
|
||||
python << PYTHONEOF
|
||||
vim.command("let result = %d" % client.reconnectCounter)
|
||||
PYTHONEOF
|
||||
return result
|
||||
endfunction " }}}
|
||||
|
||||
" s:InitClient(port) {{{
|
||||
" Initializes the python interface to the nailgun server.
|
||||
function! s:InitClient(port)
|
||||
python << PYTHONEOF
|
||||
if not vars().has_key('clients'):
|
||||
import sys, vim
|
||||
sys.path.append(vim.eval('s:python_dir'))
|
||||
import nailgun
|
||||
|
||||
clients = {}
|
||||
|
||||
port = int(vim.eval('a:port'))
|
||||
if not clients.has_key(port):
|
||||
clients[port] = nailgun.Nailgun(
|
||||
port=port,
|
||||
keepAlive=vim.eval('g:EclimNailgunKeepAlive'),
|
||||
)
|
||||
client = clients[port]
|
||||
PYTHONEOF
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
401
.vim/bundle/eclim/eclim/autoload/eclim/common/buffers.vim
Normal file
401
.vim/bundle/eclim/eclim/autoload/eclim/common/buffers.vim
Normal file
|
|
@ -0,0 +1,401 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Global Variables {{{
|
||||
if !exists('g:EclimBuffersSort')
|
||||
let g:EclimBuffersSort = 'file'
|
||||
endif
|
||||
if !exists('g:EclimBuffersSortDirection')
|
||||
let g:EclimBuffersSortDirection = 'asc'
|
||||
endif
|
||||
if !exists('g:EclimBuffersDefaultAction')
|
||||
let g:EclimBuffersDefaultAction = g:EclimDefaultFileOpenAction
|
||||
endif
|
||||
if !exists('g:EclimOnlyExclude')
|
||||
let g:EclimOnlyExclude = '^NONE$'
|
||||
endif
|
||||
if !exists('g:EclimOnlyExcludeFixed')
|
||||
let g:EclimOnlyExcludeFixed = 1
|
||||
endif
|
||||
" }}}
|
||||
|
||||
" ScriptVariables {{{
|
||||
let s:eclim_tab_id = 0
|
||||
" }}}
|
||||
|
||||
function! eclim#common#buffers#Buffers(bang) " {{{
|
||||
" Like, :buffers, but opens a temporary buffer.
|
||||
|
||||
let options = {'maxfilelength': 0}
|
||||
let buffers = eclim#common#buffers#GetBuffers(options)
|
||||
|
||||
if g:EclimBuffersSort != ''
|
||||
call sort(buffers, 'eclim#common#buffers#BufferCompare')
|
||||
endif
|
||||
|
||||
let lines = []
|
||||
let buflist = []
|
||||
let filelength = options['maxfilelength']
|
||||
let tabid = exists('*gettabvar') ? s:GetTabId() : 0
|
||||
let tabbuffers = tabpagebuflist()
|
||||
for buffer in buffers
|
||||
let eclim_tab_id = getbufvar(buffer.bufnr, 'eclim_tab_id')
|
||||
if a:bang != '' || eclim_tab_id == '' || eclim_tab_id == tabid
|
||||
" for buffers w/ out a tab id, don't show them in the list if they
|
||||
" are active, but aren't open on the current tab.
|
||||
if a:bang == '' && buffer.status =~ 'a' && index(tabbuffers, buffer.bufnr) == -1
|
||||
continue
|
||||
endif
|
||||
|
||||
call add(lines, s:BufferEntryToLine(buffer, filelength))
|
||||
call add(buflist, buffer)
|
||||
endif
|
||||
endfor
|
||||
|
||||
call eclim#util#TempWindow('[buffers]', lines)
|
||||
|
||||
setlocal modifiable noreadonly
|
||||
call append(line('$'), ['', '" use ? to view help'])
|
||||
setlocal nomodifiable readonly
|
||||
|
||||
let b:eclim_buffers = buflist
|
||||
|
||||
" syntax
|
||||
set ft=eclim_buffers
|
||||
hi link BufferActive Special
|
||||
hi link BufferHidden Comment
|
||||
syntax match BufferActive /+\?active\s\+\(\[RO\]\)\?/
|
||||
syntax match BufferHidden /+\?hidden\s\+\(\[RO\]\)\?/
|
||||
syntax match Comment /^".*/
|
||||
|
||||
" mappings
|
||||
nnoremap <silent> <buffer> <cr> :call <SID>BufferOpen(g:EclimBuffersDefaultAction)<cr>
|
||||
nnoremap <silent> <buffer> E :call <SID>BufferOpen('edit')<cr>
|
||||
nnoremap <silent> <buffer> S :call <SID>BufferOpen('split')<cr>
|
||||
nnoremap <silent> <buffer> V :call <SID>BufferOpen('vsplit')<cr>
|
||||
nnoremap <silent> <buffer> T :call <SID>BufferOpen('tablast \| tabnew')<cr>
|
||||
nnoremap <silent> <buffer> D :call <SID>BufferDelete()<cr>
|
||||
nnoremap <silent> <buffer> R :Buffers<cr>
|
||||
|
||||
" assign to buffer var to get around weird vim issue passing list containing
|
||||
" a string w/ a '<' in it on execution of mapping.
|
||||
let b:buffers_help = [
|
||||
\ '<cr> - open buffer with default action',
|
||||
\ 'E - open with :edit',
|
||||
\ 'S - open in a new split window',
|
||||
\ 'V - open in a new vertically split window',
|
||||
\ 'T - open in a new tab',
|
||||
\ 'D - delete the buffer',
|
||||
\ 'R - refresh the buffer list',
|
||||
\ ]
|
||||
nnoremap <buffer> <silent> ?
|
||||
\ :call eclim#help#BufferHelp(b:buffers_help, 'vertical', 40)<cr>
|
||||
|
||||
"augroup eclim_buffers
|
||||
" autocmd!
|
||||
" autocmd BufAdd,BufWinEnter,BufDelete,BufWinLeave *
|
||||
" \ call eclim#common#buffers#BuffersUpdate()
|
||||
" autocmd BufUnload <buffer> autocmd! eclim_buffers
|
||||
"augroup END
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#common#buffers#BuffersToggle(bang) " {{{
|
||||
let name = eclim#util#EscapeBufferName('[buffers]')
|
||||
if bufwinnr(name) == -1
|
||||
call eclim#common#buffers#Buffers(a:bang)
|
||||
else
|
||||
exec "bdelete " . bufnr(name)
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#common#buffers#BufferCompare(buffer1, buffer2) " {{{
|
||||
exec 'let attr1 = a:buffer1.' . g:EclimBuffersSort
|
||||
exec 'let attr2 = a:buffer2.' . g:EclimBuffersSort
|
||||
let compare = attr1 == attr2 ? 0 : attr1 > attr2 ? 1 : -1
|
||||
if g:EclimBuffersSortDirection == 'desc'
|
||||
let compare = 0 - compare
|
||||
endif
|
||||
return compare
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#common#buffers#Only() " {{{
|
||||
let curwin = winnr()
|
||||
let winnum = 1
|
||||
while winnum <= winnr('$')
|
||||
let fixed = g:EclimOnlyExcludeFixed && (
|
||||
\ getwinvar(winnum, '&winfixheight') == 1 ||
|
||||
\ getwinvar(winnum, '&winfixwidth') == 1)
|
||||
let excluded = bufname(winbufnr(winnum)) =~ g:EclimOnlyExclude
|
||||
if winnum != curwin && !fixed && !excluded
|
||||
if winnum < curwin
|
||||
let curwin -= 1
|
||||
endif
|
||||
exec winnum . 'winc w'
|
||||
close
|
||||
exec curwin . 'winc w'
|
||||
continue
|
||||
endif
|
||||
let winnum += 1
|
||||
endwhile
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#common#buffers#GetBuffers(...) " {{{
|
||||
let options = a:0 ? a:1 : {}
|
||||
|
||||
redir => list
|
||||
silent buffers
|
||||
redir END
|
||||
|
||||
let buffers = []
|
||||
let maxfilelength = 0
|
||||
for entry in split(list, '\n')
|
||||
let buffer = {}
|
||||
let buffer.status = substitute(entry, '\s*[0-9]\+\s\+\(.\{-}\)\s\+".*', '\1', '')
|
||||
let buffer.path = substitute(entry, '.\{-}"\(.\{-}\)".*', '\1', '')
|
||||
let buffer.path = fnamemodify(buffer.path, ':p')
|
||||
let buffer.file = fnamemodify(buffer.path, ':p:t')
|
||||
let buffer.dir = fnamemodify(buffer.path, ':p:h')
|
||||
let buffer.bufnr = str2nr(substitute(entry, '\s*\([0-9]\+\).*', '\1', ''))
|
||||
let buffer.lnum = str2nr(substitute(entry, '.*"\s\+\w\+\s\+\(\d\+\)', '\1', ''))
|
||||
call add(buffers, buffer)
|
||||
|
||||
if len(buffer.file) > maxfilelength
|
||||
let maxfilelength = len(buffer.file)
|
||||
endif
|
||||
endfor
|
||||
|
||||
if has_key(options, 'maxfilelength')
|
||||
let options['maxfilelength'] = maxfilelength
|
||||
endif
|
||||
|
||||
return buffers
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#common#buffers#TabInit() " {{{
|
||||
let tabnr = 1
|
||||
while tabnr <= tabpagenr('$')
|
||||
let tab_id = gettabvar(tabnr, 'eclim_tab_id')
|
||||
if tab_id == ''
|
||||
let s:eclim_tab_id += 1
|
||||
call settabvar(tabnr, 'eclim_tab_id', s:eclim_tab_id)
|
||||
for bufnr in tabpagebuflist(tabnr)
|
||||
let btab_id = getbufvar(bufnr, 'eclim_tab_id')
|
||||
if btab_id == ''
|
||||
call setbufvar(bufnr, 'eclim_tab_id', s:eclim_tab_id)
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
let tabnr += 1
|
||||
endwhile
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#common#buffers#TabEnter() " {{{
|
||||
if !s:GetTabId()
|
||||
call s:SetTabId()
|
||||
endif
|
||||
|
||||
if exists('s:tab_count') && s:tab_count > tabpagenr('$')
|
||||
" delete any buffers associated with the closed tab
|
||||
let buffers = eclim#common#buffers#GetBuffers()
|
||||
for buffer in buffers
|
||||
let eclim_tab_id = getbufvar(buffer.bufnr, 'eclim_tab_id')
|
||||
" don't delete active buffers, just in case the tab has the wrong
|
||||
" eclim_tab_id
|
||||
if eclim_tab_id == s:tab_prev && buffer.status !~ 'a'
|
||||
try
|
||||
exec 'bdelete ' . buffer.bufnr
|
||||
catch /E89/
|
||||
" ignore since it happens when using bd! on the last buffer for
|
||||
" another tab.
|
||||
endtry
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#common#buffers#TabLeave() " {{{
|
||||
let s:tab_prev = s:GetTabId()
|
||||
let s:tab_count = tabpagenr('$')
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#common#buffers#TabLastOpenIn() " {{{
|
||||
if !buflisted('%')
|
||||
silent! unlet b:eclim_tab_id
|
||||
endif
|
||||
|
||||
if !s:GetTabId()
|
||||
call s:SetTabId()
|
||||
endif
|
||||
|
||||
let tabnr = 1
|
||||
let other_tab = 0
|
||||
let bufnr = bufnr('%')
|
||||
while tabnr <= tabpagenr('$')
|
||||
if tabnr != tabpagenr() &&
|
||||
\ eclim#util#ListContains(tabpagebuflist(tabnr), bufnr)
|
||||
let other_tab = tabnr
|
||||
break
|
||||
endif
|
||||
let tabnr += 1
|
||||
endwhile
|
||||
|
||||
if !exists('b:eclim_tab_id') || !other_tab
|
||||
let b:eclim_tab_id = s:GetTabId()
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#common#buffers#OpenNextHiddenTabBuffer(current) " {{{
|
||||
let allbuffers = eclim#common#buffers#GetBuffers()
|
||||
|
||||
" build list of buffers open in other tabs to exclude
|
||||
let tabbuffers = []
|
||||
let lasttab = tabpagenr('$')
|
||||
let index = 1
|
||||
while index <= lasttab
|
||||
if index != tabpagenr()
|
||||
for bnum in tabpagebuflist(index)
|
||||
call add(tabbuffers, bnum)
|
||||
endfor
|
||||
endif
|
||||
let index += 1
|
||||
endwhile
|
||||
|
||||
" build list of buffers not open in any window, and last seen on the
|
||||
" current tab.
|
||||
let hiddenbuffers = []
|
||||
for buffer in allbuffers
|
||||
let bnum = buffer.bufnr
|
||||
if bnum != a:current && index(tabbuffers, bnum) == -1 && bufwinnr(bnum) == -1
|
||||
let eclim_tab_id = getbufvar(bnum, 'eclim_tab_id')
|
||||
if eclim_tab_id != '' && eclim_tab_id != t:eclim_tab_id
|
||||
continue
|
||||
endif
|
||||
|
||||
if bnum < a:current
|
||||
call insert(hiddenbuffers, bnum)
|
||||
else
|
||||
call add(hiddenbuffers, bnum)
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
|
||||
" we found a hidden buffer, so open it
|
||||
if len(hiddenbuffers) > 0
|
||||
exec 'buffer ' . hiddenbuffers[0]
|
||||
doautocmd BufEnter
|
||||
doautocmd BufWinEnter
|
||||
doautocmd BufReadPost
|
||||
return hiddenbuffers[0]
|
||||
endif
|
||||
return 0
|
||||
endfunction " }}}
|
||||
|
||||
function! s:BufferDelete() " {{{
|
||||
let line = line('.')
|
||||
if line > len(b:eclim_buffers)
|
||||
return
|
||||
endif
|
||||
|
||||
let index = line - 1
|
||||
setlocal modifiable
|
||||
setlocal noreadonly
|
||||
exec line . ',' . line . 'delete _'
|
||||
setlocal nomodifiable
|
||||
setlocal readonly
|
||||
let buffer = b:eclim_buffers[index]
|
||||
call remove(b:eclim_buffers, index)
|
||||
|
||||
let winnr = bufwinnr(buffer.bufnr)
|
||||
if winnr != -1
|
||||
" if active in a window, go to the window to delete the buffer since that
|
||||
" keeps eclim's prevention of closing the last non-utility window working
|
||||
" properly.
|
||||
let curwin = winnr()
|
||||
exec winnr . 'winc w'
|
||||
bdelete
|
||||
exec curwin . 'winc w'
|
||||
else
|
||||
exec 'bd ' . buffer.bufnr
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! s:BufferEntryToLine(buffer, filelength) " {{{
|
||||
let line = ''
|
||||
let line .= a:buffer.status =~ '+' ? '+' : ' '
|
||||
let line .= a:buffer.status =~ 'a' ? 'active' : 'hidden'
|
||||
let line .= a:buffer.status =~ '[-=]' ? ' [RO] ' : ' '
|
||||
let line .= a:buffer.file
|
||||
|
||||
let pad = a:filelength - len(a:buffer.file) + 2
|
||||
while pad > 0
|
||||
let line .= ' '
|
||||
let pad -= 1
|
||||
endwhile
|
||||
|
||||
let line .= a:buffer.dir
|
||||
return line
|
||||
endfunction " }}}
|
||||
|
||||
function! s:BufferOpen(cmd) " {{{
|
||||
let line = line('.')
|
||||
if line > len(b:eclim_buffers)
|
||||
return
|
||||
endif
|
||||
|
||||
let file = bufname(b:eclim_buffers[line - 1].bufnr)
|
||||
let winnr = b:winnr
|
||||
close
|
||||
|
||||
" prevent opening the buffer in a split of a vertical tool window (project
|
||||
" tree, taglist, etc.)
|
||||
if exists('g:VerticalToolBuffers') && has_key(g:VerticalToolBuffers, winbufnr(winnr))
|
||||
let winnr = 1
|
||||
while has_key(g:VerticalToolBuffers, winbufnr(winnr))
|
||||
let winnr += 1
|
||||
if winnr > winnr('$')
|
||||
let winnr -= 1
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
endif
|
||||
|
||||
exec winnr . 'winc w'
|
||||
call eclim#util#GoToBufferWindowOrOpen(file, a:cmd)
|
||||
endfunction " }}}
|
||||
|
||||
function! s:GetTabId(...) " {{{
|
||||
let tabnr = a:0 ? a:1 : tabpagenr()
|
||||
" using gettabvar over t:eclim_tab_id because while autocmds are executing,
|
||||
" the tabpagenr() may return the correct tab number, but accessing
|
||||
" t:eclim_tab_id may return the value from the previously focused tab.
|
||||
return gettabvar(tabnr, 'eclim_tab_id')
|
||||
endfunction " }}}
|
||||
|
||||
function! s:SetTabId(...) " {{{
|
||||
let tabnr = a:0 ? a:1 : tabpagenr()
|
||||
let s:eclim_tab_id += 1
|
||||
" using settabvar for reason explained in s:GetTabId()
|
||||
call settabvar(tabnr, 'eclim_tab_id', s:eclim_tab_id)
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
332
.vim/bundle/eclim/eclim/autoload/eclim/common/history.vim
Normal file
332
.vim/bundle/eclim/eclim/autoload/eclim/common/history.vim
Normal file
|
|
@ -0,0 +1,332 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Global Variables {{{
|
||||
if !exists('g:EclimHistoryDiffOrientation')
|
||||
let g:EclimHistoryDiffOrientation = 'vertical'
|
||||
endif
|
||||
" }}}
|
||||
|
||||
" Script Variables {{{
|
||||
let s:command_add = '-command history_add -p "<project>" -f "<file>"'
|
||||
let s:command_list = '-command history_list -p "<project>" -f "<file>"'
|
||||
let s:command_revision =
|
||||
\ '-command history_revision -p "<project>" -f "<file>" -r <revision>'
|
||||
let s:command_clear = '-command history_clear -p "<project>" -f "<file>"'
|
||||
" }}}
|
||||
|
||||
" AddHistory() {{{
|
||||
" Adds the current state of the file to the eclipse local history (should be
|
||||
" invoked prior to saving to disk).
|
||||
function! eclim#common#history#AddHistory()
|
||||
if !filereadable(expand('%')) || !eclim#project#util#IsCurrentFileInProject(0)
|
||||
return
|
||||
endif
|
||||
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let file = eclim#project#util#GetProjectRelativeFilePath()
|
||||
let command = s:command_add
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
call eclim#Execute(command)
|
||||
endfunction " }}}
|
||||
|
||||
" History() {{{
|
||||
" Opens a temporary buffer with a list of local history revisions.
|
||||
function! eclim#common#history#History()
|
||||
if !eclim#project#util#IsCurrentFileInProject()
|
||||
return
|
||||
endif
|
||||
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let file = eclim#project#util#GetProjectRelativeFilePath()
|
||||
let command = s:command_list
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
let history = eclim#Execute(command)
|
||||
if type(history) != g:LIST_TYPE
|
||||
return
|
||||
endif
|
||||
|
||||
let lines = [file]
|
||||
let revisions = [0]
|
||||
let indent = eclim#util#GetIndent(1)
|
||||
for rev in history
|
||||
call add(lines, indent . rev.datetime . ' (' . rev.delta . ')')
|
||||
call add(revisions, rev.timestamp)
|
||||
endfor
|
||||
call add(lines, '')
|
||||
call eclim#util#TempWindow('[History]', lines)
|
||||
|
||||
setlocal modifiable noreadonly
|
||||
if !g:EclimProjectKeepLocalHistory
|
||||
call append(line('$'),
|
||||
\ '" Note: local history is current disabled: ' .
|
||||
\ 'g:EclimProjectKeepLocalHistory = ' . g:EclimProjectKeepLocalHistory)
|
||||
endif
|
||||
call append(line('$'), '" use ? to view help')
|
||||
setlocal nomodifiable readonly
|
||||
syntax match Comment /^".*/
|
||||
|
||||
let b:history_revisions = revisions
|
||||
call s:Syntax()
|
||||
|
||||
command! -count=1 HistoryDiffNext call s:DiffNextPrev(1, <count>)
|
||||
command! -count=1 HistoryDiffPrev call s:DiffNextPrev(-1, <count>)
|
||||
augroup eclim_history_window
|
||||
autocmd! BufWinLeave <buffer>
|
||||
autocmd BufWinLeave <buffer>
|
||||
\ delcommand HistoryDiffNext |
|
||||
\ delcommand HistoryDiffPrev
|
||||
augroup END
|
||||
noremap <buffer> <silent> <cr> :call <SID>View()<cr>
|
||||
noremap <buffer> <silent> d :call <SID>Diff()<cr>
|
||||
noremap <buffer> <silent> r :call <SID>Revert()<cr>
|
||||
noremap <buffer> <silent> c :call <SID>Clear(1)<cr>
|
||||
|
||||
" assign to buffer var to get around weird vim issue passing list containing
|
||||
" a string w/ a '<' in it on execution of mapping.
|
||||
let b:history_help = [
|
||||
\ '<cr> - view the entry',
|
||||
\ 'd - diff the file with the version under the cursor',
|
||||
\ 'r - revert the file to the version under the cursor',
|
||||
\ 'c - clear the history',
|
||||
\ ':HistoryDiffNext - diff the file with the next version in the history',
|
||||
\ ':HistoryDiffPrev - diff the file with the previous version in the history',
|
||||
\ ]
|
||||
nnoremap <buffer> <silent> ?
|
||||
\ :call eclim#help#BufferHelp(b:history_help, 'vertical', 50)<cr>
|
||||
endfunction " }}}
|
||||
|
||||
" HistoryClear(bang) {{{
|
||||
" Clear the history for the current file.
|
||||
function! eclim#common#history#HistoryClear(bang)
|
||||
if !eclim#project#util#IsCurrentFileInProject()
|
||||
return
|
||||
endif
|
||||
|
||||
call s:Clear(a:bang == '', expand('%:p'))
|
||||
endfunction " }}}
|
||||
|
||||
" s:View([cmd]) {{{
|
||||
" View the contents of the revision under the cursor.
|
||||
function s:View(...)
|
||||
if line('.') == 1 || line('.') > len(b:history_revisions)
|
||||
return
|
||||
endif
|
||||
|
||||
let current = b:filename
|
||||
let entry = line('.') - 1
|
||||
let revision = b:history_revisions[entry]
|
||||
if eclim#util#GoToBufferWindow(current)
|
||||
let filetype = &ft
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let file = eclim#project#util#GetProjectRelativeFilePath()
|
||||
let command = s:command_revision
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
let command = substitute(command, '<revision>', revision, '')
|
||||
let result = eclim#Execute(command)
|
||||
if result == "0"
|
||||
return
|
||||
endif
|
||||
|
||||
let cmd = len(a:000) > 0 ? a:000[0] : 'split'
|
||||
call eclim#util#GoToBufferWindowOrOpen(current . '_' . revision, cmd)
|
||||
|
||||
setlocal modifiable
|
||||
setlocal noreadonly
|
||||
|
||||
let temp = tempname()
|
||||
call writefile(split(result, '\n'), temp)
|
||||
try
|
||||
silent 1,$delete _
|
||||
silent read ++edit `=temp`
|
||||
silent 1,1delete _
|
||||
finally
|
||||
call delete(temp)
|
||||
endtry
|
||||
|
||||
exec 'setlocal filetype=' . filetype
|
||||
setlocal nomodified
|
||||
setlocal readonly
|
||||
setlocal nomodifiable
|
||||
setlocal noswapfile
|
||||
setlocal nobuflisted
|
||||
setlocal buftype=nofile
|
||||
setlocal bufhidden=delete
|
||||
doautocmd BufReadPost
|
||||
|
||||
call s:HighlightEntry(entry)
|
||||
|
||||
return 1
|
||||
else
|
||||
call eclim#util#EchoWarning('Target file is no longer open.')
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" s:Diff() {{{
|
||||
" Diff the contents of the revision under the cursor against the current
|
||||
" contents.
|
||||
function s:Diff()
|
||||
let hist_buf = bufnr('%')
|
||||
let winend = winnr('$')
|
||||
let winnum = 1
|
||||
while winnum <= winend
|
||||
let bufnr = winbufnr(winnum)
|
||||
if getbufvar(bufnr, 'history_diff') != ''
|
||||
exec bufnr . 'bd'
|
||||
continue
|
||||
endif
|
||||
let winnum += 1
|
||||
endwhile
|
||||
call eclim#util#GoToBufferWindow(hist_buf)
|
||||
|
||||
let current = b:filename
|
||||
let orien = g:EclimHistoryDiffOrientation == 'horizontal' ? '' : 'vertical'
|
||||
if s:View(orien . ' below split')
|
||||
let b:history_diff = 1
|
||||
diffthis
|
||||
augroup history_diff
|
||||
autocmd! BufWinLeave <buffer>
|
||||
call eclim#util#GoToBufferWindowRegister(current)
|
||||
autocmd BufWinLeave <buffer> diffoff
|
||||
augroup END
|
||||
|
||||
call eclim#util#GoToBufferWindow(current)
|
||||
diffthis
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" s:DiffNextPrev(dir, count) {{{
|
||||
function s:DiffNextPrev(dir, count)
|
||||
let winnr = winnr()
|
||||
if eclim#util#GoToBufferWindow('[History]')
|
||||
let num = v:count > 0 ? v:count : a:count
|
||||
let cur = exists('b:history_current_entry') ? b:history_current_entry : 0
|
||||
let index = cur + (a:dir * num)
|
||||
if index < 0 || index > len(b:history_revisions)
|
||||
call eclim#util#EchoError('Operation exceeds history stack range.')
|
||||
exec winnr . 'winc w'
|
||||
return
|
||||
endif
|
||||
call cursor(index + 1, 0)
|
||||
call s:Diff()
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" s:Revert() {{{
|
||||
" Revert the file to the revision under the cursor.
|
||||
function s:Revert()
|
||||
if line('.') == 1 || line('.') > len(b:history_revisions)
|
||||
return
|
||||
endif
|
||||
|
||||
let current = b:filename
|
||||
let revision = b:history_revisions[line('.') - 1]
|
||||
if eclim#util#GoToBufferWindow(current)
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let file = eclim#project#util#GetProjectRelativeFilePath()
|
||||
let command = s:command_revision
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
let command = substitute(command, '<revision>', revision, '')
|
||||
let result = eclim#Execute(command)
|
||||
if result == "0"
|
||||
return
|
||||
endif
|
||||
|
||||
let ff = &ff
|
||||
let temp = tempname()
|
||||
call writefile(split(result, '\n'), temp)
|
||||
try
|
||||
silent 1,$delete _
|
||||
silent read ++edit `=temp`
|
||||
silent 1,1delete _
|
||||
finally
|
||||
call delete(temp)
|
||||
endtry
|
||||
|
||||
if ff != &ff
|
||||
call eclim#util#EchoWarning(
|
||||
\ "Warning: the file format is being reverted from '" . ff . "' to '" .
|
||||
\ &ff . "'. Using vim's undo will not restore the previous format so " .
|
||||
\ "if you choose to undo the reverting of this file, you will need to " .
|
||||
\ "manually set the file format back to " . ff . " (set ff=" . ff . ").")
|
||||
endif
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" s:Clear(prompt, [filename]) {{{
|
||||
" Clear the history.
|
||||
function s:Clear(prompt, ...)
|
||||
let response = 1
|
||||
if a:prompt
|
||||
let response = eclim#util#PromptConfirm(
|
||||
\ 'Clear local history?', g:EclimInfoHighlight)
|
||||
endif
|
||||
|
||||
if response == 1
|
||||
let filename = len(a:000) > 0 ? a:000[0] : b:filename
|
||||
let current = eclim#project#util#GetProjectRelativeFilePath(filename)
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let command = s:command_clear
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', current, '')
|
||||
let result = eclim#Execute(command)
|
||||
if result == "0"
|
||||
return
|
||||
endif
|
||||
|
||||
if filename != expand('%:p')
|
||||
quit
|
||||
endif
|
||||
call eclim#util#Echo(result)
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" s:Syntax() {{{
|
||||
function! s:Syntax()
|
||||
set ft=eclim_history
|
||||
hi link HistoryFile Identifier
|
||||
hi link HistoryCurrentEntry Constant
|
||||
syntax match HistoryFile /.*\%1l.*/
|
||||
syntax match Comment /^".*/
|
||||
endfunction " }}}
|
||||
|
||||
" s:HighlightEntry(index) {{{
|
||||
function s:HighlightEntry(index)
|
||||
let winnr = winnr()
|
||||
if eclim#util#GoToBufferWindow('[History]')
|
||||
let b:history_current_entry = a:index
|
||||
try
|
||||
" forces reset of syntax
|
||||
call s:Syntax()
|
||||
exec 'syntax match HistoryCurrentEntry /.*\%' . (a:index + 1) . 'l.*/'
|
||||
finally
|
||||
exec winnr . 'winc w'
|
||||
endtry
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
58
.vim/bundle/eclim/eclim/autoload/eclim/common/largefile.vim
Normal file
58
.vim/bundle/eclim/eclim/autoload/eclim/common/largefile.vim
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" Initially based on vimscript 1506
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2012 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Script Settings {{{
|
||||
let s:file_size = g:EclimLargeFileSize * 1024 * 1024
|
||||
let s:events = ['BufRead', 'CursorHold', 'FileType']
|
||||
" }}}
|
||||
|
||||
function! eclim#common#largefile#InitSettings() " {{{
|
||||
let file = expand("<afile>")
|
||||
let size = getfsize(file)
|
||||
if size >= s:file_size || size == -2
|
||||
if !exists('b:save_events')
|
||||
let b:save_events = &eventignore
|
||||
call s:ApplySettings()
|
||||
setlocal noswapfile nowrap bufhidden=unload
|
||||
autocmd eclim_largefile BufEnter,BufWinEnter <buffer> call <SID>ApplySettings()
|
||||
autocmd eclim_largefile BufLeave,BufWinLeave <buffer> call <SID>RevertSettings()
|
||||
endif
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! s:ApplySettings() " {{{
|
||||
let &eventignore=join(s:events, ',')
|
||||
if !exists('b:largefile_notified')
|
||||
let b:largefile_notified = 1
|
||||
call eclim#util#Echo('Note: Large file settings applied.')
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! s:RevertSettings() " {{{
|
||||
if exists('b:save_events')
|
||||
let &eventignore=b:save_events
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
87
.vim/bundle/eclim/eclim/autoload/eclim/common/license.vim
Normal file
87
.vim/bundle/eclim/eclim/autoload/eclim/common/license.vim
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2012 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Script Variables {{{
|
||||
let s:year = exists('*strftime') ? strftime('%Y') : '2009'
|
||||
" }}}
|
||||
|
||||
" GetLicense() {{{
|
||||
" Retrieves the file containing the license text.
|
||||
function! eclim#common#license#GetLicense()
|
||||
let file = eclim#project#util#GetProjectSetting('org.eclim.project.copyright')
|
||||
if type(file) == g:NUMBER_TYPE
|
||||
return
|
||||
elseif file == ''
|
||||
call eclim#util#EchoWarning(
|
||||
\ "Project setting 'org.eclim.project.copyright' has not been supplied.")
|
||||
return
|
||||
endif
|
||||
|
||||
let file = eclim#project#util#GetCurrentProjectRoot() . '/' . file
|
||||
if !filereadable(file)
|
||||
return
|
||||
endif
|
||||
return file
|
||||
endfunction " }}}
|
||||
|
||||
" License(pre, post, mid) {{{
|
||||
" Retrieves the license configured license and applies the specified prefix
|
||||
" and postfix as the lines before and after the license and uses 'mid' as the
|
||||
" prefix for every line.
|
||||
" Returns the license as a list of strings.
|
||||
function! eclim#common#license#License(pre, post, mid)
|
||||
let file = eclim#common#license#GetLicense()
|
||||
if type(file) == g:NUMBER_TYPE && file == 0
|
||||
return ''
|
||||
endif
|
||||
|
||||
let contents = readfile(file)
|
||||
if a:mid != ''
|
||||
call map(contents, 'a:mid . v:val')
|
||||
endif
|
||||
|
||||
if a:pre != ''
|
||||
call insert(contents, a:pre)
|
||||
endif
|
||||
|
||||
if a:post != ''
|
||||
call add(contents, a:post)
|
||||
endif
|
||||
|
||||
call map(contents, "substitute(v:val, '${year}', s:year, 'g')")
|
||||
|
||||
let author = eclim#project#util#GetProjectSetting('org.eclim.user.name')
|
||||
if type(author) == g:STRING_TYPE && author != ''
|
||||
call map(contents, "substitute(v:val, '${author}', author, 'g')")
|
||||
endif
|
||||
|
||||
let email = eclim#project#util#GetProjectSetting('org.eclim.user.email')
|
||||
if type(email) == g:STRING_TYPE && email != ''
|
||||
call map(contents, "substitute(v:val, '${email}', email, 'g')")
|
||||
endif
|
||||
call map(contents, "substitute(v:val, '\\s\\+$', '', '')")
|
||||
|
||||
return contents
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
655
.vim/bundle/eclim/eclim/autoload/eclim/common/locate.vim
Normal file
655
.vim/bundle/eclim/eclim/autoload/eclim/common/locate.vim
Normal file
File diff suppressed because it is too large
Load diff
237
.vim/bundle/eclim/eclim/autoload/eclim/common/template.vim
Normal file
237
.vim/bundle/eclim/eclim/autoload/eclim/common/template.vim
Normal file
|
|
@ -0,0 +1,237 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2012 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Global Variables {{{
|
||||
if !exists("g:EclimTemplateDir")
|
||||
let g:EclimTemplateDir = g:EclimBaseDir . '/template'
|
||||
endif
|
||||
if !exists("g:EclimTemplateExtension")
|
||||
let g:EclimTemplateExtension = '.vim'
|
||||
endif
|
||||
if !exists("g:EclimTemplateIgnore")
|
||||
let g:EclimTemplateIgnore = []
|
||||
endif
|
||||
" }}}
|
||||
|
||||
" Script Variables {{{
|
||||
let s:quote = "['\"]"
|
||||
let s:tag_regex =
|
||||
\ '<vim:[a-zA-Z]\+\(\s\+[a-zA-Z]\+\s*=\s*' . s:quote . '.*' . s:quote . '\)\?\s*/>'
|
||||
let s:tagname_regex = '.\{-}<vim:\([a-zA-Z]\+\).*'
|
||||
" }}}
|
||||
|
||||
" Template() {{{
|
||||
" Main method for finding and executing the template.
|
||||
function! eclim#common#template#Template()
|
||||
" allow some plugins to disable templates temporarily
|
||||
if exists('g:EclimTemplateTempIgnore') && g:EclimTemplateTempIgnore
|
||||
return
|
||||
endif
|
||||
|
||||
" ignore certain file patterns
|
||||
for ignore in g:EclimTemplateIgnore
|
||||
if expand('%') =~ ignore
|
||||
return
|
||||
endif
|
||||
endfor
|
||||
|
||||
let template = s:FindTemplate()
|
||||
if template != ''
|
||||
let lines = readfile(template)
|
||||
call s:ExecuteTemplate(lines)
|
||||
1,1delete _
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" s:FindTemplate() {{{
|
||||
" Finds the template file and returns the location.
|
||||
function! s:FindTemplate()
|
||||
let templatesDir = expand(g:EclimTemplateDir)
|
||||
if !isdirectory(templatesDir)
|
||||
call eclim#util#EchoDebug(
|
||||
\ 'Template dir not found (g:EclimTemplateDir): ' . templatesDir)
|
||||
return ''
|
||||
endif
|
||||
|
||||
let filename = expand('%:t')
|
||||
let ext = ""
|
||||
|
||||
" template equal to the filename
|
||||
if filereadable(templatesDir . '/' . filename . g:EclimTemplateExtension)
|
||||
return templatesDir . '/' . filename . g:EclimTemplateExtension
|
||||
endif
|
||||
|
||||
" template pattern
|
||||
let templates = globpath(templatesDir, '*' . g:EclimTemplateExtension)
|
||||
for template in split(templates, '\n')
|
||||
" remove path info
|
||||
let temp_template = substitute(template, '.*[/\\]', '', '')
|
||||
if g:EclimTemplateExtension != ''
|
||||
let temp_template =
|
||||
\ strpart(temp_template, 0, stridx(temp_template, g:EclimTemplateExtension))
|
||||
endif
|
||||
|
||||
while stridx(temp_template, '.') != -1
|
||||
let ext = strpart(temp_template, stridx(temp_template, '.'))
|
||||
let temp_template = strpart(temp_template, 0, stridx(temp_template, '.'))
|
||||
if filename =~ '.*' . temp_template . '.*' . ext
|
||||
return template
|
||||
endif
|
||||
endwhile
|
||||
endfor
|
||||
|
||||
" template equal to file extension
|
||||
if stridx(filename, '.') > 0
|
||||
let ext = strpart(filename, stridx(filename, '.'))
|
||||
while stridx(ext, '.') != -1
|
||||
let ext = strpart(ext, stridx(ext, '.') + 1)
|
||||
if filereadable(templatesDir . '/' . ext . g:EclimTemplateExtension)
|
||||
return templatesDir . '/' . ext . g:EclimTemplateExtension
|
||||
endif
|
||||
endwhile
|
||||
endif
|
||||
|
||||
" template equal to file type
|
||||
if filereadable(templatesDir . '/' . &ft . g:EclimTemplateExtension)
|
||||
return templatesDir . '/' . &ft . g:EclimTemplateExtension
|
||||
endif
|
||||
|
||||
return ''
|
||||
endfunction " }}}
|
||||
|
||||
" s:ExecuteTemplate(lines) {{{
|
||||
" Executes any logic in the supplied lines and appends those lines to the
|
||||
" current file.
|
||||
function! s:ExecuteTemplate(lines)
|
||||
for line in a:lines
|
||||
if line =~ s:tag_regex
|
||||
let tag = substitute(line, s:tagname_regex, '\1', '')
|
||||
call s:ExecuteTemplate(s:Process_{tag}(line))
|
||||
else
|
||||
call append(line('$'), line)
|
||||
endif
|
||||
endfor
|
||||
endfunction " }}}
|
||||
|
||||
" s:EvaluateExpression(expression) {{{
|
||||
" Evaluates the supplied expression.
|
||||
function! s:EvaluateExpression(expression)
|
||||
exec "return " . a:expression
|
||||
endfunction " }}}
|
||||
|
||||
" s:GetAttribute(line, tag, attribute, fail) {{{
|
||||
" Gets the an attribute value.
|
||||
function! s:GetAttribute(line, tag, attribute, fail)
|
||||
let attribute = substitute(a:line,
|
||||
\ '.\{-}<vim:' . a:tag . '.\{-}\s\+' . a:attribute .
|
||||
\ '\s*=\s*\(' . s:quote . '\)\(.\{-}\)\1.*/>.*',
|
||||
\ '\2', '')
|
||||
|
||||
if attribute == a:line
|
||||
if a:fail
|
||||
call s:TemplateError(
|
||||
\ a:line, "syntax error - missing '" . a:attribute . "' attribute")
|
||||
endif
|
||||
return ""
|
||||
endif
|
||||
return attribute
|
||||
endfunction " }}}
|
||||
|
||||
" s:TemplateError(line, message) {{{
|
||||
" Echos an error message to the user.
|
||||
function! s:TemplateError(line, message)
|
||||
call eclim#util#EchoError("Template error, line " . a:line . ": " . a:message)
|
||||
endfunction " }}}
|
||||
|
||||
" s:Process_var(line) {{{
|
||||
" Process <vim:var/> tags.
|
||||
function! s:Process_var(line)
|
||||
let name = expand(s:GetAttribute(a:line, 'var', 'name', 1))
|
||||
let value = expand(s:GetAttribute(a:line, 'var', 'value', 1))
|
||||
|
||||
exec "let " . name . " = \"" . s:EvaluateExpression(value) . "\""
|
||||
|
||||
return []
|
||||
endfunction " }}}
|
||||
|
||||
" s:Process_import(line) {{{
|
||||
" Process <vim:import/> tags.
|
||||
function! s:Process_import(line)
|
||||
let resource = expand(s:GetAttribute(a:line, 'import', 'resource', 1))
|
||||
if resource !~ '^/\'
|
||||
let resource = expand(g:EclimTemplateDir . '/' . resource)
|
||||
endif
|
||||
|
||||
if !filereadable(resource)
|
||||
call s:TemplateError(a:line, "resource not found '" . resource . "'")
|
||||
endif
|
||||
|
||||
exec "source " . resource
|
||||
|
||||
return []
|
||||
endfunction " }}}
|
||||
|
||||
" s:Process_out(line) {{{
|
||||
" Process <vim:out/> tags.
|
||||
function! s:Process_out(line)
|
||||
let value = s:GetAttribute(a:line, 'out', 'value', 1)
|
||||
let result = s:EvaluateExpression(value)
|
||||
return s:Out(a:line, '<vim:out\s\+.\{-}\s*\/>', result)
|
||||
endfunction " }}}
|
||||
|
||||
" s:Process_include(line) {{{
|
||||
" Process <vim:include/> tags.
|
||||
function! s:Process_include(line)
|
||||
let template = expand(
|
||||
\ g:EclimTemplateDir . '/' . s:GetAttribute(a:line, 'include', 'template', 1))
|
||||
|
||||
if !filereadable(template)
|
||||
call s:TemplateError(a:line, "template not found '" . template . "'")
|
||||
return []
|
||||
endif
|
||||
|
||||
return readfile(template)
|
||||
endfunction " }}}
|
||||
|
||||
" s:Process_username(line) {{{
|
||||
" Process <vim:username/> tags.
|
||||
function! s:Process_username(line)
|
||||
silent! let username = eclim#project#util#GetProjectSetting('org.eclim.user.name')
|
||||
if type(username) == g:NUMBER_TYPE
|
||||
let username = ''
|
||||
endif
|
||||
return s:Out(a:line, '<vim:username\s*\/>', username)
|
||||
endfunction " }}}
|
||||
|
||||
" s:Out(line, pattern, value) {{{
|
||||
function! s:Out(line, pattern, value)
|
||||
let results = type(a:value) == g:LIST_TYPE ? a:value : [a:value]
|
||||
if results[0] == '' && a:line =~ '^\s*' . a:pattern . '\s*$'
|
||||
return []
|
||||
endif
|
||||
|
||||
let line = substitute(a:line, a:pattern, results[0], '')
|
||||
return [line] + (len(results) > 1 ? results[1:] : [])
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
195
.vim/bundle/eclim/eclim/autoload/eclim/common/util.vim
Normal file
195
.vim/bundle/eclim/eclim/autoload/eclim/common/util.vim
Normal file
|
|
@ -0,0 +1,195 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" Various functions that are useful in and out of eclim.
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Global Variables {{{
|
||||
let s:command_read = '-command archive_read -f "<file>"'
|
||||
" }}}
|
||||
|
||||
" DiffLastSaved() {{{
|
||||
" Diff a modified file with the last saved version.
|
||||
function! eclim#common#util#DiffLastSaved()
|
||||
if &modified
|
||||
let winnum = winnr()
|
||||
let filetype=&ft
|
||||
vertical botright new | r #
|
||||
1,1delete _
|
||||
|
||||
diffthis
|
||||
setlocal buftype=nofile
|
||||
setlocal bufhidden=wipe
|
||||
setlocal nobuflisted
|
||||
setlocal noswapfile
|
||||
setlocal readonly
|
||||
exec "setlocal ft=" . filetype
|
||||
let diffnum = winnr()
|
||||
|
||||
augroup diff_saved
|
||||
autocmd! BufUnload <buffer>
|
||||
autocmd BufUnload <buffer> :diffoff!
|
||||
augroup END
|
||||
|
||||
exec winnum . "winc w"
|
||||
diffthis
|
||||
|
||||
" for some reason, these settings only take hold if set here.
|
||||
call setwinvar(diffnum, "&foldmethod", "diff")
|
||||
call setwinvar(diffnum, "&foldlevel", "0")
|
||||
else
|
||||
echo "No changes"
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" SwapTypedArguments() {{{
|
||||
" Swaps typed method declaration arguments.
|
||||
function! eclim#common#util#SwapTypedArguments()
|
||||
" FIXME: add validation to see if user is executing on a valid position.
|
||||
normal! w
|
||||
SwapWords
|
||||
normal! b
|
||||
SwapWords
|
||||
normal! www
|
||||
SwapWords
|
||||
normal! bb
|
||||
SwapWords
|
||||
normal! b
|
||||
endfunction " }}}
|
||||
|
||||
" SwapWords() {{{
|
||||
" Initially based on http://www.vim.org/tips/tip.php?tip_id=329
|
||||
function! eclim#common#util#SwapWords()
|
||||
" save the last search pattern
|
||||
let save_search = @/
|
||||
|
||||
normal! "_yiw
|
||||
s/\(\%#\w\+\)\(\_W\+\)\(\w\+\)/\3\2\1/
|
||||
exec "normal! \<C-O>"
|
||||
|
||||
" restore the last search pattern
|
||||
let @/ = save_search
|
||||
|
||||
silent! call repeat#set(":call eclim#common#util#SwapWords()\<cr>", v:count)
|
||||
endfunction " }}}
|
||||
|
||||
" Tcd(dir) {{{
|
||||
" Like vim's :lcd, but tab local instead of window local.
|
||||
function! eclim#common#util#Tcd(dir)
|
||||
let t:cwd = fnamemodify(a:dir, ':p')
|
||||
|
||||
" initialize the tab cwd for all other tabs if not already set
|
||||
let curtab = tabpagenr()
|
||||
try
|
||||
let index = 1
|
||||
while index <= tabpagenr('$')
|
||||
if index != curtab
|
||||
exec 'tabn ' . index
|
||||
if !exists('t:cwd')
|
||||
let t:cwd = getcwd()
|
||||
" try to find a window without a localdir if necessary
|
||||
if haslocaldir()
|
||||
let curwin = winnr()
|
||||
let windex = 1
|
||||
while windex <= winnr('$')
|
||||
if windex != curwin
|
||||
exec windex . 'winc w'
|
||||
if !haslocaldir()
|
||||
let t:cwd = getcwd()
|
||||
break
|
||||
endif
|
||||
endif
|
||||
let windex += 1
|
||||
endwhile
|
||||
exec curwin . 'winc w'
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
let index += 1
|
||||
endwhile
|
||||
finally
|
||||
exec 'tabn ' . curtab
|
||||
endtry
|
||||
|
||||
call s:ApplyTcd(0)
|
||||
|
||||
augroup tcd
|
||||
autocmd!
|
||||
autocmd TabEnter * call <SID>ApplyTcd(1)
|
||||
augroup END
|
||||
endfunction " }}}
|
||||
|
||||
" s:ApplyTcd(honor_lcd) {{{
|
||||
function! s:ApplyTcd(honor_lcd)
|
||||
if !exists('t:cwd')
|
||||
return
|
||||
endif
|
||||
|
||||
if a:honor_lcd && haslocaldir()
|
||||
let lcwd = getcwd()
|
||||
exec 'cd ' . escape(t:cwd, ' ')
|
||||
exec 'lcd ' . escape(lcwd, ' ')
|
||||
else
|
||||
exec 'cd ' . escape(t:cwd, ' ')
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" ReadFile() {{{
|
||||
" Reads the contents of an archived file.
|
||||
function! eclim#common#util#ReadFile()
|
||||
let archive = substitute(expand('%'), '\', '/', 'g')
|
||||
let command = substitute(s:command_read, '<file>', archive, '')
|
||||
|
||||
let file = eclim#Execute(command)
|
||||
|
||||
if string(file) != '0'
|
||||
let project = exists('b:eclim_project') ? b:eclim_project : ''
|
||||
let bufnum = bufnr('%')
|
||||
if has('win32unix')
|
||||
let file = eclim#cygwin#CygwinPath(file)
|
||||
endif
|
||||
silent exec "keepalt keepjumps edit! " . escape(file, ' ')
|
||||
if project != ''
|
||||
let b:eclim_project = project
|
||||
let b:eclim_file = archive
|
||||
endif
|
||||
|
||||
exec 'bdelete ' . bufnum
|
||||
|
||||
" alternate solution, that keeps the archive url as the buffer's filename,
|
||||
" but prevents taglist from being able to parse tags.
|
||||
"setlocal noreadonly
|
||||
"setlocal modifiable
|
||||
"silent! exec "read " . file
|
||||
"1,1delete _
|
||||
|
||||
silent exec "doautocmd BufReadPre " . file
|
||||
silent exec "doautocmd BufReadPost " . file
|
||||
|
||||
setlocal readonly
|
||||
setlocal nomodifiable
|
||||
setlocal noswapfile
|
||||
" causes taglist.vim errors (fold then delete fails)
|
||||
"setlocal bufhidden=delete
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
60
.vim/bundle/eclim/eclim/autoload/eclim/cygwin.vim
Normal file
60
.vim/bundle/eclim/eclim/autoload/eclim/cygwin.vim
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" Utility functions for cygwin usage.
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
function! eclim#cygwin#CygwinPath(path) " {{{
|
||||
return s:Cygpath(a:path, 'cygwin')
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#cygwin#WindowsPath(path) " {{{
|
||||
if type(a:path) == g:STRING_TYPE && a:path =~? '^[a-z]:'
|
||||
return substitute(a:path, '\', '/', 'g')
|
||||
endif
|
||||
return s:Cygpath(a:path, 'windows')
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#cygwin#WindowsHome() " {{{
|
||||
if !exists('s:cygpath_winhome')
|
||||
let dir = s:Cygpath('-D', 'cygwin')
|
||||
let s:cygpath_winhome = dir != '-D' ? fnamemodify(dir, ':h') : ''
|
||||
endif
|
||||
return s:cygpath_winhome
|
||||
endfunction " }}}
|
||||
|
||||
function! s:Cygpath(paths, type) " {{{
|
||||
if executable('cygpath')
|
||||
let paths = type(a:paths) == g:LIST_TYPE ? a:paths : [a:paths]
|
||||
let paths = map(paths, "'\"' . substitute(v:val, '\\', '/', 'g') . '\"'")
|
||||
|
||||
let args = a:type == 'windows' ? '-m ' : ''
|
||||
let results = split(eclim#util#System('cygpath ' . args . join(paths)), "\n")
|
||||
|
||||
if type(a:paths) == g:LIST_TYPE
|
||||
return results
|
||||
endif
|
||||
return results[0]
|
||||
endif
|
||||
return a:paths
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
103
.vim/bundle/eclim/eclim/autoload/eclim/display/menu.vim
Normal file
103
.vim/bundle/eclim/eclim/autoload/eclim/display/menu.vim
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" Plugin to generate gvim eclim menus.
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Script Variables {{{
|
||||
|
||||
let s:eclim_menus_root = []
|
||||
let s:eclim_menus = {}
|
||||
|
||||
" }}}
|
||||
|
||||
" Generate() {{{
|
||||
" Generate gvim menu items for available eclim commands.
|
||||
function! eclim#display#menu#Generate()
|
||||
" check that the menu bar is enabled or that we are running in a mac gui where
|
||||
" the menu bar always exists regardless of guioptions
|
||||
if &guioptions !~ 'm' && !has('gui_macvim')
|
||||
if exists('b:eclim_menus')
|
||||
unlet b:eclim_menus
|
||||
endif
|
||||
return
|
||||
endif
|
||||
|
||||
redir => commands
|
||||
silent exec 'command'
|
||||
redir END
|
||||
|
||||
if !exists('b:eclim_menus')
|
||||
let b:eclim_menus = {}
|
||||
|
||||
let pattern = '\<eclim#'
|
||||
if len(s:eclim_menus_root) != 0
|
||||
let pattern = '^..b.*\<eclim#'
|
||||
endif
|
||||
|
||||
for cmd in split(commands, '\n')
|
||||
if cmd =~ pattern
|
||||
let name = substitute(cmd, '....\(\w\+\)\s.*', '\1', '')
|
||||
if cmd =~ '\<eclim#[A-Z]'
|
||||
if index(s:eclim_menus_root, name) == -1
|
||||
call add(s:eclim_menus_root, name)
|
||||
endif
|
||||
else
|
||||
let group = substitute(cmd, '.\{-}\<eclim#\(\w\+\)#.*', '\1', '')
|
||||
let var = cmd =~ '^..b' ? 'b:eclim_menus' : 's:eclim_menus'
|
||||
if !has_key({var}, group)
|
||||
let {var}[group] = []
|
||||
endif
|
||||
if index({var}[group], name) == -1
|
||||
call add({var}[group], name)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
|
||||
call sort(s:eclim_menus_root)
|
||||
endif
|
||||
|
||||
silent! unmenu &Plugin.eclim
|
||||
|
||||
" merge non-buffer items with buffer items
|
||||
let menus = deepcopy(s:eclim_menus, 1)
|
||||
for group in keys(b:eclim_menus)
|
||||
if !has_key(menus, group)
|
||||
let menus[group] = []
|
||||
endif
|
||||
for name in b:eclim_menus[group]
|
||||
call add(menus[group], name)
|
||||
endfor
|
||||
endfor
|
||||
|
||||
for name in s:eclim_menus_root
|
||||
exec 'menu &Plugin.eclim.' . name . ' :' . name . ' '
|
||||
endfor
|
||||
|
||||
for group in sort(keys(menus))
|
||||
for name in sort(menus[group])
|
||||
exec 'menu &Plugin.eclim.' . group . '.' . name . ' :' . name . ' '
|
||||
endfor
|
||||
endfor
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
370
.vim/bundle/eclim/eclim/autoload/eclim/display/signs.vim
Normal file
370
.vim/bundle/eclim/eclim/autoload/eclim/display/signs.vim
Normal file
|
|
@ -0,0 +1,370 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" Functions for working with vim signs.
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2012 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Global Variables {{{
|
||||
if !exists("g:EclimShowQuickfixSigns")
|
||||
let g:EclimShowQuickfixSigns = 1
|
||||
endif
|
||||
|
||||
if !exists("g:EclimShowLoclistSigns")
|
||||
let g:EclimShowLoclistSigns = 1
|
||||
endif
|
||||
|
||||
if !exists("g:EclimQuickfixSignText")
|
||||
let g:EclimQuickfixSignText = '> '
|
||||
endif
|
||||
|
||||
if !exists("g:EclimLoclistSignText")
|
||||
let g:EclimLoclistSignText = '>>'
|
||||
endif
|
||||
|
||||
if !exists("g:EclimUserSignText")
|
||||
let g:EclimUserSignText = '#'
|
||||
endif
|
||||
|
||||
if !exists("g:EclimUserSignHighlight")
|
||||
let g:EclimUserSignHighlight = g:EclimInfoHighlight
|
||||
endif
|
||||
" }}}
|
||||
|
||||
function! eclim#display#signs#Define(name, text, highlight) " {{{
|
||||
" Defines a new sign name or updates an existing one.
|
||||
exec "sign define " . a:name . " text=" . a:text . " texthl=" . a:highlight
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#display#signs#Place(name, line) " {{{
|
||||
" Places a sign in the current buffer.
|
||||
if a:line > 0
|
||||
let lastline = line('$')
|
||||
let line = a:line <= lastline ? a:line : lastline
|
||||
let id = a:name == 'placeholder' ? 999999 : line
|
||||
exec "sign place " . id . " line=" . line . " name=" . a:name .
|
||||
\ " buffer=" . bufnr('%')
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#display#signs#PlaceAll(name, list) " {{{
|
||||
" Places a sign in the current buffer for each line in the list.
|
||||
|
||||
let lastline = line('$')
|
||||
for line in a:list
|
||||
if line > 0
|
||||
let line = line <= lastline ? line : lastline
|
||||
exec "sign place " . line . " line=" . line . " name=" . a:name .
|
||||
\ " buffer=" . bufnr('%')
|
||||
endif
|
||||
endfor
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#display#signs#Undefine(name) " {{{
|
||||
" Undefines a sign name.
|
||||
exec "sign undefine " . a:name
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#display#signs#Unplace(id) " {{{
|
||||
" Un-places a sign in the current buffer.
|
||||
exec 'sign unplace ' . a:id . ' buffer=' . bufnr('%')
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#display#signs#UnplaceAll(list) " {{{
|
||||
" Un-places all signs in the supplied list from the current buffer.
|
||||
" The list may be a list of ids or a list of dictionaries as returned by
|
||||
" GetExisting()
|
||||
|
||||
for sign in a:list
|
||||
if type(sign) == g:DICT_TYPE
|
||||
call eclim#display#signs#Unplace(sign['id'])
|
||||
else
|
||||
call eclim#display#signs#Unplace(sign)
|
||||
endif
|
||||
endfor
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#display#signs#Toggle(name, line) " {{{
|
||||
" Toggle a sign on the current line.
|
||||
if a:line > 0
|
||||
let existing = eclim#display#signs#GetExisting(a:name)
|
||||
let exists = len(filter(existing, "v:val['line'] == a:line"))
|
||||
if exists
|
||||
call eclim#display#signs#Unplace(a:line)
|
||||
else
|
||||
call eclim#display#signs#Place(a:name, a:line)
|
||||
endif
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! s:CompareSigns(s1, s2) " {{{
|
||||
" Used by ViewSigns to sort list of sign dictionaries.
|
||||
|
||||
if a:s1.line == a:s2.line
|
||||
return 0
|
||||
endif
|
||||
if a:s1.line > a:s2.line
|
||||
return 1
|
||||
endif
|
||||
return -1
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#display#signs#ViewSigns(name) " {{{
|
||||
" Open a window to view all placed signs with the given name in the current
|
||||
" buffer.
|
||||
|
||||
let filename = expand('%:p')
|
||||
let signs = eclim#display#signs#GetExisting(a:name)
|
||||
call sort(signs, 's:CompareSigns')
|
||||
let content = map(signs, "v:val.line . '|' . getline(v:val.line)")
|
||||
|
||||
call eclim#util#TempWindow('[Sign List]', content)
|
||||
|
||||
set ft=qf
|
||||
nnoremap <silent> <buffer> <cr> :call <SID>JumpToSign()<cr>
|
||||
|
||||
" Store filename so that plugins can use it if necessary.
|
||||
let b:filename = filename
|
||||
augroup temp_window
|
||||
autocmd! BufWinLeave <buffer>
|
||||
call eclim#util#GoToBufferWindowRegister(filename)
|
||||
augroup END
|
||||
endfunction " }}}
|
||||
|
||||
function! s:JumpToSign() " {{{
|
||||
let winnr = bufwinnr(bufnr('^' . b:filename))
|
||||
if winnr != -1
|
||||
let line = substitute(getline('.'), '^\(\d\+\)|.*', '\1', '')
|
||||
exec winnr . "winc w"
|
||||
call cursor(line, 1)
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#display#signs#GetDefined() " {{{
|
||||
" Gets a list of defined sign names.
|
||||
|
||||
redir => list
|
||||
silent exec 'sign list'
|
||||
redir END
|
||||
|
||||
let names = []
|
||||
for name in split(list, '\n')
|
||||
let name = substitute(name, 'sign\s\(.\{-}\)\s.*', '\1', '')
|
||||
call add(names, name)
|
||||
endfor
|
||||
return names
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#display#signs#GetExisting(...) " {{{
|
||||
" Gets a list of existing signs for the current buffer.
|
||||
" The list consists of dictionaries with the following keys:
|
||||
" id: The sign id.
|
||||
" line: The line number.
|
||||
" name: The sign name (erorr, warning, etc.)
|
||||
"
|
||||
" Optionally a sign name may be supplied to only retrieve signs of that name.
|
||||
|
||||
let bufnr = bufnr('%')
|
||||
|
||||
redir => signs
|
||||
silent exec 'sign place buffer=' . bufnr
|
||||
redir END
|
||||
|
||||
let existing = []
|
||||
for line in split(signs, '\n')
|
||||
if line =~ '.\{-}=.\{-}=' " only two equals to account for swedish output
|
||||
call add(existing, s:ParseSign(line))
|
||||
endif
|
||||
endfor
|
||||
|
||||
if len(a:000) > 0
|
||||
call filter(existing, "v:val['name'] == a:000[0]")
|
||||
endif
|
||||
|
||||
return existing
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#display#signs#HasExisting(...) " {{{
|
||||
" Determines if there are any existing signs.
|
||||
" Optionally a sign name may be supplied to only test for signs of that name.
|
||||
|
||||
let bufnr = bufnr('%')
|
||||
|
||||
redir => results
|
||||
silent exec 'sign place buffer=' . bufnr
|
||||
redir END
|
||||
|
||||
for line in split(results, '\n')
|
||||
if line =~ '.\{-}=.\{-}=' " only two equals to account for swedish output
|
||||
if len(a:000) == 0
|
||||
return 1
|
||||
endif
|
||||
let sign = s:ParseSign(line)
|
||||
if sign.name == a:000[0]
|
||||
return 1
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
|
||||
return 0
|
||||
endfunction " }}}
|
||||
|
||||
function! s:ParseSign(raw) " {{{
|
||||
let attrs = split(a:raw)
|
||||
|
||||
exec 'let line = ' . split(attrs[0], '=')[1]
|
||||
|
||||
let id = split(attrs[1], '=')[1]
|
||||
" hack for the italian localization
|
||||
if id =~ ',$'
|
||||
let id = id[:-2]
|
||||
endif
|
||||
|
||||
" hack for the swedish localization
|
||||
if attrs[2] =~ '^namn'
|
||||
let name = substitute(attrs[2], 'namn', '', '')
|
||||
else
|
||||
let name = split(attrs[2], '=')[1]
|
||||
endif
|
||||
|
||||
return {'id': id, 'line': line, 'name': name}
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#display#signs#Update() " {{{
|
||||
" Updates the signs for the current buffer. This function will read both the
|
||||
" location list and the quickfix list and place a sign for any entries for the
|
||||
" current file.
|
||||
" This function supports a severity level by examining the 'type' key of the
|
||||
" dictionaries in the location or quickfix list. It supports 'i' (info), 'w'
|
||||
" (warning), and 'e' (error).
|
||||
|
||||
if !has('signs') || !g:EclimSignLevel || &ft == 'qf'
|
||||
return
|
||||
endif
|
||||
|
||||
let save_lazy = &lazyredraw
|
||||
set lazyredraw
|
||||
|
||||
let placeholder = eclim#display#signs#SetPlaceholder()
|
||||
|
||||
" remove all existing signs
|
||||
let existing = eclim#display#signs#GetExisting()
|
||||
for exists in existing
|
||||
if exists.name =~ '^\(qf_\)\?\(error\|info\|warning\)$'
|
||||
call eclim#display#signs#Unplace(exists.id)
|
||||
endif
|
||||
endfor
|
||||
|
||||
let qflist = filter(g:EclimShowQuickfixSigns ? getqflist() : [],
|
||||
\ 'bufnr("%") == v:val.bufnr')
|
||||
let show_loclist = g:EclimShowLoclistSigns && exists('b:eclim_loclist')
|
||||
let loclist = filter(show_loclist ? getloclist(0) : [],
|
||||
\ 'bufnr("%") == v:val.bufnr')
|
||||
|
||||
for [list, marker, prefix] in [
|
||||
\ [qflist, g:EclimQuickfixSignText, 'qf_'],
|
||||
\ [loclist, g:EclimLoclistSignText, '']]
|
||||
if g:EclimSignLevel >= 4
|
||||
let info = filter(copy(list), 'v:val.type == "" || tolower(v:val.type) == "i"')
|
||||
call eclim#display#signs#Define(prefix . 'info', marker, g:EclimInfoHighlight)
|
||||
call eclim#display#signs#PlaceAll(prefix . 'info', map(info, 'v:val.lnum'))
|
||||
endif
|
||||
|
||||
if g:EclimSignLevel >= 3
|
||||
let warnings = filter(copy(list), 'tolower(v:val.type) == "w"')
|
||||
call eclim#display#signs#Define(prefix . 'warning', marker, g:EclimWarningHighlight)
|
||||
call eclim#display#signs#PlaceAll(prefix . 'warning', map(warnings, 'v:val.lnum'))
|
||||
endif
|
||||
|
||||
if g:EclimSignLevel >= 2
|
||||
let errors = filter(copy(list), 'tolower(v:val.type) == "e"')
|
||||
call eclim#display#signs#Define(prefix . 'error', marker, g:EclimErrorHighlight)
|
||||
call eclim#display#signs#PlaceAll(prefix . 'error', map(errors, 'v:val.lnum'))
|
||||
endif
|
||||
endfor
|
||||
|
||||
if placeholder
|
||||
call eclim#display#signs#RemovePlaceholder()
|
||||
endif
|
||||
|
||||
let &lazyredraw = save_lazy
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#display#signs#QuickFixCmdPost() " {{{
|
||||
" Force 'make' results to be of type error if no type set.
|
||||
if expand('<amatch>') == 'make'
|
||||
let newentries = []
|
||||
for entry in getqflist()
|
||||
if entry['type'] == ''
|
||||
let entry['type'] = 'e'
|
||||
endif
|
||||
call add(newentries, entry)
|
||||
endfor
|
||||
call setqflist(newentries, 'r')
|
||||
endif
|
||||
call eclim#display#signs#Update()
|
||||
redraw!
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#display#signs#SetPlaceholder(...) " {{{
|
||||
" Set sign at line 1 to prevent sign column from collapsing, and subsiquent
|
||||
" screen redraw.
|
||||
" Optional args:
|
||||
" only_if_necessary: if 1, only set a placeholder if there are no existing
|
||||
" signs
|
||||
|
||||
if !has('signs') || !g:EclimSignLevel
|
||||
return
|
||||
endif
|
||||
|
||||
if len(a:000) > 0 && a:000[0]
|
||||
let existing = eclim#display#signs#GetExisting()
|
||||
if !len(existing)
|
||||
return
|
||||
endif
|
||||
endif
|
||||
|
||||
call eclim#display#signs#Define('placeholder', '_ ', g:EclimInfoHighlight)
|
||||
let existing = eclim#display#signs#GetExisting('placeholder')
|
||||
if len(existing) == 0 && eclim#display#signs#HasExisting()
|
||||
call eclim#display#signs#Place('placeholder', 1)
|
||||
return 1
|
||||
endif
|
||||
return
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#display#signs#RemovePlaceholder() " {{{
|
||||
if !has('signs') || !g:EclimSignLevel
|
||||
return
|
||||
endif
|
||||
|
||||
let existing = eclim#display#signs#GetExisting('placeholder')
|
||||
for exists in existing
|
||||
call eclim#display#signs#Unplace(exists.id)
|
||||
endfor
|
||||
endfunction " }}}
|
||||
|
||||
" define signs for manually added user marks.
|
||||
if has('signs')
|
||||
call eclim#display#signs#Define(
|
||||
\ 'user', g:EclimUserSignText, g:EclimUserSignHighlight)
|
||||
endif
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
352
.vim/bundle/eclim/eclim/autoload/eclim/display/window.vim
Normal file
352
.vim/bundle/eclim/eclim/autoload/eclim/display/window.vim
Normal file
|
|
@ -0,0 +1,352 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" Utility functions for working with vim windows.
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2012 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" GlobalVariables {{{
|
||||
let g:VerticalToolBuffers = {}
|
||||
|
||||
if !exists('g:VerticalToolWindowSide')
|
||||
let g:VerticalToolWindowSide = 'left'
|
||||
endif
|
||||
|
||||
if g:VerticalToolWindowSide == 'right'
|
||||
let g:VerticalToolWindowPosition = 'botright vertical'
|
||||
else
|
||||
let g:VerticalToolWindowPosition = 'topleft vertical'
|
||||
endif
|
||||
|
||||
if !exists('g:VerticalToolWindowWidth')
|
||||
let g:VerticalToolWindowWidth = 30
|
||||
endif
|
||||
" }}}
|
||||
|
||||
function! eclim#display#window#VerticalToolWindowOpen(name, weight, ...) " {{{
|
||||
" Handles opening windows in the vertical tool window on the left (taglist,
|
||||
" project tree, etc.)
|
||||
|
||||
let taglist_window = -1
|
||||
if exists('g:TagList_title')
|
||||
let taglist_window = bufwinnr(eclim#util#EscapeBufferName(g:TagList_title))
|
||||
let taglist_position = 'left'
|
||||
if exists('g:Tlist_Use_Horiz_Window') && g:Tlist_Use_Horiz_Window
|
||||
let taglist_position = 'horizontal'
|
||||
elseif exists('g:TaglistTooPosition')
|
||||
let taglist_position = g:TaglistTooPosition
|
||||
elseif exists('g:Tlist_Use_Right_Window') && g:Tlist_Use_Right_Window
|
||||
let taglist_position = 'right'
|
||||
endif
|
||||
endif
|
||||
if taglist_window == -1 && exists(':TagbarOpen')
|
||||
let taglist_window = bufwinnr('__Tagbar__')
|
||||
let taglist_position = 'right'
|
||||
if exists('g:tagbar_left') && g:tagbar_left
|
||||
let taglist_position = 'left'
|
||||
endif
|
||||
endif
|
||||
if taglist_window != -1
|
||||
" don't consider horizontal taglist, or taglist configured to display
|
||||
" opposite the tool windows as a tool window member.
|
||||
if taglist_position != g:VerticalToolWindowSide
|
||||
let taglist_window = -1
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
let relative_window = 0
|
||||
let relative_window_loc = 'below'
|
||||
if taglist_window != -1 || len(g:VerticalToolBuffers) > 0
|
||||
if taglist_window != -1
|
||||
let relative_window = taglist_window
|
||||
endif
|
||||
for toolbuf in keys(g:VerticalToolBuffers)
|
||||
exec 'let toolbuf = ' . toolbuf
|
||||
if bufwinnr(toolbuf) != -1
|
||||
if relative_window == 0
|
||||
let relative_window = bufwinnr(toolbuf)
|
||||
if getbufvar(toolbuf, 'weight') > a:weight
|
||||
let relative_window_loc = 'below'
|
||||
else
|
||||
let relative_window_loc = 'above'
|
||||
endif
|
||||
elseif getbufvar(toolbuf, 'weight') > a:weight
|
||||
let relative_window = bufwinnr(toolbuf)
|
||||
let relative_window_loc = 'below'
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
if relative_window != 0
|
||||
let wincmd = relative_window . 'winc w | ' . relative_window_loc . ' '
|
||||
else
|
||||
let wincmd = g:VerticalToolWindowPosition . ' ' . g:VerticalToolWindowWidth
|
||||
endif
|
||||
|
||||
let escaped = substitute(
|
||||
\ a:name, '\(.\{-}\)\[\(.\{-}\)\]\(.\{-}\)', '\1[[]\2[]]\3', 'g')
|
||||
if a:0 && a:1
|
||||
let bufnum = -1
|
||||
for bnr in tabpagebuflist()
|
||||
if bufname(bnr) == a:name
|
||||
let bufnum = bnr
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
else
|
||||
let bufnum = bufnr(escaped)
|
||||
endif
|
||||
let name = bufnum == -1 ? a:name : '+buffer' . bufnum
|
||||
silent call eclim#util#ExecWithoutAutocmds(wincmd . ' split ' . name)
|
||||
|
||||
doautocmd BufWinEnter
|
||||
setlocal winfixwidth
|
||||
setlocal nonumber
|
||||
setlocal nospell norelativenumber
|
||||
|
||||
let b:weight = a:weight
|
||||
let bufnum = bufnr('%')
|
||||
let g:VerticalToolBuffers[bufnum] = a:name
|
||||
augroup eclim_vertical_tool_windows
|
||||
autocmd!
|
||||
autocmd BufDelete * call s:PreventCloseOnBufferDelete()
|
||||
autocmd BufEnter * nested call s:CloseIfLastWindow()
|
||||
augroup END
|
||||
|
||||
if exists('g:TagList_title') &&
|
||||
\ (!exists('g:Tlist_Use_Horiz_Window') || !g:Tlist_Use_Horiz_Window)
|
||||
augroup eclim_vertical_tool_windows_move_taglist
|
||||
autocmd!
|
||||
exec 'autocmd BufWinEnter ' . eclim#util#EscapeBufferName(g:TagList_title) .
|
||||
\ ' call s:MoveRelativeTo()'
|
||||
augroup END
|
||||
endif
|
||||
if exists(':TagbarOpen')
|
||||
augroup eclim_vertical_tool_windows_move_tagbar
|
||||
autocmd!
|
||||
autocmd BufWinEnter __Tagbar__ call s:MoveRelativeTo()
|
||||
augroup END
|
||||
endif
|
||||
augroup eclim_vertical_tool_windows_buffer
|
||||
exec 'autocmd BufWinLeave <buffer> ' .
|
||||
\ 'silent! call remove(g:VerticalToolBuffers, ' . bufnum . ') | ' .
|
||||
\ 'autocmd! eclim_vertical_tool_windows_buffer * <buffer=' . bufnum . '>'
|
||||
augroup END
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#display#window#VerticalToolWindowRestore() " {{{
|
||||
" Used to restore the tool windows to their proper width if some action
|
||||
" altered them.
|
||||
|
||||
for toolbuf in keys(g:VerticalToolBuffers)
|
||||
exec 'let toolbuf = ' . toolbuf
|
||||
if bufwinnr(toolbuf) != -1
|
||||
exec 'vertical ' . bufwinnr(toolbuf) . 'resize ' . g:VerticalToolWindowWidth
|
||||
endif
|
||||
endfor
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#display#window#GetWindowOptions(winnum) " {{{
|
||||
" Gets a dictionary containing all the localy set options for the specified
|
||||
" window.
|
||||
|
||||
let curwin = winnr()
|
||||
try
|
||||
exec a:winnum . 'winc w'
|
||||
redir => list
|
||||
silent exec 'setlocal'
|
||||
redir END
|
||||
finally
|
||||
exec curwin . 'winc w'
|
||||
endtry
|
||||
|
||||
let list = substitute(list, '---.\{-}---', '', '')
|
||||
let winopts = {}
|
||||
for wopt in split(list, '\(\n\|\s\s\+\)')[1:]
|
||||
if wopt =~ '^[a-z]'
|
||||
if wopt =~ '='
|
||||
let key = substitute(wopt, '\(.\{-}\)=.*', '\1', '')
|
||||
let value = substitute(wopt, '.\{-}=\(.*\)', '\1', '')
|
||||
let winopts[key] = value
|
||||
else
|
||||
let winopts[wopt] = ''
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
return winopts
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#display#window#SetWindowOptions(winnum, options) " {{{
|
||||
" Given a dictionary of options, sets each as local options for the specified
|
||||
" window.
|
||||
|
||||
let curwin = winnr()
|
||||
try
|
||||
exec a:winnum . 'winc w'
|
||||
for key in keys(a:options)
|
||||
if key =~ '^no'
|
||||
silent! exec 'setlocal ' . key
|
||||
else
|
||||
silent! exec 'setlocal ' . key . '=' . escape(a:options[key], ' ')
|
||||
endif
|
||||
endfor
|
||||
finally
|
||||
exec curwin . 'winc w'
|
||||
endtry
|
||||
endfunction " }}}
|
||||
|
||||
function! s:CloseIfLastWindow() " {{{
|
||||
if histget(':', -1) !~ '^bd'
|
||||
let close = 1
|
||||
for bufnr in tabpagebuflist()
|
||||
if has_key(g:VerticalToolBuffers, bufnr)
|
||||
continue
|
||||
endif
|
||||
if exists('g:TagList_title') && bufname(bufnr) == g:TagList_title
|
||||
continue
|
||||
endif
|
||||
if exists('g:BufExplorer_title') && bufname(bufnr) == '[BufExplorer]'
|
||||
let close = 0
|
||||
break
|
||||
endif
|
||||
|
||||
let buftype = getbufvar(bufnr, '&buftype')
|
||||
if buftype != '' && buftype != 'help'
|
||||
continue
|
||||
endif
|
||||
|
||||
let close = 0
|
||||
break
|
||||
endfor
|
||||
|
||||
if close
|
||||
if tabpagenr('$') > 1
|
||||
tabclose
|
||||
else
|
||||
quitall
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! s:MoveRelativeTo() " {{{
|
||||
" get the buffer that the taglist was opened from
|
||||
let curwin = winnr()
|
||||
let list_buffer = bufnr('%')
|
||||
winc p
|
||||
let orig_buffer = bufnr('%')
|
||||
exec curwin . 'winc p'
|
||||
|
||||
for toolbuf in keys(g:VerticalToolBuffers)
|
||||
exec 'let toolbuf = ' . toolbuf
|
||||
if bufwinnr(toolbuf) != -1
|
||||
call setwinvar(bufwinnr(toolbuf), 'marked_for_removal', 1)
|
||||
let winoptions = eclim#display#window#GetWindowOptions(bufwinnr(toolbuf))
|
||||
call remove(winoptions, 'filetype')
|
||||
call remove(winoptions, 'syntax')
|
||||
call eclim#display#window#VerticalToolWindowOpen(
|
||||
\ g:VerticalToolBuffers[toolbuf], getbufvar(toolbuf, 'weight'))
|
||||
call eclim#display#window#SetWindowOptions(winnr(), winoptions)
|
||||
endif
|
||||
endfor
|
||||
|
||||
let winnum = 1
|
||||
while winnum <= winnr('$')
|
||||
if getwinvar(winnum, 'marked_for_removal') == 1
|
||||
exec winnum . 'winc w'
|
||||
close
|
||||
else
|
||||
let winnum += 1
|
||||
endif
|
||||
endwhile
|
||||
call eclim#display#window#VerticalToolWindowRestore()
|
||||
|
||||
" some window juggling so that winc p from taglist goes back to the original
|
||||
" buffer
|
||||
exec bufwinnr(orig_buffer) . 'winc w'
|
||||
exec bufwinnr(list_buffer) . 'winc w'
|
||||
endfunction " }}}
|
||||
|
||||
function! s:PreventCloseOnBufferDelete() " {{{
|
||||
let index = 1
|
||||
let numtoolwindows = 0
|
||||
let numtempwindows = 0
|
||||
let tempbuffersbot = []
|
||||
while index <= winnr('$')
|
||||
let buf = winbufnr(index)
|
||||
let bufname = bufname(buf)
|
||||
if index(keys(g:VerticalToolBuffers), string(buf)) != -1
|
||||
let numtoolwindows += 1
|
||||
elseif getwinvar(index, '&winfixheight') || getwinvar(index, '&winfixwidth')
|
||||
let numtempwindows += 1
|
||||
if getwinvar(index, '&winfixheight')
|
||||
call add(tempbuffersbot, buf)
|
||||
endif
|
||||
endif
|
||||
let index += 1
|
||||
endwhile
|
||||
|
||||
if winnr('$') == (numtoolwindows + numtempwindows)
|
||||
let toolbuf = bufnr('%')
|
||||
if g:VerticalToolWindowSide == 'right'
|
||||
vertical topleft new
|
||||
else
|
||||
vertical botright new
|
||||
endif
|
||||
setlocal noreadonly modifiable
|
||||
let curbuf = bufnr('%')
|
||||
let removed = str2nr(expand('<abuf>'))
|
||||
let next = eclim#common#buffers#OpenNextHiddenTabBuffer(removed)
|
||||
if next != 0
|
||||
let curbuf = next
|
||||
endif
|
||||
|
||||
" resize windows
|
||||
exec bufwinnr(toolbuf) . 'winc w'
|
||||
exec 'vertical resize ' . g:VerticalToolWindowWidth
|
||||
|
||||
" fix the position of the temp windows
|
||||
for buf in tempbuffersbot
|
||||
" open the buffer in the temp window position
|
||||
botright 10new
|
||||
exec 'buffer ' . buf
|
||||
setlocal winfixheight
|
||||
|
||||
" close the old window
|
||||
let winnr = winnr()
|
||||
let index = 1
|
||||
while index <= winnr('$')
|
||||
if winbufnr(index) == buf && index != winnr
|
||||
exec index . 'winc w'
|
||||
close
|
||||
winc p
|
||||
break
|
||||
endif
|
||||
let index += 1
|
||||
endwhile
|
||||
endfor
|
||||
|
||||
exec bufwinnr(curbuf) . 'winc w'
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
169
.vim/bundle/eclim/eclim/autoload/eclim/help.vim
Normal file
169
.vim/bundle/eclim/eclim/autoload/eclim/help.vim
Normal file
|
|
@ -0,0 +1,169 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" Commands view / search eclim help files.
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Global Variables {{{
|
||||
let g:EclimHelpDir = g:EclimBaseDir . '/eclim/doc'
|
||||
" }}}
|
||||
|
||||
" Help(tag) {{{
|
||||
function! eclim#help#Help(tag, link)
|
||||
if !filereadable(substitute(g:EclimHelpDir, '\\\s', ' ', 'g') . '/tags')
|
||||
call eclim#util#Echo('indexing eclim help files...')
|
||||
exec 'helptags ' . g:EclimHelpDir
|
||||
let paths = split(glob(g:EclimHelpDir . '/**/*'), '\n')
|
||||
call filter(paths, 'isdirectory(v:val)')
|
||||
for path in paths
|
||||
exec 'helptags ' . path
|
||||
endfor
|
||||
call eclim#util#Echo('eclim help files indexed')
|
||||
endif
|
||||
|
||||
let savetags = &tags
|
||||
exec 'set tags=' . escape(escape(g:EclimHelpDir, ' '), ' ') . '/**/tags'
|
||||
try
|
||||
let tag = a:tag
|
||||
if tag == '' && !a:link
|
||||
let tag = 'index'
|
||||
elseif tag ==''
|
||||
let line = getline('.')
|
||||
let tag = substitute(
|
||||
\ line, '.*|\(\S\{-}\%' . col('.') . 'c\S\{-}\)|.*', '\1', '')
|
||||
if tag == line
|
||||
return
|
||||
endif
|
||||
endif
|
||||
|
||||
call s:HelpWindow()
|
||||
exec 'tag ' . tag
|
||||
let w:eclim_help = 1
|
||||
|
||||
" needed to ensure taglist is updated if open
|
||||
doautocmd BufEnter
|
||||
catch /^Vim\%((\a\+)\)\=:E426/
|
||||
if !exists('w:eclim_help')
|
||||
close
|
||||
endif
|
||||
call eclim#util#EchoError('Sorry no eclim help for ' . tag)
|
||||
finally
|
||||
let &tags = savetags
|
||||
endtry
|
||||
endfunction " }}}
|
||||
|
||||
" HelpGrep() {{{
|
||||
function! eclim#help#HelpGrep(args)
|
||||
exec 'vimgrep ' a:args . ' ' . g:EclimHelpDir . '/**/*.txt'
|
||||
endfunction " }}}
|
||||
|
||||
" s:HelpWindow() {{{
|
||||
function s:HelpWindow()
|
||||
let max = winnr('$')
|
||||
let index = 1
|
||||
while index <= max
|
||||
if getwinvar(index, 'eclim_help')
|
||||
exec index . 'winc w'
|
||||
return
|
||||
endif
|
||||
let index += 1
|
||||
endwhile
|
||||
|
||||
new
|
||||
endfunction " }}}
|
||||
|
||||
" BufferHelp(lines, orientation, size) {{{
|
||||
" Function to display a help window for the current buffer.
|
||||
function! eclim#help#BufferHelp(lines, orientation, size)
|
||||
let orig_bufnr = bufnr('%')
|
||||
let name = expand('%')
|
||||
if name =~ '^\W.*\W$'
|
||||
let name = name[:-2] . ' Help' . name[len(name) - 1]
|
||||
else
|
||||
let name .= ' Help'
|
||||
endif
|
||||
|
||||
let bname = eclim#util#EscapeBufferName(name)
|
||||
|
||||
let orient = a:orientation == 'vertical' ? 'v' : ''
|
||||
if bufwinnr(bname) != -1
|
||||
exec 'bd ' . bufnr(bname)
|
||||
return
|
||||
endif
|
||||
|
||||
silent! noautocmd exec a:size . orient . "new " . escape(name, ' ')
|
||||
if a:orientation == 'vertical'
|
||||
setlocal winfixwidth
|
||||
else
|
||||
setlocal winfixheight
|
||||
endif
|
||||
setlocal nowrap
|
||||
setlocal noswapfile nobuflisted nonumber
|
||||
setlocal nospell norelativenumber
|
||||
setlocal buftype=nofile bufhidden=delete
|
||||
nnoremap <buffer> <silent> ? :bd<cr>
|
||||
nnoremap <buffer> <silent> q :bd<cr>
|
||||
|
||||
setlocal modifiable noreadonly
|
||||
silent 1,$delete _
|
||||
call append(1, a:lines)
|
||||
retab
|
||||
silent 1,1delete _
|
||||
|
||||
if len(a:000) == 0 || a:000[0]
|
||||
setlocal nomodified nomodifiable readonly
|
||||
endif
|
||||
|
||||
let help_bufnr = bufnr('%')
|
||||
augroup eclim_help_buffer
|
||||
autocmd! BufWinLeave <buffer>
|
||||
autocmd BufWinLeave <buffer> nested autocmd! eclim_help_buffer * <buffer>
|
||||
exec 'autocmd BufWinLeave <buffer> nested ' .
|
||||
\ 'autocmd! eclim_help_buffer * <buffer=' . orig_bufnr . '>'
|
||||
exec 'autocmd! BufWinLeave <buffer=' . orig_bufnr . '>'
|
||||
exec 'autocmd BufWinLeave <buffer=' . orig_bufnr . '> nested bd ' . help_bufnr
|
||||
augroup END
|
||||
|
||||
return help_bufnr
|
||||
endfunction " }}}
|
||||
|
||||
" CommandComplete(argLead, cmdLine, cursorPos) {{{
|
||||
function! eclim#help#CommandCompleteTag(argLead, cmdLine, cursorPos)
|
||||
let cmdTail = strpart(a:cmdLine, a:cursorPos)
|
||||
let argLead = substitute(a:argLead, cmdTail . '$', '', '')
|
||||
|
||||
let savetags = &tags
|
||||
exec 'set tags=' . escape(escape(g:EclimHelpDir, ' '), ' ') . '/**/tags'
|
||||
try
|
||||
let tags = sort(map(taglist(argLead . '.*'), "v:val['name']"))
|
||||
let results = []
|
||||
for tag in tags
|
||||
if index(results, tag) == -1
|
||||
call add(results, tag)
|
||||
endif
|
||||
endfor
|
||||
return results
|
||||
finally
|
||||
let &tags = savetags
|
||||
endtry
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
135
.vim/bundle/eclim/eclim/autoload/eclim/html/util.vim
Normal file
135
.vim/bundle/eclim/eclim/autoload/eclim/html/util.vim
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" Various html relatd functions.
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2009 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" HtmlToText() {{{
|
||||
" Converts the supplied basic html to text.
|
||||
function! eclim#html#util#HtmlToText(html)
|
||||
let text = a:html
|
||||
let text = substitute(text, '<br/\?>\c', '\n', 'g')
|
||||
let text = substitute(text, '</\?b>\c', '', 'g')
|
||||
let text = substitute(text, '</\?ul>\c', '', 'g')
|
||||
let text = substitute(text, '<li>\c', '- ', 'g')
|
||||
let text = substitute(text, '</li>\c', '', 'g')
|
||||
let text = substitute(text, '</\?p/\?>\c', '', 'g')
|
||||
let text = substitute(text, '</\?code>\c', '', 'g')
|
||||
let text = substitute(text, '</\?pre>\c', '', 'g')
|
||||
let text = substitute(text, '<a .\{-}>\c', '', 'g')
|
||||
let text = substitute(text, '</a>', '', 'g')
|
||||
let text = substitute(text, '"\c', '"', 'g')
|
||||
let text = substitute(text, '&\c', '&', 'g')
|
||||
let text = substitute(text, '<\c', '<', 'g')
|
||||
let text = substitute(text, '>\c', '>', 'g')
|
||||
|
||||
return text
|
||||
endfunction " }}}
|
||||
|
||||
" InCssBlock() {{{
|
||||
" Determines if the cusor is inside of <style> tags.
|
||||
function! eclim#html#util#InCssBlock()
|
||||
let line = line('.')
|
||||
|
||||
let stylestart = search('<style\>', 'bcWn')
|
||||
if stylestart > 0
|
||||
let styleend = search('</style\s*>', 'bWn')
|
||||
endif
|
||||
if stylestart > 0 && stylestart < line &&
|
||||
\ (styleend == 0 || (styleend > stylestart && line < styleend))
|
||||
return stylestart
|
||||
endif
|
||||
|
||||
return 0
|
||||
endfunction " }}}
|
||||
|
||||
" InJavascriptBlock() {{{
|
||||
" Determines if the cursor is inside of <script> tags.
|
||||
function! eclim#html#util#InJavascriptBlock()
|
||||
let line = line('.')
|
||||
|
||||
let scriptstart = search('<script\>', 'bcWn')
|
||||
if scriptstart > 0
|
||||
let scriptend = search('</script\s*>', 'bWn')
|
||||
endif
|
||||
if scriptstart > 0 && scriptstart < line &&
|
||||
\ (scriptend == 0 || (scriptend > scriptstart && line < scriptend))
|
||||
return scriptstart
|
||||
endif
|
||||
|
||||
return 0
|
||||
endfunction " }}}
|
||||
|
||||
" OpenInBrowser(file) {{{
|
||||
function! eclim#html#util#OpenInBrowser(file)
|
||||
let file = a:file
|
||||
if file == ''
|
||||
let file = expand('%:p')
|
||||
else
|
||||
let file = getcwd() . '/' . file
|
||||
endif
|
||||
let url = 'file://' . file
|
||||
call eclim#web#OpenUrl(url)
|
||||
endfunction " }}}
|
||||
|
||||
" UrlEncode(string) {{{
|
||||
function! eclim#html#util#UrlEncode(string)
|
||||
let result = a:string
|
||||
|
||||
" must be first
|
||||
let result = substitute(result, '%', '%25', 'g')
|
||||
|
||||
let result = substitute(result, '\s', '%20', 'g')
|
||||
let result = substitute(result, '!', '%21', 'g')
|
||||
let result = substitute(result, '"', '%22', 'g')
|
||||
let result = substitute(result, '#', '%23', 'g')
|
||||
let result = substitute(result, '\$', '%24', 'g')
|
||||
let result = substitute(result, '&', '%26', 'g')
|
||||
let result = substitute(result, "'", '%27', 'g')
|
||||
let result = substitute(result, '(', '%28', 'g')
|
||||
let result = substitute(result, ')', '%29', 'g')
|
||||
let result = substitute(result, '*', '%2A', 'g')
|
||||
let result = substitute(result, '+', '%2B', 'g')
|
||||
let result = substitute(result, ',', '%2C', 'g')
|
||||
let result = substitute(result, '-', '%2D', 'g')
|
||||
let result = substitute(result, '\.', '%2E', 'g')
|
||||
let result = substitute(result, '\/', '%2F', 'g')
|
||||
let result = substitute(result, ':', '%3A', 'g')
|
||||
let result = substitute(result, ';', '%3B', 'g')
|
||||
let result = substitute(result, '<', '%3C', 'g')
|
||||
let result = substitute(result, '=', '%3D', 'g')
|
||||
let result = substitute(result, '>', '%3E', 'g')
|
||||
let result = substitute(result, '?', '%3F', 'g')
|
||||
let result = substitute(result, '@', '%40', 'g')
|
||||
let result = substitute(result, '[', '%5B', 'g')
|
||||
let result = substitute(result, '\\', '%5C', 'g')
|
||||
let result = substitute(result, ']', '%5D', 'g')
|
||||
let result = substitute(result, '\^', '%5E', 'g')
|
||||
let result = substitute(result, '`', '%60', 'g')
|
||||
let result = substitute(result, '{', '%7B', 'g')
|
||||
let result = substitute(result, '|', '%7C', 'g')
|
||||
let result = substitute(result, '}', '%7D', 'g')
|
||||
let result = substitute(result, '\~', '%7E', 'g')
|
||||
|
||||
return result
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
144
.vim/bundle/eclim/eclim/autoload/eclim/java/ant/complete.vim
Normal file
144
.vim/bundle/eclim/eclim/autoload/eclim/java/ant/complete.vim
Normal file
|
|
@ -0,0 +1,144 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" see http://eclim.org/vim/java/ant/complete.html
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Script Varables {{{
|
||||
let s:complete_command =
|
||||
\ '-command ant_complete -p "<project>" -f "<file>" -o <offset> -e <encoding>'
|
||||
let s:command_targets = '-command ant_targets -p "<project>" -f "<file>"'
|
||||
" }}}
|
||||
|
||||
" CodeComplete(findstart, base) {{{
|
||||
" Handles ant code completion.
|
||||
function! eclim#java#ant#complete#CodeComplete(findstart, base)
|
||||
if !eclim#project#util#IsCurrentFileInProject(0)
|
||||
return a:findstart ? -1 : []
|
||||
endif
|
||||
|
||||
if a:findstart
|
||||
call eclim#lang#SilentUpdate(1)
|
||||
|
||||
" locate the start of the word
|
||||
let line = getline('.')
|
||||
|
||||
let start = col('.') - 1
|
||||
|
||||
"exceptions that break the rule
|
||||
if line[start - 1] == '.'
|
||||
let start -= 1
|
||||
endif
|
||||
|
||||
" always start in front of the the '<'
|
||||
if line[start] == '<'
|
||||
let start += 1
|
||||
endif
|
||||
|
||||
while start > 0 && line[start - 1] =~ '\w'
|
||||
let start -= 1
|
||||
endwhile
|
||||
|
||||
" if prev char is '/' then back off the start pos, since the completion
|
||||
" result will contain the '/'.
|
||||
if line[start - 1] == '/'
|
||||
let start -= 1
|
||||
endif
|
||||
|
||||
return start
|
||||
else
|
||||
let offset = eclim#util#GetOffset() + len(a:base) - 1
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let file = eclim#lang#SilentUpdate(1, 0)
|
||||
if file == ''
|
||||
return []
|
||||
endif
|
||||
|
||||
let command = s:complete_command
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
let command = substitute(command, '<offset>', offset, '')
|
||||
let command = substitute(command, '<encoding>', eclim#util#GetEncoding(), '')
|
||||
|
||||
let completions = []
|
||||
let results = eclim#Execute(command)
|
||||
if type(results) != g:LIST_TYPE
|
||||
return
|
||||
endif
|
||||
|
||||
" if the word has a '.' in it (like package completion) then we need to
|
||||
" strip some off according to what is currently in the buffer.
|
||||
let prefix = substitute(getline('.'),
|
||||
\ '.\{-}\([[:alnum:].]\+\%' . col('.') . 'c\).*', '\1', '')
|
||||
|
||||
for result in results
|
||||
let word = result.completion
|
||||
" removed '<' and '>' from end tag results
|
||||
let word = substitute(word, '^<\(.*\)>$', '\1', '')
|
||||
|
||||
" strip off prefix if necessary.
|
||||
if word =~ '\.'
|
||||
let word = substitute(word, escape(prefix, '*'), '', '')
|
||||
endif
|
||||
|
||||
let menu = eclim#html#util#HtmlToText(result.menu)
|
||||
let info = eclim#html#util#HtmlToText(result.info)
|
||||
|
||||
let dict = {'word': word, 'menu': menu, 'info': info}
|
||||
|
||||
call add(completions, dict)
|
||||
endfor
|
||||
|
||||
return completions
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" CommandCompleteTarget(argLead, cmdLine, cursorPos) {{{
|
||||
" Custom command completion for ant targets.
|
||||
function! eclim#java#ant#complete#CommandCompleteTarget(argLead, cmdLine, cursorPos)
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
if project == ''
|
||||
return []
|
||||
endif
|
||||
|
||||
let file = eclim#java#ant#util#FindBuildFile()
|
||||
if project != "" && file != ""
|
||||
let file = eclim#project#util#GetProjectRelativeFilePath(file)
|
||||
let command = s:command_targets
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
|
||||
let targets = eclim#Execute(command)
|
||||
if type(targets) != g:LIST_TYPE
|
||||
return []
|
||||
endif
|
||||
|
||||
let cmdTail = strpart(a:cmdLine, a:cursorPos)
|
||||
let argLead = substitute(a:argLead, cmdTail . '$', '', '')
|
||||
call filter(targets, 'v:val =~ "^' . argLead . '"')
|
||||
|
||||
return targets
|
||||
endif
|
||||
|
||||
return []
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
171
.vim/bundle/eclim/eclim/autoload/eclim/java/ant/doc.vim
Normal file
171
.vim/bundle/eclim/eclim/autoload/eclim/java/ant/doc.vim
Normal file
|
|
@ -0,0 +1,171 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" see http://eclim.org/vim/java/ant/doc.html
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2012 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Global Varables {{{
|
||||
if !exists("g:AntDocDefaultUrl")
|
||||
let g:AntDocDefaultUrl =
|
||||
\ 'http://www.google.com/search?btnI=1&q=allintitle%3A<element>+task+%7C+type+site%3Aant.apache.org'
|
||||
endif
|
||||
|
||||
if !exists("g:AntUserDocs")
|
||||
let g:AntUserDocs = {}
|
||||
endif
|
||||
" }}}
|
||||
|
||||
" Script Varables {{{
|
||||
let s:targets = 'http://ant.apache.org/manual/targets.html'
|
||||
let s:using = 'http://ant.apache.org/manual/using.html#<element>s'
|
||||
let s:conditions = 'http://ant.apache.org/manual/Tasks/conditions.html#<element>'
|
||||
let s:mappers = 'http://ant.apache.org/manual/Types/mapper.html'
|
||||
let s:paths = 'http://ant.apache.org/manual/using.html#path'
|
||||
let s:types =
|
||||
\ 'http://ant.apache.org/manual/Types/<element>.html'
|
||||
let s:selectors =
|
||||
\ 'http://ant.apache.org/manual/Types/selectors.html#<element>select'
|
||||
let s:contrib_1 =
|
||||
\ 'http://ant-contrib.sourceforge.net/tasks/tasks/<element>.html'
|
||||
let s:contrib_2 =
|
||||
\ 'http://ant-contrib.sourceforge.net/tasks/tasks/<element>_task.html'
|
||||
let s:element_docs = {
|
||||
\ 'project' : s:using,
|
||||
\ 'target' : s:targets,
|
||||
\ 'and' : s:conditions,
|
||||
\ 'checksum' : s:conditions,
|
||||
\ 'checs' : s:conditions,
|
||||
\ 'contains' : s:conditions,
|
||||
\ 'equals' : s:conditions,
|
||||
\ 'filesmatch' : s:conditions,
|
||||
\ 'http' : s:conditions,
|
||||
\ 'isfalse' : s:conditions,
|
||||
\ 'isfileselected' : s:conditions,
|
||||
\ 'isreference' : s:conditions,
|
||||
\ 'isset' : s:conditions,
|
||||
\ 'istrue' : s:conditions,
|
||||
\ 'length' : s:conditions,
|
||||
\ 'not' : s:conditions,
|
||||
\ 'or' : s:conditions,
|
||||
\ 'os' : s:conditions,
|
||||
\ 'socket' : s:conditions,
|
||||
\ 'compositemapper' : s:mappers,
|
||||
\ 'filtermapper' : s:mappers,
|
||||
\ 'flattenmapper' : s:mappers,
|
||||
\ 'globmapper' : s:mappers,
|
||||
\ 'identitymapper' : s:mappers,
|
||||
\ 'mergemapper' : s:mappers,
|
||||
\ 'packagemapper' : s:mappers,
|
||||
\ 'regexmapper' : s:mappers,
|
||||
\ 'antlib' : s:types,
|
||||
\ 'description' : s:types,
|
||||
\ 'dirset' : s:types,
|
||||
\ 'filelist' : s:types,
|
||||
\ 'fileset' : s:types,
|
||||
\ 'filterchain' : s:types,
|
||||
\ 'filterset' : s:types,
|
||||
\ 'mapper' : s:types,
|
||||
\ 'patternset' : s:types,
|
||||
\ 'permissions' : s:types,
|
||||
\ 'propertyset' : s:types,
|
||||
\ 'redirector' : s:types,
|
||||
\ 'regexp' : s:types,
|
||||
\ 'xmlcatalog' : s:types,
|
||||
\ 'zipfileset' : s:types,
|
||||
\ 'classpath' : s:paths,
|
||||
\ 'path' : s:paths,
|
||||
\ 'containsregexp' : s:selectors,
|
||||
\ 'date' : s:selectors,
|
||||
\ 'depend' : s:selectors,
|
||||
\ 'depth' : s:selectors,
|
||||
\ 'different' : s:selectors,
|
||||
\ 'filename' : s:selectors,
|
||||
\ 'majority' : s:selectors,
|
||||
\ 'modified' : s:selectors,
|
||||
\ 'none' : s:selectors,
|
||||
\ 'present' : s:selectors,
|
||||
\ 'selector' : s:selectors,
|
||||
\ 'size' : s:selectors,
|
||||
\ 'type' : s:selectors,
|
||||
\ 'for' : s:contrib_1,
|
||||
\ 'foreach' : s:contrib_1,
|
||||
\ 'if' : s:contrib_1,
|
||||
\ 'outofdate' : s:contrib_1,
|
||||
\ 'runtarget' : s:contrib_1,
|
||||
\ 'switch' : s:contrib_1,
|
||||
\ 'throw' : s:contrib_1,
|
||||
\ 'timestampselector' : s:contrib_1,
|
||||
\ 'trycatch' : s:contrib_1,
|
||||
\ 'osfamily' : s:contrib_1,
|
||||
\ 'shellscript' : s:contrib_1,
|
||||
\ 'propertycopy' : s:contrib_1,
|
||||
\ 'propertyselector' : s:contrib_1,
|
||||
\ 'pathoffileset' : s:contrib_1,
|
||||
\ 'propertyregex' : s:contrib_1,
|
||||
\ 'sortlist' : s:contrib_1,
|
||||
\ 'urlencode' : s:contrib_1,
|
||||
\ 'forget' : s:contrib_1,
|
||||
\ 'compilewithwalls' : s:contrib_1,
|
||||
\ 'inifile' : s:contrib_1,
|
||||
\ 'verifydesign' : s:contrib_1,
|
||||
\ 'antcallback' : s:contrib_2,
|
||||
\ 'antfetch' : s:contrib_2,
|
||||
\ 'assert' : s:contrib_2,
|
||||
\ 'post' : s:contrib_2,
|
||||
\ 'stopwatch' : s:contrib_2,
|
||||
\ 'match' : s:contrib_2,
|
||||
\ 'variable' : s:contrib_2,
|
||||
\ 'limit' : s:contrib_2,
|
||||
\ 'antclipse' : s:contrib_2
|
||||
\ }
|
||||
" }}}
|
||||
|
||||
" FindDoc(element) {{{
|
||||
" Open the url to the documentation for the supplied element name or if not
|
||||
" provided, the element name under the cursor.
|
||||
function! eclim#java#ant#doc#FindDoc(element)
|
||||
let element = a:element
|
||||
if element == ''
|
||||
let col = eclim#util#GetCurrentElementColumn()
|
||||
if getline('.')[col - 2] !~ '<\|\/'
|
||||
" not on an element
|
||||
return
|
||||
endif
|
||||
let element = expand('<cword>')
|
||||
endif
|
||||
let element = tolower(element)
|
||||
|
||||
if has_key(s:element_docs, element)
|
||||
let url = s:element_docs[element]
|
||||
elseif has_key(g:AntUserDocs, element)
|
||||
let url = g:AntUserDocs[element]
|
||||
else
|
||||
let url = g:AntDocDefaultUrl
|
||||
endif
|
||||
|
||||
"let url = escape(url, '&%#')
|
||||
"let url = escape(url, '%#')
|
||||
let url = substitute(url, '<element>', element, 'g')
|
||||
|
||||
call eclim#web#OpenUrl(url)
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
31
.vim/bundle/eclim/eclim/autoload/eclim/java/ant/ivy.vim
Normal file
31
.vim/bundle/eclim/eclim/autoload/eclim/java/ant/ivy.vim
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" see http://eclim.org/vim/java/classpath.html
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2012 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" SetRepo(path) {{{
|
||||
" Sets the location of the ivy repository.
|
||||
function! eclim#java#ant#ivy#SetRepo(path)
|
||||
call eclim#java#classpath#VariableCreate('IVY_REPO', a:path)
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
36
.vim/bundle/eclim/eclim/autoload/eclim/java/ant/util.vim
Normal file
36
.vim/bundle/eclim/eclim/autoload/eclim/java/ant/util.vim
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" Utility functions for working with ant.
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2012 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" FindBuildFile() {{{
|
||||
" Finds the build file relative to the current file (like ant -find).
|
||||
function! eclim#java#ant#util#FindBuildFile()
|
||||
let buildFile = eclim#util#Findfile('build.xml', fnamemodify(expand('%:p'), ':h') . ';')
|
||||
if filereadable(buildFile)
|
||||
return substitute(fnamemodify(buildFile, ':p'), '\', '/', 'g')
|
||||
endif
|
||||
|
||||
return ''
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
241
.vim/bundle/eclim/eclim/autoload/eclim/java/classpath.vim
Normal file
241
.vim/bundle/eclim/eclim/autoload/eclim/java/classpath.vim
Normal file
|
|
@ -0,0 +1,241 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" see http://eclim.org/vim/java/classpath.html
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Script Variables {{{
|
||||
let s:command_variables = '-command java_classpath_variables'
|
||||
let s:command_variable_create =
|
||||
\ '-command java_classpath_variable_create -n "<name>" -p "<path>"'
|
||||
let s:command_variable_delete =
|
||||
\ '-command java_classpath_variable_delete -n "<name>"'
|
||||
|
||||
let s:entry_project =
|
||||
\ "\t<classpathentry exported=\"true\" kind=\"src\" path=\"/<path>\"/>"
|
||||
let s:entry ="\t<classpathentry kind=\"<kind>\" path=\"<path>\"/>"
|
||||
let s:entry_sourcepath =
|
||||
\ "\t<classpathentry kind=\"<kind>\" path=\"<path>\"\n\t\t\tsourcepath=\"<src>\"/>"
|
||||
let s:entry_javadoc =
|
||||
\ "\t<classpathentry kind=\"<kind>\" path=\"<path>\"\n" .
|
||||
\ "\t\t\tsourcepath=\"<src>\">\n" .
|
||||
\ "\t\t<attributes>\n" .
|
||||
\ "\t\t\t<attribute name=\"javadoc_location\" value=\"<javadoc>\"/>\n" .
|
||||
\ "\t\t</attributes>\n" .
|
||||
\ "\t</classpathentry>"
|
||||
" }}}
|
||||
|
||||
function! eclim#java#classpath#NewClasspathEntry(kind, arg, ...) " {{{
|
||||
" Adds a new entry to the current .classpath file.
|
||||
let template_name = 's:entry'
|
||||
let args = {'kind': a:kind, 'path': substitute(a:arg, '\', '/', 'g')}
|
||||
if a:0
|
||||
if a:0 == 1
|
||||
let template_name = 's:entry_sourcepath'
|
||||
let args['src'] = substitute(a:1, '\', '/', 'g')
|
||||
elseif a:0 == 2
|
||||
let template_name = 's:entry_javadoc'
|
||||
let args['src'] = substitute(a:1, '\', '/', 'g')
|
||||
let javadoc = substitute(a:2, '\', '/', 'g')
|
||||
let absolute = javadoc =~? '^\([a-z]:\)\?/'
|
||||
|
||||
" handle absolute vs project relative javadoc location
|
||||
if absolute
|
||||
" windows paths need a leading slash
|
||||
if javadoc =~? '^[a-z]:/'
|
||||
let javadoc = '/' . javadoc
|
||||
endif
|
||||
let javadoc = 'file:' . javadoc
|
||||
else
|
||||
if !eclim#project#util#IsCurrentFileInProject(1)
|
||||
return
|
||||
endif
|
||||
if javadoc =~? '\.jar$'
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let javadoc = 'platform:/resource/' . project . '/' . javadoc
|
||||
else
|
||||
" relative dirs must be made absolute
|
||||
let project = eclim#project#util#GetCurrentProjectRoot()
|
||||
let javadoc = project . '/' . javadoc
|
||||
endif
|
||||
endif
|
||||
|
||||
if javadoc =~? '\.jar$'
|
||||
let javadoc = 'jar:' . javadoc . '!/'
|
||||
elseif javadoc !~ '^file:'
|
||||
let javadoc = 'file:' . javadoc
|
||||
endif
|
||||
let args['javadoc'] = javadoc
|
||||
else
|
||||
call eclim#util#EchoError('Too many arguments.')
|
||||
return
|
||||
endif
|
||||
endif
|
||||
|
||||
if exists(template_name . '_' . a:kind)
|
||||
let template = {template_name}_{a:kind}
|
||||
else
|
||||
let template = {template_name}
|
||||
endif
|
||||
|
||||
for [key, value] in items(args)
|
||||
let template = substitute(template, '<' . key . '>', value, 'g')
|
||||
endfor
|
||||
|
||||
let cline = line('.')
|
||||
let ccol = col('.')
|
||||
call s:MoveToInsertPosition()
|
||||
let line = line('.')
|
||||
call append(line, split(template, '\n'))
|
||||
call cursor(cline + 1, ccol)
|
||||
endfunction " }}}
|
||||
|
||||
function! s:MoveToInsertPosition() " {{{
|
||||
" If necessary moves the cursor to a valid insert position.
|
||||
let start = search('<classpath\s*>', 'wn')
|
||||
let end = search('</classpath\s*>', 'wn')
|
||||
if line('.') < start || line('.') >= end
|
||||
call cursor(end - 1, 1)
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#classpath#GetVariableNames() " {{{
|
||||
let variables = eclim#Execute(s:command_variables)
|
||||
if type(variables) != g:LIST_TYPE
|
||||
return []
|
||||
endif
|
||||
return map(variables, "v:val.name")
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#classpath#VariableList() " {{{
|
||||
let variables = eclim#Execute(s:command_variables)
|
||||
if type(variables) != g:LIST_TYPE
|
||||
return
|
||||
endif
|
||||
if len(variables) == 0
|
||||
call eclim#util#Echo("No variables.")
|
||||
endif
|
||||
|
||||
let pad = 0
|
||||
for variable in variables
|
||||
let pad = len(variable.name) > pad ? len(variable.name) : pad
|
||||
endfor
|
||||
|
||||
let output = []
|
||||
for variable in variables
|
||||
call add(output, eclim#util#Pad(variable.name, pad) . ' - ' . variable.path)
|
||||
endfor
|
||||
|
||||
call eclim#util#Echo(join(output, "\n"))
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#classpath#VariableCreate(name, path) " {{{
|
||||
let path = substitute(fnamemodify(a:path, ':p'), '\', '/', 'g')
|
||||
if has('win32unix')
|
||||
let path = eclim#cygwin#WindowsPath(path)
|
||||
endif
|
||||
let command = s:command_variable_create
|
||||
let command = substitute(command, '<name>', a:name, '')
|
||||
let command = substitute(command, '<path>', path, '')
|
||||
|
||||
let result = eclim#Execute(command)
|
||||
if result != '0'
|
||||
call eclim#util#Echo(result)
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#classpath#VariableDelete(name) " {{{
|
||||
let command = s:command_variable_delete
|
||||
let command = substitute(command, '<name>', a:name, '')
|
||||
|
||||
let result = eclim#Execute(command)
|
||||
if result != '0'
|
||||
call eclim#util#Echo(result)
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#classpath#CommandCompleteVar(argLead, cmdLine, cursorPos) " {{{
|
||||
" Custom command completion for classpath var relative files.
|
||||
let cmdTail = strpart(a:cmdLine, a:cursorPos)
|
||||
let argLead = substitute(a:argLead, cmdTail . '$', '', '')
|
||||
|
||||
let vars = eclim#java#classpath#GetVariableNames()
|
||||
call filter(vars, 'v:val =~ "\\M^' . argLead . '"')
|
||||
|
||||
return vars
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#classpath#CommandCompleteVarPath(argLead, cmdLine, cursorPos) " {{{
|
||||
" Custom command completion for classpath var relative files.
|
||||
let cmdLine = strpart(a:cmdLine, 0, a:cursorPos)
|
||||
let args = eclim#util#ParseCmdLine(cmdLine)
|
||||
let argLead = cmdLine =~ '\s$' ? '' : args[len(args) - 1]
|
||||
|
||||
let vars = eclim#Execute(s:command_variables)
|
||||
|
||||
" just the variable name
|
||||
if argLead !~ '/'
|
||||
let var_names = deepcopy(vars)
|
||||
call filter(var_names, 'v:val.name =~ "^' . argLead . '"')
|
||||
if len(var_names) > 0
|
||||
call map(var_names,
|
||||
\ "isdirectory(v:val.path) ? v:val.name . '/' : v:val.name")
|
||||
endif
|
||||
return var_names
|
||||
endif
|
||||
|
||||
" variable name + path
|
||||
let var = substitute(argLead, '\(.\{-}\)/.*', '\1', '')
|
||||
let var_dir = ""
|
||||
for cv in vars
|
||||
if cv.name =~ '^' . var
|
||||
let var_dir = cv.path
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
if var_dir == ''
|
||||
return []
|
||||
endif
|
||||
|
||||
let var_dir = escape(substitute(var_dir, '\', '/', 'g'), ' ')
|
||||
let argLead = substitute(argLead, var, var_dir, '')
|
||||
let files = eclim#util#CommandCompleteFile(argLead, a:cmdLine, a:cursorPos)
|
||||
let replace = escape(var_dir, '\')
|
||||
call map(files, "substitute(v:val, '" . replace . "', '" . var . "', '')")
|
||||
|
||||
return files
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#classpath#CommandCompleteVarAndDir(argLead, cmdLine, cursorPos) " {{{
|
||||
" Custom command completion for classpath var relative files.
|
||||
let cmdLine = strpart(a:cmdLine, 0, a:cursorPos)
|
||||
let args = eclim#util#ParseCmdLine(cmdLine)
|
||||
let argLead = cmdLine =~ '\s$' ? '' : args[len(args) - 1]
|
||||
|
||||
" complete vars for first arg
|
||||
if cmdLine =~ '^' . args[0] . '\s*' . escape(argLead, '~.\') . '$'
|
||||
return eclim#java#classpath#CommandCompleteVar(argLead, a:cmdLine, a:cursorPos)
|
||||
endif
|
||||
|
||||
return eclim#util#CommandCompleteDir(a:argLead, a:cmdLine, a:cursorPos)
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
188
.vim/bundle/eclim/eclim/autoload/eclim/java/complete.vim
Normal file
188
.vim/bundle/eclim/eclim/autoload/eclim/java/complete.vim
Normal file
|
|
@ -0,0 +1,188 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" see http://eclim.org/vim/java/complete.html
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Global Varables {{{
|
||||
if !exists("g:EclimJavaCompleteLayout")
|
||||
if &completeopt !~ 'preview' && &completeopt =~ 'menu'
|
||||
let g:EclimJavaCompleteLayout = 'standard'
|
||||
else
|
||||
let g:EclimJavaCompleteLayout = 'compact'
|
||||
endif
|
||||
endif
|
||||
if !exists("g:EclimJavaCompleteCaseSensitive")
|
||||
let g:EclimJavaCompleteCaseSensitive = !&ignorecase
|
||||
endif
|
||||
" }}}
|
||||
|
||||
" Script Varables {{{
|
||||
let s:complete_command =
|
||||
\ '-command java_complete -p "<project>" -f "<file>" ' .
|
||||
\ '-o <offset> -e <encoding> -l <layout>'
|
||||
" }}}
|
||||
|
||||
" CodeComplete(findstart, base) {{{
|
||||
" Handles java code completion.
|
||||
function! eclim#java#complete#CodeComplete(findstart, base)
|
||||
if !eclim#project#util#IsCurrentFileInProject(0)
|
||||
return a:findstart ? -1 : []
|
||||
endif
|
||||
|
||||
if a:findstart
|
||||
call eclim#lang#SilentUpdate(1)
|
||||
|
||||
" locate the start of the word
|
||||
let line = getline('.')
|
||||
|
||||
let start = col('.') - 1
|
||||
|
||||
"exceptions that break the rule
|
||||
if line[start] == '.' && line[start - 1] != '.'
|
||||
let start -= 1
|
||||
endif
|
||||
|
||||
while start > 0 && line[start - 1] =~ '\w'
|
||||
let start -= 1
|
||||
endwhile
|
||||
|
||||
return start
|
||||
else
|
||||
let offset = eclim#util#GetOffset() + len(a:base)
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let file = eclim#lang#SilentUpdate(1, 0)
|
||||
if file == ''
|
||||
return []
|
||||
endif
|
||||
|
||||
let command = s:complete_command
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
let command = substitute(command, '<offset>', offset, '')
|
||||
let command = substitute(command, '<encoding>', eclim#util#GetEncoding(), '')
|
||||
let command = substitute(command, '<layout>', g:EclimJavaCompleteLayout, '')
|
||||
|
||||
let completions = []
|
||||
let response = eclim#Execute(command)
|
||||
if type(response) != g:DICT_TYPE
|
||||
return
|
||||
endif
|
||||
|
||||
if has_key(response, 'imports') && len(response.imports)
|
||||
let imports = response.imports
|
||||
if exists('g:TestEclimWorkspace') " allow this to be tested somewhat
|
||||
call eclim#java#complete#ImportThenComplete(imports)
|
||||
else
|
||||
let func = "eclim#java#complete#ImportThenComplete(" . string(imports) . ")"
|
||||
call feedkeys("\<c-e>\<c-r>=" . func . "\<cr>", 'n')
|
||||
endif
|
||||
" prevents supertab's completion chain from attempting the next
|
||||
" completion in the chain.
|
||||
return -1
|
||||
endif
|
||||
|
||||
if has_key(response, 'error') && len(response.completions) == 0
|
||||
call eclim#util#EchoError(response.error.message)
|
||||
return -1
|
||||
endif
|
||||
|
||||
" if the word has a '.' in it (like package completion) then we need to
|
||||
" strip some off according to what is currently in the buffer.
|
||||
let prefix = substitute(getline('.'),
|
||||
\ '.\{-}\([[:alnum:].]\+\%' . col('.') . 'c\).*', '\1', '')
|
||||
|
||||
" as of eclipse 3.2 it will include the parens on a completion result even
|
||||
" if the file already has them.
|
||||
let open_paren = getline('.') =~ '\%' . col('.') . 'c\s*('
|
||||
let close_paren = getline('.') =~ '\%' . col('.') . 'c\s*(\s*)'
|
||||
|
||||
" when completing imports, the completions include ending ';'
|
||||
let semicolon = getline('.') =~ '\%' . col('.') . 'c\s*;'
|
||||
|
||||
for result in response.completions
|
||||
let word = result.completion
|
||||
|
||||
" strip off prefix if necessary.
|
||||
if word =~ '\.'
|
||||
let word = substitute(word, prefix, '', '')
|
||||
endif
|
||||
|
||||
" strip off close paren if necessary.
|
||||
if word =~ ')$' && close_paren
|
||||
let word = strpart(word, 0, strlen(word) - 1)
|
||||
endif
|
||||
|
||||
" strip off open paren if necessary.
|
||||
if word =~ '($' && open_paren
|
||||
let word = strpart(word, 0, strlen(word) - 1)
|
||||
endif
|
||||
|
||||
" strip off semicolon if necessary.
|
||||
if word =~ ';$' && semicolon
|
||||
let word = strpart(word, 0, strlen(word) - 1)
|
||||
endif
|
||||
|
||||
" if user wants case sensitivity, then filter out completions that don't
|
||||
" match
|
||||
if g:EclimJavaCompleteCaseSensitive && a:base != ''
|
||||
if word !~ '^' . a:base . '\C'
|
||||
continue
|
||||
endif
|
||||
endif
|
||||
|
||||
let menu = result.menu
|
||||
let info = eclim#html#util#HtmlToText(result.info)
|
||||
|
||||
let dict = {
|
||||
\ 'word': word,
|
||||
\ 'menu': menu,
|
||||
\ 'info': info,
|
||||
\ 'kind': result.type,
|
||||
\ 'dup': 1,
|
||||
\ 'icase': !g:EclimJavaCompleteCaseSensitive,
|
||||
\ }
|
||||
|
||||
call add(completions, dict)
|
||||
endfor
|
||||
|
||||
return completions
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" ImportThenComplete {{{
|
||||
" Called by CodeComplete when the completion depends on a missing import.
|
||||
function! eclim#java#complete#ImportThenComplete(choices)
|
||||
let choice = ''
|
||||
if len(a:choices) > 1
|
||||
let choice = eclim#java#import#ImportPrompt(a:choices)
|
||||
elseif len(a:choices)
|
||||
let choice = a:choices[0]
|
||||
endif
|
||||
|
||||
if choice != ''
|
||||
call eclim#java#import#Import(choice)
|
||||
call feedkeys("\<c-x>\<c-u>", 'tn')
|
||||
endif
|
||||
return ''
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
139
.vim/bundle/eclim/eclim/autoload/eclim/java/correct.vim
Normal file
139
.vim/bundle/eclim/eclim/autoload/eclim/java/correct.vim
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" see http://eclim.org/vim/java/correct.html
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" define Correction group based on Normal.
|
||||
hi link Correction Normal
|
||||
hi Correction gui=underline,bold term=underline,bold cterm=underline,bold
|
||||
|
||||
" Script Varables {{{
|
||||
let s:command_correct =
|
||||
\ '-command java_correct -p "<project>" -f "<file>" ' .
|
||||
\ '-l <line> -o <offset> -e <encoding>'
|
||||
let s:command_correct_apply = s:command_correct . ' -a <apply>'
|
||||
" }}}
|
||||
|
||||
" Correct() {{{
|
||||
function! eclim#java#correct#Correct()
|
||||
if !eclim#project#util#IsCurrentFileInProject()
|
||||
return
|
||||
endif
|
||||
|
||||
call eclim#lang#SilentUpdate()
|
||||
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let file = eclim#project#util#GetProjectRelativeFilePath()
|
||||
|
||||
let command = s:command_correct
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
let command = substitute(command, '<line>', line('.'), '')
|
||||
let command = substitute(command, '<offset>', eclim#util#GetOffset(), '')
|
||||
let command = substitute(command, '<encoding>', eclim#util#GetEncoding(), '')
|
||||
|
||||
let window_name = file . "_correct"
|
||||
let filename = expand('%:p')
|
||||
call eclim#util#TempWindowClear(window_name)
|
||||
|
||||
let result = eclim#Execute(command)
|
||||
|
||||
" error executing the command.
|
||||
if type(result) != g:DICT_TYPE && type(result) != g:STRING_TYPE
|
||||
return
|
||||
|
||||
" no error on the current line
|
||||
elseif type(result) == g:STRING_TYPE
|
||||
call eclim#util#Echo(result)
|
||||
return
|
||||
|
||||
" no correction proposals found.
|
||||
elseif len(result.corrections) == 0
|
||||
call eclim#util#EchoInfo('No Suggestions')
|
||||
return
|
||||
endif
|
||||
|
||||
let content = []
|
||||
call add(content, result.message)
|
||||
for correction in result.corrections
|
||||
call add(content,
|
||||
\ correction.index . '.' . result.offset . ': ' . correction.description)
|
||||
for line in split(correction.preview, '\n')
|
||||
call add(content, line != '' ? ("\t" . line) : line)
|
||||
endfor
|
||||
endfor
|
||||
|
||||
call eclim#util#TempWindow(window_name, content)
|
||||
|
||||
let b:filename = filename
|
||||
augroup temp_window
|
||||
autocmd! BufWinLeave <buffer>
|
||||
call eclim#util#GoToBufferWindowRegister(filename)
|
||||
augroup END
|
||||
|
||||
setlocal ft=java
|
||||
|
||||
"exec "syntax match Normal /" . escape(getline(1), '^$/\') . "/"
|
||||
syntax match Correction /^[0-9]\+\.[0-9]\+:.*/
|
||||
|
||||
nnoremap <silent> <buffer> <cr>
|
||||
\ :call eclim#java#correct#CorrectApply()<cr>
|
||||
|
||||
redraw | echo ""
|
||||
endfunction " }}}
|
||||
|
||||
" CorrectApply() {{{
|
||||
function! eclim#java#correct#CorrectApply()
|
||||
let line = getline('.')
|
||||
if line =~ '^[0-9]\+\.[0-9]\+:'
|
||||
let winnr = bufwinnr('%')
|
||||
let name = substitute(expand('%:p'), '_correct$', '', '')
|
||||
let file_winnr = bufwinnr(bufnr('^' . b:filename))
|
||||
if file_winnr != -1
|
||||
let filename = b:filename
|
||||
exec file_winnr . "winc w"
|
||||
call eclim#lang#SilentUpdate()
|
||||
|
||||
let index = substitute(line, '^\([0-9]\+\)\..*', '\1', '')
|
||||
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let file = eclim#project#util#GetProjectRelativeFilePath()
|
||||
let command = s:command_correct_apply
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
let command = substitute(command, '<line>', line('.'), '')
|
||||
let command = substitute(command, '<offset>', eclim#util#GetOffset(), '')
|
||||
let command = substitute(command, '<encoding>', eclim#util#GetEncoding(), '')
|
||||
let command = substitute(command, '<apply>', index, '')
|
||||
|
||||
call eclim#lang#Refactor(command)
|
||||
call eclim#lang#UpdateSrcFile('java', 1)
|
||||
|
||||
exec winnr . "winc w"
|
||||
close
|
||||
else
|
||||
call eclim#util#EchoError(name . ' no longer found in an open window.')
|
||||
endif
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
272
.vim/bundle/eclim/eclim/autoload/eclim/java/doc.vim
Normal file
272
.vim/bundle/eclim/eclim/autoload/eclim/java/doc.vim
Normal file
|
|
@ -0,0 +1,272 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" see http://eclim.org/vim/java/doc.html
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Script Variables {{{
|
||||
let s:command_comment =
|
||||
\ '-command javadoc_comment -p "<project>" -f "<file>" -o <offset> -e <encoding>'
|
||||
let s:command_element_doc =
|
||||
\ '-command java_element_doc -p "<project>" -f "<file>" -o <offset> -l <length> -e <encoding>'
|
||||
let s:command_doc_link = '-command java_element_doc -u "<url>"'
|
||||
let s:command_source_dirs = '-command java_src_dirs -p "<project>"'
|
||||
" }}}
|
||||
|
||||
function! eclim#java#doc#Comment() " {{{
|
||||
" Add / update the comments for the element under the cursor.
|
||||
|
||||
if !eclim#project#util#IsCurrentFileInProject()
|
||||
return
|
||||
endif
|
||||
|
||||
call eclim#lang#SilentUpdate()
|
||||
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let file = eclim#project#util#GetProjectRelativeFilePath()
|
||||
let offset = eclim#util#GetCurrentElementOffset()
|
||||
|
||||
let command = s:command_comment
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
let command = substitute(command, '<offset>', offset, '')
|
||||
let command = substitute(command, '<encoding>', eclim#util#GetEncoding(), '')
|
||||
|
||||
let result = eclim#Execute(command)
|
||||
|
||||
if result != "0"
|
||||
call eclim#util#Reload({'retab': 1})
|
||||
write
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#doc#Preview() " {{{
|
||||
if !eclim#project#util#IsCurrentFileInProject()
|
||||
return
|
||||
endif
|
||||
|
||||
if !eclim#java#util#IsValidIdentifier(expand('<cword>'))
|
||||
call eclim#util#EchoError
|
||||
\ ("Element under the cursor is not a valid java identifier.")
|
||||
return 0
|
||||
endif
|
||||
|
||||
exec 'pedit +:call\ eclim#java#doc#PreviewOpen(' . bufnr('%') . ') [javadoc]'
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#doc#PreviewOpen(bufnr_or_url) " {{{
|
||||
if a:bufnr_or_url =~ '^\d\+$'
|
||||
let curwin = winnr()
|
||||
exec bufwinnr(a:bufnr_or_url) . 'winc w'
|
||||
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let file = eclim#lang#SilentUpdate(1, 1)
|
||||
let position = eclim#util#GetCurrentElementPosition()
|
||||
let offset = substitute(position, '\(.*\);\(.*\)', '\1', '')
|
||||
let length = substitute(position, '\(.*\);\(.*\)', '\2', '')
|
||||
|
||||
exec curwin . 'winc w'
|
||||
|
||||
let command = s:command_element_doc
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
let command = substitute(command, '<offset>', offset, '')
|
||||
let command = substitute(command, '<length>', length, '')
|
||||
let command = substitute(command, '<encoding>', eclim#util#GetEncoding(), '')
|
||||
else
|
||||
let command = s:command_doc_link
|
||||
let command = substitute(command, '<url>', a:bufnr_or_url, '')
|
||||
endif
|
||||
|
||||
let result = eclim#Execute(command)
|
||||
if type(result) == g:DICT_TYPE
|
||||
if !exists('b:eclim_javadoc_stack')
|
||||
let b:eclim_javadoc_stack = []
|
||||
let b:eclim_javadoc_index = -1
|
||||
elseif b:eclim_javadoc_index >= 0
|
||||
let b:eclim_javadoc_stack = b:eclim_javadoc_stack[:b:eclim_javadoc_index]
|
||||
endif
|
||||
call add(b:eclim_javadoc_stack, result)
|
||||
let b:eclim_javadoc_index += 1
|
||||
let b:eclim_javadoc = result
|
||||
|
||||
setlocal modifiable
|
||||
call append(0, split(result.text, '\n'))
|
||||
retab
|
||||
if getline('$') =~ '^\s*$'
|
||||
$,$delete _
|
||||
endif
|
||||
call cursor(1, 1)
|
||||
|
||||
elseif type(result) == g:STRING_TYPE
|
||||
if result == ''
|
||||
call eclim#util#EchoWarning('No javadoc found.')
|
||||
else
|
||||
call eclim#util#EchoError(result)
|
||||
endif
|
||||
|
||||
return
|
||||
endif
|
||||
|
||||
setlocal wrap
|
||||
setlocal nomodifiable
|
||||
setlocal nolist
|
||||
setlocal noswapfile
|
||||
setlocal nobuflisted
|
||||
setlocal buftype=nofile
|
||||
setlocal bufhidden=delete
|
||||
setlocal conceallevel=2 concealcursor=ncv
|
||||
|
||||
set ft=javadoc_preview
|
||||
hi link javadocPreviewLink Label
|
||||
syntax match javadocPreviewLinkStart contained /|/ conceal
|
||||
syntax match javadocPreviewLinkEnd contained /\[\d\+\]|/ conceal
|
||||
syntax region javadocPreviewLink start="|" end="" concealends
|
||||
syntax match javadocPreviewLink /|.\{-}\[\d\+\]|/
|
||||
\ contains=JavadocPreviewLinkStart,JavadocPreviewLinkEnd
|
||||
|
||||
nnoremap <silent> <buffer> <cr> :call eclim#java#doc#PreviewLink()<cr>
|
||||
nnoremap <silent> <buffer> <c-]> :call eclim#java#doc#PreviewLink()<cr>
|
||||
nnoremap <silent> <buffer> <c-o> :call eclim#java#doc#PreviewHistory(-1)<cr>
|
||||
nnoremap <silent> <buffer> <c-i> :call eclim#java#doc#PreviewHistory(1)<cr>
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#doc#PreviewLink() " {{{
|
||||
let line = getline('.')
|
||||
let cnum = col('.')
|
||||
if line[cnum - 1] == '|'
|
||||
let cnum += cnum > 1 && line[cnum - 2] == ']' ? -1 : 1
|
||||
endif
|
||||
let text = substitute(line, '.*|\(.\{-}\%' . cnum . 'c.\{-}\)|.*', '\1', '')
|
||||
if text == line || text !~ '\[\d\+]$'
|
||||
return
|
||||
endif
|
||||
|
||||
exec 'let index = ' . substitute(text, '.*\[\(\d\+\)\]$', '\1', '')
|
||||
if !exists('b:eclim_javadoc') || len(b:eclim_javadoc.links) <= index
|
||||
return
|
||||
endif
|
||||
|
||||
let url = b:eclim_javadoc.links[index].href
|
||||
if url =~ '^eclipse-javadoc:'
|
||||
exec 'pedit +:call\ eclim#java#doc#PreviewOpen("' . url . '") [javadoc]'
|
||||
else
|
||||
call eclim#web#OpenUrl(url)
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#doc#PreviewHistory(offset) " {{{
|
||||
if !exists('b:eclim_javadoc_stack')
|
||||
return
|
||||
endif
|
||||
|
||||
let index = b:eclim_javadoc_index + a:offset
|
||||
if index < 0 || index > len(b:eclim_javadoc_stack) -1
|
||||
return
|
||||
endif
|
||||
|
||||
let result = b:eclim_javadoc_stack[index]
|
||||
let b:eclim_javadoc = result
|
||||
let b:eclim_javadoc_index = index
|
||||
|
||||
setlocal modifiable
|
||||
1,$delete _
|
||||
call append(0, split(result.text, '\n'))
|
||||
retab
|
||||
if getline('$') =~ '^\s*$'
|
||||
$,$delete _
|
||||
endif
|
||||
setlocal nomodifiable
|
||||
call cursor(1, 1)
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#doc#Javadoc(bang, ...) " {{{
|
||||
" Run javadoc for all, or the supplied, source files.
|
||||
" Optional args:
|
||||
" file, file, file, ...: one ore more source files.
|
||||
|
||||
if !eclim#project#util#IsCurrentFileInProject()
|
||||
return
|
||||
endif
|
||||
|
||||
let project_path = eclim#project#util#GetCurrentProjectRoot()
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let args = '-p "' . project . '"'
|
||||
|
||||
if len(a:000) > 0 && (len(a:000) > 1 || a:000[0] != '')
|
||||
let args .= ' -f "' . join(a:000, ' ') . '"'
|
||||
endif
|
||||
|
||||
let cwd = getcwd()
|
||||
try
|
||||
exec 'lcd ' . escape(project_path, ' ')
|
||||
call eclim#util#MakeWithCompiler('eclim_javadoc', a:bang, args)
|
||||
finally
|
||||
exec 'lcd ' . escape(cwd, ' ')
|
||||
endtry
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#doc#CommandCompleteJavadoc(argLead, cmdLine, cursorPos) " {{{
|
||||
let dir = eclim#project#util#GetCurrentProjectRoot()
|
||||
|
||||
let cmdLine = strpart(a:cmdLine, 0, a:cursorPos)
|
||||
let args = eclim#util#ParseCmdLine(cmdLine)
|
||||
let argLead = cmdLine =~ '\s$' ? '' : args[len(args) - 1]
|
||||
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let command = substitute(s:command_source_dirs, '<project>', project, '')
|
||||
let result = eclim#Execute(command)
|
||||
let paths = []
|
||||
if result != '' && result != '0'
|
||||
let paths = map(split(result, "\n"),
|
||||
\ "eclim#project#util#GetProjectRelativeFilePath(v:val)")
|
||||
endif
|
||||
|
||||
let results = []
|
||||
|
||||
if argLead !~ '^\s*$'
|
||||
let follow = 0
|
||||
for path in paths
|
||||
if argLead =~ '^' . path
|
||||
let follow = 1
|
||||
break
|
||||
elseif path =~ '^' . argLead
|
||||
call add(results, path)
|
||||
endif
|
||||
endfor
|
||||
|
||||
if follow
|
||||
let results = split(eclim#util#Glob(dir . '/' . argLead . '*', 1), '\n')
|
||||
call filter(results, "isdirectory(v:val) || v:val =~ '\\.java$'")
|
||||
call map(results, "substitute(v:val, '\\', '/', 'g')")
|
||||
call map(results, 'isdirectory(v:val) ? v:val . "/" : v:val')
|
||||
call map(results, 'substitute(v:val, dir, "", "")')
|
||||
call map(results, 'substitute(v:val, "^\\(/\\|\\\\\\)", "", "g")')
|
||||
call map(results, "substitute(v:val, ' ', '\\\\ ', 'g')")
|
||||
endif
|
||||
else
|
||||
let results = paths
|
||||
endif
|
||||
|
||||
return eclim#util#ParseCommandCompletionResults(argLead, results)
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
147
.vim/bundle/eclim/eclim/autoload/eclim/java/hierarchy.vim
Normal file
147
.vim/bundle/eclim/eclim/autoload/eclim/java/hierarchy.vim
Normal file
|
|
@ -0,0 +1,147 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" see http://eclim.org/vim/java/hierarchy.html
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Global Variables {{{
|
||||
if !exists('g:EclimJavaHierarchyDefaultAction')
|
||||
let g:EclimJavaHierarchyDefaultAction = g:EclimDefaultFileOpenAction
|
||||
endif
|
||||
" }}}
|
||||
|
||||
" Script Variables {{{
|
||||
let s:command_hierarchy =
|
||||
\ '-command java_hierarchy -p "<project>" -f "<file>" -o <offset> -e <encoding>'
|
||||
|
||||
" }}}
|
||||
|
||||
" Hierarchy() {{{
|
||||
function! eclim#java#hierarchy#Hierarchy()
|
||||
if !eclim#project#util#IsCurrentFileInProject()
|
||||
return
|
||||
endif
|
||||
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let file = eclim#project#util#GetProjectRelativeFilePath()
|
||||
let command = s:command_hierarchy
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
let command = substitute(command, '<offset>', eclim#util#GetOffset(), '')
|
||||
let command = substitute(command, '<encoding>', eclim#util#GetEncoding(), '')
|
||||
let result = eclim#Execute(command)
|
||||
if type(result) != g:DICT_TYPE
|
||||
return
|
||||
endif
|
||||
|
||||
let lines = []
|
||||
let info = []
|
||||
call s:FormatHierarchy(result, lines, info, '')
|
||||
call eclim#util#TempWindow('[Hierarchy]', lines)
|
||||
set ft=java
|
||||
|
||||
setlocal modifiable noreadonly
|
||||
call append(line('$'), ['', '" use ? to view help'])
|
||||
setlocal nomodifiable readonly
|
||||
syntax match Comment /^".*/
|
||||
|
||||
let b:hierarchy_info = info
|
||||
call eclim#util#Echo(b:hierarchy_info[line('.') - 1])
|
||||
|
||||
augroup eclim_java_hierarchy
|
||||
autocmd!
|
||||
autocmd CursorMoved <buffer>
|
||||
\ if line('.') <= len(b:hierarchy_info) |
|
||||
\ call eclim#util#Echo(b:hierarchy_info[line('.') - 1]) |
|
||||
\ else |
|
||||
\ echo '' |
|
||||
\ endif
|
||||
augroup END
|
||||
|
||||
nnoremap <buffer> <silent> <cr>
|
||||
\ :call <SID>Open(g:EclimJavaHierarchyDefaultAction)<cr>
|
||||
nnoremap <buffer> <silent> E :call <SID>Open('edit')<cr>
|
||||
nnoremap <buffer> <silent> S :call <SID>Open('split')<cr>
|
||||
nnoremap <buffer> <silent> T :call <SID>Open("tablast \| tabnew")<cr>
|
||||
|
||||
" assign to buffer var to get around weird vim issue passing list containing
|
||||
" a string w/ a '<' in it on execution of mapping.
|
||||
let b:hierarchy_help = [
|
||||
\ '<cr> - open file with default action',
|
||||
\ 'E - open with :edit',
|
||||
\ 'S - open in a new split window',
|
||||
\ 'T - open in a new tab',
|
||||
\ ]
|
||||
nnoremap <buffer> <silent> ?
|
||||
\ :call eclim#help#BufferHelp(b:hierarchy_help, 'vertical', 40)<cr>
|
||||
endfunction " }}}
|
||||
|
||||
" s:FormatHierarchy(hierarchy, lines, indent) {{{
|
||||
function! s:FormatHierarchy(hierarchy, lines, info, indent)
|
||||
call add(a:lines, a:indent . a:hierarchy.name)
|
||||
call add(a:info, a:hierarchy.qualified)
|
||||
let indent = eclim#util#GetIndent(1)
|
||||
for child in a:hierarchy.children
|
||||
call s:FormatHierarchy(child, a:lines, a:info, a:indent . indent)
|
||||
endfor
|
||||
endfunction " }}}
|
||||
|
||||
" s:Open(action) {{{
|
||||
function! s:Open(action)
|
||||
let line = line('.')
|
||||
if line > len(b:hierarchy_info)
|
||||
return
|
||||
endif
|
||||
|
||||
let type = b:hierarchy_info[line - 1]
|
||||
" go to the buffer that initiated the hierarchy
|
||||
exec b:winnr . 'winc w'
|
||||
|
||||
" source the search plugin if necessary
|
||||
if !exists("g:EclimJavaSearchSingleResult")
|
||||
runtime autoload/eclim/java/search.vim
|
||||
endif
|
||||
|
||||
let action = a:action
|
||||
let filename = expand('%:p')
|
||||
if exists('b:filename')
|
||||
let filename = b:filename
|
||||
if !eclim#util#GoToBufferWindow(b:filename)
|
||||
" if the file is no longer open, open it
|
||||
silent! exec action . ' ' . b:filename
|
||||
let action = 'edit'
|
||||
endif
|
||||
endif
|
||||
|
||||
if line != 1
|
||||
let saved = g:EclimJavaSearchSingleResult
|
||||
try
|
||||
let g:EclimJavaSearchSingleResult = action
|
||||
if eclim#java#search#SearchAndDisplay('java_search', '-x declarations -p ' . type)
|
||||
let b:filename = filename
|
||||
endif
|
||||
finally
|
||||
let g:EclimJavaSearchSingleResult = saved
|
||||
endtry
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
341
.vim/bundle/eclim/eclim/autoload/eclim/java/impl.vim
Normal file
341
.vim/bundle/eclim/eclim/autoload/eclim/java/impl.vim
Normal file
|
|
@ -0,0 +1,341 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" see http://eclim.org/vim/java/impl.html
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Script Varables {{{
|
||||
let s:command_constructor =
|
||||
\ '-command java_constructor -p "<project>" -f "<file>" -o <offset> -e <encoding>'
|
||||
let s:command_properties =
|
||||
\ '-command java_bean_properties -p "<project>" -f "<file>" ' .
|
||||
\ '-o <offset> -e <encoding> -t <type> -r <properties> <indexed>'
|
||||
let s:command_impl =
|
||||
\ '-command java_impl -p "<project>" -f "<file>" -o <offset> -e <encoding>'
|
||||
let s:command_impl_insert =
|
||||
\ '-command java_impl -p "<project>" -f "<file>" -t "<type>" ' .
|
||||
\ '-s "<superType>" <methods>'
|
||||
let s:command_delegate =
|
||||
\ '-command java_delegate -p "<project>" -f "<file>" -o <offset> -e <encoding>'
|
||||
let s:command_delegate_insert =
|
||||
\ '-command java_delegate -p "<project>" -f "<file>" -v "<type>" ' .
|
||||
\ '-s "<superType>" <methods>'
|
||||
|
||||
|
||||
let s:no_properties =
|
||||
\ 'Unable to find property at current cursor position: ' .
|
||||
\ 'Not on a field declaration or possible java syntax error.'
|
||||
let s:cross_type_selection = "Visual selection is currently limited to methods of one super type at a time."
|
||||
" }}}
|
||||
|
||||
function! eclim#java#impl#Constructor(first, last, bang) " {{{
|
||||
if !eclim#project#util#IsCurrentFileInProject()
|
||||
return
|
||||
endif
|
||||
|
||||
call eclim#lang#SilentUpdate()
|
||||
|
||||
let properties = a:last == 1 ? [] :
|
||||
\ eclim#java#util#GetSelectedFields(a:first, a:last)
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let file = eclim#project#util#GetProjectRelativeFilePath()
|
||||
|
||||
let command = s:command_constructor
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
let command = substitute(command, '<offset>', eclim#util#GetOffset(), '')
|
||||
let command = substitute(command, '<encoding>', eclim#util#GetEncoding(), '')
|
||||
if a:bang == ''
|
||||
let command .= ' -s'
|
||||
endif
|
||||
if len(properties) > 0
|
||||
let command .= ' -r ''' . substitute(string(properties), "'", '"', 'g') . ''''
|
||||
endif
|
||||
|
||||
let result = eclim#Execute(command)
|
||||
if type(result) == g:STRING_TYPE && result != ''
|
||||
call eclim#util#EchoError(result)
|
||||
return
|
||||
endif
|
||||
|
||||
if result != "0"
|
||||
call eclim#util#Reload({'retab': 1})
|
||||
write
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#impl#GetterSetter(first, last, bang, type) " {{{
|
||||
if !eclim#project#util#IsCurrentFileInProject()
|
||||
return
|
||||
endif
|
||||
|
||||
call eclim#lang#SilentUpdate()
|
||||
|
||||
let properties = eclim#java#util#GetSelectedFields(a:first, a:last)
|
||||
|
||||
if len(properties) == 0
|
||||
call eclim#util#EchoError(s:no_properties)
|
||||
return
|
||||
endif
|
||||
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let file = eclim#project#util#GetProjectRelativeFilePath()
|
||||
let indexed = a:bang != '' ? '-i' : ''
|
||||
|
||||
let command = s:command_properties
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
let command = substitute(command, '<offset>', eclim#util#GetOffset(), '')
|
||||
let command = substitute(command, '<encoding>', eclim#util#GetEncoding(), '')
|
||||
let command = substitute(command, '<type>', a:type, '')
|
||||
let command = substitute(command, '<properties>', join(properties, ','), '')
|
||||
let command = substitute(command, '<indexed>', indexed, '')
|
||||
|
||||
let result = eclim#Execute(command)
|
||||
if result != "0"
|
||||
call eclim#util#Reload({'retab': 1})
|
||||
write
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#impl#Impl() " {{{
|
||||
if !eclim#project#util#IsCurrentFileInProject()
|
||||
return
|
||||
endif
|
||||
|
||||
call eclim#lang#SilentUpdate()
|
||||
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let file = eclim#project#util#GetProjectRelativeFilePath()
|
||||
let offset = eclim#util#GetCurrentElementOffset()
|
||||
|
||||
let command = s:command_impl
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
let command = substitute(command, '<offset>', offset, '')
|
||||
let command = substitute(command, '<encoding>', eclim#util#GetEncoding(), '')
|
||||
|
||||
call eclim#java#impl#ImplWindow(command)
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#impl#ImplWindow(command) " {{{
|
||||
if (eclim#java#impl#Window(a:command, "impl"))
|
||||
nnoremap <silent> <buffer> <cr> :call <SID>AddImpl(0)<cr>
|
||||
vnoremap <silent> <buffer> <cr> :<C-U>call <SID>AddImpl(1)<cr>
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#impl#ImplWindowFolding() " {{{
|
||||
setlocal foldmethod=syntax
|
||||
setlocal foldlevel=99
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#impl#Delegate() " {{{
|
||||
if !eclim#project#util#IsCurrentFileInProject()
|
||||
return
|
||||
endif
|
||||
|
||||
call eclim#lang#SilentUpdate()
|
||||
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let file = eclim#project#util#GetProjectRelativeFilePath()
|
||||
let offset = eclim#util#GetCurrentElementOffset()
|
||||
let encoding = eclim#util#GetEncoding()
|
||||
|
||||
let command = s:command_delegate
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
let command = substitute(command, '<offset>', offset, '')
|
||||
let command = substitute(command, '<encoding>', encoding, '')
|
||||
|
||||
call eclim#java#impl#DelegateWindow(command)
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#impl#DelegateWindow(command) " {{{
|
||||
if (eclim#java#impl#Window(a:command, "delegate"))
|
||||
nnoremap <silent> <buffer> <cr> :call <SID>AddDelegate(0)<cr>
|
||||
vnoremap <silent> <buffer> <cr> :<C-U>call <SID>AddDelegate(1)<cr>
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#impl#Add(command, function, visual) " {{{
|
||||
let winnr = bufwinnr(bufnr('^' . b:filename))
|
||||
" src window is not longer open.
|
||||
if winnr == -1
|
||||
call eclim#util#EchoError(b:filename . ' no longer found in an open window.')
|
||||
return
|
||||
endif
|
||||
|
||||
if a:visual
|
||||
let start = line("'<")
|
||||
let end = line("'>")
|
||||
endif
|
||||
|
||||
let superType = ""
|
||||
let methods = []
|
||||
" non-visual mode or only one line selected
|
||||
if !a:visual || start == end
|
||||
" not a valid selection
|
||||
if line('.') == 1 || getline('.') =~ '^\(\s*//\|package\|$\|}\)'
|
||||
return
|
||||
endif
|
||||
|
||||
let line = getline('.')
|
||||
if line =~ '^\s*throws'
|
||||
let line = getline(line('.') - 1)
|
||||
endif
|
||||
" on a method line
|
||||
if line =~ '^\s\+'
|
||||
call add(methods, s:MethodSig(line))
|
||||
let ln = search('^\w', 'bWn')
|
||||
if ln > 0
|
||||
let superType = substitute(getline(ln), '.*\s\(.*\) {', '\1', '')
|
||||
endif
|
||||
" on a type line
|
||||
else
|
||||
let superType = substitute(line, '.*\s\(.*\) {', '\1', '')
|
||||
endif
|
||||
|
||||
" visual mode
|
||||
else
|
||||
let pos = getpos('.')
|
||||
let index = start
|
||||
while index <= end
|
||||
let line = getline(index)
|
||||
if line =~ '^\s*\($\|throws\|package\)'
|
||||
" do nothing
|
||||
" on a method line
|
||||
elseif line =~ '^\s\+'
|
||||
call add(methods, s:MethodSig(line))
|
||||
call cursor(index, 1)
|
||||
let ln = search('^\w', 'bWn')
|
||||
if ln > 0
|
||||
let super = substitute(getline(ln), '.*\s\(.*\) {', '\1', '')
|
||||
if superType != "" && super != superType
|
||||
call eclim#util#EchoError(s:cross_type_selection)
|
||||
call setpos('.', pos)
|
||||
return
|
||||
endif
|
||||
let superType = super
|
||||
endif
|
||||
" on a type line
|
||||
else
|
||||
let super = substitute(line, '.*\s\(.*\) {', '\1', '')
|
||||
if superType != "" && super != superType
|
||||
call eclim#util#EchoError(s:cross_type_selection)
|
||||
call setpos('.', pos)
|
||||
return
|
||||
endif
|
||||
let superType = super
|
||||
endif
|
||||
call setpos('.', pos)
|
||||
|
||||
let index += 1
|
||||
endwhile
|
||||
|
||||
if superType == ""
|
||||
return
|
||||
endif
|
||||
endif
|
||||
|
||||
" search up for the nearest package
|
||||
let ln = search('^package', 'bWn')
|
||||
if ln > 0
|
||||
let package = substitute(getline(ln), '.*\s\(.*\);', '\1', '')
|
||||
let superType = package . '.' . substitute(superType, '<.\{-}>', '', 'g')
|
||||
endif
|
||||
|
||||
let type = getline(1)
|
||||
let impl_winnr = winnr()
|
||||
exec winnr . "winc w"
|
||||
call eclim#lang#SilentUpdate()
|
||||
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let file = eclim#project#util#GetProjectRelativeFilePath()
|
||||
|
||||
let command = a:command
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
let command = substitute(command, '<type>', type, '')
|
||||
let command = substitute(command, '<superType>', superType, '')
|
||||
if len(methods)
|
||||
let json = substitute(string(methods), "'", '"', 'g')
|
||||
let command = substitute(command, '<methods>', '-m ''' . json . '''', '')
|
||||
else
|
||||
let command = substitute(command, '<methods>', '', '')
|
||||
endif
|
||||
|
||||
call a:function(command)
|
||||
|
||||
noautocmd exec winnr . "winc w"
|
||||
call eclim#util#Reload({'retab': 1})
|
||||
write
|
||||
noautocmd exec impl_winnr . "winc w"
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#impl#Window(command, name) " {{{
|
||||
let name = eclim#project#util#GetProjectRelativeFilePath() . '_' . a:name
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let result = eclim#Execute(a:command, {'project': project})
|
||||
if type(result) == g:STRING_TYPE
|
||||
call eclim#util#EchoError(result)
|
||||
return
|
||||
endif
|
||||
if type(result) != g:DICT_TYPE
|
||||
return
|
||||
endif
|
||||
|
||||
let content = [result.type]
|
||||
for super in result.superTypes
|
||||
call add(content, '')
|
||||
call add(content, 'package ' . super.packageName . ';')
|
||||
call add(content, super.signature . ' {')
|
||||
for method in super.methods
|
||||
let signature = split(method, '\n')
|
||||
let content += map(signature, '"\t" . v:val')
|
||||
endfor
|
||||
call add(content, '}')
|
||||
endfor
|
||||
|
||||
call eclim#util#TempWindow(name, content, {'preserveCursor': 1})
|
||||
setlocal ft=java
|
||||
call eclim#java#impl#ImplWindowFolding()
|
||||
return 1
|
||||
endfunction " }}}
|
||||
|
||||
function! s:AddImpl(visual) " {{{
|
||||
call eclim#java#impl#Add
|
||||
\ (s:command_impl_insert, function("eclim#java#impl#ImplWindow"), a:visual)
|
||||
endfunction " }}}
|
||||
|
||||
function! s:AddDelegate(visual) " {{{
|
||||
call eclim#java#impl#Add
|
||||
\ (s:command_delegate_insert, function("eclim#java#impl#DelegateWindow"), a:visual)
|
||||
endfunction " }}}
|
||||
|
||||
function! s:MethodSig(line) " {{{
|
||||
let sig = substitute(a:line, '.*\s\(\w\+(.*\)', '\1', '')
|
||||
let sig = substitute(sig, ',\s', ',', 'g')
|
||||
let sig = substitute(sig, '<.\{-}>', '', 'g')
|
||||
return sig
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
140
.vim/bundle/eclim/eclim/autoload/eclim/java/import.vim
Normal file
140
.vim/bundle/eclim/eclim/autoload/eclim/java/import.vim
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" see http://eclim.org/vim/java/import.html
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Script Variables {{{
|
||||
let s:command_import =
|
||||
\ '-command java_import -p "<project>" -f "<file>" -o <offset> -e <encoding>'
|
||||
let s:command_organize =
|
||||
\ '-command java_import_organize -p "<project>" -f "<file>" -o <offset> -e <encoding>'
|
||||
" }}}
|
||||
|
||||
function! eclim#java#import#Import(...) " {{{
|
||||
if !eclim#project#util#IsCurrentFileInProject()
|
||||
return
|
||||
endif
|
||||
|
||||
if !a:0
|
||||
let name = expand('<cword>')
|
||||
if !eclim#java#util#IsValidIdentifier(name) ||
|
||||
\ eclim#java#util#IsKeyword(name)
|
||||
call eclim#util#EchoError("'" . name . "' not a classname.")
|
||||
return
|
||||
endif
|
||||
endif
|
||||
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let file = eclim#lang#SilentUpdate()
|
||||
let offset = eclim#util#GetOffset()
|
||||
let command = s:command_import
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
let command = substitute(command, '<offset>', offset, '')
|
||||
let command = substitute(command, '<encoding>', eclim#util#GetEncoding(), '')
|
||||
if a:0
|
||||
let command .= ' -t ' . a:1
|
||||
endif
|
||||
let result = eclim#Execute(command)
|
||||
|
||||
if type(result) == g:STRING_TYPE
|
||||
call eclim#util#EchoError(result)
|
||||
return
|
||||
endif
|
||||
|
||||
if type(result) == g:DICT_TYPE
|
||||
call eclim#util#Reload({'pos': [result.line, result.column]})
|
||||
call eclim#lang#UpdateSrcFile('java', 1)
|
||||
if result.offset != offset
|
||||
call eclim#util#Echo('Imported ' . (a:0 ? a:1 : ''))
|
||||
endif
|
||||
return
|
||||
endif
|
||||
|
||||
if type(result) != g:LIST_TYPE
|
||||
return
|
||||
endif
|
||||
|
||||
let choice = eclim#java#import#ImportPrompt(result)
|
||||
if choice != ''
|
||||
call eclim#java#import#Import(choice)
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#import#OrganizeImports(...) " {{{
|
||||
if !eclim#project#util#IsCurrentFileInProject()
|
||||
return
|
||||
endif
|
||||
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let file = eclim#lang#SilentUpdate()
|
||||
let offset = eclim#util#GetOffset()
|
||||
let command = s:command_organize
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
let command = substitute(command, '<offset>', offset, '')
|
||||
let command = substitute(command, '<encoding>', eclim#util#GetEncoding(), '')
|
||||
if a:0
|
||||
let command .= ' -t ' . join(a:1, ',')
|
||||
endif
|
||||
let result = eclim#Execute(command)
|
||||
|
||||
if type(result) == g:STRING_TYPE
|
||||
call eclim#util#EchoError(result)
|
||||
return
|
||||
endif
|
||||
|
||||
if type(result) == g:DICT_TYPE
|
||||
call eclim#util#Reload({'pos': [result.line, result.column]})
|
||||
call eclim#lang#UpdateSrcFile('java', 1)
|
||||
return
|
||||
endif
|
||||
|
||||
if type(result) != g:LIST_TYPE
|
||||
return
|
||||
endif
|
||||
|
||||
let chosen = []
|
||||
for choices in result
|
||||
let choice = eclim#java#import#ImportPrompt(choices)
|
||||
if choice == ''
|
||||
return
|
||||
endif
|
||||
call add(chosen, choice)
|
||||
endfor
|
||||
|
||||
if len(chosen)
|
||||
call eclim#java#import#OrganizeImports(chosen)
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#import#ImportPrompt(choices) " {{{
|
||||
" prompt the user to choose the class to import.
|
||||
let response = eclim#util#PromptList("Choose the class to import", a:choices)
|
||||
if response == -1
|
||||
return ''
|
||||
endif
|
||||
|
||||
return get(a:choices, response)
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
247
.vim/bundle/eclim/eclim/autoload/eclim/java/junit.vim
Normal file
247
.vim/bundle/eclim/eclim/autoload/eclim/java/junit.vim
Normal file
|
|
@ -0,0 +1,247 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" see http://eclim.org/vim/java/junit.html
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Script Variables {{{
|
||||
let s:command_junit = '-command java_junit -p "<project>"'
|
||||
let s:command_tests = '-command java_junit_tests -p "<project>"'
|
||||
let s:command_find_test =
|
||||
\ '-command java_junit_find_test -p "<project>" -f "<file>" ' .
|
||||
\ '-o <offset> -e <encoding>'
|
||||
let s:command_impl = '-command java_junit_impl -p "<project>" -f "<file>"'
|
||||
let s:command_insert =
|
||||
\ '-command java_junit_impl -p "<project>" -f "<file>" ' .
|
||||
\ '-t "<type>" -s "<superType>" <methods>'
|
||||
" }}}
|
||||
|
||||
function! eclim#java#junit#JUnit(test, bang) " {{{
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
if project == '' && exists('b:project')
|
||||
let project = b:project
|
||||
endif
|
||||
|
||||
if project == ''
|
||||
call eclim#project#util#IsCurrentFileInProject()
|
||||
return
|
||||
endif
|
||||
|
||||
let command = s:command_junit
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
if a:test != ''
|
||||
if a:test == '%'
|
||||
let command .= ' -f "' . eclim#project#util#GetProjectRelativeFilePath() . '"'
|
||||
elseif a:test != '*'
|
||||
let command .= ' -t "' . a:test . '"'
|
||||
endif
|
||||
else
|
||||
let command .= ' -f "' . eclim#project#util#GetProjectRelativeFilePath() . '"'
|
||||
let command .= ' -o ' . eclim#util#GetOffset()
|
||||
let command .= ' -e ' . eclim#util#GetEncoding()
|
||||
endif
|
||||
|
||||
let curbuf = bufnr('%')
|
||||
let result = eclim#Execute(command, {'project': project, 'exec': 1, 'raw': 1})
|
||||
let results = split(substitute(result, "^\n*", '', 'g'), "\n")
|
||||
call eclim#util#TempWindow('[JUnit Output]', results)
|
||||
let b:project = project
|
||||
|
||||
if exists(":JUnit") != 2
|
||||
command -buffer -nargs=? -complete=customlist,eclim#java#junit#CommandCompleteTest
|
||||
\ JUnit :call eclim#java#junit#JUnit('<args>', '<bang>')
|
||||
endif
|
||||
|
||||
exec bufwinnr(curbuf) . 'winc w'
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#junit#JUnitFindTest() " {{{
|
||||
if !eclim#project#util#IsCurrentFileInProject()
|
||||
return
|
||||
endif
|
||||
|
||||
runtime eclim/autoload/eclim/java/search.vim
|
||||
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let file = eclim#lang#SilentUpdate()
|
||||
let command = s:command_find_test
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
let command = substitute(command, '<offset>', eclim#util#GetOffset(), '')
|
||||
let command = substitute(command, '<encoding>', eclim#util#GetEncoding(), '')
|
||||
let result = eclim#Execute(command)
|
||||
if type(result) == g:STRING_TYPE
|
||||
call eclim#util#EchoError(result)
|
||||
return
|
||||
endif
|
||||
|
||||
if type(result) != g:DICT_TYPE
|
||||
return
|
||||
endif
|
||||
|
||||
call eclim#util#SetLocationList(eclim#util#ParseLocationEntries([result]))
|
||||
let entry = getloclist(0)[0]
|
||||
let name = substitute(bufname(entry.bufnr), '\', '/', 'g')
|
||||
if g:EclimJavaSearchSingleResult != 'lopen'
|
||||
call eclim#util#GoToBufferWindowOrOpen(name, g:EclimJavaSearchSingleResult)
|
||||
call eclim#util#SetLocationList(eclim#util#ParseLocationEntries([result]))
|
||||
call eclim#display#signs#Update()
|
||||
call cursor(entry.lnum, entry.col)
|
||||
else
|
||||
exec 'lopen ' . g:EclimLocationListHeight
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#junit#JUnitResult(test) " {{{
|
||||
" Argument test can be one of the following:
|
||||
" Empty string: Use the current file to determine the test result file.
|
||||
" Class name of a test: Locate the results for class (ex. 'TestMe').
|
||||
" The results dir relative results file name: TEST-org.foo.TestMe.xml
|
||||
|
||||
let path = s:GetResultsDir()
|
||||
if path == ''
|
||||
call eclim#util#EchoWarning(
|
||||
\ "Output directory setting for 'junit' not set. " .
|
||||
\ "Use :EclimSettings or :ProjectSettings to set it.")
|
||||
return
|
||||
endif
|
||||
|
||||
if a:test != ''
|
||||
let file = a:test
|
||||
if file !~ '^TEST-'
|
||||
let file = '*' . file
|
||||
endif
|
||||
else
|
||||
let file = substitute(eclim#java#util#GetFullyQualifiedClassname(), '\.', '/', 'g')
|
||||
endif
|
||||
|
||||
if file !~ '^TEST-'
|
||||
let file = substitute(file, '\/', '.', 'g')
|
||||
let file = 'TEST-' . file . '.xml'
|
||||
endif
|
||||
|
||||
let found = eclim#util#Globpath(path, file)
|
||||
|
||||
" try text version if xml not found.
|
||||
if found == ""
|
||||
let file = fnamemodify(file, ':r') . '.txt'
|
||||
let found = eclim#util#Globpath(path, file)
|
||||
endif
|
||||
|
||||
if found != ""
|
||||
let filename = expand('%:p')
|
||||
exec "below split " . escape(found, ' ')
|
||||
|
||||
augroup temp_window
|
||||
autocmd! BufWinLeave <buffer>
|
||||
call eclim#util#GoToBufferWindowRegister(filename)
|
||||
augroup END
|
||||
|
||||
return
|
||||
endif
|
||||
call eclim#util#Echo("Test result file not found for: " . fnamemodify(file, ':r'))
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#junit#JUnitImpl() " {{{
|
||||
if !eclim#project#util#IsCurrentFileInProject()
|
||||
return
|
||||
endif
|
||||
|
||||
call eclim#lang#SilentUpdate()
|
||||
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let file = eclim#project#util#GetProjectRelativeFilePath()
|
||||
let command = s:command_impl
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
call eclim#java#junit#JUnitImplWindow(command)
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#junit#JUnitImplWindow(command) " {{{
|
||||
if (eclim#java#impl#Window(a:command, "impl"))
|
||||
nnoremap <silent> <buffer> <cr> :call <SID>AddTestImpl(0)<cr>
|
||||
vnoremap <silent> <buffer> <cr> :<C-U>call <SID>AddTestImpl(1)<cr>
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! s:AddTestImpl(visual) " {{{
|
||||
call eclim#java#impl#Add
|
||||
\ (s:command_insert, function("eclim#java#junit#JUnitImplWindow"), a:visual)
|
||||
endfunction " }}}
|
||||
|
||||
function! s:GetResultsDir() " {{{
|
||||
let path = eclim#project#util#GetProjectSetting("org.eclim.java.junit.output_dir")
|
||||
if type(path) == g:NUMBER_TYPE
|
||||
return
|
||||
endif
|
||||
|
||||
let root = eclim#project#util#GetCurrentProjectRoot()
|
||||
let path = substitute(path, '<project>', root, '')
|
||||
let path = path != '' && path !~ '/$' ? path . '/' : path
|
||||
if path != '' && has('win32unix')
|
||||
let path = eclim#cygwin#CygwinPath(path)
|
||||
endif
|
||||
return path
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#junit#CommandCompleteTest(argLead, cmdLine, cursorPos) " {{{
|
||||
let cmdTail = strpart(a:cmdLine, a:cursorPos)
|
||||
let argLead = substitute(a:argLead, cmdTail . '$', '', '')
|
||||
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
if project == '' && exists('b:project')
|
||||
let project = b:project
|
||||
endif
|
||||
if project == ''
|
||||
return []
|
||||
endif
|
||||
|
||||
let command = s:command_tests
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let results = eclim#Execute(command)
|
||||
if type(results) != g:LIST_TYPE
|
||||
return []
|
||||
endif
|
||||
|
||||
call filter(results, 'v:val =~ "' . argLead . '"')
|
||||
return results
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#junit#CommandCompleteResult(argLead, cmdLine, cursorPos) " {{{
|
||||
let cmdTail = strpart(a:cmdLine, a:cursorPos)
|
||||
let argLead = substitute(a:argLead, cmdTail . '$', '', '')
|
||||
|
||||
let path = s:GetResultsDir()
|
||||
if path == ''
|
||||
call eclim#util#EchoWarning(
|
||||
\ "Output directory setting for 'junit' not set. " .
|
||||
\ "Use :EclimSettings or :ProjectSettings to set it.")
|
||||
return []
|
||||
endif
|
||||
|
||||
let results = split(eclim#util#Globpath(path, '*'), '\n')
|
||||
call map(results, 'fnamemodify(v:val, ":r:e")')
|
||||
call filter(results, 'v:val =~ "^' . argLead . '"')
|
||||
|
||||
return results
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
127
.vim/bundle/eclim/eclim/autoload/eclim/java/logging.vim
Normal file
127
.vim/bundle/eclim/eclim/autoload/eclim/java/logging.vim
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" see http://eclim.org/vim/java/logging.html
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
function! eclim#java#logging#LoggingInit(var) " {{{
|
||||
let char = nr2char(getchar())
|
||||
" only execute if the user types a '.' for a method call and if the logger
|
||||
" is not already present.
|
||||
if char == '.' && s:InitLoggingSettings() &&
|
||||
\ !search('\(final\|static\)\>.\{-}\<Log\(ger\)\?\s', 'n')
|
||||
let line = line('.')
|
||||
let col = col('.')
|
||||
let position = eclim#java#util#GetClassDeclarationPosition(1)
|
||||
if position
|
||||
let logger = s:logger
|
||||
let logger = substitute(logger, '\${class}', eclim#java#util#GetClassname(), '')
|
||||
let logger = substitute(logger, '\${var}', a:var, '')
|
||||
if strlen(logger) > &textwidth && logger !~ '\n'
|
||||
let logger = substitute(logger,
|
||||
\ '\(.*\)\s\(.*\)', '\1\n' . eclim#util#GetIndent(2) . '\2', '')
|
||||
endif
|
||||
|
||||
let position = search('{')
|
||||
let lines = split(logger, '\n')
|
||||
let offset = len(lines) + 1
|
||||
call append(position, '')
|
||||
call append(position, lines)
|
||||
call cursor(line + offset, col)
|
||||
for import in s:logger_imports
|
||||
call eclim#java#import#Import(import)
|
||||
endfor
|
||||
endif
|
||||
endif
|
||||
return char
|
||||
endfunction " }}}
|
||||
|
||||
function! s:InitLoggingSettings() " {{{
|
||||
let s:EclimLoggingImpl =
|
||||
\ eclim#project#util#GetProjectSetting("org.eclim.java.logging.impl")
|
||||
if type(s:EclimLoggingImpl) == g:NUMBER_TYPE || s:EclimLoggingImpl == '0'
|
||||
unlet s:EclimLoggingImpl
|
||||
return
|
||||
endif
|
||||
|
||||
let indent = eclim#util#GetIndent(1)
|
||||
if s:EclimLoggingImpl == "commons-logging"
|
||||
let s:logger = indent .
|
||||
\ "private static final Log ${var} = LogFactory.getLog(${class}.class);"
|
||||
let s:logger_imports = [
|
||||
\ "org.apache.commons.logging.Log",
|
||||
\ "org.apache.commons.logging.LogFactory"]
|
||||
elseif s:EclimLoggingImpl == "slf4j"
|
||||
let s:logger = indent .
|
||||
\ "private static final Logger ${var} = LoggerFactory.getLogger(${class}.class);"
|
||||
let s:logger_imports = ["org.slf4j.Logger", "org.slf4j.LoggerFactory"]
|
||||
elseif s:EclimLoggingImpl == "log4j"
|
||||
let s:logger = indent .
|
||||
\ "private static final Logger ${var} = Logger.getLogger(${class}.class);"
|
||||
let s:logger_imports = ["org.apache.log4j.Logger"]
|
||||
elseif s:EclimLoggingImpl == "jdk"
|
||||
let s:logger = indent .
|
||||
\ "private static final Logger ${var} = Logger.getLogger(${class}.class.getName());"
|
||||
let s:logger_imports = ["java.util.logging.Logger"]
|
||||
elseif s:EclimLoggingImpl == "custom"
|
||||
let instance = eclim#client#nailgun#ChooseEclimdInstance()
|
||||
if type(instance) != g:DICT_TYPE
|
||||
return
|
||||
endif
|
||||
|
||||
let name = eclim#project#util#GetProjectSetting("org.eclim.java.logging.template")
|
||||
if type(name) == g:NUMBER_TYPE || name == ''
|
||||
return
|
||||
endif
|
||||
|
||||
let local = eclim#UserHome() . '/.eclim/resources/jdt/templates/' . name
|
||||
let remote = substitute(instance.home, 'org.eclim_', 'org.eclim.jdt_', '') .
|
||||
\ '/resources/templates/' . name
|
||||
if filereadable(local)
|
||||
let template = local
|
||||
elseif filereadable(remote)
|
||||
let template = remote
|
||||
else
|
||||
call eclim#util#EchoError(
|
||||
\ "Custom logger template not found local or remote location:\n" .
|
||||
\ " local: " . local . "\n" .
|
||||
\ " remote: " . remote)
|
||||
return
|
||||
endif
|
||||
let lines = readfile(template)
|
||||
let s:logger_imports = lines[:]
|
||||
call filter(s:logger_imports, "v:val =~ '^\\s*import\\>'")
|
||||
call map(s:logger_imports,
|
||||
\ "substitute(v:val, '^\\s*import\\>\\s*\\(.*\\);\\s*', '\\1', '')")
|
||||
call filter(lines, "v:val !~ '\\(^\\s*$\\|^\\s*import\\>\\)'")
|
||||
let s:logger = indent . join(lines, "\n" . indent)
|
||||
elseif s:EclimLoggingImpl == ''
|
||||
" no setting returned, probably not in a project, or user is attempting to
|
||||
" disable this functionality for the current project.
|
||||
return
|
||||
else
|
||||
echoe "Invalid logging implementation '" . s:EclimLoggingImpl . "' configured."
|
||||
return
|
||||
endif
|
||||
return 1
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
255
.vim/bundle/eclim/eclim/autoload/eclim/java/maven.vim
Normal file
255
.vim/bundle/eclim/eclim/autoload/eclim/java/maven.vim
Normal file
|
|
@ -0,0 +1,255 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" see http://eclim.org/vim/java/maven/dependency.html
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Script Variables {{{
|
||||
let s:update_command = '-command project_update -p "<project>" -b "<build>"'
|
||||
|
||||
let s:command_search =
|
||||
\ '-command maven_dependency_search ' .
|
||||
\ '-p "<project>" -f "<file>" -t "<type>" -s <query>'
|
||||
|
||||
let s:dependency_template{'maven'} =
|
||||
\ "\t<dependency>\n" .
|
||||
\ "\t\t<groupId>${groupId}</groupId>\n" .
|
||||
\ "\t\t<artifactId>${artifactId}</artifactId>\n" .
|
||||
\ "\t\t<version>${version}</version>\n" .
|
||||
\ "\t</dependency>"
|
||||
|
||||
let s:dependency_template{'mvn'} =
|
||||
\ "\t<dependency>\n" .
|
||||
\ "\t\t<groupId>${groupId}</groupId>\n" .
|
||||
\ "\t\t<artifactId>${artifactId}</artifactId>\n" .
|
||||
\ "\t\t<version>${version}</version>\n" .
|
||||
\ "\t\t<scope>compile</scope>\n" .
|
||||
\ "\t</dependency>"
|
||||
|
||||
let s:dependency_template{'ivy'} =
|
||||
\ "\t<dependency org=\"${groupId}\" name=\"${artifactId}\" rev=\"${version}\"/>"
|
||||
" }}}
|
||||
|
||||
function! eclim#java#maven#Search(query, type) " {{{
|
||||
" Searches online maven repository.
|
||||
|
||||
if !eclim#project#util#IsCurrentFileInProject()
|
||||
return
|
||||
endif
|
||||
|
||||
update
|
||||
|
||||
let filename = substitute(expand('%:p'), '\', '/', 'g')
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let file = eclim#project#util#GetProjectRelativeFilePath()
|
||||
|
||||
let command = s:command_search
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
let command = substitute(command, '<type>', a:type, '')
|
||||
let command = substitute(command, '<query>', a:query, '')
|
||||
|
||||
let results = eclim#Execute(command)
|
||||
if type(results) != g:LIST_TYPE
|
||||
return
|
||||
endif
|
||||
|
||||
let content = []
|
||||
let groupId = ''
|
||||
for result in results
|
||||
if result.groupId != groupId
|
||||
let groupId = result.groupId
|
||||
call add(content, result.groupId)
|
||||
endif
|
||||
if result.existing
|
||||
let result.artifactId = '//' . result.artifactId
|
||||
endif
|
||||
call add(content, "\t" . result.artifactId . ' (' . result.version . ')')
|
||||
endfor
|
||||
|
||||
let window_name = "Dependency_Search_Results"
|
||||
call eclim#util#TempWindowClear(window_name)
|
||||
|
||||
if len(content)
|
||||
call eclim#util#TempWindow(window_name, content)
|
||||
|
||||
let b:filename = filename
|
||||
let b:type = a:type
|
||||
setlocal ft=dependency_search_results
|
||||
syntax match Statement /^\w\+.*$/
|
||||
syntax match Identifier /(.\{-})/
|
||||
syntax match Comment /^\s*\/\/.*$/
|
||||
|
||||
nnoremap <silent> <buffer> <cr> :call <SID>AddDependency(b:type)<cr>
|
||||
else
|
||||
call eclim#util#Echo('No results found.')
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! s:AddDependency(type) " {{{
|
||||
let line = getline('.')
|
||||
if line =~ '^\s\+.*(.*)$' && line !~ '^\s*//'
|
||||
let artifact = substitute(line, '\s\+\(.*\) (.*)$', '\1', '')
|
||||
let vrsn = substitute(line, '.*(\(.*\))$', '\1', '')
|
||||
let group = getline(search('^\w\+', 'bnW'))
|
||||
|
||||
let results_winnr = winnr()
|
||||
exec bufwinnr(b:filename) . "winc w"
|
||||
|
||||
call s:InsertDependency(a:type, group, artifact, vrsn)
|
||||
exec results_winnr . "winc w"
|
||||
|
||||
" mark dependency as added
|
||||
let line = substitute(line, '^\(\s*\)', '\1//', '')
|
||||
|
||||
setlocal modifiable
|
||||
setlocal noreadonly
|
||||
call setline(line('.'), line)
|
||||
setlocal nomodifiable
|
||||
setlocal readonly
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! s:InsertDependency(type, group, artifact, vrsn) " {{{
|
||||
let depend = deepcopy(s:dependency_template{a:type})
|
||||
let depend = substitute(depend, '\${groupId}', a:group, '')
|
||||
let depend = substitute(depend, '\${artifactId}', a:artifact, '')
|
||||
let depend = substitute(depend, '\${version}', a:vrsn, '')
|
||||
let dependency = split(depend, '\n')
|
||||
|
||||
let lnum = search('</dependencies>', 'cnw')
|
||||
let insertDependenciesNode = 0
|
||||
if !lnum
|
||||
let lnum = search('<build>', 'cnw')
|
||||
if !lnum
|
||||
call eclim#util#EchoError('No <dependencies> node found.')
|
||||
return
|
||||
endif
|
||||
let insertDependenciesNode = 1
|
||||
endif
|
||||
|
||||
let indent = substitute(getline(lnum), '^\(\s*\).*', '\1', '')
|
||||
call map(dependency, 'indent . v:val')
|
||||
|
||||
if insertDependenciesNode
|
||||
call append(lnum - 1, indent . '</dependencies>')
|
||||
call append(lnum - 1, indent . '<dependencies>')
|
||||
let lnum += 1
|
||||
endif
|
||||
|
||||
call append(lnum - 1, dependency)
|
||||
|
||||
retab
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#maven#SetClasspathVariable(cmd, variable, args) " {{{
|
||||
let instance = eclim#client#nailgun#ChooseEclimdInstance()
|
||||
if type(instance) != g:DICT_TYPE
|
||||
return
|
||||
endif
|
||||
|
||||
let workspace = instance.workspace
|
||||
|
||||
" maven 1.x
|
||||
if a:cmd == 'Maven'
|
||||
let prefs = workspace .
|
||||
\ '/.metadata/.plugins/org.eclipse.jdt.core/pref_store.ini'
|
||||
let command = a:cmd .
|
||||
\ ' "-Dmaven.eclipse.workspace=' . workspace . '"' .
|
||||
\ ' eclipse:add-maven-repo'
|
||||
|
||||
" maven 2.x
|
||||
else
|
||||
let prefs = workspace .
|
||||
\ '/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs'
|
||||
let command = a:cmd . ' ' . a:args .
|
||||
\ ' "-Declipse.workspace=' . workspace . '"' .
|
||||
\ ' eclipse:configure-workspace'
|
||||
endif
|
||||
|
||||
call eclim#util#Exec(command)
|
||||
|
||||
if !v:shell_error
|
||||
" the maven command edits the eclipse preference file directly, so in
|
||||
" order to get the value in memory without restarting eclim, we read the
|
||||
" value out and let the server set it again.
|
||||
let winrestore = winrestcmd()
|
||||
|
||||
if filereadable(prefs)
|
||||
silent exec 'sview ' . prefs
|
||||
let line = search('org.eclipse.jdt.core.classpathVariable.' . a:variable, 'cnw')
|
||||
let value = line ? substitute(getline(line), '.\{-}=\(.*\)', '\1', '') : ''
|
||||
if line
|
||||
call eclim#java#classpath#VariableCreate(a:variable, value)
|
||||
endif
|
||||
|
||||
if substitute(bufname('%'), '\', '/', 'g') =~ prefs
|
||||
close
|
||||
exec winrestore
|
||||
endif
|
||||
|
||||
if line
|
||||
call eclim#util#Echo(a:variable . " classpath variable set to:\n" . value)
|
||||
else
|
||||
call eclim#util#EchoWarning(
|
||||
\ "Unable to locate " . a:variable . " classpath variable.\n" .
|
||||
\ "If it was successful set by maven, you may need to\n" .
|
||||
\ "restart eclipse for the change to take affect.")
|
||||
endif
|
||||
else
|
||||
call eclim#util#EchoWarning(
|
||||
\ "Unable to read:\n" . prefs . "\n" .
|
||||
\ "If the " . a:variable . " classpath variable was successfully set by maven\n" .
|
||||
\ "you may need to restart eclipse for the change to take affect.")
|
||||
endif
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#maven#UpdateClasspath() " {{{
|
||||
" Updates the classpath on the server w/ the changes made to the current pom file.
|
||||
|
||||
if !eclim#project#util#IsCurrentFileInProject()
|
||||
return
|
||||
endif
|
||||
|
||||
" validate the xml first
|
||||
if eclim#xml#validate#Validate(expand('%:p'), 0)
|
||||
return
|
||||
endif
|
||||
|
||||
let name = eclim#project#util#GetCurrentProjectName()
|
||||
let command = s:update_command
|
||||
let command = substitute(command, '<project>', name, '')
|
||||
let command = substitute(command, '<build>', escape(expand('%:p'), '\'), '')
|
||||
let result = eclim#Execute(command)
|
||||
|
||||
if type(result) == g:LIST_TYPE && len(result) > 0
|
||||
let errors = eclim#util#ParseLocationEntries(
|
||||
\ result, g:EclimValidateSortResults)
|
||||
call eclim#util#SetLocationList(errors, 'r')
|
||||
call eclim#util#EchoError(
|
||||
\ "Operation contained errors. See location list for details (:lopen).")
|
||||
else
|
||||
call eclim#util#ClearLocationList()
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
120
.vim/bundle/eclim/eclim/autoload/eclim/java/refactor.vim
Normal file
120
.vim/bundle/eclim/eclim/autoload/eclim/java/refactor.vim
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" License: {{{
|
||||
"
|
||||
" Copyright (C) 2005 - 2012 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Script Varables {{{
|
||||
let s:command_rename = '-command java_refactor_rename ' .
|
||||
\ '-p "<project>" -f "<file>" -o <offset> -e <encoding> -l <length> -n <name>'
|
||||
let s:command_move = '-command java_refactor_move ' .
|
||||
\ '-p "<project>" -f "<file>" -n <package>'
|
||||
" }}}
|
||||
|
||||
function! eclim#java#refactor#Rename(name) " {{{
|
||||
if !eclim#project#util#IsCurrentFileInProject()
|
||||
return
|
||||
endif
|
||||
|
||||
let element = expand('<cword>')
|
||||
if !eclim#java#util#IsValidIdentifier(element)
|
||||
call eclim#util#EchoError
|
||||
\ ("Element under the cursor is not a valid java identifier.")
|
||||
return
|
||||
endif
|
||||
|
||||
let line = getline('.')
|
||||
let package_pattern = '^\s*package\s\+\(.*\%' . col('.') . 'c\w*\).*;'
|
||||
if line =~ package_pattern
|
||||
let element = substitute(line, package_pattern, '\1', '')
|
||||
endif
|
||||
|
||||
let prompt = printf('Rename "%s" to "%s"', element, a:name)
|
||||
let result = exists('g:EclimRefactorPromptDefault') ?
|
||||
\ g:EclimRefactorPromptDefault : eclim#lang#RefactorPrompt(prompt)
|
||||
if result <= 0
|
||||
return
|
||||
endif
|
||||
|
||||
" update the file before vim makes any changes.
|
||||
call eclim#lang#SilentUpdate()
|
||||
wall
|
||||
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let file = eclim#project#util#GetProjectRelativeFilePath()
|
||||
let position = eclim#util#GetCurrentElementPosition()
|
||||
let offset = substitute(position, '\(.*\);\(.*\)', '\1', '')
|
||||
let length = substitute(position, '\(.*\);\(.*\)', '\2', '')
|
||||
|
||||
let command = s:command_rename
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
let command = substitute(command, '<offset>', offset, '')
|
||||
let command = substitute(command, '<length>', length, '')
|
||||
let command = substitute(command, '<encoding>', eclim#util#GetEncoding(), '')
|
||||
let command = substitute(command, '<name>', a:name, '')
|
||||
" user chose preview at the prompt
|
||||
if result == 2
|
||||
let command .= ' -v'
|
||||
call eclim#lang#RefactorPreview(command)
|
||||
return
|
||||
endif
|
||||
|
||||
call eclim#lang#Refactor(command)
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#refactor#Move(package) " {{{
|
||||
if !eclim#project#util#IsCurrentFileInProject()
|
||||
return
|
||||
endif
|
||||
|
||||
let line = getline('.')
|
||||
let package_pattern = '^\s*package\s\+\(.*\%' . col('.') . 'c\w*\).*;'
|
||||
if line =~ package_pattern
|
||||
let element = substitute(line, package_pattern, '\1', '')
|
||||
endif
|
||||
|
||||
let name = eclim#java#util#GetClassname()
|
||||
let package = eclim#java#util#GetPackage()
|
||||
let prompt = printf('Move %s from "%s" to "%s"', name, package, a:package)
|
||||
let result = exists('g:EclimRefactorPromptDefault') ?
|
||||
\ g:EclimRefactorPromptDefault : eclim#lang#RefactorPrompt(prompt)
|
||||
if result <= 0
|
||||
return
|
||||
endif
|
||||
|
||||
" update the file before vim makes any changes.
|
||||
call eclim#lang#SilentUpdate()
|
||||
wall
|
||||
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let file = eclim#project#util#GetProjectRelativeFilePath()
|
||||
let command = s:command_move
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
let command = substitute(command, '<package>', a:package, '')
|
||||
" user chose preview at the prompt
|
||||
if result == 2
|
||||
let command .= ' -v'
|
||||
call eclim#lang#RefactorPreview(command)
|
||||
return
|
||||
endif
|
||||
call eclim#lang#Refactor(command)
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
402
.vim/bundle/eclim/eclim/autoload/eclim/java/search.vim
Normal file
402
.vim/bundle/eclim/eclim/autoload/eclim/java/search.vim
Normal file
|
|
@ -0,0 +1,402 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" see http://eclim.org/vim/java/search.html
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Global Varables {{{
|
||||
if !exists("g:EclimJavaDocSearchSingleResult")
|
||||
" possible values ('open', 'lopen')
|
||||
let g:EclimJavaDocSearchSingleResult = "open"
|
||||
endif
|
||||
|
||||
if !exists("g:EclimJavaSearchSingleResult")
|
||||
" possible values ('split', 'edit', 'lopen')
|
||||
let g:EclimJavaSearchSingleResult = g:EclimDefaultFileOpenAction
|
||||
endif
|
||||
" }}}
|
||||
|
||||
" Script Varables {{{
|
||||
let s:search_src = "java_search"
|
||||
let s:search_doc = "java_docsearch"
|
||||
let s:search_element =
|
||||
\ '-command <search> -n "<project>" -f "<file>" ' .
|
||||
\ '-o <offset> -e <encoding> -l <length> <args>'
|
||||
let s:search_pattern = '-command <search>'
|
||||
let s:options = ['-p', '-t', '-x', '-s', '-i']
|
||||
let s:contexts = ['all', 'declarations', 'implementors', 'references']
|
||||
let s:scopes = ['all', 'project']
|
||||
let s:types = [
|
||||
\ 'annotation',
|
||||
\ 'class',
|
||||
\ 'classOrEnum',
|
||||
\ 'classOrInterface',
|
||||
\ 'constructor',
|
||||
\ 'enum',
|
||||
\ 'field',
|
||||
\ 'interface',
|
||||
\ 'method',
|
||||
\ 'package',
|
||||
\ 'type']
|
||||
|
||||
let s:search_alt_all = '\<<element>\>'
|
||||
let s:search_alt_references = s:search_alt_all
|
||||
let s:search_alt_implementors =
|
||||
\ '\(implements\|extends\)\_[0-9A-Za-z,[:space:]]*\<<element>\>\_[0-9A-Za-z,[:space:]]*{'
|
||||
" }}}
|
||||
|
||||
function! s:Search(command, ...) " {{{
|
||||
" Executes a search.
|
||||
" Usage closely resebles eclim command line client usage.
|
||||
" When doing a non-pattern search the element under the cursor is searched for.
|
||||
" Search for declarations of element under the cursor
|
||||
" call s:Search("-x", "declarations")
|
||||
" Search for references of HashMap
|
||||
" call s:Search("-p", "HashM*", "-t", "class", "-x", "references")
|
||||
" Or all the arguments can be passed in at once:
|
||||
" call s:Search("-p 'HashM*' -t class -x references")
|
||||
|
||||
let argline = ""
|
||||
let index = 1
|
||||
while index <= a:0
|
||||
if index != 1
|
||||
let argline = argline . " "
|
||||
endif
|
||||
let argline = argline . a:{index}
|
||||
let index = index + 1
|
||||
endwhile
|
||||
|
||||
" check if pattern supplied without -p.
|
||||
if argline !~ '^\s*-[a-z]' && argline !~ '^\s*$'
|
||||
let argline = '-p ' . argline
|
||||
endif
|
||||
|
||||
let in_project = eclim#project#util#IsCurrentFileInProject(0)
|
||||
|
||||
" element search
|
||||
if argline !~ '-p\>'
|
||||
if &ft != 'java'
|
||||
call eclim#util#EchoWarning
|
||||
\ ("Element searches only supported in java source files.")
|
||||
return 0
|
||||
endif
|
||||
|
||||
if !eclim#java#util#IsValidIdentifier(expand('<cword>'))
|
||||
call eclim#util#EchoError
|
||||
\ ("Element under the cursor is not a valid java identifier.")
|
||||
return 0
|
||||
endif
|
||||
|
||||
if !in_project
|
||||
" build a pattern search and execute it
|
||||
return s:SearchAlternate('-p ' . s:BuildPattern() . ' ' . argline, 1)
|
||||
endif
|
||||
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let file = eclim#project#util#GetProjectRelativeFilePath()
|
||||
let position = eclim#util#GetCurrentElementPosition()
|
||||
let offset = substitute(position, '\(.*\);\(.*\)', '\1', '')
|
||||
let length = substitute(position, '\(.*\);\(.*\)', '\2', '')
|
||||
|
||||
let search_cmd = s:search_element
|
||||
let search_cmd = substitute(search_cmd, '<project>', project, '')
|
||||
let search_cmd = substitute(search_cmd, '<search>', a:command, '')
|
||||
let search_cmd = substitute(search_cmd, '<file>', file, '')
|
||||
let search_cmd = substitute(search_cmd, '<offset>', offset, '')
|
||||
let search_cmd = substitute(search_cmd, '<encoding>', eclim#util#GetEncoding(), '')
|
||||
let search_cmd = substitute(search_cmd, '<length>', length, '')
|
||||
let search_cmd = substitute(search_cmd, '<args>', argline, '')
|
||||
|
||||
let result = eclim#Execute(search_cmd)
|
||||
|
||||
" pattern search
|
||||
else
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
|
||||
" pattern search
|
||||
let search_cmd = s:search_pattern
|
||||
let search_cmd = substitute(search_cmd, '<search>', a:command, '')
|
||||
if project != ''
|
||||
let search_cmd .= ' -n "' . project . '"'
|
||||
endif
|
||||
let file = eclim#project#util#GetProjectRelativeFilePath()
|
||||
if file != ''
|
||||
let search_cmd .= ' -f "' . file . '"'
|
||||
endif
|
||||
let search_cmd .= ' ' . argline
|
||||
" quote the search pattern
|
||||
let search_cmd =
|
||||
\ substitute(search_cmd, '\(.*-p\s\+\)\(.\{-}\)\(\s\|$\)\(.*\)', '\1"\2"\3\4', '')
|
||||
|
||||
let result = eclim#Execute(search_cmd)
|
||||
|
||||
if !in_project && filereadable(expand('%'))
|
||||
return result + s:SearchAlternate(argline, 0)
|
||||
endif
|
||||
endif
|
||||
|
||||
return result
|
||||
endfunction " }}}
|
||||
|
||||
function! s:SearchAlternate(argline, element) " {{{
|
||||
" Alternate search for non-project src files using vimgrep and &path.
|
||||
|
||||
call eclim#util#EchoInfo("Executing alternate search...")
|
||||
if a:argline =~ '-t'
|
||||
call eclim#util#EchoError
|
||||
\ ("Alternate search doesn't support the type (-t) option yet.")
|
||||
return []
|
||||
endif
|
||||
let search_pattern = ""
|
||||
if a:argline =~ '-x all'
|
||||
let search_pattern = s:search_alt_all
|
||||
elseif a:argline =~ '-x implementors'
|
||||
let search_pattern = s:search_alt_implementors
|
||||
elseif a:argline =~ '-x references'
|
||||
let search_pattern = s:search_alt_references
|
||||
endif
|
||||
|
||||
let pattern = substitute(a:argline, '.*-p\s\+\(.\{-}\)\(\s.*\|$\)', '\1', '')
|
||||
let file_pattern = substitute(pattern, '\.', '/', 'g') . ".java"
|
||||
|
||||
" search relative to the current dir first.
|
||||
let package_path = substitute(eclim#java#util#GetPackage(), '\.', '/', 'g')
|
||||
let path = substitute(expand('%:p:h'), '\', '/', 'g')
|
||||
let path = substitute(path, package_path, '', '')
|
||||
let files = split(eclim#util#Globpath(path, "**/" . file_pattern), '\n')
|
||||
|
||||
" if none found, then search the path.
|
||||
if len(files) == 0
|
||||
let files = eclim#util#FindFileInPath(file_pattern, 1)
|
||||
let path = ""
|
||||
endif
|
||||
|
||||
let results = []
|
||||
|
||||
if len(files) > 0 && search_pattern != ''
|
||||
" narrow down to, hopefully, a distribution path for a narrower search.
|
||||
let response = eclim#util#PromptList(
|
||||
\ "Multiple type matches. Please choose the relevant file.",
|
||||
\ files, g:EclimInfoHighlight)
|
||||
if response == -1
|
||||
return
|
||||
endif
|
||||
|
||||
let file = substitute(get(files, response), '\', '/', 'g')
|
||||
if path == ""
|
||||
let path = eclim#util#GetPathEntry(file)
|
||||
endif
|
||||
let path = escape(path, '/\')
|
||||
let path = substitute(file, '\(' . path . '[/\\]\?.\{-}[/\\]\).*', '\1', '')
|
||||
let pattern = substitute(pattern, '\*', '.\\\\{-}', 'g')
|
||||
let search_pattern = substitute(search_pattern, '<element>', pattern, '')
|
||||
let command = "vimgrep /" . search_pattern . "/gj " . path . "**/*.java"
|
||||
silent! exec command
|
||||
|
||||
let loclist = getloclist(0)
|
||||
for entry in loclist
|
||||
let bufname = bufname(entry.bufnr)
|
||||
let result = {
|
||||
\ 'filename': bufname,
|
||||
\ 'message': entry.text,
|
||||
\ 'line': entry.lnum,
|
||||
\ 'column': entry.col,
|
||||
\ }
|
||||
" when searching for implementors, prevent dupes from the somewhat
|
||||
" greedy pattern search (may need some more updating post conversion to
|
||||
" dict results).
|
||||
if a:argline !~ '-x implementors' || !eclim#util#ListContains(results, result)
|
||||
call add(results, result)
|
||||
endif
|
||||
endfor
|
||||
elseif len(files) > 0
|
||||
for file in files
|
||||
let fully_qualified = eclim#java#util#GetPackage(file) . '.' .
|
||||
\ eclim#java#util#GetClassname(file)
|
||||
" if an element search, filter out results that are not imported.
|
||||
if !a:element || eclim#java#util#IsImported(fully_qualified)
|
||||
call add(results, {
|
||||
\ 'filename': file,
|
||||
\ 'message': fully_qualified,
|
||||
\ 'line': 1,
|
||||
\ 'column': 1,
|
||||
\ })
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
call eclim#util#Echo(' ')
|
||||
return results
|
||||
endfunction " }}}
|
||||
|
||||
function! s:BuildPattern() " {{{
|
||||
" Builds a pattern based on the cursors current position in the file.
|
||||
|
||||
let class = expand('<cword>')
|
||||
" see if the classname element selected is fully qualified.
|
||||
let line = getline('.')
|
||||
let package =
|
||||
\ substitute(line, '.*\s\([0-9A-Za-z._]*\)\.' . class . '\>.*', '\1', '')
|
||||
|
||||
" not fully qualified, so attempt to determine package from import.
|
||||
if package == line
|
||||
let package = eclim#java#util#GetPackageFromImport(class)
|
||||
|
||||
" maybe the element is the current class?
|
||||
if package == ""
|
||||
if eclim#java#util#GetClassname() == class
|
||||
let package = eclim#java#util#GetPackage()
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
if package != ""
|
||||
return package . "." . class
|
||||
endif
|
||||
return class
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#search#SearchAndDisplay(type, args) " {{{
|
||||
" Execute a search and displays the results via quickfix.
|
||||
|
||||
" if running from a non java source file, no SilentUpdate needed.
|
||||
if &ft == 'java'
|
||||
call eclim#lang#SilentUpdate()
|
||||
endif
|
||||
|
||||
let argline = a:args
|
||||
|
||||
" check if just a pattern was supplied.
|
||||
if argline =~ '^\s*\w'
|
||||
let argline = '-p ' . argline
|
||||
endif
|
||||
|
||||
let results = s:Search(a:type, argline)
|
||||
if type(results) != g:LIST_TYPE
|
||||
return
|
||||
endif
|
||||
if !empty(results)
|
||||
if a:type == 'java_search'
|
||||
call eclim#util#SetLocationList(eclim#util#ParseLocationEntries(results))
|
||||
let locs = getloclist(0)
|
||||
" if only one result and it's for the current file, just jump to it.
|
||||
" note: on windows the expand result must be escaped
|
||||
if len(results) == 1 && locs[0].bufnr == bufnr('%')
|
||||
if results[0].line != 1 && results[0].column != 1
|
||||
lfirst
|
||||
endif
|
||||
|
||||
" single result in another file.
|
||||
elseif len(results) == 1 && g:EclimJavaSearchSingleResult != "lopen"
|
||||
let entry = getloclist(0)[0]
|
||||
let name = substitute(bufname(entry.bufnr), '\', '/', 'g')
|
||||
call eclim#util#GoToBufferWindowOrOpen(name, g:EclimJavaSearchSingleResult)
|
||||
call eclim#util#SetLocationList(eclim#util#ParseLocationEntries(results))
|
||||
call eclim#display#signs#Update()
|
||||
call cursor(entry.lnum, entry.col)
|
||||
else
|
||||
exec 'lopen ' . g:EclimLocationListHeight
|
||||
endif
|
||||
elseif a:type == 'java_docsearch'
|
||||
let window_name = "javadoc_search_results"
|
||||
let filename = expand('%:p')
|
||||
call eclim#util#TempWindowClear(window_name)
|
||||
|
||||
if len(results) == 1 && g:EclimJavaDocSearchSingleResult == "open"
|
||||
let entry = results[0]
|
||||
call s:ViewDoc(entry)
|
||||
else
|
||||
call eclim#util#TempWindow(
|
||||
\ window_name, results, {'height': g:EclimLocationListHeight})
|
||||
|
||||
nnoremap <silent> <buffer> <cr> :call <SID>ViewDoc()<cr>
|
||||
augroup temp_window
|
||||
autocmd! BufWinLeave <buffer>
|
||||
call eclim#util#GoToBufferWindowRegister(filename)
|
||||
augroup END
|
||||
endif
|
||||
endif
|
||||
return 1
|
||||
else
|
||||
if argline =~ '-p '
|
||||
let searchedFor = substitute(argline, '.*-p \(.\{-}\)\( .*\|$\)', '\1', '')
|
||||
call eclim#util#EchoInfo("Pattern '" . searchedFor . "' not found.")
|
||||
elseif &ft == 'java'
|
||||
if !eclim#java#util#IsValidIdentifier(expand('<cword>'))
|
||||
return
|
||||
endif
|
||||
|
||||
let searchedFor = expand('<cword>')
|
||||
call eclim#util#EchoInfo("No results for '" . searchedFor . "'.")
|
||||
endif
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! s:ViewDoc(...) " {{{
|
||||
" View the supplied file in a browser, or if none proved, the file under the
|
||||
" cursor.
|
||||
let url = a:0 > 0 ? a:1 : substitute(getline('.'), '\(.\{-}\)|.*', '\1', '')
|
||||
call eclim#web#OpenUrl(url)
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#search#CommandCompleteJavaSearch(argLead, cmdLine, cursorPos) " {{{
|
||||
let cmdLine = strpart(a:cmdLine, 0, a:cursorPos)
|
||||
let cmdTail = strpart(a:cmdLine, a:cursorPos)
|
||||
let argLead = substitute(a:argLead, cmdTail . '$', '', '')
|
||||
if cmdLine =~ '-s\s\+[a-z]*$'
|
||||
let scopes = deepcopy(s:scopes)
|
||||
call filter(scopes, 'v:val =~ "^' . argLead . '"')
|
||||
return scopes
|
||||
elseif cmdLine =~ '-t\s\+[a-z]*$'
|
||||
let types = deepcopy(s:types)
|
||||
call filter(types, 'v:val =~ "^' . argLead . '"')
|
||||
return types
|
||||
elseif cmdLine =~ '-x\s\+[a-z]*$'
|
||||
let contexts = deepcopy(s:contexts)
|
||||
call filter(contexts, 'v:val =~ "^' . argLead . '"')
|
||||
return contexts
|
||||
elseif cmdLine =~ '\s\+[-]\?$'
|
||||
let options = deepcopy(s:options)
|
||||
let index = 0
|
||||
for option in options
|
||||
if a:cmdLine =~ option
|
||||
call remove(options, index)
|
||||
else
|
||||
let index += 1
|
||||
endif
|
||||
endfor
|
||||
return options
|
||||
endif
|
||||
return []
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#search#FindClassDeclaration() " {{{
|
||||
" Used by non java source files to find the declaration of a classname under
|
||||
" the cursor.
|
||||
let line = getline('.')
|
||||
let class = substitute(line,
|
||||
\ '.\{-}\([0-9a-zA-Z_.]*\%' . col('.') . 'c[0-9a-zA-Z_.]*\).*', '\1', '')
|
||||
if class != line && class != '' && class =~ '^[a-zA-Z]'
|
||||
call eclim#java#search#SearchAndDisplay(
|
||||
\ 'java_search', '-t classOrInterface -p ' . class)
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
88
.vim/bundle/eclim/eclim/autoload/eclim/java/src.vim
Normal file
88
.vim/bundle/eclim/eclim/autoload/eclim/java/src.vim
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" License: " {{{
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Script Variables {{{
|
||||
let s:format_command =
|
||||
\ '-command java_format -p "<project>" -f "<file>" ' .
|
||||
\ '-h <hoffset> -t <toffset> -e <encoding>'
|
||||
let s:checkstyle_command = '-command java_checkstyle -p "<project>" -f "<file>"'
|
||||
" }}}
|
||||
|
||||
function! eclim#java#src#Format(first, last) " {{{
|
||||
if !eclim#project#util#IsCurrentFileInProject()
|
||||
return
|
||||
endif
|
||||
|
||||
call eclim#lang#SilentUpdate()
|
||||
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let file = eclim#project#util#GetProjectRelativeFilePath()
|
||||
|
||||
let command = s:format_command
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
let begin = eclim#util#GetOffset(a:first, 1)
|
||||
let end = eclim#util#GetOffset(a:last, 1) + len(getline(a:last)) - 1
|
||||
let command = substitute(command, '<hoffset>', begin, '')
|
||||
let command = substitute(command, '<toffset>', end, '')
|
||||
let command = substitute(command, '<encoding>', eclim#util#GetEncoding(), '')
|
||||
|
||||
let result = eclim#Execute(command)
|
||||
if result != "0"
|
||||
call eclim#util#Reload({'retab': 1})
|
||||
write
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#src#Checkstyle() " {{{
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
if project != ""
|
||||
let config =
|
||||
\ eclim#project#util#GetProjectSetting('org.eclim.java.checkstyle.config')
|
||||
if type(config) == g:NUMBER_TYPE
|
||||
return
|
||||
endif
|
||||
|
||||
if config == ''
|
||||
call eclim#util#EchoWarning(
|
||||
\ "Before invoking checkstyle, you must first configure the " .
|
||||
\ "location of your\ncheckstyle config via the setting: " .
|
||||
\ "'org.eclim.java.checkstyle.config'.")
|
||||
return
|
||||
endif
|
||||
|
||||
let file = eclim#project#util#GetProjectRelativeFilePath()
|
||||
let command = s:checkstyle_command
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
|
||||
let result = eclim#Execute(command)
|
||||
if type(result) == g:LIST_TYPE && len(result) > 0
|
||||
let errors = eclim#util#ParseLocationEntries(
|
||||
\ result, g:EclimValidateSortResults)
|
||||
call eclim#util#SetLocationList(errors)
|
||||
else
|
||||
call eclim#util#ClearLocationList('checkstyle')
|
||||
endif
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
310
.vim/bundle/eclim/eclim/autoload/eclim/java/tools.vim
Normal file
310
.vim/bundle/eclim/eclim/autoload/eclim/java/tools.vim
Normal file
|
|
@ -0,0 +1,310 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" see http://eclim.org/vim/java/tools.html
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Script Variables {{{
|
||||
let s:command_src_find = '-command java_src_find -p "<project>" -c "<classname>"'
|
||||
|
||||
let s:entry_match{'junit'} = 'Tests run:'
|
||||
let s:entry_text_replace{'junit'} = '.*[junit] '
|
||||
let s:entry_text_with{'junit'} = ''
|
||||
|
||||
let s:entry_match{'testng'} = 'eclim testng:'
|
||||
let s:entry_text_replace{'testng'} = '.*eclim testng: .\{-}:'
|
||||
let s:entry_text_with{'testng'} = ''
|
||||
|
||||
let s:open_console = 'Open jconsole'
|
||||
let s:view_info = 'View Info'
|
||||
let s:view_stacks = 'View Stacks'
|
||||
let s:view_map = 'View Memory Map'
|
||||
let s:args_main = 'Arguments To Main Method'
|
||||
let s:args_vm = 'Arguments To JVM'
|
||||
|
||||
let s:supported_command = '\(' .
|
||||
\ s:open_console . '\|' .
|
||||
\ s:view_info . '\|' .
|
||||
\ s:view_stacks . '\|' .
|
||||
\ s:view_map .
|
||||
\ '\)'
|
||||
|
||||
hi link JpsArguments Normal
|
||||
hi link JpsViewAdditional Normal
|
||||
hi JpsViewAdditional gui=underline,bold term=underline,bold cterm=underline,bold
|
||||
" }}}
|
||||
|
||||
function! eclim#java#tools#MakeWithJavaBuildTool(compiler, bang, args) " {{{
|
||||
augroup eclim_make_java_test
|
||||
autocmd!
|
||||
autocmd QuickFixCmdPost make
|
||||
\ call eclim#java#tools#ResolveQuickfixResults(['junit', 'testng'])
|
||||
augroup END
|
||||
|
||||
try
|
||||
call eclim#util#MakeWithCompiler(a:compiler, a:bang, a:args)
|
||||
finally
|
||||
silent! autocmd! eclim_make_java_test
|
||||
endtry
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#tools#ResolveQuickfixResults(frameworks) " {{{
|
||||
" Invoked after a :make to resolve any junit results in the quickfix entries.
|
||||
let frameworks = type(a:frameworks) == g:LIST_TYPE ? a:frameworks : [a:frameworks]
|
||||
let entries = getqflist()
|
||||
let newentries = []
|
||||
for entry in entries
|
||||
let filename = bufname(entry.bufnr)
|
||||
let text = entry.text
|
||||
|
||||
for framework in frameworks
|
||||
if entry.text =~ s:entry_match{framework}
|
||||
let filename = fnamemodify(filename, ':t')
|
||||
let text = substitute(text,
|
||||
\ s:entry_text_replace{framework}, s:entry_text_with{framework}, '')
|
||||
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let command = s:command_src_find
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<classname>', filename, '')
|
||||
let filename = eclim#Execute(command)
|
||||
if filename == ''
|
||||
" file not found.
|
||||
continue
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
|
||||
if !filereadable(filename)
|
||||
continue
|
||||
endif
|
||||
|
||||
let newentry = {
|
||||
\ 'filename': filename,
|
||||
\ 'lnum': entry.lnum,
|
||||
\ 'col': entry.col,
|
||||
\ 'type': entry.type,
|
||||
\ 'text': text
|
||||
\ }
|
||||
call add(newentries, newentry)
|
||||
endfor
|
||||
|
||||
call setqflist(newentries, 'r')
|
||||
|
||||
" vim is finicky about changing the quickfix list during a QuickFixCmdPost
|
||||
" autocmd, so force a delayed reload of the quickfix results
|
||||
call eclim#util#DelayedCommand('call setqflist(getqflist(), "r")')
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#tools#Jps() " {{{
|
||||
call eclim#util#Echo('Executing...')
|
||||
|
||||
let content = []
|
||||
let processes = eclim#java#tools#GetJavaProcesses()
|
||||
if len(processes) == 1 && string(processes[0]) == '0'
|
||||
return
|
||||
endif
|
||||
|
||||
for process in processes
|
||||
if len(content) > 0
|
||||
call add(content, "")
|
||||
endif
|
||||
|
||||
call add(content, process.id . ' - ' . process.name)
|
||||
|
||||
if executable('jconsole')
|
||||
call add(content, "\t" . s:open_console)
|
||||
endif
|
||||
|
||||
if executable('jinfo')
|
||||
call add(content, "\t" . s:view_info)
|
||||
endif
|
||||
|
||||
if executable('jstack')
|
||||
call add(content, "\t" . s:view_stacks)
|
||||
endif
|
||||
|
||||
if executable('jmap')
|
||||
call add(content, "\t" . s:view_map)
|
||||
endif
|
||||
|
||||
call add(content, "")
|
||||
|
||||
call add(content, "\t" . s:args_main . " {")
|
||||
let args_main = has_key(process, 'args_main') ?
|
||||
\ map(split(process.args_main), '"\t\t" . v:val') : []
|
||||
let content = content + args_main
|
||||
call add(content, "\t}")
|
||||
|
||||
if has_key(process, 'args_vm')
|
||||
call add(content, "")
|
||||
call add(content, "\t" . s:args_vm . " {")
|
||||
let args_vm = map(split(process.args_vm), '"\t\t" . v:val')
|
||||
let content = content + args_vm
|
||||
call add(content, "\t}")
|
||||
endif
|
||||
endfor
|
||||
|
||||
if len(content) == 0
|
||||
call add(content, 'No Running Java Processes Found')
|
||||
endif
|
||||
|
||||
call eclim#util#TempWindow('Java_Processes', content)
|
||||
|
||||
setlocal ft=jps_list
|
||||
setlocal foldmethod=syntax
|
||||
setlocal foldlevel=0
|
||||
setlocal foldtext=getline(v:foldstart)
|
||||
|
||||
exec 'syntax match JpsViewAdditional /' . s:supported_command . '$/'
|
||||
exec 'syntax region JpsArguments start=/' . s:args_main . ' {$/ end=/^\s*}$/ fold'
|
||||
exec 'syntax region JpsArguments start=/' . s:args_vm . ' {$/ end=/^\s*}$/ fold'
|
||||
|
||||
nnoremap <silent> <buffer> <cr> :call <SID>ViewAdditionalInfo()<cr>
|
||||
|
||||
call eclim#util#Echo(' ')
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#tools#GetJavaProcesses() " {{{
|
||||
let java_processes = []
|
||||
let result = eclim#util#System('jps -vV')
|
||||
if v:shell_error
|
||||
call eclim#util#EchoError('Unable to execute jps - ' . result)
|
||||
return [0]
|
||||
endif
|
||||
let vm_args = split(result, '\n')
|
||||
for process in split(eclim#util#System('jps -lm'), '\n')
|
||||
if process =~ 'sun.tools.jps.Jps' "|| process =~ '^[0-9]\+\s*$'
|
||||
continue
|
||||
endif
|
||||
|
||||
let java_process_info = {}
|
||||
let java_process_info['id'] = substitute(process, '\(.\{-}\) .*', '\1', '')
|
||||
let java_process_info['name'] =
|
||||
\ substitute(process, '.\{-} \(.\{-}\) .*', '\1', '')
|
||||
if process =~ '.\{-} .\{-} \(.*\)'
|
||||
let java_process_info['args_main'] =
|
||||
\ substitute(process, '.\{-} .\{-} \(.*\)', '\1', '')
|
||||
endif
|
||||
|
||||
let index = 0
|
||||
for args in vm_args
|
||||
if args =~ '^' . java_process_info.id . '\>'
|
||||
if args =~ '.\{-} .\{-} \(.*\)'
|
||||
let java_process_info['args_vm'] =
|
||||
\ substitute(args, '.\{-} .\{-} \(.*\)', '\1', '')
|
||||
endif
|
||||
call remove(vm_args, index)
|
||||
endif
|
||||
let index += 1
|
||||
endfor
|
||||
|
||||
call add(java_processes, java_process_info)
|
||||
endfor
|
||||
return java_processes
|
||||
endfunction " }}}
|
||||
|
||||
function! s:ViewAdditionalInfo() " {{{
|
||||
let line = getline('.')
|
||||
if line =~ '^\s*' . s:supported_command . '$'
|
||||
" get the process id.
|
||||
let lnum = search('^[0-9]\+ - ', 'bn')
|
||||
let id = substitute(getline(lnum), '^\([0-9]\+\) - .*', '\1', '')
|
||||
|
||||
if line =~ '^\s*' . s:open_console . '$'
|
||||
call s:OpenConsole(id)
|
||||
elseif line =~ '^\s*' . s:view_info . '$'
|
||||
call s:ViewInfo(id)
|
||||
elseif line =~ '^\s*' . s:view_stacks . '$'
|
||||
call s:ViewStacks(id)
|
||||
elseif line =~ '^\s*' . s:view_map . '$'
|
||||
call s:ViewMap(id)
|
||||
endif
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! s:OpenConsole(id) " {{{
|
||||
call eclim#util#Echo('Executing...')
|
||||
|
||||
if has('win32') || has('win64')
|
||||
call eclim#util#Exec('silent! !start jconsole ' . a:id)
|
||||
else
|
||||
call eclim#util#Exec('silent! !jconsole ' . a:id . ' &')
|
||||
endif
|
||||
exec "normal! \<c-l>"
|
||||
|
||||
call eclim#util#Echo(' ')
|
||||
endfunction " }}}
|
||||
|
||||
function! s:ViewInfo(id) " {{{
|
||||
if executable('jinfo')
|
||||
call eclim#util#Echo('Executing...')
|
||||
|
||||
let content = split(eclim#util#System('jinfo ' . a:id), '\n')
|
||||
if v:shell_error
|
||||
call eclim#util#EchoError('Unable to execute jinfo.')
|
||||
return
|
||||
endif
|
||||
|
||||
call eclim#util#TempWindow('Java_Process_Info_' . a:id, content)
|
||||
setlocal ft=jproperties
|
||||
|
||||
call eclim#util#Echo(' ')
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! s:ViewStacks(id) " {{{
|
||||
if executable('jstack')
|
||||
call eclim#util#Echo('Executing...')
|
||||
let content = split(eclim#util#System('jstack ' . a:id), '\n')
|
||||
|
||||
if v:shell_error
|
||||
call eclim#util#EchoError('Unable to execute jstack.')
|
||||
return
|
||||
endif
|
||||
|
||||
call map(content, 'substitute(v:val, "^ \\(\\S\\)", " \\1", "")')
|
||||
call map(content, 'substitute(v:val, "^\t", " ", "")')
|
||||
|
||||
call eclim#util#TempWindow('Java_Process_Stacks_' . a:id, content)
|
||||
setlocal ft=java
|
||||
|
||||
call eclim#util#Echo(' ')
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! s:ViewMap(id) " {{{
|
||||
if executable('jmap')
|
||||
call eclim#util#Echo('Executing...')
|
||||
let content = split(eclim#util#System('jmap ' . a:id), '\n')
|
||||
|
||||
if v:shell_error
|
||||
call eclim#util#EchoError('Unable to execute jmap.')
|
||||
return
|
||||
endif
|
||||
|
||||
call eclim#util#TempWindow('Java_Process_Map_' . a:id, content)
|
||||
|
||||
call eclim#util#Echo(' ')
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
352
.vim/bundle/eclim/eclim/autoload/eclim/java/util.vim
Normal file
352
.vim/bundle/eclim/eclim/autoload/eclim/java/util.vim
Normal file
|
|
@ -0,0 +1,352 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" Utility functions for java eclim ftplugins.
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Script Variables {{{
|
||||
let s:keywords = '\(abstract\|assert\|boolean\|case\|catch\|char\|class\|do\|double\|enum\|extends\|final\|finally\|float\|for\|if\|implements\|import\|int\|interface\|long\|new\|null\|package\|private\|protected\|public\|return\|short\|static\|switch\|throw\|throws\|try\|void\|while\)'
|
||||
|
||||
let s:class_declaration = '^\s*\(public\|private\|protected\)\?\(\s\+abstract\)\?\s\+\(class\|interface\|enum\)\s\+[A-Z]'
|
||||
|
||||
let s:command_src_exists = '-command java_src_exists -f "<file>"'
|
||||
let s:command_list_installs = '-command java_list_installs'
|
||||
let s:command_classpath = '-command java_classpath -p "<project>"'
|
||||
let s:command_read_class = '-command java_class_prototype -c <class>'
|
||||
let s:command_complete_package = '-command java_complete_package -p "<project>"'
|
||||
|
||||
let s:import_pattern = '^\s*import\_s\+<import>\_s*;'
|
||||
" }}}
|
||||
|
||||
function! eclim#java#util#FileExists(name) " {{{
|
||||
let command = substitute(s:command_src_exists, '<file>', a:name, '')
|
||||
let result = eclim#Execute(command)
|
||||
return result =~ '^true$'
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#util#GetClassname(...) " {{{
|
||||
if a:0 > 0
|
||||
return fnamemodify(a:1, ":t:r")
|
||||
endif
|
||||
return expand("%:t:r")
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#util#GetClassDeclarationPosition(movecursor) " {{{
|
||||
let pos = getpos('.')
|
||||
call cursor(1,1)
|
||||
|
||||
let position = search(s:class_declaration)
|
||||
|
||||
if !a:movecursor || !position
|
||||
call setpos('.', pos)
|
||||
endif
|
||||
|
||||
return position
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#util#GetFullyQualifiedClassname(...) " {{{
|
||||
if a:0 > 0
|
||||
return eclim#java#util#GetPackage(a:1) . '.' . eclim#java#util#GetClassname(a:1)
|
||||
endif
|
||||
return eclim#java#util#GetPackage() . '.' . eclim#java#util#GetClassname()
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#util#GetPackage(...) " {{{
|
||||
if a:0 > 0
|
||||
let winreset = winrestcmd()
|
||||
silent exec "sview " . a:1
|
||||
endif
|
||||
|
||||
let pos = getpos('.')
|
||||
|
||||
call cursor(1,1)
|
||||
|
||||
let package = ""
|
||||
let packageLine = search('^\s*\<package\>', 'w')
|
||||
if packageLine > 0
|
||||
let package =
|
||||
\ substitute(getline('.'), '.*\<package\>\s\+\(.\{-\}\)[ ;].*', '\1', '')
|
||||
endif
|
||||
|
||||
if a:0 > 0
|
||||
close
|
||||
silent exec winreset
|
||||
|
||||
" not necessary and may screw up display (see autoload/project.vim)
|
||||
"redraw
|
||||
else
|
||||
call setpos('.', pos)
|
||||
endif
|
||||
|
||||
return package
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#util#GetPackageFromImport(class) " {{{
|
||||
let pattern = '^\s*import\s\+\([0-9A-Za-z._]*\)\.' . a:class . '\s*;'
|
||||
let found = search(pattern, 'wn')
|
||||
if found
|
||||
return substitute(getline(found), pattern, '\1', '')
|
||||
endif
|
||||
return ""
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#util#GetSelectedFields(first, last) range " {{{
|
||||
" normalize each field statement into a single line.
|
||||
let selection = ''
|
||||
let index = a:first
|
||||
let blockcomment = 0
|
||||
while index <= a:last
|
||||
let line = getline(index)
|
||||
|
||||
" ignore comment lines
|
||||
if line =~ '^\s*/\*'
|
||||
let blockcomment = 1
|
||||
endif
|
||||
if blockcomment && line =~ '\*/\s*$'
|
||||
let blockcomment = 0
|
||||
endif
|
||||
if line !~ '^\s*//' && !blockcomment
|
||||
" remove quoted values.
|
||||
let line = substitute(line, '".\{-}"', '', 'g')
|
||||
" strip off trailing comments
|
||||
let line = substitute(line, '//.*', '', '')
|
||||
let line = substitute(line, '/\*.*\*/', '', '')
|
||||
|
||||
let selection = selection . line
|
||||
endif
|
||||
|
||||
let index += 1
|
||||
endwhile
|
||||
|
||||
" compact comma separated multi field declarations
|
||||
let selection = substitute(selection, ',\s*', ',', 'g')
|
||||
" break fields back up into their own line.
|
||||
let selection = substitute(selection, ';', ';\n', 'g')
|
||||
" remove the assignment portion of the field.
|
||||
let selection = substitute(selection, '\(.\{-}\)\s*=.\{-};', '\1;', 'g')
|
||||
|
||||
" extract field names
|
||||
let properties = []
|
||||
let lines = split(selection, '\n')
|
||||
for line in lines
|
||||
if line !~ '^\s*\/\/'
|
||||
let fields = substitute(line, '.*\s\(.*\);', '\1', '')
|
||||
if fields =~ '^[a-zA-Z0-9_,]'
|
||||
for field in split(fields, ',')
|
||||
call add(properties, field)
|
||||
endfor
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
|
||||
return properties
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#util#IsKeyword(word) " {{{
|
||||
return (a:word =~ '^' . s:keywords . '$\C')
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#util#IsImported(classname) " {{{
|
||||
" search for fully qualified import
|
||||
let import_search = s:import_pattern
|
||||
let import_search = substitute(import_search, '<import>', a:classname, '')
|
||||
let found = search(import_search, 'wn')
|
||||
if found
|
||||
return 1
|
||||
endif
|
||||
|
||||
" search for package.* import
|
||||
let package = substitute(a:classname, '\(.*\)\..*', '\1', '')
|
||||
let import_search = s:import_pattern
|
||||
let import_search = substitute(import_search, '<import>', package . '\\.\\*', '')
|
||||
let found = search(import_search, 'wn')
|
||||
if found
|
||||
return 1
|
||||
endif
|
||||
|
||||
" check if current file and supplied classname are in the same package
|
||||
if eclim#java#util#GetPackage() == package
|
||||
return 1
|
||||
endif
|
||||
|
||||
" not imported
|
||||
return 0
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#util#IsValidIdentifier(word) " {{{
|
||||
if a:word == '' || a:word =~ '\W' || a:word =~ '^\d\+$' ||
|
||||
\ eclim#java#util#IsKeyword(a:word)
|
||||
return 0
|
||||
endif
|
||||
return 1
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#util#Java(classname, args) " {{{
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
if project == '' && exists('b:project')
|
||||
let project = b:project
|
||||
endif
|
||||
|
||||
if project == ''
|
||||
call eclim#project#util#IsCurrentFileInProject()
|
||||
return
|
||||
endif
|
||||
|
||||
let args = eclim#util#ParseArgs(a:args)
|
||||
let classname = a:classname
|
||||
if classname == '' && len(args)
|
||||
let arg1 = args[0]
|
||||
if arg1 == '%'
|
||||
let args = args[1:]
|
||||
let classname = exists('b:filename') ?
|
||||
\ eclim#java#util#GetFullyQualifiedClassname(b:filename) :
|
||||
\ eclim#java#util#GetFullyQualifiedClassname()
|
||||
endif
|
||||
endif
|
||||
|
||||
let command = '-command java -p "' . project . '"'
|
||||
if classname != ''
|
||||
let command .= ' -c ' . classname
|
||||
endif
|
||||
|
||||
if len(args)
|
||||
let command .= ' -a'
|
||||
for arg in args
|
||||
let arg = substitute(arg, '^-', '\\-', '')
|
||||
let command .= ' "' . escape(arg, '"') . '"'
|
||||
endfor
|
||||
endif
|
||||
|
||||
let result = eclim#Execute(command, {'project': project, 'exec': 1, 'raw': 1})
|
||||
let results = split(result, "\n")
|
||||
call eclim#util#TempWindow('[Java Output]', results)
|
||||
let b:project = project
|
||||
|
||||
if exists(":Java") != 2
|
||||
command -buffer -nargs=* Java :call eclim#java#util#Java('', <q-args>)
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#util#Classpath(...) " {{{
|
||||
if !eclim#project#util#IsCurrentFileInProject()
|
||||
return
|
||||
endif
|
||||
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let command = s:command_classpath
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
for arg in a:000
|
||||
if arg == '\n'
|
||||
let arg = "\n"
|
||||
endif
|
||||
let command .= " \"" . arg . "\""
|
||||
endfor
|
||||
let result = eclim#Execute(command)
|
||||
if result == '0'
|
||||
return
|
||||
endif
|
||||
call eclim#util#Echo(result)
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#util#ListInstalls() " {{{
|
||||
let installs = eclim#Execute(s:command_list_installs)
|
||||
if type(installs) != g:LIST_TYPE
|
||||
return
|
||||
endif
|
||||
if len(installs) == 0
|
||||
call eclim#util#Echo("No jdk/jre installs found.")
|
||||
endif
|
||||
|
||||
let pad = 0
|
||||
for install in installs
|
||||
let name = install.name . ' ' . install.version
|
||||
if install.default
|
||||
let name .= ' (default)'
|
||||
endif
|
||||
let pad = len(name) > pad ? len(name) : pad
|
||||
endfor
|
||||
|
||||
let output = []
|
||||
let type = ''
|
||||
for install in installs
|
||||
if install.type != type
|
||||
let type = install.type
|
||||
call add(output, 'Type: ' . install.type)
|
||||
endif
|
||||
let name = install.name . ' ' . install.version
|
||||
if install.default
|
||||
let name .= ' (default)'
|
||||
endif
|
||||
call add(output, ' ' . eclim#util#Pad(name, pad) . ' - ' . install.dir)
|
||||
endfor
|
||||
call eclim#util#Echo(join(output, "\n"))
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#util#ReadClassPrototype() " {{{
|
||||
let file = substitute(expand('%:p'), '\', '/', 'g')
|
||||
let command = s:command_read_class
|
||||
let command = substitute(command, '<class>', expand('%:t:r'), '')
|
||||
let command .= ' -f "' . file . '"'
|
||||
|
||||
let file = eclim#Execute(command)
|
||||
if string(file) != '0'
|
||||
let bufnum = bufnr('%')
|
||||
if has('win32unix')
|
||||
let file = eclim#cygwin#CygwinPath(file)
|
||||
endif
|
||||
silent exec "keepjumps edit! " . escape(file, ' ')
|
||||
|
||||
exec 'bdelete ' . bufnum
|
||||
|
||||
silent exec "doautocmd BufReadPre " . file
|
||||
silent exec "doautocmd BufReadPost " . file
|
||||
|
||||
call eclim#util#DelayedCommand('set ft=java')
|
||||
setlocal readonly
|
||||
setlocal nomodifiable
|
||||
setlocal noswapfile
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#util#CommandCompleteProject(argLead, cmdLine, cursorPos) " {{{
|
||||
return eclim#project#util#CommandCompleteProjectByNature(
|
||||
\ a:argLead, a:cmdLine, a:cursorPos, 'java')
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#java#util#CommandCompletePackage(argLead, cmdLine, cursorPos) " {{{
|
||||
let cmdTail = strpart(a:cmdLine, a:cursorPos)
|
||||
let argLead = substitute(a:argLead, cmdTail . '$', '', '')
|
||||
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
if project == ''
|
||||
return []
|
||||
endif
|
||||
|
||||
let command = s:command_complete_package
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
if argLead != ''
|
||||
let command .= ' -n ' . argLead
|
||||
endif
|
||||
let results = eclim#Execute(command)
|
||||
return type(results) == g:LIST_TYPE ? results : []
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
619
.vim/bundle/eclim/eclim/autoload/eclim/lang.vim
Normal file
619
.vim/bundle/eclim/eclim/autoload/eclim/lang.vim
Normal file
File diff suppressed because it is too large
Load diff
139
.vim/bundle/eclim/eclim/autoload/eclim/lang/hierarchy.vim
Normal file
139
.vim/bundle/eclim/eclim/autoload/eclim/lang/hierarchy.vim
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" License: {{{
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Script Variables {{{
|
||||
let s:call_hierarchy =
|
||||
\ '-command <lang>_callhierarchy -p "<project>" -f "<file>" ' .
|
||||
\ '-o <offset> -l <length> -e <encoding>'
|
||||
" }}}
|
||||
|
||||
function! eclim#lang#hierarchy#CallHierarchy(lang, default_action, bang) " {{{
|
||||
if !eclim#project#util#IsCurrentFileInProject(1)
|
||||
return
|
||||
endif
|
||||
|
||||
call eclim#lang#SilentUpdate()
|
||||
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let file = eclim#project#util#GetProjectRelativeFilePath()
|
||||
let position = eclim#util#GetCurrentElementPosition()
|
||||
let offset = substitute(position, '\(.*\);\(.*\)', '\1', '')
|
||||
let length = substitute(position, '\(.*\);\(.*\)', '\2', '')
|
||||
let command = s:call_hierarchy
|
||||
let command = substitute(command, '<lang>', a:lang, '')
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
let command = substitute(command, '<offset>', offset, '')
|
||||
let command = substitute(command, '<length>', length, '')
|
||||
let command = substitute(command, '<encoding>', eclim#util#GetEncoding(), '')
|
||||
" return callees
|
||||
if a:bang != ''
|
||||
let command .= ' -c'
|
||||
endif
|
||||
|
||||
let result = eclim#Execute(command)
|
||||
if type(result) != g:DICT_TYPE
|
||||
return
|
||||
endif
|
||||
|
||||
if len(result) == 0
|
||||
call eclim#util#Echo('No results found.')
|
||||
return
|
||||
endif
|
||||
|
||||
let lines = []
|
||||
let info = []
|
||||
let key = a:bang != '' ? 'callees' : 'callers'
|
||||
call s:CallHierarchyFormat(result, key, lines, info, '')
|
||||
|
||||
call eclim#util#TempWindow('[Call Hierarchy]', lines)
|
||||
exec 'set ft=' . a:lang
|
||||
" fold function calls into their parent
|
||||
setlocal foldmethod=expr
|
||||
setlocal foldexpr='>'.len(substitute(getline(v:lnum),'^\\(\\s*\\).*','\\1',''))/2
|
||||
setlocal foldtext=substitute(getline(v:foldstart),'^\\(\\s*\\)\\s\\s','\\1+\ ','').':\ '.(v:foldend-v:foldstart+1).'\ lines'
|
||||
|
||||
setlocal modifiable noreadonly
|
||||
call append(line('$'), ['', '" use ? to view help'])
|
||||
setlocal nomodifiable readonly
|
||||
syntax match Comment /^".*/
|
||||
|
||||
let b:hierarchy_info = info
|
||||
|
||||
exec 'nnoremap <buffer> <silent> <cr> ' .
|
||||
\ ':call <SID>Open("' . a:default_action . '")<cr>'
|
||||
nnoremap <buffer> <silent> E :call <SID>Open('edit')<cr>
|
||||
nnoremap <buffer> <silent> S :call <SID>Open('split')<cr>
|
||||
nnoremap <buffer> <silent> T :call <SID>Open("tablast \| tabnew")<cr>
|
||||
|
||||
" assign to buffer var to get around weird vim issue passing list containing
|
||||
" a string w/ a '<' in it on execution of mapping.
|
||||
let b:hierarchy_help = [
|
||||
\ '<cr> - open file with default action',
|
||||
\ 'E - open with :edit',
|
||||
\ 'S - open in a new split window',
|
||||
\ 'T - open in a new tab',
|
||||
\ ]
|
||||
nnoremap <buffer> <silent> ?
|
||||
\ :call eclim#help#BufferHelp(b:hierarchy_help, 'vertical', 40)<cr>
|
||||
endfunction " }}}
|
||||
|
||||
function! s:CallHierarchyFormat(result, key, lines, info, indent) " {{{
|
||||
if has_key(a:result, 'position')
|
||||
call add(a:info, {
|
||||
\ 'file': a:result.position.filename,
|
||||
\ 'line': a:result.position.line,
|
||||
\ 'col': a:result.position.column
|
||||
\ })
|
||||
call add(a:lines, a:indent . a:result.name)
|
||||
else
|
||||
call add(a:info, {'file': '', 'line': -1, 'col': -1})
|
||||
call add(a:lines, a:indent . a:result.name)
|
||||
endif
|
||||
|
||||
for call in get(a:result, a:key, [])
|
||||
call s:CallHierarchyFormat(call, a:key, a:lines, a:info, a:indent . "\t")
|
||||
endfor
|
||||
endfunction " }}}
|
||||
|
||||
function! s:Open(action) " {{{
|
||||
let line = line('.')
|
||||
if line > len(b:hierarchy_info)
|
||||
return
|
||||
endif
|
||||
|
||||
let info = b:hierarchy_info[line - 1]
|
||||
if info.file != ''
|
||||
" go to the buffer that initiated the hierarchy
|
||||
exec b:winnr . 'winc w'
|
||||
|
||||
let action = a:action
|
||||
call eclim#util#GoToBufferWindowOrOpen(info.file, action)
|
||||
call cursor(info.line, info.col)
|
||||
|
||||
" force any previous messge from else below to be cleared
|
||||
echo ''
|
||||
else
|
||||
call eclim#util#Echo('No associated file was found.')
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
133
.vim/bundle/eclim/eclim/autoload/eclim/project/problems.vim
Normal file
133
.vim/bundle/eclim/eclim/autoload/eclim/project/problems.vim
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Global variables {{{
|
||||
if !exists('g:EclimProblemsQuickFixOpen')
|
||||
let g:EclimProblemsQuickFixOpen = 'botright copen'
|
||||
endif
|
||||
" }}}
|
||||
|
||||
" Script variables {{{
|
||||
let s:problems_command = '-command problems -p "<project>"'
|
||||
" }}}
|
||||
|
||||
function! eclim#project#problems#Problems(project, open, bang) " {{{
|
||||
let project = a:project
|
||||
if project == ''
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
endif
|
||||
if project == ''
|
||||
call eclim#project#util#UnableToDetermineProject()
|
||||
return
|
||||
endif
|
||||
|
||||
let command = s:problems_command
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
if a:bang != ""
|
||||
let command .= ' -e'
|
||||
endif
|
||||
let result = eclim#Execute(command)
|
||||
let errors = []
|
||||
if type(result) == g:LIST_TYPE && len(result) > 0
|
||||
let errors = eclim#util#ParseLocationEntries(
|
||||
\ result, g:EclimValidateSortResults)
|
||||
endif
|
||||
|
||||
let action = eclim#project#problems#IsProblemsList() ? 'r' : ' '
|
||||
call eclim#util#SetQuickfixList(errors, action)
|
||||
|
||||
" generate a 'signature' to distinguish the problems list from other qf
|
||||
" lists.
|
||||
let s:eclim_problems_sig = s:QuickfixSignature()
|
||||
let s:eclim_problems_bang = a:bang
|
||||
|
||||
if a:open
|
||||
exec g:EclimProblemsQuickFixOpen
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#project#problems#ProblemsUpdate(action) " {{{
|
||||
if a:action == 'save' && !g:EclimProjectProblemsUpdateOnSave
|
||||
return
|
||||
endif
|
||||
|
||||
if a:action == 'build' && !g:EclimProjectProblemsUpdateOnBuild
|
||||
return
|
||||
endif
|
||||
|
||||
if !eclim#project#problems#IsProblemsList()
|
||||
return
|
||||
endif
|
||||
|
||||
" preserve the cursor position in the quickfix window
|
||||
let qf_winnr = 0
|
||||
let index = 1
|
||||
while index <= winnr('$')
|
||||
if getbufvar(winbufnr(index), '&ft') == 'qf'
|
||||
let cur = winnr()
|
||||
let qf_winnr = index
|
||||
exec qf_winnr . 'winc w'
|
||||
let pos = getpos('.')
|
||||
exec cur . 'winc w'
|
||||
break
|
||||
endif
|
||||
let index += 1
|
||||
endwhile
|
||||
|
||||
let bang = exists('s:eclim_problems_bang') ? s:eclim_problems_bang : ''
|
||||
call eclim#project#problems#Problems('', 0, bang)
|
||||
|
||||
" restore the cursor position
|
||||
if qf_winnr
|
||||
let cur = winnr()
|
||||
exec qf_winnr . 'winc w'
|
||||
call setpos('.', pos)
|
||||
redraw
|
||||
exec cur . 'winc w'
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#project#problems#IsProblemsList() " {{{
|
||||
" if available, compare the problems signature against the signature of
|
||||
" the current list to see if we are now on the problems list, probably via
|
||||
" :colder or :cnewer.
|
||||
if exists('s:eclim_problems_sig')
|
||||
return s:QuickfixSignature() == s:eclim_problems_sig
|
||||
endif
|
||||
if exists('s:eclim_problems_bang')
|
||||
unlet s:eclim_problems_bang
|
||||
endif
|
||||
return 0
|
||||
endfunction " }}}
|
||||
|
||||
function! s:QuickfixSignature() " {{{
|
||||
let qflist = getqflist()
|
||||
let len = len(qflist)
|
||||
return {
|
||||
\ 'len': len,
|
||||
\ 'first': len > 0 ? (qflist[0]['bufnr'] . ':' . qflist[0]['text']) : '',
|
||||
\ 'last': len > 0 ? (qflist[-1]['bufnr'] . ':' . qflist[-1]['text']) : ''
|
||||
\ }
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
518
.vim/bundle/eclim/eclim/autoload/eclim/project/tree.vim
Normal file
518
.vim/bundle/eclim/eclim/autoload/eclim/project/tree.vim
Normal file
File diff suppressed because it is too large
Load diff
1444
.vim/bundle/eclim/eclim/autoload/eclim/project/util.vim
Normal file
1444
.vim/bundle/eclim/eclim/autoload/eclim/project/util.vim
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,33 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2011 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Parse(file, settings) {{{
|
||||
function! eclim#taglisttoo#lang#commonsvalidator#Parse(file, settings)
|
||||
return taglisttoo#util#Parse(a:file, a:settings, [
|
||||
\ ['c', '<constant-name\s*>\s*(.*?)\s*</constant-name\s*>', 1],
|
||||
\ ['f', "<form\\s+[^>]*?name=['\"](.*?)['\"]", 1],
|
||||
\ ['v', "<validator\\s+[^>]*?name=['\"](.*?)['\"]", 1],
|
||||
\ ])
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2011 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Parse(file, settings) {{{
|
||||
function! eclim#taglisttoo#lang#eclimhelp#Parse(file, settings)
|
||||
return taglisttoo#util#Parse(a:file, a:settings, [
|
||||
\ ['a', '\*([^ *]+)\*', 1],
|
||||
\ ['s', '\n([^\n]+)\n[=^-]{4,}', 1],
|
||||
\ ])
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2011 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" ParseDocument(file, settings) {{{
|
||||
function! eclim#taglisttoo#lang#forrest#ParseDocument(file, settings)
|
||||
return taglisttoo#util#Parse(a:file, a:settings, [
|
||||
\ ['s', "<section\\s+[^>]*?id=['\"](.*?)['\"]", 1],
|
||||
\ ])
|
||||
endfunction " }}}
|
||||
|
||||
" ParseStatus(file, settings) {{{
|
||||
function! eclim#taglisttoo#lang#forrest#ParseStatus(file, settings)
|
||||
return taglisttoo#util#Parse(a:file, a:settings, [
|
||||
\ ['t', "<actions\\s+[^>]*?priority=['\"](.*?)['\"]", 1],
|
||||
\ ['r', "<release\\s+[^>]*?version=['\"](.*?)['\"]", 1],
|
||||
\ ])
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2010 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Parse(file, settings) {{{
|
||||
function! eclim#taglisttoo#lang#gant#Parse(file, settings)
|
||||
return taglisttoo#util#Parse(a:file, a:settings, [
|
||||
\ ['t', "\\s*target\\s*\\(\\s*(?:name\\s*:)?\\s*['\"]?([^'\",: ]+)", 1],
|
||||
\ ['f', "\\s*def\\s+(\\w+)\\s*\\(", 1],
|
||||
\ ['f', "\\s*(?:final|def)?\\s*(\\w+)\\s*=\\s*\\{", 1],
|
||||
\ ])
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2011 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Parse(file, settings) {{{
|
||||
function! eclim#taglisttoo#lang#hibernate#Parse(file, settings)
|
||||
return taglisttoo#util#Parse(a:file, a:settings, [
|
||||
\ ['c', "<class\\s+[^>]*?name=['\"](.*?)['\"]", 1],
|
||||
\ ['j', "<joined-subclass\\s+[^>]*?name=['\"](.*?)['\"]", 1],
|
||||
\ ['t', "<typedef\\s+[^>]*?name=['\"](.*?)['\"]", 1],
|
||||
\ ['f', "<filter-def\\s+[^>]*?name=['\"](.*?)['\"]", 1],
|
||||
\ ['i', "<import\\s+[^>]*?class=['\"](.*?)['\"]", 1],
|
||||
\ ['q', "<query\\s+[^>]*?name=['\"](.*?)['\"]", 1],
|
||||
\ ['s', "<sql-query\\s+[^>]*?name=['\"](.*?)['\"]", 1],
|
||||
\ ])
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2011 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Parse(file, settings) {{{
|
||||
function! eclim#taglisttoo#lang#junit#Parse(file, settings)
|
||||
return taglisttoo#util#Parse(a:file, a:settings, [
|
||||
\ ['t', "<testcase\\s+[^>]*?\\bname=['\"](.*?)['\"]", 1],
|
||||
\ ['f', "<testcase\\s+[^>]*?\\bname=['\"]([^'\"]+?)['\"]\\s+[^>]*?>\\s*<failure\\b", 1],
|
||||
\ ['o', '<system-(out|err)\s*>', 1],
|
||||
\ ])
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2011 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Parse(file, settings) {{{
|
||||
function! eclim#taglisttoo#lang#spring#Parse(file, settings)
|
||||
return taglisttoo#util#Parse(a:file, a:settings, [
|
||||
\ ['b', "<bean\\s+[^>]*?(?:name|id)=['\"](.*?)['\"]", 1],
|
||||
\ ['i', "<import\\s+[^>]*?resource=['\"](.*?)['\"]", 1],
|
||||
\ ['a', "<alias\\s+[^>]*?alias=['\"](.*?)['\"]", 1],
|
||||
\ ])
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2010 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" ParseWebXml(file, settings) {{{
|
||||
function! eclim#taglisttoo#lang#webxml#ParseWebXml(file, settings)
|
||||
return taglisttoo#util#Parse(a:file, a:settings, [
|
||||
\ ['p', '<context-param\s*>\s*<param-name\s*>\s*(.*?)\s*</param-name\s*>', 1],
|
||||
\ ['f', '<filter\s*>\s*<filter-name\s*>\s*(.*?)\s*</filter-name\s*>', 1],
|
||||
\ ['i', '<filter-mapping\s*>\s*<filter-name\s*>\s*(.*?)\s*</filter-name\s*>', 1],
|
||||
\ ['l', '<listener\s*>\s*<listener-class\s*>\s*(.*?)\s*</listener-class\s*>', 1],
|
||||
\ ['s', '<servlet\s*>\s*<servlet-name\s*>\s*(.*?)\s*</servlet-name\s*>', 1],
|
||||
\ ['v', '<servlet-mapping\s*>\s*<servlet-name\s*>\s*(.*?)\s*</servlet-name\s*>', 1],
|
||||
\ ])
|
||||
endfunction " }}}
|
||||
|
||||
" ParseTld(file, settings) {{{
|
||||
function! eclim#taglisttoo#lang#webxml#ParseTld(file, settings)
|
||||
return taglisttoo#util#Parse(a:file, a:settings, [
|
||||
\ ['t', '<tag\s*>\s*<name\s*>\s*(.*?)\s*</name\s*>', 1],
|
||||
\ ])
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
1236
.vim/bundle/eclim/eclim/autoload/eclim/tree.vim
Normal file
1236
.vim/bundle/eclim/eclim/autoload/eclim/tree.vim
Normal file
File diff suppressed because it is too large
Load diff
1568
.vim/bundle/eclim/eclim/autoload/eclim/util.vim
Normal file
1568
.vim/bundle/eclim/eclim/autoload/eclim/util.vim
Normal file
File diff suppressed because it is too large
Load diff
82
.vim/bundle/eclim/eclim/autoload/eclim/vimplugin.vim
Normal file
82
.vim/bundle/eclim/eclim/autoload/eclim/vimplugin.vim
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" Contains any global vim side code for embedding gvim in eclipse.
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2011 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" BufferWritten() {{{
|
||||
" Invoked when a buffer opened from eclipse is saved, to notify eclipse of the
|
||||
" save.
|
||||
function eclim#vimplugin#BufferWritten()
|
||||
if has('netbeans_enabled') && exists('g:vimplugin_running')
|
||||
if exists('b:eclim_file_modified')
|
||||
unlet b:eclim_file_modified
|
||||
endif
|
||||
nbkey unmodified
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" BufferModified() {{{
|
||||
" Invoked on cursor hold to check if a previously modified buffer is now
|
||||
" unmodified, and vice versa, so that eclipse can be notified.
|
||||
function eclim#vimplugin#BufferModified()
|
||||
if has('netbeans_enabled') && exists('g:vimplugin_running')
|
||||
if !exists('b:eclim_file_modified')
|
||||
let b:eclim_file_modified = &modified
|
||||
endif
|
||||
|
||||
if &modified != b:eclim_file_modified
|
||||
unlet b:eclim_file_modified
|
||||
exec 'nbkey ' . (&modified ? 'modified' : 'unmodified')
|
||||
endif
|
||||
let b:eclim_file_modified = &modified
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" BufferClosed() {{{
|
||||
" Invoked when a buffer is removed from a window to signal that eclipse should
|
||||
" close the associated editor tab. This is only needed for external vim +
|
||||
" tabbed mode.
|
||||
function eclim#vimplugin#BufferClosed()
|
||||
if has('netbeans_enabled') && exists('g:vimplugin_tabbed')
|
||||
exec 'nbkey fileClosed ' . expand('<afile>:p')
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" BufferEnter() {{{
|
||||
" Invoked when switching buffers so we can update the eclipse tab title.
|
||||
function eclim#vimplugin#BufferEnter()
|
||||
if has('netbeans_enabled') && exists('g:vimplugin_running')
|
||||
exec 'nbkey bufferEnter ' . expand('<afile>:p')
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" FeedKeys(keys, [refocusGvim]) {{{
|
||||
" Feeds eclipse compatible key string to eclipse if current gvim instance is
|
||||
" attached via the netbeans protocol.
|
||||
function eclim#vimplugin#FeedKeys(keys, ...)
|
||||
if has('netbeans_enabled') && exists('g:vimplugin_running')
|
||||
let refocus = a:0 > 0 && a:1 ? ',refocus' : ''
|
||||
silent exec 'nbkey feedkeys ' . a:keys . refocus
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
232
.vim/bundle/eclim/eclim/autoload/eclim/web.vim
Normal file
232
.vim/bundle/eclim/eclim/autoload/eclim/web.vim
Normal file
|
|
@ -0,0 +1,232 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" see http://eclim.org/vim/common/web.html
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Global Variables {{{
|
||||
if !exists("g:EclimOpenUrlInVimPatterns")
|
||||
let g:EclimOpenUrlInVimPatterns = []
|
||||
endif
|
||||
if !exists("g:EclimOpenUrlInVimAction")
|
||||
let g:EclimOpenUrlInVimAction = g:EclimDefaultFileOpenAction
|
||||
endif
|
||||
" }}}
|
||||
|
||||
" Script Variables {{{
|
||||
let s:win_browsers = [
|
||||
\ 'C:/Program Files/Opera/Opera.exe',
|
||||
\ 'C:/Program Files/Mozilla Firefox/firefox.exe',
|
||||
\ 'C:/Program Files/Internet Explorer/iexplore.exe'
|
||||
\ ]
|
||||
|
||||
let s:browsers = [
|
||||
\ 'xdg-open', 'chromium', 'opera', 'firefox', 'konqueror',
|
||||
\ 'epiphany', 'mozilla', 'netscape', 'iexplore'
|
||||
\ ]
|
||||
" }}}
|
||||
|
||||
function! eclim#web#OpenUrl(url, ...) " {{{
|
||||
" Opens the supplied url in a web browser or opens the url under the cursor.
|
||||
|
||||
if !exists('s:browser') || s:browser == ''
|
||||
let s:browser = s:DetermineBrowser()
|
||||
|
||||
" slight hack for IE which doesn't like the url to be quoted.
|
||||
if s:browser =~ 'iexplore' && !has('win32unix')
|
||||
let s:browser = substitute(s:browser, '"', '', 'g')
|
||||
endif
|
||||
endif
|
||||
|
||||
if s:browser == ''
|
||||
return
|
||||
endif
|
||||
|
||||
let url = a:url
|
||||
if url == ''
|
||||
if len(a:000) > 2
|
||||
let start = a:000[1]
|
||||
let end = a:000[2]
|
||||
while start <= end
|
||||
call eclim#web#OpenUrl(eclim#util#GrabUri(start, col('.')), a:000[0])
|
||||
let start += 1
|
||||
endwhile
|
||||
return
|
||||
else
|
||||
let url = eclim#util#GrabUri()
|
||||
endif
|
||||
endif
|
||||
|
||||
if url == ''
|
||||
call eclim#util#EchoError(
|
||||
\ 'No url supplied at command line or found under the cursor.')
|
||||
return
|
||||
endif
|
||||
|
||||
" prepend http:// or file:// if no protocol defined.
|
||||
if url !~ '^\(https\?\|file\):'
|
||||
" absolute file on windows or unix
|
||||
if url =~ '^\([a-zA-Z]:[/\\]\|/\)'
|
||||
let url = 'file://' . url
|
||||
|
||||
" everything else
|
||||
else
|
||||
let url = 'http://' . url
|
||||
endif
|
||||
endif
|
||||
|
||||
if len(a:000) == 0 || a:000[0] == ''
|
||||
for pattern in g:EclimOpenUrlInVimPatterns
|
||||
if url =~ pattern
|
||||
exec g:EclimOpenUrlInVimAction . ' ' . url
|
||||
return
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
let url = substitute(url, '\', '/', 'g')
|
||||
let url = escape(url, '&%!')
|
||||
let url = escape(url, '%!')
|
||||
let command = escape(substitute(s:browser, '<url>', url, ''), '#')
|
||||
silent call eclim#util#Exec(command)
|
||||
redraw!
|
||||
|
||||
if v:shell_error
|
||||
call eclim#util#EchoError("Unable to open browser:\n" . s:browser .
|
||||
\ "\nCheck that the browser executable is in your PATH " .
|
||||
\ "or that you have properly configured g:EclimBrowser")
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#web#SearchEngine(url, args, line1, line2) " {{{
|
||||
" Function to use a search engine to search for a word or phrase.
|
||||
|
||||
let search_string = a:args
|
||||
if search_string == ''
|
||||
let search_string = eclim#util#GetVisualSelection(a:line1, a:line2, 0)
|
||||
if search_string == ''
|
||||
let search_string = expand('<cword>')
|
||||
endif
|
||||
endif
|
||||
|
||||
let search_string = eclim#html#util#UrlEncode(search_string)
|
||||
let url = substitute(a:url, '<query>', search_string, '')
|
||||
|
||||
call eclim#web#OpenUrl(url)
|
||||
endfunction " }}}
|
||||
|
||||
function! eclim#web#WordLookup(url, word) " {{{
|
||||
" Function to lookup a word on an online dictionary, thesaurus, etc.
|
||||
|
||||
let word = a:word
|
||||
if word == ''
|
||||
let word = expand('<cword>')
|
||||
endif
|
||||
|
||||
let url = substitute(a:url, '<query>', word, '')
|
||||
|
||||
call eclim#web#OpenUrl(url)
|
||||
endfunction " }}}
|
||||
|
||||
function! s:DetermineBrowser() " {{{
|
||||
let browser = ''
|
||||
|
||||
" user specified a browser, we just need to fill in any gaps if necessary.
|
||||
if exists("g:EclimBrowser")
|
||||
let browser = g:EclimBrowser
|
||||
" add "<url>" if necessary
|
||||
if browser !~ '<url>'
|
||||
let browser = substitute(browser,
|
||||
\ '^\([[:alnum:][:blank:]-/\\_.:"]\+\)\(.*\)$',
|
||||
\ '\1 "<url>" \2', '')
|
||||
endif
|
||||
|
||||
if has("win32") || has("win64")
|
||||
" add 'start' to run process in background if necessary.
|
||||
if browser !~ '^[!]\?start'
|
||||
let browser = 'start ' . browser
|
||||
endif
|
||||
else
|
||||
" add '&' to run process in background if necessary.
|
||||
if browser !~ '&\s*$' &&
|
||||
\ browser !~ '^\(/[/a-zA-Z0-9]\+/\)\?\<\(links\|lynx\|elinks\|w3m\)\>'
|
||||
let browser = browser . ' &'
|
||||
endif
|
||||
|
||||
" add redirect of std out and error if necessary.
|
||||
if browser !~ '/dev/null'
|
||||
let browser = substitute(browser, '\s*&\s*$', '&> /dev/null &', '')
|
||||
endif
|
||||
endif
|
||||
|
||||
if browser !~ '^\s*!'
|
||||
let browser = '!' . browser
|
||||
endif
|
||||
|
||||
" user did not specify a browser, so attempt to find a suitable one.
|
||||
else
|
||||
if has('win32') || has('win64') || has('win32unix')
|
||||
" Note: this version may not like .html suffixes on windows 2000
|
||||
if executable('rundll32')
|
||||
let browser = 'rundll32 url.dll,FileProtocolHandler <url>'
|
||||
endif
|
||||
" this doesn't handle local files very well or '&' in the url.
|
||||
"let browser = '!cmd /c start <url>'
|
||||
if browser == ''
|
||||
for name in s:win_browsers
|
||||
if has('win32unix')
|
||||
let name = eclim#cygwin#CygwinPath(name)
|
||||
endif
|
||||
if executable(name)
|
||||
let browser = name
|
||||
if has('win32unix')
|
||||
let browser = '"' . browser . '"'
|
||||
endif
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
elseif has('mac')
|
||||
let browser = '!open <url>'
|
||||
else
|
||||
for name in s:browsers
|
||||
if executable(name)
|
||||
let browser = name
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
if browser != ''
|
||||
let g:EclimBrowser = browser
|
||||
let browser = s:DetermineBrowser()
|
||||
endif
|
||||
endif
|
||||
|
||||
if browser == ''
|
||||
call eclim#util#EchoError("Unable to determine browser. " .
|
||||
\ "Please set g:EclimBrowser to your preferred browser.")
|
||||
endif
|
||||
|
||||
return browser
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
79
.vim/bundle/eclim/eclim/autoload/eclim/xml/definition.vim
Normal file
79
.vim/bundle/eclim/eclim/autoload/eclim/xml/definition.vim
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" see http://eclim.org/vim/xml/definition.html
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2009 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Script Variables {{{
|
||||
let s:element_def{'dtd'} = '<!ELEMENT\s\+<name>\>\(\s\|(\|$\)'
|
||||
let s:element_def{'xsd'} =
|
||||
\ '<\s*\(.\{-}:\)\?element\>\_[^>]*name\s*=\s*' .
|
||||
\ g:EclimQuote . '<name>' . g:EclimQuote
|
||||
" }}}
|
||||
|
||||
" DtdDefinition(element) {{{
|
||||
" Opens the current xml file's dtd definition and optionally jumps to an
|
||||
" element if an element name supplied.
|
||||
function! eclim#xml#definition#DtdDefinition(element)
|
||||
let dtd = eclim#xml#util#GetDtd()
|
||||
let element = a:element == '' ? eclim#xml#util#GetElementName() : a:element
|
||||
call s:OpenDefinition(dtd, element, 'dtd')
|
||||
endfunction " }}}
|
||||
|
||||
" XsdDefinition(element) {{{
|
||||
" Opens the current xml file's xsd definition and optionally jumps to an
|
||||
" element if an element name supplied.
|
||||
function! eclim#xml#definition#XsdDefinition(element)
|
||||
let element = a:element == '' ? eclim#xml#util#GetElementName() : a:element
|
||||
if element =~ ':'
|
||||
let namespace = substitute(element, ':.*', '', '')
|
||||
let element = substitute(element, '.*:', '', '')
|
||||
let xsd = eclim#xml#util#GetXsd(namespace)
|
||||
else
|
||||
let xsd = eclim#xml#util#GetXsd()
|
||||
endif
|
||||
call s:OpenDefinition(xsd, element, 'xsd')
|
||||
endfunction " }}}
|
||||
|
||||
" OpenDefinition(file, element, type) {{{
|
||||
" Open the supplied definition file and jump to the element if supplied.
|
||||
function! s:OpenDefinition(file, element, type)
|
||||
if a:file == ''
|
||||
call eclim#util#EchoWarning('Unable to locate ' . a:type . ' in current file.')
|
||||
return
|
||||
endif
|
||||
|
||||
" see if file is already open.
|
||||
let winnr = bufwinnr(a:file)
|
||||
if winnr != -1
|
||||
exec winnr . 'winc w'
|
||||
else
|
||||
exec 'split ' . a:file
|
||||
endif
|
||||
|
||||
" jump to element definition if supplied
|
||||
if a:element != ''
|
||||
let search = substitute(s:element_def{a:type}, '<name>', a:element, 'g')
|
||||
call search(search, 'w')
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
109
.vim/bundle/eclim/eclim/autoload/eclim/xml/format.vim
Normal file
109
.vim/bundle/eclim/eclim/autoload/eclim/xml/format.vim
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" see http://eclim.org/vim/xml/format.html
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Script Variables {{{
|
||||
let s:command_format =
|
||||
\ '-command xml_format -f "<file>" -w <width> -i <indent> -m <ff>'
|
||||
" }}}
|
||||
|
||||
function! eclim#xml#format#Format() " {{{
|
||||
call eclim#util#ExecWithoutAutocmds('update')
|
||||
let file = substitute(expand('%:p'), '\', '/', 'g')
|
||||
if has('win32unix')
|
||||
let file = eclim#cygwin#WindowsPath(file)
|
||||
endif
|
||||
|
||||
let command = s:command_format
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
let command = substitute(command, '<width>', &textwidth, '')
|
||||
let command = substitute(command, '<indent>', &shiftwidth, '')
|
||||
let command = substitute(command, '<ff>', &ff, '')
|
||||
|
||||
let result = eclim#Execute(command)
|
||||
if result != '0'
|
||||
silent! 1,$delete _
|
||||
silent put =result
|
||||
silent! 1,1delete _
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! s:SelectOuterTag(count) " {{{
|
||||
let pos = getpos('.')
|
||||
|
||||
exec 'silent! normal! v' . a:count . 'atv'
|
||||
call setpos('.', pos)
|
||||
|
||||
return s:VisualSelectionMap()
|
||||
endfunction " }}}
|
||||
|
||||
function! s:SelectInnerTag() " {{{
|
||||
silent! normal! vit
|
||||
normal! v
|
||||
call cursor(line("'<"), col("'<"))
|
||||
|
||||
return s:VisualSelectionMap()
|
||||
endfunction " }}}
|
||||
|
||||
function! s:VisualSelectionMap() " {{{
|
||||
let lstart = line("'<")
|
||||
let cstart = col("'<")
|
||||
let lend = line("'>")
|
||||
let cend = col("'>")
|
||||
|
||||
if cstart > len(getline(lstart))
|
||||
let lstart += 1
|
||||
let cstart = 1
|
||||
endif
|
||||
|
||||
if strpart(getline(lend), 0, cend) =~ '^\s*$'
|
||||
let lend -= 1
|
||||
let cend = len(getline(lend))
|
||||
endif
|
||||
|
||||
return {'lstart': lstart, 'cstart': cstart, 'lend': lend, 'cend': cend}
|
||||
endfunction " }}}
|
||||
|
||||
function! s:InsertCr(line, col) " {{{
|
||||
call cursor(a:line, a:col)
|
||||
exec "normal! i\<cr>\<esc>"
|
||||
endfunction " }}}
|
||||
|
||||
function! s:GetRootLine() " {{{
|
||||
let pos = getpos('.')
|
||||
|
||||
let line = 1
|
||||
call cursor(1, 1)
|
||||
while getline('.') !~ '<\w'
|
||||
let line = line('.') + 1
|
||||
if line > line('$')
|
||||
break
|
||||
endif
|
||||
call cursor(line, 1)
|
||||
endwhile
|
||||
|
||||
call setpos('.', pos)
|
||||
return line
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
137
.vim/bundle/eclim/eclim/autoload/eclim/xml/util.vim
Normal file
137
.vim/bundle/eclim/eclim/autoload/eclim/xml/util.vim
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" Utility functions for xml plugins.
|
||||
"
|
||||
" This plugin contains shared functions that can be used regardless of the
|
||||
" current file type being edited.
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2009 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Script Variables {{{
|
||||
let s:dtd = '.*' . g:EclimQuote . '\(.*\)' . g:EclimQuote . '\s*>.*'
|
||||
let s:xsd = '.\{-}<ns>:schemaLocation\s*=\s*' .
|
||||
\ g:EclimQuote . '\(.\{-}\)' . g:EclimQuote . '.*'
|
||||
let s:element = '.\{-}<\([a-zA-Z].\{-}\)\(\s\|>\|$\).*'
|
||||
" }}}
|
||||
|
||||
" GetDtd() {{{
|
||||
" Get the dtd defined in the current file.
|
||||
function! eclim#xml#util#GetDtd()
|
||||
let linenum = search('<!DOCTYPE\s\+\_.\{-}>', 'bcnw')
|
||||
if linenum > 0
|
||||
let line = ''
|
||||
while getline(linenum) !~ '>'
|
||||
let line = line . getline(linenum)
|
||||
let linenum += 1
|
||||
endwhile
|
||||
let line = line . getline(linenum)
|
||||
|
||||
let dtd = substitute(line, s:dtd, '\1', '')
|
||||
if dtd != line
|
||||
return dtd
|
||||
endif
|
||||
endif
|
||||
return ''
|
||||
endfunction " }}}
|
||||
|
||||
" GetXsd() {{{
|
||||
" Get the schema defined in the current file, for the optionally provided
|
||||
" namespace prefix, or the default namespace.
|
||||
function! eclim#xml#util#GetXsd(...)
|
||||
let namespace = ''
|
||||
if len(a:000) > 0
|
||||
let namespace = a:000[0]
|
||||
endif
|
||||
|
||||
" if no namespace given, try 'xsi' as that is a common default.
|
||||
if namespace == ''
|
||||
let xsd = eclim#xml#util#GetXsd('xsi')
|
||||
if xsd != ''
|
||||
return xsd
|
||||
endif
|
||||
endif
|
||||
|
||||
let linenum = search(namespace . ':schemaLocation\>', 'bcnw')
|
||||
if linenum > 0
|
||||
let line = ''
|
||||
while getline(linenum) !~ '>'
|
||||
let line = line . getline(linenum)
|
||||
let linenum += 1
|
||||
endwhile
|
||||
let line = line . getline(linenum)
|
||||
|
||||
let pattern = substitute(s:xsd, '<ns>', namespace, '')
|
||||
let xsd = substitute(line, pattern, '\1', '')
|
||||
if xsd != line
|
||||
" last http definition is the schema
|
||||
return strpart(xsd, strridx(xsd, 'http://'))
|
||||
endif
|
||||
endif
|
||||
return ''
|
||||
endfunction " }}}
|
||||
|
||||
" GetElementName() {{{
|
||||
" Get name of the element that the cursor is currently on.
|
||||
function! eclim#xml#util#GetElementName()
|
||||
let line = getline('.')
|
||||
let cnum = col('.')
|
||||
if line[cnum - 1] == '<'
|
||||
let cnum += 1
|
||||
endif
|
||||
if line[cnum - 1] == '>'
|
||||
let cnum -= 1
|
||||
endif
|
||||
|
||||
let name = substitute(line,
|
||||
\ '.*</\?\s*\(.*\%' . cnum . 'c.\{-}\)\(\s.*\|\s*/\?>.*\|$\)', '\1', '')
|
||||
|
||||
if name == line || name =~ '<\|>' || name =~ '\S\s\S'
|
||||
return ''
|
||||
endif
|
||||
|
||||
let name = substitute(name, '\s\|/', '', 'g')
|
||||
|
||||
return name
|
||||
endfunction " }}}
|
||||
|
||||
" GetParentElementName() {{{
|
||||
" Get the parent element name relative to the current cursor position.
|
||||
" Depends on 'at' visual selection ability.
|
||||
function! eclim#xml#util#GetParentElementName()
|
||||
let pos = getpos('.')
|
||||
|
||||
" select tags (best solution I can think of).
|
||||
silent! normal! v2at
|
||||
normal! v
|
||||
|
||||
call cursor(line("'<"), col("'<"))
|
||||
let parent = eclim#xml#util#GetElementName()
|
||||
|
||||
call setpos('.', pos)
|
||||
|
||||
if eclim#xml#util#GetElementName() == parent
|
||||
return ''
|
||||
endif
|
||||
|
||||
return parent
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
84
.vim/bundle/eclim/eclim/autoload/eclim/xml/validate.vim
Normal file
84
.vim/bundle/eclim/eclim/autoload/eclim/xml/validate.vim
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" see http://eclim.org/vim/xml/validate.html
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
" Global Variables {{{
|
||||
if !exists("g:EclimXmlValidate")
|
||||
let g:EclimXmlValidate = 1
|
||||
endif
|
||||
" }}}
|
||||
|
||||
" Script Variables {{{
|
||||
let s:command_validate = '-command xml_validate -p "<project>" -f "<file>"'
|
||||
" }}}
|
||||
|
||||
function! eclim#xml#validate#Validate(on_save, ...) " {{{
|
||||
" Optional args:
|
||||
" bang: '!' or '', where '!' indicates that we should not jump to the
|
||||
" first error.
|
||||
if a:on_save && (!g:EclimXmlValidate || eclim#util#WillWrittenBufferClose())
|
||||
return
|
||||
endif
|
||||
|
||||
if eclim#EclimAvailable()
|
||||
if !eclim#project#util#IsCurrentFileInProject()
|
||||
return
|
||||
endif
|
||||
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let file = eclim#project#util#GetProjectRelativeFilePath()
|
||||
let command = s:command_validate
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
if search('xsi:schemaLocation', 'cnw')
|
||||
let command .= ' -s'
|
||||
endif
|
||||
|
||||
let result = eclim#Execute(command)
|
||||
if type(result) == g:LIST_TYPE && len(result) > 0
|
||||
let errors = eclim#util#ParseLocationEntries(
|
||||
\ result, g:EclimValidateSortResults)
|
||||
call eclim#util#SetLocationList(errors)
|
||||
" bang arg supplied, but no bang, so jump to first error.
|
||||
if len(a:000) > 0 && a:000[0] == ''
|
||||
lfirst
|
||||
endif
|
||||
return 1
|
||||
else
|
||||
call eclim#util#ClearLocationList()
|
||||
return 0
|
||||
endif
|
||||
else
|
||||
" alternative method via xmllint
|
||||
if !a:on_save && executable('xmllint')
|
||||
let file = substitute(expand('%:p'), '\', '/', 'g')
|
||||
call eclim#util#MakeWithCompiler('eclim_xmllint', '', file)
|
||||
call eclim#display#signs#Update()
|
||||
elseif !a:on_save
|
||||
call eclim#util#EchoWarning("eclimd not running.")
|
||||
endif
|
||||
endif
|
||||
return 0
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
21
.vim/bundle/eclim/eclim/bin/bash_complete
Normal file
21
.vim/bundle/eclim/eclim/bin/bash_complete
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
##
|
||||
# Script to manually invoke a bash completion function and print the results
|
||||
# one result per line.
|
||||
##
|
||||
|
||||
. /etc/bash_completion
|
||||
|
||||
COMP_FUNC=$1
|
||||
shift
|
||||
COMP_WORDS=("${@}")
|
||||
COMP_CWORD=$((${#COMP_WORDS[@]}-1))
|
||||
|
||||
CMD=${COMP_WORDS[0]}
|
||||
CUR=${COMP_WORDS[$COMP_CWORD]}
|
||||
PRE=${COMP_WORDS[$(($COMP_CWORD-1))]}
|
||||
|
||||
$COMP_FUNC $CMD $CUR $PRE
|
||||
for reply in ${COMPREPLY[@]} ; do
|
||||
echo $reply
|
||||
done
|
||||
87
.vim/bundle/eclim/eclim/compiler/eclim_ant.vim
Normal file
87
.vim/bundle/eclim/eclim/compiler/eclim_ant.vim
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" Compiler for ant (enhancement to default ant compiler provided w/ vim).
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "eclim_ant"
|
||||
|
||||
if !exists('g:EclimAntCompilerAdditionalErrorFormat')
|
||||
let g:EclimAntCompilerAdditionalErrorFormat = ''
|
||||
endif
|
||||
|
||||
if !exists('g:EclimAntErrorFormat')
|
||||
let g:EclimAntErrorFormat = ''
|
||||
endif
|
||||
|
||||
if !exists('g:EclimAntErrorsEnabled')
|
||||
let g:EclimAntErrorsEnabled = 0
|
||||
endif
|
||||
if g:EclimAntErrorsEnabled
|
||||
let g:EclimAntErrorFormat .= '\%A%f:%l:\ %m,'
|
||||
endif
|
||||
|
||||
CompilerSet makeprg=ant\ -find\ build.xml\ $*
|
||||
|
||||
" The two entries before the last one, are for catching ant build file names
|
||||
" and error line numbers.
|
||||
exec 'CompilerSet errorformat=' .
|
||||
\ '\%-G%.%#[javac]\ %.%#:\ warning:\ unmappable\ character\ %.%#,' .
|
||||
\ '\%A%.%#[javac]\ %f:%l:\ %m,' .
|
||||
\ '\%C%.%#[javac]\ symbol\ %#:\ %m,' .
|
||||
\ '\%-Z%.%#[javac]\ %p^,' .
|
||||
\ '\%A%.%#[javadoc]\ %f:%l:\ %m,' .
|
||||
\ '\%-C%.%#[javadoc]\ location:\ %.%#,' .
|
||||
\ '\%-C%.%#[javadoc]\ %#,' .
|
||||
\ '\%-Z%.%#[javadoc]\ %p^,' .
|
||||
\ '\%-G%.%#[javadoc]\ Note:%.%#,' .
|
||||
\ '\%-G%.%#[javadoc]\ javadoc:%.%#,' .
|
||||
\ '\%.%#[javadoc]\ %f:\ %m,' .
|
||||
\ '\%.%#[java]\ org\.apache\.jasper\.JasperException:\ file:%f(%l\\,%c)\ %m,' .
|
||||
\ '\%+A%.%#[junit]\ %.%#Failures:\ %[%^0]%.%#\ Time\ elapsed:\ %.%#,' .
|
||||
\ '\%-Z%.%#[junit]\ Test\ %f\ FAILED,' .
|
||||
\ '\%+A%.%#[junit]\ %.%#Errors:\ %[%^0]%.%#\ Time\ elapsed:\ %.%#,' .
|
||||
\ '\%-Z%.%#[junit]\ Test\ %f\ FAILED,' .
|
||||
\ '\%+A%.%#[cactus]\ %.%#Failures:\ %[%^0]%.%#\ Time\ elapsed:\ %.%#,' .
|
||||
\ '\%-Z%.%#[cactus]\ Test\ %f\ FAILED,' .
|
||||
\ '\%+A%.%#[cactus]\ %.%#Errors:\ %[%^0]%.%#\ Time\ elapsed:\ %.%#,' .
|
||||
\ '\%-Z%.%#[cactus]\ Test\ %f\ FAILED,' .
|
||||
\ '\%.%#[checkstyle]\ %f:%l:%c:\ %m,' .
|
||||
\ '\%.%#[checkstyle]\ %f:%l:\ %m,' .
|
||||
\ '\%E%.%#[scalac]\ %f:%l:\ error:\ %m,' .
|
||||
\ '\%-Z%.%#[scalac]\ %p^,' .
|
||||
\ '\%W%.%#[scalac]\ %f:%l:\ warning:\ %m,' .
|
||||
\ '\%-Z%.%#[scalac]\ %p^,' .
|
||||
\ '\%A%.%#[scalac]\ %f:%l:\ %m,' .
|
||||
\ '\%-Z%.%#[scalac]\ %p^,' .
|
||||
\ '\%+A%.%#eclim\ testng:\ %f:%m,' .
|
||||
\ '\%.%#\ ERROR\ %.%#\ line\ %l\ in\ file:\ %.%f%.:\ %m,' .
|
||||
\ g:EclimAntCompilerAdditionalErrorFormat .
|
||||
\ '\%.%#[exec]\ %f:%l:%c:\ %m,' .
|
||||
\ '\%.%#[exec]\ %f:%l:\ %m,' .
|
||||
\ '\%f:%l:%c:\ %m,' .
|
||||
\ g:EclimAntErrorFormat .
|
||||
\ '\%-G%.%#'
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
44
.vim/bundle/eclim/eclim/compiler/eclim_javadoc.vim
Normal file
44
.vim/bundle/eclim/eclim/compiler/eclim_javadoc.vim
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" License: {{{
|
||||
"
|
||||
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "eclim_javadoc"
|
||||
|
||||
let instance = eclim#client#nailgun#ChooseEclimdInstance()
|
||||
let command = eclim#client#nailgun#GetEclimCommand(instance.home)
|
||||
let command .= ' --nailgun-port ' . instance.port
|
||||
let command .= ' -command javadoc $*'
|
||||
if has('win32') || has('win64') || has('win32unix')
|
||||
let command = 'cmd /c " ' . command . ' "'
|
||||
else
|
||||
let command = substitute(command, '"', '', 'g')
|
||||
endif
|
||||
exec 'CompilerSet makeprg=' . escape(command, ' "')
|
||||
|
||||
exec 'CompilerSet errorformat=' .
|
||||
\ '\%A%.%#[javadoc]\ %f:%l:\ %m,' .
|
||||
\ '\%-Z%.%#[javadoc]\ %p^,' .
|
||||
\ '\%-G%.%#[javadoc]%.%#,' .
|
||||
\ '\%-G%.%#'
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
56
.vim/bundle/eclim/eclim/compiler/eclim_make.vim
Normal file
56
.vim/bundle/eclim/eclim/compiler/eclim_make.vim
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" Compiler for make.
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2009 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "eclim_make"
|
||||
|
||||
if !exists('g:EclimMakeCompilerAdditionalErrorFormat')
|
||||
let g:EclimMakeCompilerAdditionalErrorFormat = ''
|
||||
endif
|
||||
|
||||
CompilerSet makeprg=make
|
||||
|
||||
" With the exception of the last two lines, this is a straight copy from the
|
||||
" vim default.
|
||||
exec 'CompilerSet errorformat=' .
|
||||
\ '%*[^\"]\"%f\"%*\\D%l:\ %m,' .
|
||||
\ '\"%f\"%*\\D%l:\ %m,'.
|
||||
\ '%-G%f:%l:\ (Each\ undeclared\ identifier\ is\ reported\ only\ once,' .
|
||||
\ '%-G%f:%l:\ for\ each\ function\ it\ appears\ in.),' .
|
||||
\ '%f:%l:%c:%m,' .
|
||||
\ '%f(%l):%m,' .
|
||||
\ '%f:%l:%m,' .
|
||||
\ '\"%f\"\\,\ line\ %l%*\\D%c%*[^\ ]\ %m,' .
|
||||
\ "%D%*\\\\a[%*\\\\d]:\\ Entering\\ directory\\ `%f'," .
|
||||
\ "%X%*\\\\a[%*\\\\d]:\\ Leaving\\ directory\\ `%f'," .
|
||||
\ "%D%*\\\\a:\\ Entering\\ directory\\ `%f'," .
|
||||
\ "%X%*\\\\a:\\ Leaving\\ directory\\ `%f'," .
|
||||
\ '%DMaking\ %*\\a\ in\ %f,' .
|
||||
\ '%f\|%l\|\ %m,' .
|
||||
\ g:EclimMakeCompilerAdditionalErrorFormat .
|
||||
\ '\%-G%.%#'
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
61
.vim/bundle/eclim/eclim/compiler/eclim_maven.vim
Normal file
61
.vim/bundle/eclim/eclim/compiler/eclim_maven.vim
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" Compiler for maven 1.x.
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2009 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "eclim_maven"
|
||||
|
||||
if !exists('g:EclimMavenCompilerAdditionalErrorFormat')
|
||||
let g:EclimMavenCompilerAdditionalErrorFormat = ''
|
||||
endif
|
||||
|
||||
CompilerSet makeprg=maven\ --find\ project.xml\ $*
|
||||
|
||||
" Lines 17 - 20: javac minus adornments (must be last to prevent picking up
|
||||
" other errors in the wrong format).
|
||||
exec 'CompilerSet errorformat=' .
|
||||
\ '\%A%.%#[javac]\ %f:%l:\ %m,' .
|
||||
\ '\%C%.%#[javac]\ symbol%.%#:\ %m,' .
|
||||
\ '\%C%.%#[javac]\ location%.%#:\ %m,' .
|
||||
\ '\%-Z%.%#[javac]\ %p^,' .
|
||||
\ '\%W%.%#[javadoc]\ %f:%l:\ warning\ -\ %m,' .
|
||||
\ '\%E%.%#[javadoc]\ %f:%l:\ error\ -\ %m,' .
|
||||
\ '\%A%.%#[javadoc]\ %f:%l:\ %m,' .
|
||||
\ '\%-C%.%#[javadoc]\ location:\ %.%#,' .
|
||||
\ '\%-Z%.%#[javadoc]\ %p^,' .
|
||||
\ '\%-G%.%#[javadoc]\ Note:%.%#,' .
|
||||
\ '\%-G%.%#[javadoc]\ javadoc:%.%#,' .
|
||||
\ '\%+A%.%#[junit]\ %.%#Failures:\ %[%^0]%.%#\ Time\ elapsed:\ %.%#,' .
|
||||
\ '\%-Z%.%#[junit]%.%#\ Test\ %f\ FAILED,' .
|
||||
\ '\%+A%.%#[junit]%.%#\ %.%#Errors:\ %[%^0]%.%#\ Time\ elapsed:\ %.%#,' .
|
||||
\ '\%-Z%.%#[junit]\ Test\ %f\ FAILED,' .
|
||||
\ g:EclimMavenCompilerAdditionalErrorFormat .
|
||||
\ '\%A%f:%l:\ %m,' .
|
||||
\ '\%Csymbol%.%#:\ %m,' .
|
||||
\ '\%Clocation%.%#:\ %m,' .
|
||||
\ '\%-Z\ %p^,' .
|
||||
\ '\%-G%.%#'
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
51
.vim/bundle/eclim/eclim/compiler/eclim_mvn.vim
Normal file
51
.vim/bundle/eclim/eclim/compiler/eclim_mvn.vim
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" Compiler for maven 2.x.
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2009 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "eclim_maven"
|
||||
|
||||
if !exists('g:EclimMvnCompilerAdditionalErrorFormat')
|
||||
let g:EclimMvnCompilerAdditionalErrorFormat = ''
|
||||
endif
|
||||
|
||||
CompilerSet makeprg=mvn\ $*
|
||||
|
||||
" Lines 1 - 3: javac
|
||||
" Lines 4 - 7: javadoc
|
||||
exec 'CompilerSet errorformat=' .
|
||||
\ '\%A%f:[%l\\,%c]\ %m,' .
|
||||
\ '\%Csymbol%.%#:\ %m,' .
|
||||
\ '\%Zlocation%.%#:\ %m,' .
|
||||
\ '\%AEmbedded\ error:%.%#\ -\ %f:%l:\ %m,' .
|
||||
\ '\%-Z\ %p^,' .
|
||||
\ '\%A%f:%l:\ %m,' .
|
||||
\ '\%-Z\ %p^,' .
|
||||
\ '\%ARunning\ %f,' .
|
||||
\ '\%+ZTests\ run%.%#FAILURE!,' .
|
||||
\ g:EclimMvnCompilerAdditionalErrorFormat .
|
||||
\ '\%-G%.%#'
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
39
.vim/bundle/eclim/eclim/compiler/eclim_xmllint.vim
Normal file
39
.vim/bundle/eclim/eclim/compiler/eclim_xmllint.vim
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" Description: {{{
|
||||
" Compiler for xmllint.
|
||||
"
|
||||
" License:
|
||||
"
|
||||
" Copyright (C) 2005 - 2009 Eric Van Dewoestine
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
" the Free Software Foundation, either version 3 of the License, or
|
||||
" (at your option) any later version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful,
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
" GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License
|
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"
|
||||
" }}}
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "eclim_xmllint"
|
||||
|
||||
CompilerSet makeprg=xmllint\ --valid\ --noout\ $*
|
||||
|
||||
CompilerSet errorformat=
|
||||
\%E%f:%l:\ %.%#\ error\ :\ %m,
|
||||
\%W%f:%l:\ %.%#\ warning\ :\ %m,
|
||||
\%-Z%p^,
|
||||
\%-C%.%#,
|
||||
\%-G%.%#
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
32
.vim/bundle/eclim/eclim/dict/java
Normal file
32
.vim/bundle/eclim/eclim/dict/java
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
author
|
||||
abstract
|
||||
boolean
|
||||
case
|
||||
catch
|
||||
char
|
||||
class
|
||||
double
|
||||
extends
|
||||
false
|
||||
final
|
||||
finally
|
||||
float
|
||||
implements
|
||||
int
|
||||
interface
|
||||
link
|
||||
new
|
||||
package
|
||||
param
|
||||
private
|
||||
protected
|
||||
public
|
||||
return
|
||||
short
|
||||
static
|
||||
switch
|
||||
throw
|
||||
throws
|
||||
true
|
||||
try
|
||||
version
|
||||
11
.vim/bundle/eclim/eclim/doc/404.txt
Normal file
11
.vim/bundle/eclim/eclim/doc/404.txt
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
*404*
|
||||
|
||||
Page Not Found
|
||||
**************
|
||||
|
||||
The page you requested does not exist or may have been moved.
|
||||
|
||||
You can use the "Site" drop down or the search box in the nav bar
|
||||
above to search for your desired topic.
|
||||
|
||||
vim:ft=eclimhelp
|
||||
1556
.vim/bundle/eclim/eclim/doc/archive/changes.txt
Normal file
1556
.vim/bundle/eclim/eclim/doc/archive/changes.txt
Normal file
File diff suppressed because it is too large
Load diff
478
.vim/bundle/eclim/eclim/doc/archive/news.txt
Normal file
478
.vim/bundle/eclim/eclim/doc/archive/news.txt
Normal file
|
|
@ -0,0 +1,478 @@
|
|||
*archive-news*
|
||||
|
||||
Eclim News Archive
|
||||
******************
|
||||
|
||||
|
||||
2011-09-10
|
||||
==========
|
||||
|
||||
Eclim 1.7.2 (|1.7.2|) is now available.
|
||||
This version fixes running the installer with java 7 as well as several other
|
||||
small bug fixes and improvements.
|
||||
|
||||
I'd also like to announce the #eclim channel on freenode.
|
||||
|
||||
|
||||
2011-07-02
|
||||
==========
|
||||
|
||||
Eclim 1.7.1 (|1.7.1|) is now available.
|
||||
This is a bug fix release.
|
||||
|
||||
|
||||
2011-06-26
|
||||
==========
|
||||
|
||||
Eclim 1.7.0 (|1.7.0|) is now available.
|
||||
The most notable changes are:
|
||||
|
||||
- Eclim has been upgraded to support Eclipse 3.7 (Indigo).
|
||||
|
||||
Note: Eclim now requires Eclipse 3.7.
|
||||
|
||||
|
||||
2011-04-16
|
||||
==========
|
||||
|
||||
Eclim 1.6.3 (|1.6.3|) is now available.
|
||||
This is primarily a bug fix release.
|
||||
|
||||
|
||||
2011-02-26
|
||||
==========
|
||||
|
||||
Eclim 1.6.2 (|1.6.2|) is now available.
|
||||
This is mostly a bug fix release, but please note that a handful of vim
|
||||
features have been broken out into separate projects and are no longer shipped
|
||||
with eclim.
|
||||
|
||||
|
||||
2010-10-23
|
||||
==========
|
||||
|
||||
Eclim 1.6.1 (|1.6.1|) is now available.
|
||||
This is mostly a bug fix release with a few minor features tossed in.
|
||||
|
||||
|
||||
2010-08-01
|
||||
==========
|
||||
|
||||
Eclim 1.6.0 (|1.6.0|) is now available.
|
||||
The most notable changes are:
|
||||
|
||||
- Eclim has been upgraded to support Eclipse 3.6 (Helios).
|
||||
|
||||
Note: Eclim now requires Eclipse 3.6.
|
||||
|
||||
|
||||
2010-06-26
|
||||
==========
|
||||
|
||||
Eclim 1.5.8 (|1.5.8|) is now available.
|
||||
This is a bug fix release for the installer as well as some php and ruby
|
||||
features.
|
||||
|
||||
|
||||
2010-06-20
|
||||
==========
|
||||
|
||||
Eclim 1.5.7 (|1.5.7|) is now available.
|
||||
The main focus of this release is bug fixes and improving the installer.
|
||||
|
||||
|
||||
2010-03-06
|
||||
==========
|
||||
|
||||
Eclim 1.5.6 (|1.5.6|) is now available.
|
||||
|
||||
|
||||
2010-02-22
|
||||
==========
|
||||
|
||||
Eclim 1.5.5 (|1.5.5|) is now available.
|
||||
This is a bug fix release for the eclim installer.
|
||||
|
||||
|
||||
2009-12-18
|
||||
==========
|
||||
|
||||
Eclim 1.5.4 (|1.5.4|) is now available.
|
||||
This is primarily a bug fix release for OSX users.
|
||||
|
||||
|
||||
2009-12-12
|
||||
==========
|
||||
|
||||
Eclim 1.5.3 (|1.5.3|) is now available.
|
||||
|
||||
|
||||
2009-08-30
|
||||
==========
|
||||
|
||||
Eclim 1.5.2 (|1.5.2|) is now available.
|
||||
|
||||
|
||||
2009-07-18
|
||||
==========
|
||||
|
||||
Eclim 1.5.1 (|1.5.1|) is now available.
|
||||
This is primarily a bug fix release
|
||||
|
||||
|
||||
2009-07-12
|
||||
==========
|
||||
|
||||
Eclim 1.5.0 (|1.5.0|) is now available.
|
||||
The most notable changes are:
|
||||
|
||||
- Eclim has been upgraded to support Eclipse 3.5 (Galileo).
|
||||
|
||||
Note: Eclim now requires Eclipse 3.5.
|
||||
|
||||
- Ruby support has been added using the eclipse dltk
|
||||
(http://eclipse.org/dltk/).
|
||||
|
||||
|
||||
2009-06-14
|
||||
==========
|
||||
|
||||
Eclim 1.4.9 (|1.4.9|) is now available.
|
||||
This is primarily a bug fix release, with a few refinements.
|
||||
|
||||
|
||||
2009-05-30
|
||||
==========
|
||||
|
||||
Eclim 1.4.8 (|1.4.8|) is now available.
|
||||
This is primarily a bug fix release with a few enhancements.
|
||||
|
||||
|
||||
2009-05-02
|
||||
==========
|
||||
|
||||
Eclim 1.4.7 (|1.4.7|) is now available.
|
||||
This is a bug fix release which resolves an installation on unix based
|
||||
operating systems.
|
||||
|
||||
|
||||
2009-05-02
|
||||
==========
|
||||
|
||||
Eclim 1.4.6 (|1.4.6|) is now available.
|
||||
The major highlight of this release is support for c/c++ using the
|
||||
eclipse cdt (http://eclipse.org/cdt/) plugin.
|
||||
|
||||
|
||||
2009-04-04
|
||||
==========
|
||||
|
||||
Eclim 1.4.5 (|1.4.5|) is now available.
|
||||
This is primarily a bug fix release.
|
||||
|
||||
|
||||
2009-01-10
|
||||
==========
|
||||
|
||||
Eclim 1.4.4 (|1.4.4|) is now available.
|
||||
Highlights of this release include:
|
||||
|
||||
- re-enabled php support
|
||||
|
||||
- added ability to run eclimd inside of eclipse gui
|
||||
|
||||
- added support for embedding gvim in eclipse
|
||||
|
||||
|
||||
2008-11-15
|
||||
==========
|
||||
|
||||
Eclim 1.4.3 (|1.4.3|) is now available.
|
||||
This release focuses on updating the installer to support ganymede's p2 for
|
||||
upgrading / installing external dependencies and adding additional python
|
||||
support.
|
||||
|
||||
|
||||
2008-09-30
|
||||
==========
|
||||
|
||||
Eclim 1.4.2 (|1.4.2|) is now available.
|
||||
This is primary a bug fix release.
|
||||
|
||||
|
||||
2008-08-24
|
||||
==========
|
||||
|
||||
Eclim 1.4.1 (|1.4.1|) is now available.
|
||||
This is primary a bug fix release, but there are some new features included
|
||||
as well.
|
||||
|
||||
|
||||
2008-07-27
|
||||
==========
|
||||
|
||||
Eclim 1.4.0 (|1.4.0|) is now available.
|
||||
Please note that eclim now requires the latest version of eclipse (http://eclipse.org)
|
||||
(Ganymede, 3.4.x).
|
||||
|
||||
Also note that the eclipse pdt plugin which serves as the base for
|
||||
eclim's php support has not yet been released for the latest version
|
||||
of eclipse. For this reason php support has been temporarily removed
|
||||
from this release and will hopefully return soon after the pdt team
|
||||
release a Ganymede (3.4) compatible version.
|
||||
|
||||
Another major change worth noting, is that eclim is now licensed under
|
||||
the GPLv3. This was done to give eclim the freedom to integrate with
|
||||
other GPL projects in the future.
|
||||
|
||||
|
||||
2008-03-11
|
||||
==========
|
||||
|
||||
Eclim 1.3.5 (|1.3.5|) is now available.
|
||||
You can view the release notes (|release notes|) for
|
||||
more info.
|
||||
|
||||
|
||||
2008-02-05
|
||||
==========
|
||||
|
||||
Eclim 1.3.4 (|1.3.4|) is now available.
|
||||
This release fixes a few minor bugs, improves the installer to account for
|
||||
eclipse installs with per user plugin locations, and adds php support.
|
||||
|
||||
|
||||
2007-12-15
|
||||
==========
|
||||
|
||||
Eclim 1.3.3 (|1.3.3|) is now available.
|
||||
This release fixes some installer issues. If you have already installed
|
||||
1.3.2, then there is no need to upgrade to 1.3.3.
|
||||
|
||||
|
||||
2007-12-04
|
||||
==========
|
||||
|
||||
Eclim 1.3.2 (|1.3.2|) is now available.
|
||||
|
||||
|
||||
2007-07-13
|
||||
==========
|
||||
|
||||
Eclim 1.3.1 (|1.3.1|) is now available.
|
||||
This is only a bug fix release.
|
||||
|
||||
|
||||
2007-07-01
|
||||
==========
|
||||
|
||||
Eclim 1.3.0 (|1.3.0|) is now available.
|
||||
The most notable changes are:
|
||||
|
||||
- Eclim has been upgraded to support Eclipse 3.3.
|
||||
|
||||
Note: Eclim now requires Eclipse 3.3 and JDK 1.5.
|
||||
|
||||
- A new graphical installer (|installer|) built on the formic
|
||||
(http://github.com/ervandew/formic/) installer framework.
|
||||
|
||||
- New functionality based on and requiring the eclipse wst
|
||||
(http://eclipse.org/webtools/).
|
||||
|
||||
- Many more changes (|changes|).
|
||||
|
||||
|
||||
2006-10-09
|
||||
==========
|
||||
|
||||
All Users: A bug made its way into the initial 1.2.3 release which
|
||||
prevents you from adding methods via :JavaImpl.
|
||||
|
||||
An updated eclim_vim_1.2.3.jar is now available to resolve this issue.
|
||||
If you downloaded this file on October 8th or 9th you can either
|
||||
download the updated version or execute the following within vim:
|
||||
|
||||
>
|
||||
|
||||
:PatchEclim eclim/autoload/eclim/util.vim 1.27
|
||||
|
||||
<
|
||||
|
||||
|
||||
|
||||
2006-10-08
|
||||
==========
|
||||
|
||||
Eclim 1.2.3 is now available.
|
||||
This is primarily a bug fix release.
|
||||
|
||||
Please view the release notes (|release notes|) for more info.
|
||||
|
||||
|
||||
2006-09-08
|
||||
==========
|
||||
|
||||
Eclim 1.2.2 is now available.
|
||||
The previous release introduced two new bugs that managed to slip through the
|
||||
cracks. These have now been fixed including a third that had been around for
|
||||
some time but went previously unnoticed.
|
||||
|
||||
To see a list of fixes you may view the release notes (|release
|
||||
notes|).
|
||||
|
||||
|
||||
2006-09-07
|
||||
==========
|
||||
|
||||
Eclim 1.2.1 is now available.
|
||||
This is primarily a bug fix release, but some new functionality has been
|
||||
added as well. This release should resolve all known issues.
|
||||
|
||||
To see a list of what's new / changed, be sure to take a look at the
|
||||
release notes (|release notes|).
|
||||
|
||||
|
||||
2006-07-17
|
||||
==========
|
||||
|
||||
Windows Users: Eclim 1.2.0 contained a couple issues that can
|
||||
potentially prevent eclim from functioning. A new version of
|
||||
eclim_vim_1.2.0.jar is now available, which fixes these issues.
|
||||
|
||||
Simply download the new file and extract it as explained in the <a
|
||||
href="guides/install.html#step3">installation guide</a>. There is no
|
||||
need to download or re-install the Eclipse plugins.
|
||||
|
||||
If any other issues are encountered please report them.
|
||||
|
||||
|
||||
2006-07-16
|
||||
==========
|
||||
|
||||
Eclim 1.2.0 is now available.
|
||||
This release requires Eclipse 3.2 (http://eclipse.org/downloads).
|
||||
|
||||
To see a list of what's new / changed, be sure to take a look at the
|
||||
release notes (|release notes|).
|
||||
|
||||
Warning: The layout of eclim plugins within the Vim runtimepath has changed.
|
||||
Please read the <a href="changes.html#upgrade_1.2.0">details</a> in
|
||||
the release notes and take the appropriate action prior to
|
||||
upgrading.
|
||||
|
||||
|
||||
2006-05-07
|
||||
==========
|
||||
|
||||
Eclim 1.1.2 is now available.
|
||||
Before upgrading, you should upgrade your Vim installation to the stable
|
||||
release of Vim 7.0 or greater.
|
||||
|
||||
To see a list of what's new / changed, be sure to take a look at the
|
||||
release notes (|release notes|).
|
||||
|
||||
|
||||
2006-02-19
|
||||
==========
|
||||
|
||||
New version of eclim (1.1.1) is now available.
|
||||
This is mostly a bug fix release will a few new additions.
|
||||
Please note, that this latest version requires Eclipse version 3.1.2 for some
|
||||
bug fixes and improvements.
|
||||
|
||||
To see a list of what's new / changed, be sure to take a look at the
|
||||
release notes (|release notes|).
|
||||
|
||||
|
||||
2005-12-26
|
||||
==========
|
||||
|
||||
New version of eclim (1.1.0) is now available.
|
||||
All questions, issues, suggestions are welcome and encouraged.
|
||||
|
||||
To see a list of what's new / changed, be sure to take a look at the
|
||||
release notes (|release notes|).
|
||||
|
||||
|
||||
2005-10-16
|
||||
==========
|
||||
|
||||
The first eclim release (1.0.0) is now available. All questions,
|
||||
issues, suggestions are welcome and encouraged.
|
||||
|
||||
Be sure to read the docs to see what features are currently available,
|
||||
and take a look at the <a href="todo.html">todo</a> to see what's
|
||||
coming in future releases.
|
||||
|
||||
|
||||
2005-09-11
|
||||
==========
|
||||
|
||||
Several new additions over the past couple weeks:
|
||||
|
||||
- Java code completion: Integrated into Vim via Vim 7's new "User
|
||||
Defined Completion".
|
||||
|
||||
- Added eclim command line support for creating and updating projects,
|
||||
including Vim support for editing Eclipse .classpath files and
|
||||
updating Eclipse upon writing of those files.
|
||||
|
||||
- Integrated nailgun (http://www.martiansoftware.com/nailgun/) to
|
||||
greatly improve the command line client performance.
|
||||
|
||||
- Started documenting eclim and its features.
|
||||
|
||||
With the addition of these features I'm going to stop adding new
|
||||
functionality for the time being and focus on testing and ensuring
|
||||
that everything works as expected on Windows.
|
||||
|
||||
|
||||
2005-08-21
|
||||
==========
|
||||
|
||||
Code navigation / searching is done! Most of the Vim integration for
|
||||
searching is done as well. The only thing missing is viewing code for
|
||||
results that are found in a jar file that have no corresponding source
|
||||
attachment. I may end up doing what Eclipse appears to do, which is
|
||||
to use javap to display the class and method signatures. That or I'll
|
||||
use jad to decompile the whole source. My only issue with jad, is
|
||||
that it is not up to date with the 1.5 byte code.
|
||||
|
||||
I also have automated importing done as well. The eclim server
|
||||
request just returns a list of possible results to import for a given
|
||||
request and the editor (Vim in this case) handles prompting the user
|
||||
and updating the code.
|
||||
|
||||
Note: The Vim integration now requires Vim 7. Even though Vim 7 is still
|
||||
alpha, I haven't had any major issues with it and the new additions
|
||||
to the Vim scripting language are just too good to pass up.
|
||||
|
||||
My next step is to start documenting everything and testing on a
|
||||
Windows environment to ensure there aren't any compatibility issues.
|
||||
|
||||
After that I should be ready to put out a preliminary release. I'm
|
||||
trying to be very careful about releasing anything too soon. The last
|
||||
thing I want it to scare anyone off with a broken project that doesn't
|
||||
seem to work properly.
|
||||
|
||||
|
||||
2005-08-11
|
||||
==========
|
||||
|
||||
Sourceforge site is up! Now it's just a matter of getting the ball
|
||||
rolling again.
|
||||
|
||||
I'm hoping to have source code navigation working by the end of next
|
||||
week. This includes the ability to simply hit <enter> on a class name,
|
||||
method name, method call, etc. to jump to its declaration. Basically
|
||||
I want to replace my previous Vim plug-in
|
||||
(http://www.vim.org/scripts/script.php?script_id=1106) with the new
|
||||
Eclipse one.
|
||||
|
||||
Before I put out any releases though, I want to have a comprehensive
|
||||
set of documentation. For the first few releases, setup will probably
|
||||
be pretty manual, with most of it occurring through the Eclipse
|
||||
interface. Going forward, I want to move more of that functionality
|
||||
into Vim.
|
||||
|
||||
vim:ft=eclimhelp
|
||||
42
.vim/bundle/eclim/eclim/doc/archive/tags
Normal file
42
.vim/bundle/eclim/eclim/doc/archive/tags
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
1.0.0 changes.txt /*1.0.0*
|
||||
1.1.0 changes.txt /*1.1.0*
|
||||
1.1.1 changes.txt /*1.1.1*
|
||||
1.1.2 changes.txt /*1.1.2*
|
||||
1.2.0 changes.txt /*1.2.0*
|
||||
1.2.1 changes.txt /*1.2.1*
|
||||
1.2.2 changes.txt /*1.2.2*
|
||||
1.2.3 changes.txt /*1.2.3*
|
||||
1.3.0 changes.txt /*1.3.0*
|
||||
1.3.1 changes.txt /*1.3.1*
|
||||
1.3.2 changes.txt /*1.3.2*
|
||||
1.3.3 changes.txt /*1.3.3*
|
||||
1.3.4 changes.txt /*1.3.4*
|
||||
1.3.5 changes.txt /*1.3.5*
|
||||
1.4.0 changes.txt /*1.4.0*
|
||||
1.4.1 changes.txt /*1.4.1*
|
||||
1.4.2 changes.txt /*1.4.2*
|
||||
1.4.3 changes.txt /*1.4.3*
|
||||
1.4.4 changes.txt /*1.4.4*
|
||||
1.4.5 changes.txt /*1.4.5*
|
||||
1.4.6 changes.txt /*1.4.6*
|
||||
1.4.7 changes.txt /*1.4.7*
|
||||
1.4.8 changes.txt /*1.4.8*
|
||||
1.4.9 changes.txt /*1.4.9*
|
||||
1.5.0 changes.txt /*1.5.0*
|
||||
1.5.1 changes.txt /*1.5.1*
|
||||
1.5.2 changes.txt /*1.5.2*
|
||||
1.5.3 changes.txt /*1.5.3*
|
||||
1.5.4 changes.txt /*1.5.4*
|
||||
1.5.5 changes.txt /*1.5.5*
|
||||
1.5.6 changes.txt /*1.5.6*
|
||||
1.5.7 changes.txt /*1.5.7*
|
||||
1.5.8 changes.txt /*1.5.8*
|
||||
1.6.0 changes.txt /*1.6.0*
|
||||
1.6.1 changes.txt /*1.6.1*
|
||||
1.6.2 changes.txt /*1.6.2*
|
||||
1.6.3 changes.txt /*1.6.3*
|
||||
1.7.0 changes.txt /*1.7.0*
|
||||
1.7.1 changes.txt /*1.7.1*
|
||||
1.7.2 changes.txt /*1.7.2*
|
||||
archive-changes changes.txt /*archive-changes*
|
||||
archive-news news.txt /*archive-news*
|
||||
515
.vim/bundle/eclim/eclim/doc/changes.txt
Normal file
515
.vim/bundle/eclim/eclim/doc/changes.txt
Normal file
File diff suppressed because it is too large
Load diff
474
.vim/bundle/eclim/eclim/doc/cheatsheet.txt
Normal file
474
.vim/bundle/eclim/eclim/doc/cheatsheet.txt
Normal file
|
|
@ -0,0 +1,474 @@
|
|||
*cheatsheet*
|
||||
|
||||
Cheatsheet
|
||||
**********
|
||||
|
||||
Here you will find a comprehensive list of eclim commands that you can
|
||||
use as a reference.
|
||||
|
||||
|
||||
Global Commands
|
||||
===============
|
||||
|
||||
- :PingEclim (|vim-core-eclim#:PingEclim|) - Pings eclimd server.
|
||||
|
||||
- :ShutdownEclim (|vim-core-eclim#:ShutdownEclim|) - Shuts down eclimd
|
||||
server.
|
||||
|
||||
- :EclimSettings (|vim-core-eclim#:EclimSettings|) - View / edit
|
||||
global settings.
|
||||
|
||||
- :EclimDisable (|vim-core-eclim#:EclimDisable|) - Temporarily
|
||||
disables communication with eclimd.
|
||||
|
||||
- :EclimEnable (|vim-core-eclim#:EclimEnable|) - Re-enables
|
||||
communication with eclimd.
|
||||
|
||||
- :EclimHelp (|vim-core-eclim#:EclimHelp|) [helptopic] - View eclim
|
||||
documentation in vim.
|
||||
|
||||
- :EclimHelpGrep (|vim-core-eclim#:EclimHelpGrep|) /regex/ - Search
|
||||
the eclim documentation in vim.
|
||||
|
||||
|
||||
Project Commands
|
||||
================
|
||||
|
||||
- |:ProjectCreate| <folder> [-p <project_name>] -n <nature> ... [-d
|
||||
<project_dependency> ...] - Create a new project.
|
||||
|
||||
- |:ProjectImport| <folder> - Import a project from an existing
|
||||
eclipse project folder.
|
||||
|
||||
- |:ProjectList| - List current projects.
|
||||
|
||||
- |:ProjectSettings| [<project>] - View / edit project settings.
|
||||
|
||||
- |:ProjectDelete| <project> - Delete a project.
|
||||
|
||||
- |:ProjectRename| [<project>] <name> - Rename a project.
|
||||
|
||||
- |:ProjectMove| [<project>] <dir> - Move a project.
|
||||
|
||||
- |:ProjectRefresh| [<project> <project> ...] - Refresh supplied list
|
||||
of projects against the current files on disk. If no project names
|
||||
supplied, refresh the current project.
|
||||
|
||||
- |:ProjectRefreshAll| - Refresh all projects.
|
||||
|
||||
- |:ProjectBuild| [<project>] - Build the current or supplied project.
|
||||
|
||||
- |:ProjectInfo| [<project>] - Echos info for the current or supplied
|
||||
project.
|
||||
|
||||
- |:ProjectOpen| [<project>] - Opens a project.
|
||||
|
||||
- |:ProjectClose| [<project>] - Closes a project.
|
||||
|
||||
- |:ProjectNatures| [<project>] - View the configured natures for one
|
||||
or all projects.
|
||||
|
||||
- |:ProjectNatureAdd| <project> [<nature> ...] - Add one or more
|
||||
natures to a project.
|
||||
|
||||
- |:ProjectNatureRemove| <project> [<nature> ...] - Remove one or more
|
||||
natures from a project.
|
||||
|
||||
- |:ProjectProblems| [<project>] - Populates vim's quickfix with all
|
||||
eclipse build errors and warnings for the current, or specified
|
||||
project, and all related projects.
|
||||
|
||||
- |:ProjectCD| - Changes the global current working directory to the
|
||||
root directory of the current file's project (executes a :cd).
|
||||
|
||||
- |:ProjectLCD| - Changes the current working directory of the current
|
||||
window to the root directory of the current file's project (executes
|
||||
a :lcd).
|
||||
|
||||
- |:ProjectTree| [<project> <project> ...] - Opens navigable a tree
|
||||
for one or more projects.
|
||||
|
||||
- |:ProjectsTree| - Opens a tree containing all projects.
|
||||
|
||||
- |:ProjectTab| <project> - Opens a new tab containing the project
|
||||
tree and the tab local working directory set to the supplied
|
||||
project's root.
|
||||
|
||||
- |:ProjectGrep| /<pattern>/ file_pattern [file_pattern ...] - Issues
|
||||
a vimgrep starting at the root of the current project.
|
||||
|
||||
- |:ProjectGrepAdd| /<pattern>/ file_pattern [file_pattern ...] -
|
||||
Issues a vimgrepadd starting at the root of the current project.
|
||||
|
||||
- |:ProjectLGrep| /<pattern>/ file_pattern [file_pattern ...] - Issues
|
||||
a lvimgrep starting at the root of the current project.
|
||||
|
||||
- |:ProjectLGrepAdd| /<pattern>/ file_pattern [file_pattern ...] -
|
||||
Issues a lvimgrepadd starting at the root of the current project.
|
||||
|
||||
- |:ProjectTodo| - Searches project files for todo / fixme patterns
|
||||
and adds them to the location list.
|
||||
|
||||
- |:Todo| - Searches the current file for todo / fixme patterns and
|
||||
adds them to the location list.
|
||||
|
||||
|
||||
Android Commands
|
||||
================
|
||||
|
||||
*:AndroidReload*
|
||||
|
||||
- :AndroidReload - Reloads the Android SDK environment in the running
|
||||
eclimd/eclipse instance. Useful if you've made changes to the SDK
|
||||
outside of eclipse (installed a new target platform, etc).
|
||||
|
||||
|
||||
Ant Commands
|
||||
============
|
||||
|
||||
- |:Ant| [<target> ...] - Execute ant from the current project.
|
||||
|
||||
- |:AntDoc| [<element>] - Find and open the documentation for the
|
||||
element under the cursor or the element supplied as an argument.
|
||||
|
||||
- :Validate (|:Validate_ant|) - Validate the current ant build file.
|
||||
|
||||
|
||||
C/C++ Commands
|
||||
==============
|
||||
|
||||
- :Validate (|:Validate_c|) - Validate the current file.
|
||||
|
||||
- |:CSearch| [-p <pattern> -t <type> -s <scope> -x <context>] - Search
|
||||
for classes, functions, methods, macros, etc.
|
||||
|
||||
- |:CSearchContext| - Find the element under the cursor based on its
|
||||
context.
|
||||
|
||||
- |:CProjectConfigs| [project] - Open a temp buffer to view/modify the
|
||||
current projects cdt configurations.
|
||||
|
||||
- |:CCallHierarchy| - Display the call hierarchy for the function or
|
||||
method under the cursor.
|
||||
|
||||
|
||||
Css Commands
|
||||
============
|
||||
|
||||
- :Validate (|:Validate_css|) - Validate the current file.
|
||||
|
||||
|
||||
Dtd Commands
|
||||
============
|
||||
|
||||
- :Validate (|:Validate_dtd|) - Validate the current file.
|
||||
|
||||
|
||||
Html Commands
|
||||
=============
|
||||
|
||||
- :Validate (|:Validate_html|) - Validate the current file.
|
||||
|
||||
- |:BrowserOpen| - Opens the current file in your configured browser.
|
||||
|
||||
|
||||
Ivy Commands
|
||||
============
|
||||
|
||||
- |:IvyRepo| <path> - Sets the necessary IVY_REPO classpath variable
|
||||
for supporting automatic updates to .classpath files upon ivy.xml
|
||||
updates.
|
||||
|
||||
- |:IvyDependencySearch| <artifact> - Searches online repository and
|
||||
opens a window with results that can be added to the current ivy
|
||||
file by hitting <Enter> on a result. Available when editing an
|
||||
ivy.xml file.
|
||||
|
||||
|
||||
Java Commands
|
||||
=============
|
||||
|
||||
- |:JavaGet| - Create a java bean getter method.
|
||||
|
||||
- |:JavaSet| - Create a java bean setter method.
|
||||
|
||||
- |:JavaGetSet| - Create both a java bean getter and setter method.
|
||||
|
||||
- |:JavaConstructor| - Creates class constructor, either empty or
|
||||
based on selected class fields.
|
||||
|
||||
- |:JavaCallHierarchy| - Display the call hierarchy for the method
|
||||
under the cursor.
|
||||
|
||||
- |:JavaHierarchy| - View the type hierarchy tree.
|
||||
|
||||
- |:JavaImpl| - View implementable / overridable methods from super
|
||||
classes and implemented interfaces.
|
||||
|
||||
- |:JavaDelegate| - View list of methods that delegate to the field
|
||||
under the cursor.
|
||||
|
||||
- |:JUnit| [testcase] - Allows you to execute junit test cases.
|
||||
|
||||
- |:JUnitFindTest| - Attempts to find the corresponding test for the
|
||||
current source file.
|
||||
|
||||
- |:JUnitImpl| - Similar to :JavaImpl, but creates test methods.
|
||||
|
||||
- |:JUnitResult| [testcase] - Allows you to view the results of a test
|
||||
case.
|
||||
|
||||
- |:JavaImport| - Import the class under the cursor.
|
||||
|
||||
- |:JavaImportOrganize| - Import undefined types, remove unused
|
||||
imports, sort and format imports.
|
||||
|
||||
- |:JavaSearch| [-p <pattern>] [-t <type>] [-x <context>] [-s <scope>]
|
||||
- Search for classes, methods, fields, etc. (With pattern supplied,
|
||||
searches for the element under the cursor).
|
||||
|
||||
- |:JavaSearchContext| - Perform a context sensitive search for the
|
||||
element under the cursor.
|
||||
|
||||
- |:JavaCorrect| - Suggest possible corrections for a source error.
|
||||
|
||||
- |:JavaDocSearch| - Search for javadocs. Same usage as :JavaSearch.
|
||||
|
||||
- |:JavaDocComment| - Adds or updates the comments for the element
|
||||
under the cursor.
|
||||
|
||||
- |:JavaDocPreview| - Display the javadoc of the element under the
|
||||
cursor in vim's preview window.
|
||||
|
||||
- |:JavaRename| [new_name] - Rename the element under the cursor.
|
||||
|
||||
- |:JavaMove| [new_package] - Move the current class/interface to
|
||||
another package.
|
||||
|
||||
- |:Java| - Executes the java using your project's main class.
|
||||
|
||||
- |:JavaClasspath| [-d <delim>] - Echos the project's classpath
|
||||
delimited by the system path separator or the supplied delimiter.
|
||||
|
||||
- |:Javadoc| [file, file, ...] - Executes the javadoc utility against
|
||||
all or just the supplied source files.
|
||||
|
||||
- |:JavaListInstalls| - List known JDK/JRE installs.
|
||||
|
||||
- |:JavaFormat| - Formats java source code.
|
||||
|
||||
- |:Checkstyle| - Invokes checkstyle on the current file.
|
||||
|
||||
- |:Jps| - Opens window with information about the currently running
|
||||
java processes.
|
||||
|
||||
- :Validate (|:Validate_java|) - Manually runs source code validation.
|
||||
|
||||
|
||||
Java .classpath Commands
|
||||
========================
|
||||
|
||||
- :NewSrcEntry (|:NewSrcEntry_java|) <dir> - Add a new source dir
|
||||
entry.
|
||||
|
||||
- :NewProjectEntry (|:NewProjectEntry_java|) <project> - Add a new
|
||||
project entry.
|
||||
|
||||
- :NewJarEntry (|:NewJarEntry_java|) <file> [<src_path>
|
||||
<javadoc_path>] - Add a jar entry.
|
||||
|
||||
- :NewVarEntry (|:NewVarEntry_java|) <VAR/file> [<src_path>
|
||||
<javadoc_path>] - Add a new var entry.
|
||||
|
||||
- |:VariableList| List available classpath variables and their
|
||||
corresponding values.
|
||||
|
||||
- |:VariableCreate| <name> <path> - Creates or updates the variable
|
||||
with the supplied name.
|
||||
|
||||
- |:VariableDelete| <name> - Deletes the variable with the supplied
|
||||
name.
|
||||
|
||||
|
||||
Javascript Commands
|
||||
===================
|
||||
|
||||
- :Validate (|:Validate_javascript|) - Validate the current javascript
|
||||
file.
|
||||
|
||||
|
||||
Log4j Commands
|
||||
==============
|
||||
|
||||
- :Validate (|:Validate_log4j|) - Validate the current log4j xml
|
||||
configuration file.
|
||||
|
||||
|
||||
Maven Commands
|
||||
==============
|
||||
|
||||
- |:Maven| [<goal> ...] - Execute maven 1.x from the current project.
|
||||
|
||||
- |:Mvn| [<goal> ...] - Execute maven 2.x from the current project.
|
||||
|
||||
- |:MavenRepo| - Sets the necessary MAVEN_REPO classpath variable for
|
||||
maven's (1.x) eclipse support.
|
||||
|
||||
- |:MvnRepo| - Sets the necessary M2_REPO classpath variable for
|
||||
maven's (2.x) eclipse support.
|
||||
|
||||
- |:MavenDependencySearch| <artifact> - Searches online repository and
|
||||
opens a window with results that can be added to the current project
|
||||
file by hitting <Enter> on a result. Available when editing a maven
|
||||
1.x project.xml file.
|
||||
|
||||
- |:MvnDependencySearch| <artifact> - Searches online repository and
|
||||
opens a window with results that can be added to the current pom
|
||||
file by hitting <Enter> on a result. Available when editing a maven
|
||||
2.x pom.xml file.
|
||||
|
||||
|
||||
Php Commands
|
||||
============
|
||||
|
||||
- |:PhpSearch| [-p <pattern> -t <type> -s <scope> -x <context>] -
|
||||
Search for classes, methods, and constants.
|
||||
|
||||
- |:PhpSearchContext| - Find the element under the cursor based on its
|
||||
context.
|
||||
|
||||
- :Validate (|:Validate_php|) - Manually runs source code validation.
|
||||
|
||||
|
||||
Python Commands
|
||||
===============
|
||||
|
||||
- |:PythonFindDefinition| - Find the element under the cursor.
|
||||
|
||||
- |:PythonSearchContext| - Find the element under the cursor based on
|
||||
its context.
|
||||
|
||||
- :Validate (|:Validate_python|) - Validates the current file using
|
||||
pyflakes (http://www.divmod.org/trac/wiki/DivmodPyflakes).
|
||||
|
||||
- |:PyLint| - Runs pylint (http://www.logilab.org/857) on the current
|
||||
file.
|
||||
|
||||
- |:DjangoManage| - Invokes django's manage.py from any file in the
|
||||
same directory as your manage.py or in any of the child directories.
|
||||
|
||||
- |:DjangoFind| - Available when editing a django html template file.
|
||||
Finds tag/filter definition, other template files, and static files.
|
||||
|
||||
- |:DjangoTemplateOpen| - Available when editing a python file. Finds
|
||||
the template referenced under the cursor.
|
||||
|
||||
- |:DjangoViewOpen| - Available when editing a python file. When
|
||||
within a django url patterns definition, finds the view referenced
|
||||
under the cursor.
|
||||
|
||||
- |:DjangoContextOpen| - Available when editing a python file.
|
||||
Executes :DjangoViewOpen, :DjangoTemplateOpen, or
|
||||
:PythonSearchContext depending on the context of the text under the
|
||||
cursor.
|
||||
|
||||
|
||||
Ruby Commands
|
||||
=============
|
||||
|
||||
- |:RubySearch| [-p <pattern> -t <type> -s <scope> -x <context>] -
|
||||
Search for modules, classes, methods, etc.
|
||||
|
||||
- |:RubySearchContext| - Find the element under the cursor based on
|
||||
its context.
|
||||
|
||||
- :Validate (|:Validate_ruby|) - Manually runs source code validation.
|
||||
|
||||
- |:RubyInterpreterAdd| [-n <name>] <path> - Add a ruby interpreter.
|
||||
|
||||
- |:RubyInterpreterRemove| <path> - Remove a ruby interpreter.
|
||||
|
||||
- |:RubyInterpreterList| - List the available ruby interpreters.
|
||||
|
||||
|
||||
WebXml Commands
|
||||
===============
|
||||
|
||||
- :Validate (|:Validate_webxml|) - Validate the current web.xml file.
|
||||
|
||||
|
||||
Xml Commands
|
||||
============
|
||||
|
||||
- |:DtdDefinition| [<element>] - Open the current xml file's dtd and
|
||||
jump to the element definition if supplied.
|
||||
|
||||
- |:XsdDefinition| [<element>] - Open the current xml file's xsd and
|
||||
jump to the element definition if supplied.
|
||||
|
||||
- :Validate (|:Validate_xml|) [<file>] - Validates the supplied xml
|
||||
file or the current file if none supplied.
|
||||
|
||||
- |:XmlFormat| - Reformats the current xml file.
|
||||
|
||||
|
||||
Xsd Commands
|
||||
============
|
||||
|
||||
- :Validate (|:Validate_xsd|) - Validate the current file.
|
||||
|
||||
|
||||
Misc. Commands
|
||||
==============
|
||||
|
||||
- |:LocateFile| [file] - Locates a relative file and opens it.
|
||||
|
||||
- |:Tcd| dir - Like :lcd but sets the tab's local working directory.
|
||||
|
||||
- |:DiffLastSaved| - Performs a diffsplit with the last saved version
|
||||
of the currently modifed file.
|
||||
|
||||
- |:SwapWords| - Swaps two words (with cursor placed on the first
|
||||
word). Supports swapping around non-word characters like commas,
|
||||
periods, etc.
|
||||
|
||||
- |:Sign| - Toggles adding or removing a vim sign on the current line.
|
||||
|
||||
- |:Signs| - Opens a new window containing a list of signs for the
|
||||
current buffer.
|
||||
|
||||
- |:SignClearUser| - Removes all vim signs added via :Sign.
|
||||
|
||||
- |:SignClearAll| - Removes all vim signs.
|
||||
|
||||
- |:QuickFixClear| - Removes all entries from the quick fix window.
|
||||
|
||||
- |:LocationListClear| - Removes all entries from the location list
|
||||
window.
|
||||
|
||||
- |:Buffers| - Opens a temporary window with a list of all the
|
||||
currently listed buffers, allowing you to open or remove them.
|
||||
|
||||
- |:BuffersToggle| - Opens the buffers window if not open, otherwise
|
||||
closes it.
|
||||
|
||||
- |:Only| - Closes all but the current window and any windows excluded
|
||||
by g:EclimOnlyExclude.
|
||||
|
||||
- |:History| - View the local history entries for the current file.
|
||||
|
||||
- |:HistoryClear| - Clear the local history entries for the current
|
||||
file.
|
||||
|
||||
- |:HistoryDiffNext| / |:HistoryDiffPrev| - Diff the current file
|
||||
against the next/previous entry in the history stack.
|
||||
|
||||
- |:RefactorUndo| / |:RefactorRedo| - Undo / Redo the last
|
||||
refactoring.
|
||||
|
||||
- |:RefactorUndoPeek| / |:RefactorRedoPeek| - Display a short
|
||||
description of the refactoring to be undone / redone.
|
||||
|
||||
- |:OpenUrl| [url] - Opens a url in your configured web browser.
|
||||
|
||||
vim:ft=eclimhelp
|
||||
66
.vim/bundle/eclim/eclim/doc/contribute.txt
Normal file
66
.vim/bundle/eclim/eclim/doc/contribute.txt
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
*contribute*
|
||||
|
||||
Contribute
|
||||
**********
|
||||
|
||||
Eclim is a project developed entirely in my spare time, so its growth
|
||||
and success can be directly impacted by contributions from the
|
||||
community. There are several ways in which you can contribute:
|
||||
|
||||
1. Documentation: The documentation can always use improvements.
|
||||
Right now it is written entirely by me, and as such, it may not be
|
||||
as detailed in some areas as it should. What the documentation
|
||||
could really use is some help from its users:
|
||||
|
||||
- Point out any grammar or spelling errors, since some always
|
||||
manage to slip through.
|
||||
|
||||
- Point out areas of the documentation that are vague and could use
|
||||
elaboration.
|
||||
|
||||
- Write new guides to be included in the "Guides" section of the
|
||||
site.
|
||||
|
||||
2. Bug Reports: Some people are a bit shy about speaking up and
|
||||
reporting bugs. I want to urge people not to be. If something
|
||||
doesn't work, report it. It may be a bug, but even if it is just a
|
||||
configuration issue on your end, a misconception on how you thought
|
||||
it should work, or some other quirk specific to your environment,
|
||||
speak up. These can signal that some scripts may need to validate
|
||||
or account for some aspect of the user's environment, or that the
|
||||
documentation may need some work to ensure the user knows what to
|
||||
expect. Any issue that goes unreported, goes unfixed, so please
|
||||
report all issues, big and small.
|
||||
|
||||
3. Feature Requests: On occasion I receive a request or two, but I
|
||||
would like to encourage more people to voice their opinion on what
|
||||
they think should be added or changed in eclim. Once again,
|
||||
nothing is too small to suggest. Chances are, that if you have
|
||||
something that you would like added or changed, there are others
|
||||
out there that would benefit from the same addition or
|
||||
modification.
|
||||
|
||||
To see what features I have already thought about, you can view my
|
||||
todo list (http://github.com/ervandew/eclim/blob/master/notes.txt).
|
||||
|
||||
4. Code Contributions: In addition to reporting bugs or requesting
|
||||
features, you can also take that next step and implement a fix or
|
||||
feature yourself. I just ask that you document your patch
|
||||
accordingly so that I know exactly what you are attempting to fix
|
||||
or add. Also, if you plan to add a medium or large feature, please
|
||||
let me know prior to beginning your work. That way I can keep a
|
||||
small list of who is working on what to avoid any duplication of
|
||||
effort and link people together that wish to work on the same
|
||||
feature. The list would also afford me the ability to contact you
|
||||
should a change to eclim possibly affect what you are working on.
|
||||
If you plan on making any code contributes, please read the
|
||||
developer guide (|development-gettingstarted|) first.
|
||||
|
||||
5. Monetary Contributions: I am not currently accepting any donations.
|
||||
My day job pays well, and I work on eclim for the love of it. If
|
||||
you have money you would like to donate, it would go to much better
|
||||
use if you donated to vim (http://www.vim.org/sponsor/index.php),
|
||||
where it is used to help children in Uganda. Feel free to mention
|
||||
your referral from eclim if appropriate.
|
||||
|
||||
vim:ft=eclimhelp
|
||||
38
.vim/bundle/eclim/eclim/doc/development/architecture.txt
Normal file
38
.vim/bundle/eclim/eclim/doc/development/architecture.txt
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
*development-architecture*
|
||||
|
||||
Architecture
|
||||
************
|
||||
|
||||
The eclim architecture is pretty straight forward. Commands issued by
|
||||
a user in vim are relayed via nailgun
|
||||
(http://www.martiansoftware.com/nailgun/) to the running eclim daemon
|
||||
and the proper command implementation is then located and executed.
|
||||
|
||||
Here is a diagram showing the sequence in a bit more detail:
|
||||
|
||||
[diagram]
|
||||
|
||||
The commands which are executed on the eclimd side are also fairly
|
||||
simple. They accept an object containing the command line parameters
|
||||
passed into the eclim invocation and then return an object (String,
|
||||
Collection, etc) which is converted to a json response. Below is a
|
||||
simple class diagram showing the hierarchy of a couple typical
|
||||
commands.
|
||||
|
||||
[diagram]
|
||||
|
||||
Another important aspect of eclim's architecture is support for
|
||||
plugins. Plugins for eclim are bundled as eclipse plugins with their
|
||||
auto start attribute set to false. When the eclim daemon starts it
|
||||
will locate and load any eclipse plugin with an 'org.eclim.' prefix.
|
||||
|
||||
When a plugin is loaded, eclim will locate the plugin's required
|
||||
resources provider and invoke its initialize method which will then
|
||||
inject its resources (messages, command options, etc) into eclim and
|
||||
register any new commands.
|
||||
|
||||
Here is graphical representation of this process:
|
||||
|
||||
[diagram]
|
||||
|
||||
vim:ft=eclimhelp
|
||||
248
.vim/bundle/eclim/eclim/doc/development/commands.txt
Normal file
248
.vim/bundle/eclim/eclim/doc/development/commands.txt
Normal file
|
|
@ -0,0 +1,248 @@
|
|||
*development-commands*
|
||||
|
||||
Commands
|
||||
********
|
||||
|
||||
For each eclipse feature that is exposed in eclim, there is a
|
||||
corresponding command on the daemon which handles calling the
|
||||
appropriate eclipse APIs and returning a result back to the client.
|
||||
This page will walk you through creating a simple command to
|
||||
familiarize you with the process.
|
||||
|
||||
|
||||
Creating a Command
|
||||
==================
|
||||
|
||||
Commands are simple classes which extend AbstractCommand and are
|
||||
registered using the @Command annotation. They then define an execute
|
||||
method which can return any object that can be serialized
|
||||
appropriately using gson (http://code.google.com/p/google-gson/).
|
||||
|
||||
Here is an example of a trivial command which returns a map of the
|
||||
arguments it was supplied, with the supplied project and file paths
|
||||
converted to absolute paths and the file byte offset converted to a
|
||||
character offset (eclim's vim function eclim#util#GetOffset() returns
|
||||
the offset in bytes since getting a character offset in vim with multi
|
||||
byte characters is less reliable, but most eclipse APIs expect
|
||||
character offsets):
|
||||
|
||||
Note: Eclim's source code is grouped by bundles (org.eclim,
|
||||
org.eclim.core, etc), each of which has java directory containing
|
||||
the java source code for that bundle.
|
||||
|
||||
>
|
||||
|
||||
package org.eclim.plugin.core.command.sample;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.eclim.annotation.Command;
|
||||
|
||||
import org.eclim.command.CommandLine;
|
||||
import org.eclim.command.Options;
|
||||
|
||||
import org.eclim.plugin.core.command.AbstractCommand;
|
||||
|
||||
import org.eclim.plugin.core.util.ProjectUtils;
|
||||
|
||||
import org.eclipse.core.resources.IProject;
|
||||
|
||||
@Command(
|
||||
name = "echo",
|
||||
options =
|
||||
"REQUIRED p project ARG," +
|
||||
"REQUIRED f file ARG," +
|
||||
"REQUIRED o offset ARG," +
|
||||
"OPTIONAL e encoding ARG"
|
||||
)
|
||||
public class EchoCommand
|
||||
extends AbstractCommand
|
||||
{
|
||||
@Override
|
||||
public Object execute(CommandLine commandLine)
|
||||
throws Exception
|
||||
{
|
||||
String projectName = commandLine.getValue(Options.PROJECT_OPTION);
|
||||
String file = commandLine.getValue(Options.FILE_OPTION);
|
||||
|
||||
IProject project = ProjectUtils.getProject(projectName);
|
||||
|
||||
// translates client supplied byte offset to a character offset using the
|
||||
// 'project', 'file', 'offset', and 'encoding' command line args.
|
||||
int offset = getOffset(commandLine);
|
||||
|
||||
HashMap<String,Object> result = new HashMap<String,Object>();
|
||||
result.put("project", ProjectUtils.getPath(project));
|
||||
result.put("file", ProjectUtils.getFilePath(project, file));
|
||||
result.put("offset", offset);
|
||||
if (commandLine.hasOption(Options.ENCODING_OPTION)){
|
||||
result.put("encoding", commandLine.getValue(Options.ENCODING_OPTION));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
<
|
||||
|
||||
|
||||
When registering the command with the @Command annotation, you give it
|
||||
a name and a comma separated list of options. Each option consists of
|
||||
4 parts in the form of:
|
||||
|
||||
>
|
||||
|
||||
REQUIRED|OPTIONAL s longname ARG|NOARG|ANY
|
||||
|
||||
<
|
||||
|
||||
|
||||
Where each part is defined as:
|
||||
|
||||
1. REQUIRED or OPTIONAL
|
||||
|
||||
2. a single letter short name for the option
|
||||
|
||||
3. a long name for the option
|
||||
|
||||
4. whether the option requires an argument, no argument, or can have
|
||||
any number of additional arguments. In the case of ANY, you should
|
||||
only have one option with that value and when running the command
|
||||
from the command line, that option should be supplied last.
|
||||
|
||||
That should give you the basics on what's involved with creating a new
|
||||
command, but the biggest hurdle for creating most commands is locating
|
||||
and deciphering the eclipse API calls that are necessary to implement
|
||||
the feature you want. Unfortunately most of the eclipse code that
|
||||
you'll need to hook into will most likely have little to no
|
||||
documentation so you're going to have to dig through the eclipse code.
|
||||
Eclim does provide a couple ant tasks to at least help you to quickly
|
||||
extract any docs or source code found in your eclipse install:
|
||||
|
||||
- eclipse.doc: This target will extract any doc jars from your eclipse
|
||||
install to a 'doc' directory in your eclipse home (or user local
|
||||
eclipse home).
|
||||
|
||||
- eclipse.src: This target will extract any src jars from your eclipse
|
||||
install to a 'src' directory in your eclipse home (or user local
|
||||
eclipse home). If you download the sdk version of eclipse then the
|
||||
jdt and all the core eclipse source will be available. Some other
|
||||
plugins provide sdk versions which include the source code and this
|
||||
target can extract those as well, but some plugins don't seem to
|
||||
have this option when installing via eclipse's update manager (and
|
||||
may not include the source when installed from a system package
|
||||
manager). For those you can often download a zip version of their
|
||||
update site which should include source bundles. Once you've
|
||||
extracted that file, you can tell this target to extract source
|
||||
bundles from a specified directory. Here is an example of extracting
|
||||
the source from an unpacked dltk update site:
|
||||
|
||||
>
|
||||
$ ant -Dsrc.dir=/home/ervandew/downloads/dltk-core-5.0.0/plugins eclipse.src
|
||||
|
||||
<
|
||||
|
||||
|
||||
Running a Command
|
||||
=================
|
||||
|
||||
Once you've created your command you then need to compile the code
|
||||
using eclim's ant build file. After you've done that you can then
|
||||
start eclimd and execute your command from the command line to test
|
||||
it:
|
||||
|
||||
>
|
||||
|
||||
$ eclim -pretty -command echo -p eclim -f org.eclim.core/plugin.properties -o 42 -e utf-8
|
||||
|
||||
<
|
||||
|
||||
|
||||
Note: As you are developing your commands, you can avoid restarting eclimd
|
||||
after every change by using eclim's reload command which will reload
|
||||
all of eclim's plugin bundles with the exception of org.eclim.core
|
||||
(so unfortunately it won't help with our example above if we put
|
||||
that command in the org.eclim.core bundle):>
|
||||
|
||||
$ eclim -command reload
|
||||
|
||||
<
|
||||
|
||||
|
||||
|
||||
Adding to Vim
|
||||
=============
|
||||
|
||||
Continuing with our echo command example, we can add the command to
|
||||
vim by first defining a new vim command in
|
||||
org.eclim.core/vim/eclim/plugin/eclim.vim:
|
||||
|
||||
Note: If the command should only be available for a specific file type,
|
||||
then you'd put it in a vim/eclim/ftplugin/somefiltetype.vim file
|
||||
instead.
|
||||
|
||||
>
|
||||
|
||||
command EclimEcho :call eclim#echo#Echo()
|
||||
|
||||
<
|
||||
|
||||
|
||||
Now that we've created the command, we then need to define our
|
||||
eclim#echo#Echo() function accordingly in
|
||||
org.eclim.core/vim/eclim/autoload/eclim/echo.vim:
|
||||
|
||||
>
|
||||
|
||||
" Script Variables {{{
|
||||
let s:echo_command =
|
||||
\ '-command echo -p "<project>" -f "<file>" ' .
|
||||
\ '-o <offset> -e <encoding>'
|
||||
" }}}
|
||||
|
||||
function! eclim#echo#Echo() " {{{
|
||||
if !eclim#project#util#IsCurrentFileInProject(0)
|
||||
return
|
||||
endif
|
||||
|
||||
let project = eclim#project#util#GetCurrentProjectName()
|
||||
let file = eclim#project#util#GetProjectRelativeFilePath()
|
||||
|
||||
let command = s:echo_command
|
||||
let command = substitute(command, '<project>', project, '')
|
||||
let command = substitute(command, '<file>', file, '')
|
||||
let command = substitute(command, '<offset>', eclim#util#GetOffset(), '')
|
||||
let command = substitute(command, '<encoding>', eclim#util#GetEncoding(), '')
|
||||
|
||||
let response = eclim#Execute(command)
|
||||
|
||||
" if we didn't get back a dict as expected, then there was probably a
|
||||
" failure in the command, which eclim#Execute will handle alerting the user
|
||||
" to.
|
||||
if type(response) != g:DICT_TYPE
|
||||
return
|
||||
endif
|
||||
|
||||
" simply print the response for the user.
|
||||
call eclim#util#Echo(string(response))
|
||||
endfunction " }}}
|
||||
|
||||
<
|
||||
|
||||
|
||||
And that's all there is to it. After re-building eclim, restarting
|
||||
eclimd, and restarting vim, you can now execute the command :EclimEcho
|
||||
to see the response printed in vim.
|
||||
|
||||
Now that you know the basics, you can explore the many existing eclim
|
||||
commands found in the eclim source code to see detailed examples of
|
||||
how to access various eclipse features to expose them for use in vim
|
||||
or the editor of your choice.
|
||||
|
||||
You should also take a look at the eclim Plugins
|
||||
(|development-plugins|) documentation which documents how to create a
|
||||
new eclim plugin, including information on adding new eclim settings,
|
||||
managing the plugin's dependencies through its META-INF/MANIFEST.MF,
|
||||
etc.
|
||||
|
||||
vim:ft=eclimhelp
|
||||
257
.vim/bundle/eclim/eclim/doc/development/gettingstarted.txt
Normal file
257
.vim/bundle/eclim/eclim/doc/development/gettingstarted.txt
Normal file
|
|
@ -0,0 +1,257 @@
|
|||
*development-gettingstarted*
|
||||
|
||||
Developers Guide
|
||||
****************
|
||||
|
||||
This guide is intended for those who wish to contribute to eclim by
|
||||
fixing bugs or adding new functionality.
|
||||
|
||||
|
||||
Checking out the code and building it.
|
||||
======================================
|
||||
|
||||
|
||||
1. Check out the code:
|
||||
----------------------
|
||||
|
||||
>
|
||||
|
||||
$ git clone git://github.com/ervandew/eclim.git
|
||||
|
||||
<
|
||||
|
||||
|
||||
Note: If you are still using Eclipse 3.7 (Indigo) you will need to
|
||||
checkout the eclim indigo branch before attempting to build eclim:>
|
||||
|
||||
$ cd eclim
|
||||
$ git checkout indigo
|
||||
|
||||
<
|
||||
|
||||
|
||||
|
||||
2. Build eclim:
|
||||
---------------
|
||||
|
||||
>
|
||||
|
||||
$ cd eclim
|
||||
$ ant -Declipse.home=/your/eclipse/home/dir
|
||||
|
||||
<
|
||||
|
||||
|
||||
Note: If your eclipse home path contains a space, be sure to quote it:>
|
||||
|
||||
> ant "-Declipse.home=C:/Program Files/eclipse"
|
||||
|
||||
<
|
||||
|
||||
|
||||
This will build and deploy eclim to your eclipse and vim directories.
|
||||
|
||||
Note: If your vimfiles directory is not located at the default location
|
||||
for your OS, then you can specify the location using the "vim.files"
|
||||
property:>
|
||||
|
||||
$ ant -Dvim.files=<your vimfiles dir>
|
||||
|
||||
<
|
||||
|
||||
|
||||
When the build starts, it will first examine your eclipse installation
|
||||
to find what eclipse plugins are available. It will then use that list
|
||||
to determine which eclim features/plugins should be built and will
|
||||
output a list like the one below showing what will be built vs what
|
||||
will be skipped:
|
||||
|
||||
>
|
||||
|
||||
[echo] ${eclipse}: /opt/eclipse
|
||||
[echo] # Skipping org.eclim.adt, missing com.android.ide.eclipse.adt
|
||||
[echo] # Skipping org.eclim.dltk, missing org.eclipse.dltk.core
|
||||
[echo] # Skipping org.eclim.dltkruby, missing org.eclipse.dltk.ruby
|
||||
[echo] # Skipping org.eclim.pdt, missing org.eclipse.php
|
||||
[echo] Plugins:
|
||||
[echo] org.eclim.cdt
|
||||
[echo] org.eclim.jdt
|
||||
[echo] org.eclim.python
|
||||
[echo] org.eclim.sdt
|
||||
[echo] org.eclim.wst
|
||||
|
||||
<
|
||||
|
||||
|
||||
In this case we can see that four eclim plugins will be skipped along
|
||||
with the eclipse feature that would be required to build those
|
||||
plugins. If you see an eclipse feature in that list that you know you
|
||||
have, it may be the case that you installed it as a regular user, so
|
||||
that feature was installed in your user local eclipse directory. In
|
||||
that case you will need to notify the build of that directory so it
|
||||
can examine it as well (just replace the <version> portion below with
|
||||
the actual version found in your ~/.eclipse directory):
|
||||
|
||||
>
|
||||
|
||||
$ ant \
|
||||
-Declipse.home=/opt/eclipse \
|
||||
-Declipse.local=$HOME/.eclipse/org.eclipse.platform_<version>
|
||||
|
||||
<
|
||||
|
||||
|
||||
If you don't want to supply the eclipse home directory, or any other
|
||||
properties, on the command line every time you build eclim, you can
|
||||
create a user.properties file at the eclim source root and put all
|
||||
your properties in there:
|
||||
|
||||
>
|
||||
|
||||
$ vim user.properties
|
||||
eclipse.home=/opt/eclipse
|
||||
vim.files=${user.home}/.vim/bundle/eclim
|
||||
|
||||
<
|
||||
|
||||
|
||||
*coding-style*
|
||||
|
||||
|
||||
Coding Style
|
||||
============
|
||||
|
||||
When contributing code please try to adhere to the coding style of
|
||||
similar code so that eclim's source can retain consistency throughout.
|
||||
For java code, eclim includes a checkstyle configuration which can be
|
||||
run against the whole project:
|
||||
|
||||
>
|
||||
|
||||
$ ant checkstyle
|
||||
|
||||
<
|
||||
|
||||
|
||||
or against the current java file from within vim:
|
||||
|
||||
>
|
||||
|
||||
:Checkstyle
|
||||
|
||||
<
|
||||
|
||||
|
||||
*development-patches*
|
||||
|
||||
|
||||
Developing / Submitting Patches
|
||||
===============================
|
||||
|
||||
The preferred means of developing and submitting patches is to use a
|
||||
github fork. Github provides a nice guide to forking
|
||||
(http://help.github.com/forking/) which should get you started.
|
||||
|
||||
Although using a github fork is preferred, you can of course still
|
||||
submit patches via email using git's format-patch command:
|
||||
|
||||
>
|
||||
|
||||
$ git format-patch -M origin/master
|
||||
|
||||
<
|
||||
|
||||
|
||||
Running the above command will generate a series of patch files which
|
||||
can be submitted to the eclim development group
|
||||
(http://groups.google.com/group/eclim-dev).
|
||||
|
||||
|
||||
Building the eclim installer
|
||||
============================
|
||||
|
||||
It should be rare that someone should need to build the eclim
|
||||
installer, but should the need arise here are the instructions for
|
||||
doing so.
|
||||
|
||||
To build the installer you first need a couple external tools
|
||||
installed:
|
||||
|
||||
- sphinx (http://sphinx.pocoo.org): Sphinx is used to build the eclim
|
||||
documentation which is included in the installer.
|
||||
|
||||
Eclim also uses a custom sphinx theme which is included in eclim as
|
||||
a git submodule. So before you can build the installer you will need
|
||||
to initialize the submodule:
|
||||
|
||||
>
|
||||
$ git submodule init
|
||||
$ git submodule update
|
||||
|
||||
<
|
||||
|
||||
- graphviz (http://www.graphviz.org/): The docs include a few uml
|
||||
diagrams which are generated using plantuml
|
||||
(http://plantuml.sourceforge.net/) (included in the eclim source
|
||||
tree) which in turn requires graphviz (http://www.graphviz.org/).
|
||||
|
||||
- formic (http://github.com/ervandew/formic): The eclim installer has
|
||||
been developed using the formic framework, and requires it to build
|
||||
the installer distributables. Formic doesn't currently have an
|
||||
official release, so you'll need to check out the source code:
|
||||
|
||||
>
|
||||
$ git clone git://github.com/ervandew/formic.git
|
||||
|
||||
<
|
||||
|
||||
After checking out the code, you'll need to build the formic
|
||||
distribution:
|
||||
|
||||
>
|
||||
$ cd formic
|
||||
$ ant dist
|
||||
|
||||
<
|
||||
|
||||
Then extract the formic tar to the location of your choice
|
||||
|
||||
>
|
||||
$ tar -zxvf build/dist/formic-0.2.0.tar.gz -C /location/of/your/choice
|
||||
|
||||
<
|
||||
|
||||
Once you have installed the above dependencies, you can then build the
|
||||
eclim installer with the following command.
|
||||
|
||||
>
|
||||
|
||||
$ ant -Dformic.home=/your/formic/install/dir dist
|
||||
|
||||
<
|
||||
|
||||
|
||||
In lieu of supplying the formic home on the command line, you can
|
||||
instead put it in a user.properties file at the eclim source root:
|
||||
|
||||
>
|
||||
|
||||
$ vim user.properties
|
||||
formic.home=/your/formic/install/dir
|
||||
|
||||
<
|
||||
|
||||
|
||||
|
||||
What's Next
|
||||
===========
|
||||
|
||||
Now that you're familiar with the basics of building and patching
|
||||
eclim, the next step is to familiarize yourself with the eclim
|
||||
architecture and to review the detailed docs on how new features are
|
||||
added.
|
||||
|
||||
All of that and more can be found in the eclim development docs
|
||||
(|development-index|).
|
||||
|
||||
vim:ft=eclimhelp
|
||||
21
.vim/bundle/eclim/eclim/doc/development/index.txt
Normal file
21
.vim/bundle/eclim/eclim/doc/development/index.txt
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
*development-index*
|
||||
|
||||
Development Docs
|
||||
****************
|
||||
|
||||
Developers Guide (|development-gettingstarted|)
|
||||
|
||||
Architecture (|development-architecture|)
|
||||
Explains the underlying architecture that eclim utilizes including
|
||||
an overview of the call sequence from vim to eclipse.
|
||||
|
||||
Commands (|development-commands|)
|
||||
Details the process of adding a new command to vim which calls to
|
||||
corresponding implementation in eclipse.
|
||||
|
||||
Plugins (|development-plugins|)
|
||||
Details the process of adding a new plugin to eclim.
|
||||
|
||||
... More To Come
|
||||
|
||||
vim:ft=eclimhelp
|
||||
234
.vim/bundle/eclim/eclim/doc/development/plugins.txt
Normal file
234
.vim/bundle/eclim/eclim/doc/development/plugins.txt
Normal file
|
|
@ -0,0 +1,234 @@
|
|||
*development-plugins*
|
||||
|
||||
Plugins
|
||||
*******
|
||||
|
||||
Note: This guide is a work in progress. If in the process of writing a new
|
||||
plugin you find anything here that is unclear or missing, please
|
||||
don't hesitate to post to the eclim-dev
|
||||
(http://groups.google.com/group/eclim-dev) mailing list with
|
||||
questions, suggestions, etc.
|
||||
|
||||
To allow eclim to support different languages, eclim is broken up into
|
||||
eclipse plugins, each of which depend on a corresponding eclipse
|
||||
feature which provides support for that language. When you install or
|
||||
build eclim, it will examine your eclipse install to determine which
|
||||
features are available and will add the corresponding eclim plugins to
|
||||
expose those features. This page documents the core aspects of what
|
||||
goes into the creation of a new eclim plugin.
|
||||
|
||||
|
||||
Bootstrapping the plugin artifacts
|
||||
==================================
|
||||
|
||||
Eclim includes a set of templates to help you bootstrap a new plugin.
|
||||
To utilize them you can run the following ant target:
|
||||
|
||||
>
|
||||
|
||||
$ ant plugin.create
|
||||
|
||||
<
|
||||
|
||||
|
||||
You will be prompted to enter a name for this plugin along with some
|
||||
guidelines on choosing an appropriate name.
|
||||
|
||||
Once you've chosen a name, the plugin's directory structure will be
|
||||
created and populated with bare bones version of the required
|
||||
artifacts. Eclim's build.xml file will also be updated to include a
|
||||
target to the new plugin's unit test target.
|
||||
|
||||
|
||||
Updating the initial artifacts
|
||||
==============================
|
||||
|
||||
After you've bootstrapped your plugin, you can now start updating the
|
||||
generated artifacts:
|
||||
|
||||
|
||||
build_<plugin_name>.gant
|
||||
------------------------
|
||||
|
||||
The first file you'll need to modify is a gant file for your plugin.
|
||||
The main eclim build.gant script will load this file during the build
|
||||
process to determine what the plugin's eclipse dependency is, so it
|
||||
knows whether it can be built against the target eclipse install. So
|
||||
the first thing we need to do is to fill in that information by
|
||||
updating the feature_<plugin_name> variable with the name of the
|
||||
eclipse feature that this plugin depends on. For example, the eclim
|
||||
jdt plugin has this set to 'org.eclipse.jdt'. The build script will
|
||||
look in the features directory of your eclipse install (including the
|
||||
dropins and your user local eclipse dir if set), to find this feature,
|
||||
so the value you set, must be found in one of those locations (the
|
||||
version suffixes will be removed from the features in order to match
|
||||
it against the value you've set).
|
||||
|
||||
You'll also notice that there is a unit test target in the gant file.
|
||||
You can ignore that for now.
|
||||
|
||||
|
||||
META-INF/MANIFEST.MF
|
||||
--------------------
|
||||
|
||||
The next file to note is the plugin's META-INF/MANIFEST.MF. This is
|
||||
the file that eclipse will use to determine how to load the bundle and
|
||||
what to include in its classpath. The only part of this file that you
|
||||
should edit is the Require-Bundle: section. This is a comma separated
|
||||
list of bundles (or plugins) which this bundle depends on. When this
|
||||
bundle is loaded only those bundles listed here will be available in
|
||||
the classpath. So when you start running commands you've written
|
||||
later, if you receive a ClassNotFoundException, that is likely due to
|
||||
the bundle containing that class not being listed in your plugin's
|
||||
Require-Bundle: list. At this point you probably don't know yet what
|
||||
bundles you need to add to this list. When you start writing commands
|
||||
for your plugin, you'll have to find out which bundles contain the
|
||||
classes imported from the eclipse plugin you are integrating with, and
|
||||
you'll need to add those bundles accordingly.
|
||||
|
||||
It's also worth noting that eclim provides a custom classpath
|
||||
container which scans the manifest of each eclim plugin and loads the
|
||||
required bundles of each into the classpath. So when adding new
|
||||
bundles, if you want validation, search, code completion, etc to work
|
||||
with classes from those new bundles, you'll have to restart the eclim
|
||||
daemon. While restarting can be annoying, this is generally better
|
||||
than having to add/remove entries from the .classpath file or worrying
|
||||
about one user having different bundle version numbers from another.
|
||||
|
||||
|
||||
PluginResources.java
|
||||
--------------------
|
||||
|
||||
At this point you'll typically need to start customizing your plugin's
|
||||
org.eclim.<name>/java/org/eclim/plugin/<name>/PluginResources.java
|
||||
file. Here is where you will map a short alias to the project nature,
|
||||
or natures, of the plugin you are integrating with, register a project
|
||||
manager for initializing project's for this plugin, register any
|
||||
plugin settings that users can configure, etc. You'll be doing all
|
||||
this inside of the initialize method which has been generated for you.
|
||||
|
||||
|
||||
Project Nature
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
You'll first need to find out where the plugin's nature id is defined.
|
||||
Here are some examples that should give you an idea of where to look:
|
||||
|
||||
- jdt: org.eclipse.jdt.core.JavaCore.NATURE_ID
|
||||
|
||||
- cdt:
|
||||
|
||||
- org.eclipse.cdt.core.CProjectNature.CNATURE_ID
|
||||
|
||||
- org.eclipse.cdt.core.CCProjectNature.CC_NATURE_ID
|
||||
|
||||
- dltkruby: org.eclipse.dltk.ruby.core.RubyNature.NATURE_ID
|
||||
|
||||
- adt: com.android.ide.eclipse.adt.AdtConstants.NATURE_DEFAULT
|
||||
|
||||
One way to find it is to open up the .project file in a project
|
||||
containing the nature, locate the fully qualified name in the
|
||||
<natures> section, then grep the plugin's code for that name.
|
||||
|
||||
Once you have the reference to the nature id, you can then create a
|
||||
public static variable called NATURE:
|
||||
|
||||
>
|
||||
|
||||
public static final String NATURE = SomeClass.NATURE_ID;
|
||||
|
||||
<
|
||||
|
||||
|
||||
You'll be using this constant as the key to register features for
|
||||
project containing this nature, but first we'll register a short alias
|
||||
for this nature since the actual nature id tends to be long and
|
||||
unstandardized, and we don't want users to have to type it out when
|
||||
creating projects from eclim:
|
||||
|
||||
>
|
||||
|
||||
ProjectNatureFactory.addNature("shortname", NATURE);
|
||||
|
||||
<
|
||||
|
||||
|
||||
|
||||
Project Manager
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
The next thing you'll probably need to do is to create a project
|
||||
manager for your project
|
||||
(org.eclim.<name>/java/org/eclim/plugin/<name>/project/SomeProjectManager.java).
|
||||
The project manager is responsible for performing any post create,
|
||||
update, delete, or refresh logic required for projects of this nature.
|
||||
This logic can include things such as creating an initial
|
||||
classpath/buildpath, validate the classpath/buildpath on update,
|
||||
forcing a full update of the search index on refresh, or any number of
|
||||
other things.
|
||||
|
||||
Overriding the create method will almost certainly be necessary, but
|
||||
the logic you'll need here varies widely. Finding what you'll need is
|
||||
a matter of digging through the parent plugin's source code, typically
|
||||
looking for the project creation wizard class, to see what it does to
|
||||
create a project of this nature and later comparing the created
|
||||
artifacts from your code against those of a project created from the
|
||||
eclipse gui. This can be a difficult hurdle to get past for someone
|
||||
doing this the first time, so please don't be shy about asking for
|
||||
help on the eclim-dev (http://groups.google.com/group/eclim-dev)
|
||||
mailing list.
|
||||
|
||||
Eclim does provide a couple ant tasks to at least help you to quickly
|
||||
extract any docs and source code found in your eclipse install:
|
||||
|
||||
- eclipse.doc: This target will extract any doc jars from your eclipse
|
||||
install to a 'doc' directory in your eclipse home (or user local
|
||||
eclipse home).
|
||||
|
||||
- eclipse.src: This target will extract any src jars from your eclipse
|
||||
install to a 'src' directory in your eclipse home (or user local
|
||||
eclipse home). If you download the sdk version of eclipse then the
|
||||
jdt and all the core eclipse source will be available. Some other
|
||||
plugins provide sdk versions which include the source code and this
|
||||
target can extract those as well, but some plugins don't seem to
|
||||
have this option when installing via eclipse's update manager (and
|
||||
may not include the source when installed from a system package
|
||||
manager). For those you can often download a zip version of their
|
||||
update site which should include source bundles. Once you've
|
||||
extracted that file, you can tell this target to extract source
|
||||
bundles from a specified directory. Here is an example of extracting
|
||||
the source from an unpacked dltk update site:
|
||||
|
||||
>
|
||||
$ ant -Dsrc.dir=/home/ervandew/downloads/dltk-core-5.0.0/plugins eclipse.src
|
||||
|
||||
<
|
||||
|
||||
Once you've created your project manager, you then map it to your
|
||||
plugin's nature inside of your PluginResources.initialize method like
|
||||
so:
|
||||
|
||||
>
|
||||
|
||||
ProjectManagement.addProjectManager(NATURE, new SomeProjectManager());
|
||||
|
||||
<
|
||||
|
||||
|
||||
|
||||
Project Settings
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
At this point you should have the minimum of what is needed for a new
|
||||
plugin. Hopefully you can now create new projects with your plugin's
|
||||
defined nature. The next step would be to start adding commands
|
||||
(|development-commands|) to provide validation, code completion, etc.
|
||||
The remaining items in this list are not required to continue. They
|
||||
provide you with the ability to setup your own preferences or to
|
||||
expose the parent plugin's defined preferences inside of vim. When
|
||||
you've come to the point that you need to work with preferences, then
|
||||
feel free to come back here and continue reading.
|
||||
|
||||
To Be Continued...
|
||||
|
||||
vim:ft=eclimhelp
|
||||
7
.vim/bundle/eclim/eclim/doc/development/tags
Normal file
7
.vim/bundle/eclim/eclim/doc/development/tags
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
coding-style gettingstarted.txt /*coding-style*
|
||||
development-architecture architecture.txt /*development-architecture*
|
||||
development-commands commands.txt /*development-commands*
|
||||
development-gettingstarted gettingstarted.txt /*development-gettingstarted*
|
||||
development-index index.txt /*development-index*
|
||||
development-patches gettingstarted.txt /*development-patches*
|
||||
development-plugins plugins.txt /*development-plugins*
|
||||
452
.vim/bundle/eclim/eclim/doc/eclimd.txt
Normal file
452
.vim/bundle/eclim/eclim/doc/eclimd.txt
Normal file
|
|
@ -0,0 +1,452 @@
|
|||
*eclimd*
|
||||
|
||||
The Eclim Daemon
|
||||
****************
|
||||
|
||||
*eclimd-headless*
|
||||
|
||||
|
||||
Headless eclipse server
|
||||
=======================
|
||||
|
||||
The most mature usage scenario that eclim provides, is the running of
|
||||
a headless eclipse server and communicating with that server inside of
|
||||
vim. Starting and stopping of the headless eclipse instance is
|
||||
detailed below.
|
||||
|
||||
Starting eclimd
|
||||
|
||||
Linux / Mac / BSD (and other unix based systems): To start eclimd from
|
||||
linux, simply execute the eclimd script found in your eclipse root
|
||||
directory: $ECLIPSE_HOME/eclimd
|
||||
|
||||
Note: When starting the eclim daemon, you must start it as the same user
|
||||
who will be running vim.
|
||||
|
||||
Windows: The easiest way to start eclimd in windows is to double click
|
||||
on the eclimd.bat file found in your eclipse root directory:
|
||||
%ECLIPSE_HOME%/eclimd.bat
|
||||
|
||||
Note: Even though an eclipse gui is not started in eclim's headless mode,
|
||||
eclipse still requires a running X server to function. To run
|
||||
eclimd on a truely headless server, please see the headless guide
|
||||
(|install-headless|).
|
||||
|
||||
Stopping eclimd
|
||||
|
||||
To cleanly shutdown eclim use any one of the following.
|
||||
|
||||
- From Vim:
|
||||
|
||||
>
|
||||
:ShutdownEclim
|
||||
|
||||
<
|
||||
|
||||
- From a console:
|
||||
|
||||
>
|
||||
$ $ECLIPSE_HOME/eclim -command shutdown
|
||||
|
||||
<
|
||||
|
||||
- Lastly you can use Ctrl-C at the console if you are running eclimd
|
||||
in the foreground, or issue a kill to the eclimd java process.
|
||||
|
||||
>
|
||||
$ kill *pid*
|
||||
|
||||
<
|
||||
|
||||
You will need to kill the java process since killing the eclimd or
|
||||
eclipse process will not do so. While eclim provides a shutdown
|
||||
hook to support a clean shutdown when the java process is killed in
|
||||
this manner, it is still recommended that you utilize one of the
|
||||
first two methods instead, and reserve this as a last resort. Also
|
||||
note that when killing the java process eclipse will pop up an alert
|
||||
dialog notifying you that the java process was terminated underneath
|
||||
it. This is nothing to be alarmed about.
|
||||
|
||||
*eclimd-headed*
|
||||
|
||||
|
||||
Headed eclipse server
|
||||
=====================
|
||||
|
||||
For users that find themselves periodically needing the eclipse gui,
|
||||
or otherwise wanting to keep the gui open while using eclim, there is
|
||||
support for running the eclim server inside of a headed eclipse
|
||||
instance.
|
||||
|
||||
Starting eclimd
|
||||
|
||||
The eclim daemon inside of eclipse is implemented as an eclipse view
|
||||
which can be found via:
|
||||
|
||||
Window ‣ Show View ‣ Other ‣ Eclim ‣ eclimd
|
||||
|
||||
The view will be opened in a new tab in the same pane as the
|
||||
"Problems" tab, as shown below.
|
||||
|
||||
[image]
|
||||
|
||||
Note: By default, if you open an instance of gvim from within eclipse, the
|
||||
eclimd view will be opened for you if necessary. This behavior is
|
||||
configurable via the Vimplugin preferences.
|
||||
|
||||
Stopping eclimd
|
||||
|
||||
As long as the eclimd tab is open then the eclim daemon will be
|
||||
running. Stopping the eclim daemon is just a matter of closing the
|
||||
eclimd tab. Also note that leaving the tab open and closing eclipse
|
||||
will shutdown the daemon as well, and on the next start of eclipse the
|
||||
tab will be opened, but the eclim daemon will not start until the tab
|
||||
is forced to display itself. In other words, the daemon will not start
|
||||
until the eclimd tab is the active tab in that group.
|
||||
|
||||
*gvim-embedded*
|
||||
|
||||
|
||||
Embedded gvim
|
||||
=============
|
||||
|
||||
Note: Embedding is only supported on Windows and Unix systems (where gvim
|
||||
is compiled with the gtk gui).Embedding of macvim for OSX is not
|
||||
supported since macvim does not currently have the ability to be
|
||||
embedded like gvim. Macvim can still be used to open files from
|
||||
eclipse, but macvim will open as an external editor. Also note that
|
||||
macvim snapshots 56 through 63 contain a bug
|
||||
(https://github.com/b4winckler/macvim/pull/22) where opening a file
|
||||
from eclipse will open an instance of macvim, but the file will not
|
||||
be loaded into that instance.
|
||||
|
||||
Another feature provided by eclim for those who prefer to work inside
|
||||
of the eclipse gui, is the embedding of gvim inside of eclipse. This
|
||||
feature is provided by an eclim local fork of vimplugin
|
||||
(http://vimplugin.org). The feature adds a new editor to eclipse
|
||||
which allows you to open files in gvim by right clicking the file name
|
||||
in the eclipse tree and then selecting:
|
||||
|
||||
Open With ‣ Vim
|
||||
|
||||
[image]
|
||||
|
||||
Please note that if you want to use supported eclipse features (code
|
||||
completion, validation, searching, etc.) from the embedded gvim
|
||||
editor, you must have the eclimd view open.
|
||||
|
||||
Note: If you'd like to have the embedded gvim editor as the default for
|
||||
one or more file types, you can configure it to be in your eclipse
|
||||
preferences:Window ‣ Preferences ‣ General ‣ Editors ‣ File
|
||||
Associations
|
||||
|
||||
The eclim installer should take care of locating your gvim
|
||||
installation for use inside of eclipse, but in the event that it could
|
||||
not locate it, you can set the location and other settings via the
|
||||
vimplugin preferences:
|
||||
|
||||
Window ‣ Preferences ‣ Vimplugin
|
||||
|
||||
For MacVim users on OSX, the eclim installer will attempt to locate
|
||||
MacVim's mvim script on your path. If it's not found you can set the
|
||||
location of that script in the Vimplugin preferences:
|
||||
|
||||
Eclipse ‣ Preferences ‣ Vimplugin
|
||||
|
||||
Note: If you have a non-eclim version of vimplugin installed you should
|
||||
remove it prior to using the eclim version.
|
||||
|
||||
Note: Some users have reported issues with the embedded gvim's command
|
||||
line being cut off or possible rendering issues when scrolling
|
||||
through the file. If you experience either of these issues, try
|
||||
adding the following to your vimrc file, which should hopefully
|
||||
resolve those problems:>
|
||||
|
||||
set guioptions-=m " turn off menu bar
|
||||
set guioptions-=T " turn off toolbar
|
||||
|
||||
<
|
||||
|
||||
|
||||
Additionally, some users have reported that gvim's left scrollbar
|
||||
may also need to be disabled:>
|
||||
|
||||
set guioptions-=L " turn off left scrollbar
|
||||
set guioptions-=l
|
||||
|
||||
<
|
||||
|
||||
|
||||
*eclim-gvim-embedded-focus*
|
||||
|
||||
Embedded gvim focus
|
||||
|
||||
In some windowing environments, the embedded gvim is treated more like
|
||||
a separate window. The result of this is that clicking the eclipse tab
|
||||
(or using tab focusing keyboard shortcuts) may focus that tab, but it
|
||||
won't focus the embedded gvim on that tab. Eclim adds a setting to
|
||||
vimplugin which when enabled, will attempt to simulate a click on the
|
||||
embedded gvim window to force it to focus:
|
||||
|
||||
Window ‣ Preferences ‣ Vimplugin ‣ Force gvim focus via automated
|
||||
click
|
||||
|
||||
*eclim-gvim-embedded-shortcuts*
|
||||
|
||||
Eclipse/Vim key shortcuts in embedded gvim
|
||||
|
||||
Depending on your OS and windowing system, when the embedded gvim has
|
||||
focus, you will fall into one of two groups:
|
||||
|
||||
1. In the first group of users, all key presses are received by
|
||||
eclipse prior to sending them to gvim.
|
||||
|
||||
For this group, when typing a possible key shortcut (ctrl-n for
|
||||
example), eclipse will first evaluate that key stroke to see if
|
||||
there are any eclipse key bindings registered. If there are, then
|
||||
eclipse will run the associated command and the key stroke is never
|
||||
sent to gvim. If no key binding is found, then eclipse will pass
|
||||
the key stroke through to gvim. What this means for you is that
|
||||
for any gvim key mappings that you use that have an eclipse key
|
||||
binding, they will not be evaluated inside of gvim. So, if you
|
||||
encounter this issue, you'll need to remap the keys in vim or
|
||||
eclipse. To remove the key binding from the eclipse side, simply
|
||||
open the "Keys" preferences page:
|
||||
|
||||
Window ‣ Preferences ‣ General ‣ Keys
|
||||
|
||||
Then find the entry in the list that corresponds with the key
|
||||
binding you want to remove, select it, and hit the "Unbind Command"
|
||||
button.
|
||||
|
||||
Note: By default eclim will auto-remove a couple of the standard
|
||||
eclipse bindings whenever an embedded gvim editor has focus and
|
||||
then restore them with a non-gvim editor gains focus:
|
||||
|
||||
- Ctrl+U: in eclipse this runs "Execute", but in gvim this is
|
||||
needed to run code completion (ex. ctrl-x ctrl-u).
|
||||
|
||||
- Ctrl+N: in eclipse this runs the "New" wizard, but in gvim this
|
||||
is also needed as a part of code completion, to scroll through
|
||||
the results.
|
||||
|
||||
- Ctrl+V: in eclipse this pastes text from the clipboard (though
|
||||
not into gvim), but in gvim this is needed for column wise
|
||||
visual selections.
|
||||
|
||||
- Ctrl+W: in eclipse this closes a tab, but in gvim this is
|
||||
needed to switch windows (ex. ctrl-w j).
|
||||
|
||||
- Ctrl+X: in eclipse this cuts a selection to the clipboard, but
|
||||
in gvim this is needed to start various insert completions (ex.
|
||||
ctrl-x ctrl-u).
|
||||
|
||||
*FeedKeys*
|
||||
|
||||
1. In the second group, all key presses are received by gvim and not
|
||||
evaluated at all by eclipse.
|
||||
|
||||
For this group of users, you may have an eclipse key shortcut that
|
||||
you like to use (Shift+Ctrl+R for example), but when you hit that
|
||||
key combination, it will be evaluated by gvim instead of eclipse.
|
||||
To remedy this situation, eclim provides a means to map eclipse
|
||||
shortcuts inside of gvim. To register a shortcut, simply add your
|
||||
mappings to your vimrc, gvimrc, or other standard gvim file like
|
||||
so:
|
||||
|
||||
>
|
||||
" maps Ctrl-F6 to eclipse's Ctrl-F6 key binding (switch editors)
|
||||
nmap <silent> <c-f6> :call eclim#vimplugin#FeedKeys('Ctrl+F6')<cr>
|
||||
|
||||
" maps Ctrl-F7 to eclipse's Ctrl-F7 key binding (switch views)
|
||||
nmap <silent> <c-f7> :call eclim#vimplugin#FeedKeys('Ctrl+F7')<cr>
|
||||
|
||||
" maps Ctrl-F to eclipse's Ctrl-Shift-R key binding (find resource)
|
||||
nmap <silent> <c-f> :call eclim#vimplugin#FeedKeys('Ctrl+Shift+R')<cr>
|
||||
|
||||
" maps Ctrl-M to eclipse's Ctrl-M binding to maximize the editor
|
||||
nmap <silent> <c-m> :call eclim#vimplugin#FeedKeys('Ctrl+M', 1)<cr>
|
||||
|
||||
<
|
||||
|
||||
The value supplied to the FeedKeys function must be an eclipse
|
||||
compatible key binding string as found in:
|
||||
|
||||
Windows ‣ Preferences ‣ General ‣ Keys
|
||||
|
||||
Be sure to notice the extra argument to the FeedKeys function in
|
||||
the last mapping. Supplying 1 as the arg will result in the
|
||||
refocusing of gvim after the eclipse key binding has been executed.
|
||||
|
||||
*eclimrc*
|
||||
|
||||
|
||||
~/.eclimrc
|
||||
==========
|
||||
|
||||
On unix platforms (linux, mac, bsd) eclim supports an optional
|
||||
.eclimrc file located in your home directory. In this file you may
|
||||
supply any system properties or vm args which you would like passed to
|
||||
eclimd at startup. The format of this file is the same as the
|
||||
standard java properties file format with the exception of any vm args
|
||||
which you would like to include.
|
||||
|
||||
Ex.
|
||||
|
||||
>
|
||||
|
||||
# Bind eclimd to all interfaces
|
||||
nailgun.server.host=0.0.0.0
|
||||
|
||||
# Specifies the port that nailgun / eclimd listens on for client requests.
|
||||
nailgun.server.port=10012
|
||||
|
||||
# Specifies the workspace directory to use
|
||||
# See $ECLIPSE_HOME/configuration/config.ini for other osgi properties.
|
||||
osgi.instance.area.default=@user.home/myworkspace
|
||||
|
||||
# increase heap size
|
||||
-Xmx256M
|
||||
|
||||
# increase perm gen size
|
||||
-XX:PermSize=64m
|
||||
-XX:MaxPermSize=128m
|
||||
|
||||
<
|
||||
|
||||
|
||||
The eclim client will also utilize this file, but only to determine
|
||||
the nailgun server port should you choose to change the default.
|
||||
|
||||
Note: Your system must have perl and sed available so that eclim can
|
||||
process your .eclimrc file.
|
||||
|
||||
Both the eclim and eclimd scripts also support a -f argument allowing
|
||||
you to specify an alternate location for your .eclimrc:
|
||||
|
||||
>
|
||||
|
||||
$ eclimd -f ~/.my_eclimrc
|
||||
$ eclim -f ~/.my_eclimrc -command ping
|
||||
|
||||
<
|
||||
|
||||
|
||||
|
||||
eclimd logging
|
||||
==============
|
||||
|
||||
Eclimd utilizes log4j for all of its logging. As such, the logging
|
||||
can be configured via the
|
||||
$ECLIPSE_HOME/plugins/org.eclim_version/log4j.xml file.
|
||||
|
||||
By default, eclimd writes all logging info to both the console and to
|
||||
a log file in your workspace: <workspace>/eclimd.log
|
||||
|
||||
*eclimd-multiworkspace*
|
||||
|
||||
|
||||
Multiple Workspaces
|
||||
===================
|
||||
|
||||
Running eclim against more than one eclipse workspace can be
|
||||
accomplished by running multiple eclimd instances. You must configure
|
||||
each instance to run nailgun on a unique port and supply the path to
|
||||
the workspace you which that instance to use. Once your eclimd
|
||||
instances are up and running the vim client will automatically
|
||||
determine which server to send requests to based on your context. In
|
||||
some cases you may be prompted for which workspace to use if one
|
||||
cannot be determined for you.
|
||||
|
||||
Below are some different ways in which you can configure your eclimd
|
||||
instances:
|
||||
|
||||
1. All Users: Supply the nailgun port and eclipse workspace path when
|
||||
starting eclimd:
|
||||
|
||||
>
|
||||
$ eclimd -Dosgi.instance.area.default=@user.home/workspace1 -Dnailgun.server.port=9091
|
||||
$ eclimd -Dosgi.instance.area.default=@user.home/workspace2 -Dnailgun.server.port=9092
|
||||
|
||||
<
|
||||
|
||||
If you are using the eclimd view in the eclipse gui, then you can
|
||||
start the eclipse gui with the desired nailgun server port (note
|
||||
that you must place the -vmargs option before the list of jvm
|
||||
arguments):
|
||||
|
||||
>
|
||||
$ eclipse -vmargs -Dnailgun.server.port=9092
|
||||
|
||||
<
|
||||
|
||||
2. Linux, OSX, BSD Users: Specify the port and workspace in eclimrc
|
||||
files and start eclimd with the -f argument:
|
||||
|
||||
>
|
||||
$ vim ~/.eclimrc1
|
||||
osgi.instance.area.default=@user.home/workspace1
|
||||
nailgun.server.port=9091
|
||||
|
||||
$ vim ~/.eclimrc2
|
||||
osgi.instance.area.default=@user.home/workspace2
|
||||
nailgun.server.port=9092
|
||||
|
||||
$ eclimd -f ~/.eclimrc1
|
||||
$ eclimd -f ~/.eclimrc2
|
||||
|
||||
<
|
||||
|
||||
Note: The -f argument is not supported by eclipse so the above option
|
||||
is only available when using a headless eclimd instance.
|
||||
|
||||
3. Windows Users: Create Windows shortcuts:
|
||||
|
||||
- In Windows Explorer, open your eclipse folder.
|
||||
|
||||
- Hold down the right mouse button and drag the eclimd.bat file to
|
||||
where you want the shortcut to exist (like your desktop) and
|
||||
release the right mouse button.
|
||||
|
||||
- Choose "Create Shortcut(s) Here"
|
||||
|
||||
- Right click the shortcut and choose "Properties"
|
||||
|
||||
- On the "Shortcut" tab edit the "Target:" field and append:
|
||||
-Dosgi.instance.area.default=@user.home/workspace1 -Dnailgun.server.port=9091
|
||||
|
||||
- Repeat this process for your other workspaces.
|
||||
|
||||
*eclimd-extdir*
|
||||
|
||||
|
||||
Hosting third party nailgun apps in eclimd
|
||||
==========================================
|
||||
|
||||
Since nailgun provides a simple way to alleviate the startup cost of
|
||||
the jvm, other projects utilize it as well. However, running several
|
||||
nailgun servers isn't ideal, so eclim supports hosting other nailgun
|
||||
apps via an ext dir where you can drop in jar files which will be made
|
||||
available to eclim's nailgun server.
|
||||
|
||||
The ext dir that eclim reads from is located in your vim files
|
||||
directory:
|
||||
|
||||
Linux / BSD / OSX:
|
||||
|
||||
>
|
||||
|
||||
~/.eclim/resources/ext
|
||||
|
||||
<
|
||||
|
||||
|
||||
Windows:
|
||||
|
||||
>
|
||||
|
||||
$HOME/.eclim/resources/ext
|
||||
|
||||
<
|
||||
|
||||
vim:ft=eclimhelp
|
||||
373
.vim/bundle/eclim/eclim/doc/faq.txt
Normal file
373
.vim/bundle/eclim/eclim/doc/faq.txt
Normal file
|
|
@ -0,0 +1,373 @@
|
|||
*faq*
|
||||
|
||||
FAQ / Troubleshooting
|
||||
*********************
|
||||
|
||||
|
||||
FAQ
|
||||
===
|
||||
|
||||
*eclim_workspace*
|
||||
|
||||
|
||||
How do I tell eclim which eclipse workspace to use?
|
||||
---------------------------------------------------
|
||||
|
||||
To configure the workspace you can start eclimd like so:
|
||||
|
||||
>
|
||||
|
||||
$ eclimd -Dosgi.instance.area.default=@user.home/another_workspace
|
||||
|
||||
<
|
||||
|
||||
|
||||
Note the system property osgi.instance.area.default, which is used to
|
||||
specify the location of your workspace. Also note the variable
|
||||
@user.home which will be replaced with your home directory at runtime.
|
||||
|
||||
If you are running a unix variant (linux, mac osx, bsd, etc.) then you
|
||||
can specify the above system property in the .eclimrc file in your
|
||||
home directory.
|
||||
|
||||
>
|
||||
|
||||
$ echo "osgi.instance.area.default=@user.home/another_workspace" >> ~/.eclimrc
|
||||
|
||||
<
|
||||
|
||||
|
||||
*eclimd_options_windows*
|
||||
|
||||
For Windows users there are a couple alternatives to the unsupported
|
||||
.eclimrc:
|
||||
|
||||
1. Your first option is to add a new environment variable:
|
||||
|
||||
- Windows 2000: Control Panel ‣ System ‣ Advanced ‣ Environment Variables
|
||||
Windows XP: Control Panel ‣ Performance And Maintenance ‣ System ‣ Advanced ‣ Environment Variables
|
||||
|
||||
- Under "User variables..." click "New..."
|
||||
Variable Name: ECLIMD_OPTS
|
||||
Variable Value: -Dosgi.instance.area.default=@user.home/another_workspace
|
||||
|
||||
- Then you can start eclimd as normal (via the eclimd.bat file).
|
||||
|
||||
2. The second option is to create a shortcut to the eclimd.bat file:
|
||||
|
||||
- In Windows Explorer, open your eclipse folder.
|
||||
|
||||
- Hold down the right mouse button and drag the eclimd.bat file to
|
||||
where you want the shortcut to exist (like your desktop) and
|
||||
release the right mouse button.
|
||||
|
||||
- Choose "Create Shortcut(s) Here"
|
||||
|
||||
- Right click the shortcut and choose "Properties"
|
||||
|
||||
- On the "Shortcut" tab edit the "Target:" field and append:
|
||||
-Dosgi.instance.area.default=@user.home/another_workspace
|
||||
|
||||
*eclim_proxy*
|
||||
|
||||
|
||||
How can I configure eclim to use a proxy?
|
||||
-----------------------------------------
|
||||
|
||||
The occasional eclim feature requires network access to function
|
||||
properly. For example, xml validation may require validating the file
|
||||
against a dtd or xsd located remotely. If you are behind a proxy then
|
||||
you may need to provide eclim with the necessary proxy settings.
|
||||
|
||||
>
|
||||
|
||||
$ eclimd -Dhttp.proxyHost=my.proxy -Dhttp.proxyPort=8080
|
||||
|
||||
<
|
||||
|
||||
|
||||
If you are running a unix variant (linux, mac osx, bsd, etc.) then you
|
||||
can specify the above system property in the .eclimrc file in your
|
||||
home directory.
|
||||
|
||||
>
|
||||
|
||||
$ echo -e "http.proxyHost=my.proxy\nhttp.proxyPort=8080" >> ~/.eclimrc
|
||||
|
||||
<
|
||||
|
||||
|
||||
If your proxy requires authentication, you'll need to supply the
|
||||
-Dhttp.proxyUser and -Dhttp.proxyPassword properties as well.
|
||||
|
||||
On Windows systems you can use the same steps described above, for
|
||||
setting the workspace location, to also set the proxy settings.
|
||||
|
||||
*eclim_memory*
|
||||
|
||||
|
||||
How do I specify jvm memory arguments for eclim (fix OutOfMemory errors).
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
If you are using the headless version of eclimd, then you have a
|
||||
couple options:
|
||||
|
||||
1. pass the necessary jvm args to eclimd. For example, to increase the
|
||||
heap size:
|
||||
|
||||
>
|
||||
$ eclimd -Xmx256M
|
||||
|
||||
<
|
||||
|
||||
2. if you are using a unix variant, then you can add the necessary vm
|
||||
args to a .eclimrc file in your home directory.
|
||||
|
||||
>
|
||||
# increase heap size
|
||||
-Xmx256M
|
||||
|
||||
# increase perm gen size
|
||||
-XX:PermSize=64m
|
||||
-XX:MaxPermSize=128m
|
||||
|
||||
<
|
||||
|
||||
On Windows systems you can use the same steps described above, for
|
||||
setting the workspace location, to also specify the jvm memory
|
||||
args.
|
||||
|
||||
If you are using the headed version of eclimd, then setting the jvm
|
||||
memory arguments for eclim is the same procedure as setting them for
|
||||
eclipse. Details can be found on the eclipse wiki
|
||||
(http://wiki.eclipse.org/Eclipse.ini).
|
||||
|
||||
*eclim_troubleshoot*
|
||||
|
||||
|
||||
How do I troubleshoot features not functioning, or errors encountered?
|
||||
----------------------------------------------------------------------
|
||||
|
||||
For troubleshooting eclim, please see the dedicated troubleshooting
|
||||
section below.
|
||||
|
||||
*eclim_full_headless*
|
||||
|
||||
|
||||
How can I run eclimd on a truly headless server?
|
||||
------------------------------------------------
|
||||
|
||||
Please see the headless guide (|install-headless|).
|
||||
|
||||
*eclim_encoding*
|
||||
|
||||
|
||||
How can I set the default encoding used by eclipse/eclimd?
|
||||
----------------------------------------------------------
|
||||
|
||||
To set the default encoding you can set the file.encoding system
|
||||
property according to your setup:
|
||||
|
||||
1. Headless eclimd users on any unix variant (Linux, OSX, etc) can
|
||||
simply add the property your .eclimrc file in your home directory:
|
||||
|
||||
>
|
||||
# set the default file encoding
|
||||
file.encoding=utf-8
|
||||
|
||||
<
|
||||
|
||||
2. Headless eclimd users on Windows can add the system property (eg.
|
||||
-Dfile.encoding=utf-8) using the same steps described above, for
|
||||
setting the workspace location.
|
||||
|
||||
3. Headed eclimd users can add the system property (eg.
|
||||
-Dfile.encoding=utf-8) to your eclipse.ini file found in your
|
||||
eclipse install's root directory. Be sure to add the property on a
|
||||
new line after the -vmargs line:
|
||||
|
||||
>
|
||||
...
|
||||
-vmargs
|
||||
...
|
||||
-Dfile.encoding=utf-8
|
||||
|
||||
<
|
||||
|
||||
You can read more about the eclipse.ini file on the eclipse wiki
|
||||
(http://wiki.eclipse.org/Eclipse.ini).
|
||||
|
||||
*troubleshooting*
|
||||
|
||||
|
||||
Troubleshooting
|
||||
===============
|
||||
|
||||
The purpose of this guide is to serve as a means to help troubleshoot
|
||||
common issues encountered when getting start with eclim, or providing
|
||||
information if you've discovered a possible bug.
|
||||
|
||||
The first thing to note is that as of eclim 1.6.1, errors raised by
|
||||
eclimd when executing an autocmd from vim, like validating a file on
|
||||
write, are no longer echoed as errors to the user. Instead these
|
||||
errors are logged and only displayed if your eclim log level is set to
|
||||
a relevant level. You can set the log level at any time by running:
|
||||
|
||||
>
|
||||
|
||||
:let g:EclimLogLevel = 10
|
||||
|
||||
<
|
||||
|
||||
|
||||
in vim, which in this case sets the logging to verbose (the default
|
||||
log level is 4). After setting the log level any external commands
|
||||
that are run or autocmd errors encountered will be printed (you may
|
||||
need to run :messages to see them all).
|
||||
|
||||
Below are a series of sections broken up by the behavior (or lack of)
|
||||
experienced and the steps for diagnosing the cause of that behavior.
|
||||
|
||||
If you can't find the answer to your question here, be sure to take a
|
||||
look at the faq to see if your question is answered there.
|
||||
|
||||
*ts_workspace*
|
||||
|
||||
|
||||
Eclim does not recognize any of my existing projects.
|
||||
-----------------------------------------------------
|
||||
|
||||
A fairly common occurrence for users new to eclim, is that after
|
||||
starting eclimd and then attempting to execute some project dependent
|
||||
functionality, the functionality appears to do nothing or eclim
|
||||
complains that the project could not be determined. If you have
|
||||
existing projects created in eclipse and eclim is not finding them,
|
||||
then the likely cause is that your projects are located in a
|
||||
non-default workspace location.
|
||||
|
||||
For the answer to how to specify the location of your workspace when
|
||||
starting eclimd, please see the faq devoted to this.
|
||||
|
||||
*ts_completion*
|
||||
|
||||
|
||||
I'm editing a [java, python, php, etc] file and code completion doesn't work.
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
- If you receive the message "E764: Option 'completefunc' is not set",
|
||||
please see the file type section below.
|
||||
|
||||
- Next step is to make sure that the current file is in an eclipse
|
||||
project by running the following command in the vim windows
|
||||
containing the file you are working on.
|
||||
|
||||
>
|
||||
:ProjectInfo
|
||||
|
||||
<
|
||||
|
||||
If that returns an error that it is unable to determine the project,
|
||||
then see the workspace section above or the guide on creating a new
|
||||
project (|gettingstarted-create|).
|
||||
|
||||
- If the correct project info is found, then try running the
|
||||
completion again, if it still doesn't return any results run the
|
||||
command:
|
||||
|
||||
>
|
||||
:messages
|
||||
|
||||
<
|
||||
|
||||
This will print out any messages that you might have missed. If you
|
||||
see an error regarding a java exception while running a command then
|
||||
see the section on troubleshooting exceptions.
|
||||
|
||||
*ts_ftplugin*
|
||||
|
||||
|
||||
I'm editing a [java, python, php, etc] file and none of the file type commands exist.
|
||||
-------------------------------------------------------------------------------------
|
||||
|
||||
This usually indicates that you don't have file type plugins enabled
|
||||
in vim. To check you can run:
|
||||
|
||||
>
|
||||
|
||||
:EclimValidate
|
||||
|
||||
<
|
||||
|
||||
|
||||
If it complains about filetype plugin support not being found, then
|
||||
follow its directions on adding the following to your vimrc:
|
||||
|
||||
>
|
||||
|
||||
filetype plugin indent on
|
||||
|
||||
<
|
||||
|
||||
|
||||
*ts_signs_misplaced*
|
||||
|
||||
|
||||
Code validation signs are showing up on the wrong lines.
|
||||
--------------------------------------------------------
|
||||
|
||||
This is most likely a result of eclipse being setup to use a different
|
||||
file encoding than vim, most likely cp1251 (windows-1251) vs utf-8.
|
||||
You should be able to resolve this issue by setting eclipse's default
|
||||
encoding accordingly.
|
||||
|
||||
If you're unsure what encoding to use, try using utf-8.
|
||||
|
||||
*ts_exception*
|
||||
|
||||
|
||||
I received a java exception "while executing command" message.
|
||||
--------------------------------------------------------------
|
||||
|
||||
If you receive a java exception while performing some action in vim,
|
||||
it should also include a message indicating the issue. However, if
|
||||
you receive something like a NullPointerException or some other
|
||||
exception which doesn't include a helpful message, then you may have
|
||||
encountered a bug.
|
||||
|
||||
Once you've encountered this type of issue, the first step it to get
|
||||
more details which you can do by enabling eclim debugging in vim:
|
||||
|
||||
>
|
||||
|
||||
:let g:EclimLogLevel = 10
|
||||
|
||||
<
|
||||
|
||||
|
||||
Then you can perform the same action that triggered the error again.
|
||||
This time you should receive the full stack trace of the error.
|
||||
|
||||
Once you've obtained the stack trace, the next step it to send it to
|
||||
the eclim-user (http://groups.google.com/group/eclim-user) mailing
|
||||
list along with a description of what you were doing when the error
|
||||
occurred, as well as the OS you are on, and whether you were using
|
||||
eclimd headless or headed (inside of the eclipse gui).
|
||||
|
||||
*ts_incompatible_plugins*
|
||||
|
||||
|
||||
Incompatible Plugins
|
||||
--------------------
|
||||
|
||||
There are some third party eclipse plugins which currently may
|
||||
interfere with eclim. Below is a list of these known plugin
|
||||
incompatibilities.
|
||||
|
||||
- Spring IDE: At least one user has reported that eclim's java
|
||||
validation no longer works after installing the Spring IDE.
|
||||
|
||||
- viPlugin: Attempting to open a file using the embedded gvim support
|
||||
fails if viPlugin is installed. This issue has been reported on the
|
||||
viPlugin site.
|
||||
|
||||
vim:ft=eclimhelp
|
||||
181
.vim/bundle/eclim/eclim/doc/features.txt
Normal file
181
.vim/bundle/eclim/eclim/doc/features.txt
Normal file
|
|
@ -0,0 +1,181 @@
|
|||
*features*
|
||||
|
||||
Features
|
||||
********
|
||||
|
||||
The following is a partial list of eclim features with much more still
|
||||
to come. For more details please see the detailed documentation
|
||||
(|vim-index|). For a more comprehensive list you can also visit the
|
||||
cheatsheet (|cheatsheet|).
|
||||
|
||||
|
||||
Eclipse Projects
|
||||
================
|
||||
|
||||
- Create, update, and delete Eclipse projects.
|
||||
|
||||
- Easily manage Eclipse .classpath files (support for maven and ivy).
|
||||
|
||||
- Quickly and easily manage settings globally or on a project basis.
|
||||
|
||||
|
||||
C/C++
|
||||
=====
|
||||
|
||||
- Context sensitive code completion.
|
||||
|
||||
- Searching.
|
||||
|
||||
- Source code validation.
|
||||
|
||||
|
||||
Css
|
||||
===
|
||||
|
||||
- Context sensitive code completion.
|
||||
|
||||
- Source code validation.
|
||||
|
||||
|
||||
Html
|
||||
====
|
||||
|
||||
- Context sensitive code completion.
|
||||
|
||||
- Automatic validation (w/ visual marking of errors and warnings).
|
||||
|
||||
|
||||
Java
|
||||
====
|
||||
|
||||
- Automatic source code validation (w/ visual marking of errors and
|
||||
warnings).
|
||||
|
||||
- Context sensitive code completion.
|
||||
|
||||
- Code correction suggestions with option to apply a suggestion.
|
||||
|
||||
- Class constructor generation.
|
||||
|
||||
- Java Bean getter and setter generation.
|
||||
|
||||
- Generation of delegate methods.
|
||||
|
||||
- Java source and java doc searching capabilities.
|
||||
|
||||
- Generate stub methods from implemented interfaces or super classes.
|
||||
|
||||
- Generate stub methods for junit testing.
|
||||
|
||||
- Quickly clean and sort imports and easily import new classes.
|
||||
|
||||
- Automatic generation of logging initialization code, upon first
|
||||
usage of a logger.
|
||||
|
||||
- Javadoc generation for package, class, field, method, etc.
|
||||
|
||||
- Java regular expression testing.
|
||||
|
||||
- Support for Checkstyle.
|
||||
|
||||
- Validation of log4j xml files.
|
||||
|
||||
|
||||
Android
|
||||
-------
|
||||
|
||||
- Support for creating android projects from vim.
|
||||
|
||||
|
||||
Ant
|
||||
---
|
||||
|
||||
- Ant execution from any file.
|
||||
|
||||
- Context sensitive code completion when editing build files.
|
||||
|
||||
- Automatic validation of build files (w/ visual marking of errors and
|
||||
warnings).
|
||||
|
||||
- Quick access to ant documentation.
|
||||
|
||||
|
||||
Maven
|
||||
-----
|
||||
|
||||
- Maven execution from any file.
|
||||
|
||||
- Maven repository searching and ability to add results to pom file.
|
||||
|
||||
|
||||
JavaScript
|
||||
==========
|
||||
|
||||
- File validation using jsl (http://www.javascriptlint.com/).
|
||||
|
||||
|
||||
Php
|
||||
===
|
||||
|
||||
- Code completion.
|
||||
|
||||
- Searching.
|
||||
|
||||
- Source code validation.
|
||||
|
||||
|
||||
Python
|
||||
======
|
||||
|
||||
- Context sensitive code completion.
|
||||
|
||||
- Find element definition support.
|
||||
|
||||
- Regular expression testing.
|
||||
|
||||
- Django functionality.
|
||||
|
||||
- Validation via python compiler, pyflakes
|
||||
(http://www.divmod.org/trac/wiki/DivmodPyflakes), and pylint
|
||||
(http://www.logilab.org/857).
|
||||
|
||||
|
||||
Ruby
|
||||
====
|
||||
|
||||
- Context sensitive code completion.
|
||||
|
||||
- Searching.
|
||||
|
||||
- Source code validation.
|
||||
|
||||
|
||||
Vim Script
|
||||
==========
|
||||
|
||||
- Find user defined command, function, or global variable declarations
|
||||
/ references.
|
||||
|
||||
- Quickly lookup help topic for a keyword, functions, command, etc.
|
||||
|
||||
|
||||
Xml / Dtd / Xsd
|
||||
===============
|
||||
|
||||
- Automatic validation (w/ visual marking of errors and warnings).
|
||||
|
||||
- Quickly look up element definition from the current xml file's dtd
|
||||
or xsd.
|
||||
|
||||
- Context sensitive code completion.
|
||||
|
||||
|
||||
Common Vim Functionality
|
||||
========================
|
||||
|
||||
- Commands to locate a project, workspace, or current file relative
|
||||
file and open it (split, edit, or tabnew).
|
||||
|
||||
- Much more...
|
||||
|
||||
vim:ft=eclimhelp
|
||||
54
.vim/bundle/eclim/eclim/doc/gettinghelp.txt
Normal file
54
.vim/bundle/eclim/eclim/doc/gettinghelp.txt
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
*gettinghelp*
|
||||
|
||||
Getting Help
|
||||
************
|
||||
|
||||
|
||||
Mailing Lists
|
||||
=============
|
||||
|
||||
If at any time you have any questions or feedback, feel free to post
|
||||
to one of the eclim mailing lists:
|
||||
|
||||
- eclim-user (http://groups.google.com/group/eclim-user): For all
|
||||
questions regarding installation, usage, troubleshooting, etc.
|
||||
|
||||
- eclim-dev (http://groups.google.com/group/eclim-dev): For all eclim
|
||||
development related discussions.
|
||||
|
||||
|
||||
IRC (#eclim on freenode.net)
|
||||
============================
|
||||
|
||||
If you would like to get help or ask questions on IRC, then feel free
|
||||
to join #eclim on freenode.net. Please note that I (Eric Van
|
||||
Dewoestine, ervandew on irc) try to stay in the channel as much as
|
||||
possible, but I might not be available to answer questions
|
||||
immediately. It's also worth noting that I live in California, so if
|
||||
you are in Europe, Asia, or some other timezone whose normal waking
|
||||
hours don't overlap well with mine, then you may be better off getting
|
||||
help using one of the mailing lists above.
|
||||
|
||||
|
||||
Reporting Bugs
|
||||
==============
|
||||
|
||||
If you've found a bug please report the issue to either the eclim-dev
|
||||
(http://groups.google.com/group/eclim-dev) mailing list or create a
|
||||
new issue on eclim's github issue tracker
|
||||
(http://github.com/ervandew/eclim/issues).
|
||||
|
||||
When reporting a bug, please include the following information:
|
||||
|
||||
- What OS are you on?
|
||||
|
||||
- Linux users: please include the distro and version.
|
||||
|
||||
- What version of eclim, vim, and eclipse are you using?
|
||||
|
||||
- Linux users: please indicate whether you installed eclipse via
|
||||
your distro's package manager or not, and if not, please indicate
|
||||
what distribution of eclipse you are using ("Eclipse Classic",
|
||||
"Eclipse IDE for C/C++ Developers", some other eclipse bundle).
|
||||
|
||||
vim:ft=eclimhelp
|
||||
352
.vim/bundle/eclim/eclim/doc/gettingstarted.txt
Normal file
352
.vim/bundle/eclim/eclim/doc/gettingstarted.txt
Normal file
|
|
@ -0,0 +1,352 @@
|
|||
*gettingstarted*
|
||||
|
||||
Getting Started
|
||||
***************
|
||||
|
||||
Once you've installed (|install|) eclim, the next step is to create
|
||||
your first project after which you can then start writing code and
|
||||
familiarizing yourself with eclim's features.
|
||||
|
||||
First make sure eclimd is running (see the eclimd docs (|eclimd|) if
|
||||
you are unsure how to start eclimd).
|
||||
|
||||
*gettingstarted-create*
|
||||
|
||||
|
||||
Creating your first project
|
||||
===========================
|
||||
|
||||
Once you've got eclimd running, open an instance of vim and create
|
||||
your project like so:
|
||||
|
||||
Note: Android Users: the android section below contains additional info
|
||||
regarding the creation of android projects.Maven Users: you may
|
||||
refer to the maven section below for an alternate way to create a
|
||||
java project.
|
||||
|
||||
>
|
||||
|
||||
:ProjectCreate /path/to/my_project -n java
|
||||
|
||||
<
|
||||
|
||||
|
||||
This example creates a project with a java nature (-n java), but the
|
||||
same method can be used to create a project for other languages by
|
||||
simply changing the nature accordingly:
|
||||
|
||||
>
|
||||
|
||||
:ProjectCreate /path/to/my_java_project -n android
|
||||
:ProjectCreate /path/to/my_c_project -n c
|
||||
:ProjectCreate /path/to/my_cpp_project -n c++
|
||||
:ProjectCreate /path/to/my_java_project -n java
|
||||
:ProjectCreate /path/to/my_php_project -n php
|
||||
:ProjectCreate /path/to/my_python_project -n none
|
||||
:ProjectCreate /path/to/my_ruby_project -n ruby
|
||||
|
||||
<
|
||||
|
||||
|
||||
The only odd ball in the bunch is the creation of the python project
|
||||
which currently uses the 'none' nature.
|
||||
|
||||
The path supplied to the |:ProjectCreate| command will be the path to
|
||||
the root of your project. This path may or may not exist. If it does
|
||||
not exist it will be created for you. After you've created your
|
||||
project, there will be a .project file added to your project's root
|
||||
along with another file where references to your project's source
|
||||
directories and any third party libraries your project uses reside.
|
||||
The name of this file will vary depending on your project's nature,
|
||||
but in all cases eclim will provide you with commands to manage this
|
||||
file:
|
||||
|
||||
- java, android - .classpath file (|vim-java-classpath|)
|
||||
|
||||
- php, ruby - .buildpath file (|vim-dltk-buildpath|)
|
||||
|
||||
- c, c++ - .cproject, managed via the |:CProjectConfigs| command
|
||||
|
||||
- python - .ropeproject (see the rope docs (|python-rope|))
|
||||
|
||||
Once you've created your project you can use the :ProjectList command
|
||||
to list the available projects and you should see your newly created
|
||||
one in the list.
|
||||
|
||||
>
|
||||
|
||||
my_project - open - /path/to/my_project
|
||||
|
||||
<
|
||||
|
||||
|
||||
The :ProjectList result is in the form of projectName - (open|closed)
|
||||
- /project/root/path. When you create projects, the last path element
|
||||
will be used for the project name. If that element contains any
|
||||
spaces, these will be converted to underscores.
|
||||
|
||||
|
||||
Adding project source directories
|
||||
=================================
|
||||
|
||||
Before you can start writing code, you will first need to create and
|
||||
register your project's source directories. If you created your
|
||||
project from an existing code base, then this step may have been
|
||||
perform automatically for you, but you should validate the settings to
|
||||
be sure.
|
||||
|
||||
We will use a java project in this example but the steps for other
|
||||
languages are very similar. Please see the relevant docs for your
|
||||
language for more details:
|
||||
|
||||
- java and android (|vim-java-classpath|)
|
||||
|
||||
- php and ruby (|vim-dltk-buildpath|)
|
||||
|
||||
- c and c++ (|:CProjectConfigs|)
|
||||
|
||||
- python (|python-rope|)
|
||||
|
||||
For the purpose of this example we will assume that you will store
|
||||
your source files at:
|
||||
|
||||
>
|
||||
|
||||
/path/to/my_project/src/java
|
||||
|
||||
<
|
||||
|
||||
|
||||
So, given that location, you will need to open the file
|
||||
/path/to/my_project/.classpath in Vim.
|
||||
|
||||
>
|
||||
|
||||
vim /path/to/my_project/.classpath
|
||||
|
||||
<
|
||||
|
||||
|
||||
To add the source directory simply execute the following
|
||||
|
||||
>
|
||||
|
||||
:NewSrcEntry src/java
|
||||
|
||||
<
|
||||
|
||||
|
||||
This will add the necessary entry to the end of your .classpath file.
|
||||
The contents of this file should now look something like this:
|
||||
|
||||
>
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
<classpathentry kind="src" path="src/java"/>
|
||||
</classpath>
|
||||
|
||||
<
|
||||
|
||||
|
||||
Now that your source directory is setup, you can proceed to edit java
|
||||
files in that directory and make use of the java functionality
|
||||
(|vim-java-index|) provided by eclim.
|
||||
|
||||
*gettingstarted-coding*
|
||||
|
||||
|
||||
Writing code in your new project
|
||||
================================
|
||||
|
||||
Now that you have a project created, you can start writing code and
|
||||
utilize the features that eclim provides.
|
||||
|
||||
Note: Below we'll walk through a trivial java example, but some of the
|
||||
steps apply to all the languages that eclim supports, although the
|
||||
command names may differ a bit. For additional docs on working with
|
||||
the language of your choice, please see the relevant section of the
|
||||
docs:
|
||||
|
||||
- c/c++ (|vim-c-index|)
|
||||
|
||||
- java (|vim-java-index|)
|
||||
|
||||
- php (|vim-php-index|)
|
||||
|
||||
- python (|vim-python-index|)
|
||||
|
||||
- ruby (|vim-ruby-index|)
|
||||
|
||||
- etc. (|vim-index|)
|
||||
|
||||
Lets get started writing our first java application using eclim.
|
||||
|
||||
1. First, navigate to your new project's source directory (src/java in
|
||||
this example) and create any necessary package directories:
|
||||
|
||||
>
|
||||
$ cd /path/to/my_project/src/java
|
||||
$ mkdir -p org/test/
|
||||
|
||||
<
|
||||
|
||||
2. Then start editing your first java source file:
|
||||
|
||||
>
|
||||
$ vim org/test/TestMain.java
|
||||
|
||||
<
|
||||
|
||||
>
|
||||
package org.test;
|
||||
|
||||
public class TestMain
|
||||
{
|
||||
public static final void main(String[] args)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
<
|
||||
|
||||
3. You can start to use some of the core features now. For example,
|
||||
lets add the following code to the main method so we can test
|
||||
eclim's source code validation:
|
||||
|
||||
>
|
||||
System.
|
||||
|
||||
<
|
||||
|
||||
Then save the file and note that an error marker is placed in the
|
||||
left margin of your file and when the cursor is on that line an
|
||||
error message is printed at the bottom of your vim window. You can
|
||||
also run :lopen to view all the errors in the file at once.
|
||||
|
||||
4. Now lets try out code completion. Place your cursor on the '.' of
|
||||
'System.' and start insert mode in vim using 'a', then follow the
|
||||
example below:
|
||||
|
||||
>
|
||||
System.<ctrl-x><ctrl-u> // starts the completion mode
|
||||
System.<ctrl-n> // cycle through the completion suggestions
|
||||
System.out // assuming you chose the 'out' suggestion
|
||||
System.out.p<ctrl-x><ctrl-u> // now start completion again
|
||||
System.out.p<ctrl-n> // hit <ctrl-n> until you get 'println'
|
||||
System.out.println(
|
||||
System.out.println("Hello World"); // finish up the example code.
|
||||
|
||||
<
|
||||
|
||||
5. After saving the file you should have no more validation errors, so
|
||||
now we can run the code like so:
|
||||
|
||||
>
|
||||
:Java
|
||||
|
||||
<
|
||||
|
||||
After running the :Java command in vim you should now see your
|
||||
output in a new split window.
|
||||
|
||||
This only scratches the surface on the number of java features
|
||||
(|vim-java-index|) that eclim provides, but hopefully this example was
|
||||
enough to get you started.
|
||||
|
||||
*gettingstarted-android*
|
||||
|
||||
|
||||
Android Users
|
||||
=============
|
||||
|
||||
Creating an android project is the same as creating a regular java
|
||||
project, but you use the android nature instead:
|
||||
|
||||
>
|
||||
|
||||
:ProjectCreate /path/to/my_project -n android
|
||||
|
||||
<
|
||||
|
||||
|
||||
This will result in a series of prompts for you to input your
|
||||
project's information:
|
||||
|
||||
Note: at any point in this process you can use Ctrl+C to cancel the
|
||||
project creation.
|
||||
|
||||
1. First you will be asked to choose the target android platform. If
|
||||
you have only one platform installed on your system, this prompt
|
||||
will be skipped and that platform will be used when creating the
|
||||
project. If you have no platforms installed then you will receive
|
||||
an error directing you to install a platform using the Android SDK
|
||||
Manager. If you install a new platform you will need to either
|
||||
restart eclipse/eclimd or run the eclim supplied |:AndroidReload|
|
||||
command.
|
||||
|
||||
2. Next you will be asked to supply a package name (Ex:
|
||||
com.mycompany.myapp).
|
||||
|
||||
3. Then you will need to supply a name for your application.
|
||||
|
||||
4. The next prompt will ask you if you are creating a library project
|
||||
or not. Most likely you are not, so type 'n' here to proceed.
|
||||
|
||||
5. Lastly, if you are not creating a library project, you will be
|
||||
asked whether or not you want to have a new android activity
|
||||
created for you and if so, you will be asked for the name of that
|
||||
activity.
|
||||
|
||||
Once you've finished supplying the necessary information, your android
|
||||
project will be created. An android project is simply a specialized
|
||||
java project, so you can now leverage all the eclim provided java
|
||||
functionality (|vim-java-index|) while developing your app.
|
||||
|
||||
*gettingstarted-maven*
|
||||
|
||||
|
||||
Maven Users
|
||||
===========
|
||||
|
||||
Creating your first project with maven can be accomplished using the
|
||||
same method as any other java project, or you can utilize some of
|
||||
maven's built in features to get your project started.
|
||||
|
||||
1. Run maven's generate archetype to create the project directory and
|
||||
samples:
|
||||
|
||||
>
|
||||
$ mvn archetype:generate
|
||||
|
||||
<
|
||||
|
||||
2. Once you've created the initial project directory, cd into that
|
||||
directory and run the following command to generate the necessary
|
||||
eclipse files:
|
||||
|
||||
>
|
||||
$ cd <project_dir>
|
||||
$ mvn eclipse:eclipse
|
||||
|
||||
<
|
||||
|
||||
3. Now you can start an instance of vim at the project's root
|
||||
directory and run the following commands to:
|
||||
|
||||
- set the necessary eclipse classpath variable to point to your
|
||||
maven repository.
|
||||
|
||||
- import your new project into eclipse.
|
||||
|
||||
>
|
||||
$ vim
|
||||
:MvnRepo
|
||||
:ProjectImport /path/to/new/project
|
||||
|
||||
<
|
||||
|
||||
vim:ft=eclimhelp
|
||||
315
.vim/bundle/eclim/eclim/doc/index.txt
Normal file
315
.vim/bundle/eclim/eclim/doc/index.txt
Normal file
|
|
@ -0,0 +1,315 @@
|
|||
*index*
|
||||
|
||||
Welcome to Eclim
|
||||
****************
|
||||
|
||||
The power of Eclipse in your favorite editor.
|
||||
|
||||
|
||||
What is it?
|
||||
===========
|
||||
|
||||
Eclim provides the ability to access Eclipse (http://eclipse.org)
|
||||
features (code completion, searching, code validation, and many more
|
||||
(|features|)) via the command line or a local network connection,
|
||||
allowing those features to be integrated with your favorite editor.
|
||||
Eclim provides an integration with Vim (http://www.vim.org), but third
|
||||
party clients (|relatedprojects|) have been created to add eclim
|
||||
support to other editors as well (emacs, sublime text 2, textmate).
|
||||
|
||||
There are three primary usage scenarios in which eclim is designed to
|
||||
be used:
|
||||
|
||||
[image]
|
||||
|
||||
1. The first scenario (|eclimd-headless|) is for those for which vim
|
||||
is their primary editing interface. In this scenario you run a
|
||||
headless instance of eclipse which all vim instances can then
|
||||
communicate with to provide the various eclipse features.
|
||||
|
||||
2. The second scenario (|eclimd-headed|) is for those who prefer using
|
||||
vim as their main interface, but frequently end up jumping back to
|
||||
eclipse for any features not provided by eclim. In this case you
|
||||
can run the eclim server inside of the eclipse gui and then
|
||||
interact with it via external vim instances just like the first
|
||||
scenario.
|
||||
|
||||
3. The last scenario (|gvim-embedded|) is for those who wish to use
|
||||
the eclipse interface full time, but want to use gvim as an
|
||||
embedded eclipse editor. Just like the previous use case, the eclim
|
||||
server is run inside of the eclipse gui and the embedded gvim will
|
||||
interact with it just like external vim instances would. This
|
||||
feature is only support on Windows and Unix systems (where gvim is
|
||||
compiled with the gtk gui).
|
||||
|
||||
Note: Please be aware that the embedded vim does not behave like a
|
||||
standard eclipse editor. It's a separate program (vim) embedded
|
||||
into eclipse, so eclipse features are provided by eclim's vim
|
||||
plugins and not the usual eclipse key bindings, context menus,
|
||||
etc. For those that just want vim like key bindings in their
|
||||
eclipse editors, vrapper (http://vrapper.sourceforge.net/home/)
|
||||
is an excellent alternative which provides exactly that.
|
||||
|
||||
Eclim is released under the GPLv3
|
||||
(http://www.gnu.org/licenses/gpl-3.0-standalone.html).
|
||||
|
||||
|
||||
How do I get/install it?
|
||||
========================
|
||||
|
||||
You can follow the eclim install guide (|install|) which will walk you
|
||||
through downloading and installing eclim.
|
||||
|
||||
|
||||
How do I use it?
|
||||
================
|
||||
|
||||
After you've installed eclim, you can refer to the getting started
|
||||
(|gettingstarted|) page which will walk you through creating your
|
||||
first project.
|
||||
|
||||
|
||||
Where can I get help?
|
||||
=====================
|
||||
|
||||
|
||||
Mailing Lists
|
||||
-------------
|
||||
|
||||
If at any time you have any questions or feedback, feel free to post
|
||||
to one of the eclim mailing lists:
|
||||
|
||||
- eclim-user (http://groups.google.com/group/eclim-user): For all
|
||||
questions regarding installation, usage, troubleshooting, etc.
|
||||
|
||||
- eclim-dev (http://groups.google.com/group/eclim-dev): For all eclim
|
||||
development related discussions.
|
||||
|
||||
|
||||
IRC (#eclim on freenode.net)
|
||||
----------------------------
|
||||
|
||||
If you would like to get help or ask questions on IRC, then feel free
|
||||
to join #eclim on freenode.net. Please note that I (Eric Van
|
||||
Dewoestine, ervandew on irc) try to stay in the channel as much as
|
||||
possible, but I might not be available to answer questions
|
||||
immediately. It's also worth noting that I live in California, so if
|
||||
you are in Europe, Asia, or some other timezone whose normal waking
|
||||
hours don't overlap well with mine, then you may be better off getting
|
||||
help using one of the mailing lists above.
|
||||
|
||||
|
||||
How do I report a bug?
|
||||
======================
|
||||
|
||||
|
||||
Reporting Bugs
|
||||
--------------
|
||||
|
||||
If you've found a bug please report the issue to either the eclim-dev
|
||||
(http://groups.google.com/group/eclim-dev) mailing list or create a
|
||||
new issue on eclim's github issue tracker
|
||||
(http://github.com/ervandew/eclim/issues).
|
||||
|
||||
When reporting a bug, please include the following information:
|
||||
|
||||
- What OS are you on?
|
||||
|
||||
- Linux users: please include the distro and version.
|
||||
|
||||
- What version of eclim, vim, and eclipse are you using?
|
||||
|
||||
- Linux users: please indicate whether you installed eclipse via
|
||||
your distro's package manager or not, and if not, please indicate
|
||||
what distribution of eclipse you are using ("Eclipse Classic",
|
||||
"Eclipse IDE for C/C++ Developers", some other eclipse bundle).
|
||||
|
||||
|
||||
What's New?
|
||||
===========
|
||||
|
||||
[image: Rss Feed for What's New][image] (index.rss)
|
||||
|
||||
|
||||
Sep. 12, 2013
|
||||
-------------
|
||||
|
||||
This release fixes the extraction of the necessary vim files when
|
||||
installing scala support.
|
||||
|
||||
- Eclim 2.3.2 (|2.3.2|) for Eclipse 4.3 (Kepler).
|
||||
|
||||
- Eclim 1.7.18 (|1.7.18|) for Eclipse 3.7/3.8 (Indigo).
|
||||
|
||||
|
||||
Jul. 27, 2013
|
||||
-------------
|
||||
|
||||
The previous eclim installer for Kepler was still pointing at the Juno
|
||||
update site. This release remedies that.
|
||||
|
||||
- Eclim 2.3.1 (|2.3.1|) for Eclipse 4.3 (Kepler).
|
||||
|
||||
|
||||
Jul. 21, 2013
|
||||
-------------
|
||||
|
||||
The focus of this release is to bring eclim fully up to date with
|
||||
Eclipse Kepler support. The installer for eclim 2.3.0 now requires
|
||||
that you install against Kepler.
|
||||
|
||||
- Eclim 2.3.0 (|2.3.0|) for Eclipse 4.3 (Kepler).
|
||||
|
||||
- Eclim 1.7.17 (|1.7.17|) for Eclipse 3.7/3.8 (Indigo).
|
||||
|
||||
|
||||
Jul. 14, 2013
|
||||
-------------
|
||||
|
||||
This is primarily a bug fix release with a few new features. Unless
|
||||
some critical error is found, this will be the last release targeting
|
||||
Juno. The next release will likely target Kepler though this release
|
||||
should work fine on Kepler as well, with the exception of scala
|
||||
support which has not been tested. Indigo support will continue but
|
||||
will likely end with the release of Luna, possibly sooner.
|
||||
|
||||
- Eclim 2.2.7 (|2.2.7|) for Eclipse 4.2 (Juno).
|
||||
|
||||
- Eclim 1.7.16 (|1.7.16|) for Eclipse 3.7/3.8 (Indigo).
|
||||
|
||||
|
||||
May 18, 2013
|
||||
------------
|
||||
|
||||
Eclim has been updated to support the Android Development Toolkit
|
||||
version 22.0.0, scala is now supported for both Juno and Indigo, and
|
||||
there are a few other improvements and many bug fixes.
|
||||
|
||||
- Eclim 2.2.6 (|2.2.6|) for Eclipse 4.2 (Juno).
|
||||
|
||||
- Eclim 1.7.14 (|1.7.14|) for Eclipse 3.7/3.8 (Indigo).
|
||||
|
||||
|
||||
Nov. 25, 2012
|
||||
-------------
|
||||
|
||||
The most notable change in this release is support for Eclipse 3.8
|
||||
with the Indigo release (1.7.13). Both releases also include several
|
||||
small bug fixes.
|
||||
|
||||
- Eclim 2.2.5 (|2.2.5|) for Eclipse 4.2 (Juno).
|
||||
|
||||
- Eclim 1.7.13 (|1.7.13|) for Eclipse 3.7/3.8 (Indigo).
|
||||
|
||||
|
||||
Nov. 18, 2012
|
||||
-------------
|
||||
|
||||
This is another bug fix release which includes support for the latest
|
||||
Android development toolkit (21.0.0).
|
||||
|
||||
- Eclim 2.2.4 (|2.2.4|) for Eclipse 4.2 (Juno).
|
||||
|
||||
- Eclim 1.7.12 (|1.7.12|) for Eclipse 3.7 (Indigo).
|
||||
|
||||
|
||||
Oct. 19, 2012
|
||||
-------------
|
||||
|
||||
This is a bug fix release for Windows users which fixes executing of
|
||||
eclim commands from vim:
|
||||
|
||||
- Eclim 2.2.3 (|2.2.3|) for Eclipse 4.2 (Juno).
|
||||
|
||||
- Eclim 1.7.11 (|1.7.11|) for Eclipse 3.7 (Indigo).
|
||||
|
||||
|
||||
Oct. 07, 2012
|
||||
-------------
|
||||
|
||||
Two new eclim updates are once again available with several bug fixes
|
||||
and improvements.
|
||||
|
||||
- Eclim 2.2.2 (|2.2.2|) for Eclipse 4.2 (Juno).
|
||||
|
||||
- Eclim 1.7.10 (|1.7.10|) for Eclipse 3.7 (Indigo).
|
||||
|
||||
|
||||
Sep. 09, 2012
|
||||
-------------
|
||||
|
||||
Eclim 1.7.9 (|1.7.9|) for Eclipse 3.7 (Indigo) is now available.
|
||||
This release adds initial support for scala (|vim-scala-index|).
|
||||
|
||||
Please note that the Scala IDE (http://scala-ide.org) , which eclim
|
||||
uses to provide scala support, is not yet available for Eclipse 4.2
|
||||
(Juno), so eclim's scala support will not be available for the eclim
|
||||
2.2.x releases until sometime after the Scala IDE has been updated for
|
||||
Juno.
|
||||
|
||||
|
||||
Sep. 01, 2012
|
||||
-------------
|
||||
|
||||
Another set of releases are now available for both Juno and Indigo.
|
||||
These both include several bug fixes along with new support for
|
||||
creating android projects.
|
||||
|
||||
- Eclim 2.2.1 (|2.2.1|) for Eclipse 4.2 (Juno).
|
||||
|
||||
- Eclim 1.7.8 (|1.7.8|) for Eclipse 3.7 (Indigo).
|
||||
|
||||
Eclim also has a newly redesigned site using the sphinx bootstrap
|
||||
theme (https://github.com/ervandew/sphinx-bootstrap-theme).
|
||||
|
||||
|
||||
Aug. 07, 2012
|
||||
-------------
|
||||
|
||||
Two new versions of eclim have been released, one for the latest
|
||||
Eclipse version, Juno, the other a bug fix release for the previous
|
||||
version of Eclipse, Indigo.
|
||||
|
||||
- Eclim 2.2.0 (|2.2.0|) for Eclipse 4.2 (Juno).
|
||||
|
||||
- Eclim 1.7.7 (|1.7.7|) for Eclipse 3.7 (Indigo).
|
||||
|
||||
|
||||
Jun. 07, 2012
|
||||
-------------
|
||||
|
||||
Eclim 1.7.6 (|1.7.6|) is now available.
|
||||
This is a minor bug fix release.
|
||||
|
||||
|
||||
Jun. 03, 2012
|
||||
-------------
|
||||
|
||||
Eclim 1.7.5 (|1.7.5|) is now available.
|
||||
This is a minor release with an improved installer, some bug fixes, and a few
|
||||
minor enhancements.
|
||||
|
||||
|
||||
Apr. 22, 2012
|
||||
-------------
|
||||
|
||||
Eclim 1.7.4 (|1.7.4|) is now available.
|
||||
This is a bug fix release.
|
||||
|
||||
|
||||
Mar. 18, 2012
|
||||
-------------
|
||||
|
||||
Eclim 1.7.3 (|1.7.3|) is now available.
|
||||
This version fixes numerious small bugs and adds a handful of small features.
|
||||
|
||||
Warning: Non vim users (emacs-eclim, subclim, etc.): The underlying command
|
||||
response format for eclim has changed, which means that any project
|
||||
relying on the old format isn't going to work. So if you are
|
||||
installing eclim for use with a client other than vim, then be sure
|
||||
to check with the client project to see if it has been updated for
|
||||
eclim 1.7.3 or later.
|
||||
|
||||
Eclim News Archive (|archive-news|)
|
||||
|
||||
vim:ft=eclimhelp
|
||||
618
.vim/bundle/eclim/eclim/doc/install.txt
Normal file
618
.vim/bundle/eclim/eclim/doc/install.txt
Normal file
File diff suppressed because it is too large
Load diff
27
.vim/bundle/eclim/eclim/doc/relatedprojects.txt
Normal file
27
.vim/bundle/eclim/eclim/doc/relatedprojects.txt
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
*relatedprojects*
|
||||
|
||||
Related Projects
|
||||
****************
|
||||
|
||||
|
||||
Eclim clients for other editors:
|
||||
================================
|
||||
|
||||
- Emacs (emacs-eclim (http://github.com/senny/emacs-eclim))
|
||||
|
||||
- Sublime Text 2 (Subclim (http://github.com/JulianEberius/Subclim))
|
||||
|
||||
- Texmate (Eclim.tmbundle
|
||||
(http://github.com/JulianEberius/Eclim.tmbundle))
|
||||
|
||||
|
||||
Vim emulator plugins for Eclipse:
|
||||
=================================
|
||||
|
||||
- Vrapper (http://vrapper.sourceforge.net) (free and open source)
|
||||
|
||||
- viPlugin (http://www.satokar.com/viplugin/index.php)
|
||||
|
||||
- Viable (http://viableplugin.com)
|
||||
|
||||
vim:ft=eclimhelp
|
||||
443
.vim/bundle/eclim/eclim/doc/tags
Normal file
443
.vim/bundle/eclim/eclim/doc/tags
Normal file
|
|
@ -0,0 +1,443 @@
|
|||
1.0.0 archive/changes.txt /*1.0.0*
|
||||
1.1.0 archive/changes.txt /*1.1.0*
|
||||
1.1.1 archive/changes.txt /*1.1.1*
|
||||
1.1.2 archive/changes.txt /*1.1.2*
|
||||
1.2.0 archive/changes.txt /*1.2.0*
|
||||
1.2.1 archive/changes.txt /*1.2.1*
|
||||
1.2.2 archive/changes.txt /*1.2.2*
|
||||
1.2.3 archive/changes.txt /*1.2.3*
|
||||
1.3.0 archive/changes.txt /*1.3.0*
|
||||
1.3.1 archive/changes.txt /*1.3.1*
|
||||
1.3.2 archive/changes.txt /*1.3.2*
|
||||
1.3.3 archive/changes.txt /*1.3.3*
|
||||
1.3.4 archive/changes.txt /*1.3.4*
|
||||
1.3.5 archive/changes.txt /*1.3.5*
|
||||
1.4.0 archive/changes.txt /*1.4.0*
|
||||
1.4.1 archive/changes.txt /*1.4.1*
|
||||
1.4.2 archive/changes.txt /*1.4.2*
|
||||
1.4.3 archive/changes.txt /*1.4.3*
|
||||
1.4.4 archive/changes.txt /*1.4.4*
|
||||
1.4.5 archive/changes.txt /*1.4.5*
|
||||
1.4.6 archive/changes.txt /*1.4.6*
|
||||
1.4.7 archive/changes.txt /*1.4.7*
|
||||
1.4.8 archive/changes.txt /*1.4.8*
|
||||
1.4.9 archive/changes.txt /*1.4.9*
|
||||
1.5.0 archive/changes.txt /*1.5.0*
|
||||
1.5.1 archive/changes.txt /*1.5.1*
|
||||
1.5.2 archive/changes.txt /*1.5.2*
|
||||
1.5.3 archive/changes.txt /*1.5.3*
|
||||
1.5.4 archive/changes.txt /*1.5.4*
|
||||
1.5.5 archive/changes.txt /*1.5.5*
|
||||
1.5.6 archive/changes.txt /*1.5.6*
|
||||
1.5.7 archive/changes.txt /*1.5.7*
|
||||
1.5.8 archive/changes.txt /*1.5.8*
|
||||
1.6.0 archive/changes.txt /*1.6.0*
|
||||
1.6.1 archive/changes.txt /*1.6.1*
|
||||
1.6.2 archive/changes.txt /*1.6.2*
|
||||
1.6.3 archive/changes.txt /*1.6.3*
|
||||
1.7.0 archive/changes.txt /*1.7.0*
|
||||
1.7.1 archive/changes.txt /*1.7.1*
|
||||
1.7.10 changes.txt /*1.7.10*
|
||||
1.7.11 changes.txt /*1.7.11*
|
||||
1.7.12 changes.txt /*1.7.12*
|
||||
1.7.13 changes.txt /*1.7.13*
|
||||
1.7.14 changes.txt /*1.7.14*
|
||||
1.7.16 changes.txt /*1.7.16*
|
||||
1.7.17 changes.txt /*1.7.17*
|
||||
1.7.18 changes.txt /*1.7.18*
|
||||
1.7.2 archive/changes.txt /*1.7.2*
|
||||
1.7.3 changes.txt /*1.7.3*
|
||||
1.7.4 changes.txt /*1.7.4*
|
||||
1.7.5 changes.txt /*1.7.5*
|
||||
1.7.6 changes.txt /*1.7.6*
|
||||
1.7.7 changes.txt /*1.7.7*
|
||||
1.7.8 changes.txt /*1.7.8*
|
||||
1.7.9 changes.txt /*1.7.9*
|
||||
2.2.0 changes.txt /*2.2.0*
|
||||
2.2.1 changes.txt /*2.2.1*
|
||||
2.2.2 changes.txt /*2.2.2*
|
||||
2.2.3 changes.txt /*2.2.3*
|
||||
2.2.4 changes.txt /*2.2.4*
|
||||
2.2.5 changes.txt /*2.2.5*
|
||||
2.2.6 changes.txt /*2.2.6*
|
||||
2.2.7 changes.txt /*2.2.7*
|
||||
2.3.0 changes.txt /*2.3.0*
|
||||
2.3.1 changes.txt /*2.3.1*
|
||||
2.3.2 changes.txt /*2.3.2*
|
||||
404 404.txt /*404*
|
||||
:AndroidReload cheatsheet.txt /*:AndroidReload*
|
||||
:Ant vim/java/ant.txt /*:Ant*
|
||||
:AntDoc vim/java/ant.txt /*:AntDoc*
|
||||
:AntUserDoc vim/java/ant.txt /*:AntUserDoc*
|
||||
:BrowserOpen vim/html/index.txt /*:BrowserOpen*
|
||||
:Buffers vim/core/util.txt /*:Buffers*
|
||||
:BuffersToggle vim/core/util.txt /*:BuffersToggle*
|
||||
:CCallHierarchy vim/c/inspection.txt /*:CCallHierarchy*
|
||||
:CProjectConfigs vim/c/project.txt /*:CProjectConfigs*
|
||||
:CSearch vim/c/search.txt /*:CSearch*
|
||||
:CSearchContext vim/c/search.txt /*:CSearchContext*
|
||||
:Checkstyle vim/java/validate.txt /*:Checkstyle*
|
||||
:DiffLastSaved vim/core/util.txt /*:DiffLastSaved*
|
||||
:DjangoContextOpen vim/python/django.txt /*:DjangoContextOpen*
|
||||
:DjangoFind vim/python/django.txt /*:DjangoFind*
|
||||
:DjangoManage vim/python/django.txt /*:DjangoManage*
|
||||
:DjangoTemplateOpen vim/python/django.txt /*:DjangoTemplateOpen*
|
||||
:DjangoViewOpen vim/python/django.txt /*:DjangoViewOpen*
|
||||
:DtdDefinition vim/xml/index.txt /*:DtdDefinition*
|
||||
:EclimDisable vim/core/eclim.txt /*:EclimDisable*
|
||||
:EclimEnable vim/core/eclim.txt /*:EclimEnable*
|
||||
:EclimHelp vim/core/eclim.txt /*:EclimHelp*
|
||||
:EclimHelpGrep vim/core/eclim.txt /*:EclimHelpGrep*
|
||||
:EclimSettings vim/core/eclim.txt /*:EclimSettings*
|
||||
:History vim/core/history.txt /*:History*
|
||||
:HistoryClear vim/core/history.txt /*:HistoryClear*
|
||||
:HistoryDiffNext vim/core/history.txt /*:HistoryDiffNext*
|
||||
:HistoryDiffPrev vim/core/history.txt /*:HistoryDiffPrev*
|
||||
:IvyDependencySearch vim/java/classpath.txt /*:IvyDependencySearch*
|
||||
:IvyRepo vim/java/classpath.txt /*:IvyRepo*
|
||||
:JUnit vim/java/unittests.txt /*:JUnit*
|
||||
:JUnitFindTest vim/java/unittests.txt /*:JUnitFindTest*
|
||||
:JUnitImpl vim/java/unittests.txt /*:JUnitImpl*
|
||||
:JUnitResult vim/java/unittests.txt /*:JUnitResult*
|
||||
:Java vim/java/java.txt /*:Java*
|
||||
:JavaCallHierarchy vim/java/inspection.txt /*:JavaCallHierarchy*
|
||||
:JavaClasspath vim/java/java.txt /*:JavaClasspath*
|
||||
:JavaConstructor vim/java/methods.txt /*:JavaConstructor*
|
||||
:JavaCorrect vim/java/validate.txt /*:JavaCorrect*
|
||||
:JavaDelegate vim/java/methods.txt /*:JavaDelegate*
|
||||
:JavaDocComment vim/java/javadoc.txt /*:JavaDocComment*
|
||||
:JavaDocPreview vim/java/javadoc.txt /*:JavaDocPreview*
|
||||
:JavaDocSearch vim/java/javadoc.txt /*:JavaDocSearch*
|
||||
:JavaFormat vim/java/format.txt /*:JavaFormat*
|
||||
:JavaGet vim/java/methods.txt /*:JavaGet*
|
||||
:JavaGetSet vim/java/methods.txt /*:JavaGetSet*
|
||||
:JavaHierarchy vim/java/inspection.txt /*:JavaHierarchy*
|
||||
:JavaImpl vim/java/methods.txt /*:JavaImpl*
|
||||
:JavaImport vim/java/import.txt /*:JavaImport*
|
||||
:JavaImportOrganize vim/java/import.txt /*:JavaImportOrganize*
|
||||
:JavaListInstalls vim/java/java.txt /*:JavaListInstalls*
|
||||
:JavaMove vim/java/refactor.txt /*:JavaMove*
|
||||
:JavaRename vim/java/refactor.txt /*:JavaRename*
|
||||
:JavaSearch vim/java/search.txt /*:JavaSearch*
|
||||
:JavaSearchContext vim/java/search.txt /*:JavaSearchContext*
|
||||
:JavaSet vim/java/methods.txt /*:JavaSet*
|
||||
:Javadoc vim/java/javadoc.txt /*:Javadoc*
|
||||
:Jps vim/java/java.txt /*:Jps*
|
||||
:LocateFile vim/core/locate.txt /*:LocateFile*
|
||||
:LocationListClear vim/core/util.txt /*:LocationListClear*
|
||||
:Maven vim/java/maven.txt /*:Maven*
|
||||
:MavenDependencySearch vim/java/maven.txt /*:MavenDependencySearch*
|
||||
:MavenRepo vim/java/classpath.txt /*:MavenRepo*
|
||||
:Mvn vim/java/maven.txt /*:Mvn*
|
||||
:MvnDependencySearch vim/java/maven.txt /*:MvnDependencySearch*
|
||||
:MvnRepo vim/java/classpath.txt /*:MvnRepo*
|
||||
:NewJarEntry_java vim/java/classpath.txt /*:NewJarEntry_java*
|
||||
:NewLibEntry_dltk vim/dltk/buildpath.txt /*:NewLibEntry_dltk*
|
||||
:NewLibEntry_dltk_php vim/php/buildpath.txt /*:NewLibEntry_dltk_php*
|
||||
:NewLibEntry_dltk_ruby vim/ruby/buildpath.txt /*:NewLibEntry_dltk_ruby*
|
||||
:NewProjectEntry_dltk vim/dltk/buildpath.txt /*:NewProjectEntry_dltk*
|
||||
:NewProjectEntry_dltk_php vim/php/buildpath.txt /*:NewProjectEntry_dltk_php*
|
||||
:NewProjectEntry_dltk_ruby vim/ruby/buildpath.txt /*:NewProjectEntry_dltk_ruby*
|
||||
:NewProjectEntry_java vim/java/classpath.txt /*:NewProjectEntry_java*
|
||||
:NewSrcEntry_dltk vim/dltk/buildpath.txt /*:NewSrcEntry_dltk*
|
||||
:NewSrcEntry_dltk_php vim/php/buildpath.txt /*:NewSrcEntry_dltk_php*
|
||||
:NewSrcEntry_dltk_ruby vim/ruby/buildpath.txt /*:NewSrcEntry_dltk_ruby*
|
||||
:NewSrcEntry_java vim/java/classpath.txt /*:NewSrcEntry_java*
|
||||
:NewVarEntry_java vim/java/classpath.txt /*:NewVarEntry_java*
|
||||
:Only vim/core/util.txt /*:Only*
|
||||
:OpenUrl vim/core/util.txt /*:OpenUrl*
|
||||
:PhpSearch vim/php/search.txt /*:PhpSearch*
|
||||
:PhpSearchContext vim/php/search.txt /*:PhpSearchContext*
|
||||
:PingEclim vim/core/eclim.txt /*:PingEclim*
|
||||
:ProjectBuild vim/core/project.txt /*:ProjectBuild*
|
||||
:ProjectCD vim/core/project.txt /*:ProjectCD*
|
||||
:ProjectClose vim/core/project.txt /*:ProjectClose*
|
||||
:ProjectCreate vim/core/project.txt /*:ProjectCreate*
|
||||
:ProjectDelete vim/core/project.txt /*:ProjectDelete*
|
||||
:ProjectGrep vim/core/project.txt /*:ProjectGrep*
|
||||
:ProjectGrepAdd vim/core/project.txt /*:ProjectGrepAdd*
|
||||
:ProjectImport vim/core/project.txt /*:ProjectImport*
|
||||
:ProjectInfo vim/core/project.txt /*:ProjectInfo*
|
||||
:ProjectLCD vim/core/project.txt /*:ProjectLCD*
|
||||
:ProjectLGrep vim/core/project.txt /*:ProjectLGrep*
|
||||
:ProjectLGrepAdd vim/core/project.txt /*:ProjectLGrepAdd*
|
||||
:ProjectList vim/core/project.txt /*:ProjectList*
|
||||
:ProjectMove vim/core/project.txt /*:ProjectMove*
|
||||
:ProjectNatureAdd vim/core/project.txt /*:ProjectNatureAdd*
|
||||
:ProjectNatureRemove vim/core/project.txt /*:ProjectNatureRemove*
|
||||
:ProjectNatures vim/core/project.txt /*:ProjectNatures*
|
||||
:ProjectOpen vim/core/project.txt /*:ProjectOpen*
|
||||
:ProjectProblems vim/core/project.txt /*:ProjectProblems*
|
||||
:ProjectRefresh vim/core/project.txt /*:ProjectRefresh*
|
||||
:ProjectRefreshAll vim/core/project.txt /*:ProjectRefreshAll*
|
||||
:ProjectRename vim/core/project.txt /*:ProjectRename*
|
||||
:ProjectSettings vim/core/project.txt /*:ProjectSettings*
|
||||
:ProjectTab vim/core/project.txt /*:ProjectTab*
|
||||
:ProjectTodo vim/core/project.txt /*:ProjectTodo*
|
||||
:ProjectTree vim/core/project.txt /*:ProjectTree*
|
||||
:ProjectTreeToggle vim/core/project.txt /*:ProjectTreeToggle*
|
||||
:ProjectsTree vim/core/project.txt /*:ProjectsTree*
|
||||
:PyLint vim/python/validate.txt /*:PyLint*
|
||||
:PythonFindDefinition vim/python/search.txt /*:PythonFindDefinition*
|
||||
:PythonSearchContext vim/python/search.txt /*:PythonSearchContext*
|
||||
:QuickFixClear vim/core/util.txt /*:QuickFixClear*
|
||||
:RefactorRedo vim/refactoring.txt /*:RefactorRedo*
|
||||
:RefactorUndo vim/refactoring.txt /*:RefactorUndo*
|
||||
:RefactorUndoPeek vim/refactoring.txt /*:RefactorUndoPeek*
|
||||
:RubyInterpreterAdd vim/ruby/buildpath.txt /*:RubyInterpreterAdd*
|
||||
:RubyInterpreterList vim/ruby/buildpath.txt /*:RubyInterpreterList*
|
||||
:RubyInterpreterRemove vim/ruby/buildpath.txt /*:RubyInterpreterRemove*
|
||||
:RubySearch vim/ruby/search.txt /*:RubySearch*
|
||||
:RubySearchContext vim/ruby/search.txt /*:RubySearchContext*
|
||||
:ScalaSearch vim/scala/search.txt /*:ScalaSearch*
|
||||
:ShutdownEclim vim/core/eclim.txt /*:ShutdownEclim*
|
||||
:Sign vim/core/util.txt /*:Sign*
|
||||
:SignClearAll vim/core/util.txt /*:SignClearAll*
|
||||
:SignClearUser vim/core/util.txt /*:SignClearUser*
|
||||
:Signs vim/core/util.txt /*:Signs*
|
||||
:SwapWords vim/core/util.txt /*:SwapWords*
|
||||
:Tcd vim/core/util.txt /*:Tcd*
|
||||
:Todo vim/core/project.txt /*:Todo*
|
||||
:Validate_ant vim/java/ant.txt /*:Validate_ant*
|
||||
:Validate_c vim/c/validate.txt /*:Validate_c*
|
||||
:Validate_css vim/html/index.txt /*:Validate_css*
|
||||
:Validate_dtd vim/xml/index.txt /*:Validate_dtd*
|
||||
:Validate_html vim/html/index.txt /*:Validate_html*
|
||||
:Validate_java vim/java/validate.txt /*:Validate_java*
|
||||
:Validate_javascript vim/javascript/index.txt /*:Validate_javascript*
|
||||
:Validate_log4j vim/java/logging.txt /*:Validate_log4j*
|
||||
:Validate_php vim/php/validate.txt /*:Validate_php*
|
||||
:Validate_python vim/python/validate.txt /*:Validate_python*
|
||||
:Validate_ruby vim/ruby/validate.txt /*:Validate_ruby*
|
||||
:Validate_scala vim/scala/validate.txt /*:Validate_scala*
|
||||
:Validate_webxml vim/java/webxml.txt /*:Validate_webxml*
|
||||
:Validate_xml vim/xml/index.txt /*:Validate_xml*
|
||||
:Validate_xsd vim/xml/index.txt /*:Validate_xsd*
|
||||
:VariableCreate vim/java/classpath.txt /*:VariableCreate*
|
||||
:VariableDelete vim/java/classpath.txt /*:VariableDelete*
|
||||
:VariableList vim/java/classpath.txt /*:VariableList*
|
||||
:XmlFormat vim/xml/index.txt /*:XmlFormat*
|
||||
:XsdDefinition vim/xml/index.txt /*:XsdDefinition*
|
||||
FeedKeys eclimd.txt /*FeedKeys*
|
||||
archive-changes archive/changes.txt /*archive-changes*
|
||||
archive-news archive/news.txt /*archive-news*
|
||||
changes changes.txt /*changes*
|
||||
cheatsheet cheatsheet.txt /*cheatsheet*
|
||||
classpath-ivy vim/java/classpath.txt /*classpath-ivy*
|
||||
classpath-maven vim/java/classpath.txt /*classpath-maven*
|
||||
classpath-maven-pom vim/java/classpath.txt /*classpath-maven-pom*
|
||||
classpath-src-javadocs vim/java/classpath.txt /*classpath-src-javadocs*
|
||||
coding-style development/gettingstarted.txt /*coding-style*
|
||||
contribute contribute.txt /*contribute*
|
||||
css vim/html/index.txt /*css*
|
||||
development-architecture development/architecture.txt /*development-architecture*
|
||||
development-commands development/commands.txt /*development-commands*
|
||||
development-gettingstarted development/gettingstarted.txt /*development-gettingstarted*
|
||||
development-index development/index.txt /*development-index*
|
||||
development-patches development/gettingstarted.txt /*development-patches*
|
||||
development-plugins development/plugins.txt /*development-plugins*
|
||||
dtd vim/xml/index.txt /*dtd*
|
||||
eclim#web#SearchEngine vim/core/util.txt /*eclim#web#SearchEngine*
|
||||
eclim#web#WordLookup vim/core/util.txt /*eclim#web#WordLookup*
|
||||
eclim-gvim-embedded-focus eclimd.txt /*eclim-gvim-embedded-focus*
|
||||
eclim-gvim-embedded-shortcuts eclimd.txt /*eclim-gvim-embedded-shortcuts*
|
||||
eclim_encoding faq.txt /*eclim_encoding*
|
||||
eclim_full_headless faq.txt /*eclim_full_headless*
|
||||
eclim_memory faq.txt /*eclim_memory*
|
||||
eclim_proxy faq.txt /*eclim_proxy*
|
||||
eclim_troubleshoot faq.txt /*eclim_troubleshoot*
|
||||
eclim_workspace faq.txt /*eclim_workspace*
|
||||
eclimd eclimd.txt /*eclimd*
|
||||
eclimd-extdir eclimd.txt /*eclimd-extdir*
|
||||
eclimd-headed eclimd.txt /*eclimd-headed*
|
||||
eclimd-headless eclimd.txt /*eclimd-headless*
|
||||
eclimd-multiworkspace eclimd.txt /*eclimd-multiworkspace*
|
||||
eclimd_options_windows faq.txt /*eclimd_options_windows*
|
||||
eclimrc eclimd.txt /*eclimrc*
|
||||
faq faq.txt /*faq*
|
||||
features features.txt /*features*
|
||||
g:EclimAntCompilerAdditionalErrorFormat vim/java/ant.txt /*g:EclimAntCompilerAdditionalErrorFormat*
|
||||
g:EclimAntErrorsEnabled vim/java/ant.txt /*g:EclimAntErrorsEnabled*
|
||||
g:EclimAntValidate vim/java/ant.txt /*g:EclimAntValidate*
|
||||
g:EclimBrowser vim/core/eclim.txt /*g:EclimBrowser*
|
||||
g:EclimBuffersSort vim/core/util.txt /*g:EclimBuffersSort*
|
||||
g:EclimBuffersSortDirection vim/core/util.txt /*g:EclimBuffersSortDirection*
|
||||
g:EclimCCallHierarchyDefaultAction vim/c/inspection.txt /*g:EclimCCallHierarchyDefaultAction*
|
||||
g:EclimCSearchSingleResult vim/c/search.txt /*g:EclimCSearchSingleResult*
|
||||
g:EclimCValidate vim/c/validate.txt /*g:EclimCValidate*
|
||||
g:EclimCompletionMethod vim/code_completion.txt /*g:EclimCompletionMethod*
|
||||
g:EclimCssValidate vim/html/index.txt /*g:EclimCssValidate*
|
||||
g:EclimDebugHighlight vim/core/eclim.txt /*g:EclimDebugHighlight*
|
||||
g:EclimDjangoAdmin vim/python/django.txt /*g:EclimDjangoAdmin*
|
||||
g:EclimDjangoFindAction vim/python/django.txt /*g:EclimDjangoFindAction*
|
||||
g:EclimDjangoStaticPaths vim/python/django.txt /*g:EclimDjangoStaticPaths*
|
||||
g:EclimDtdValidate vim/xml/index.txt /*g:EclimDtdValidate*
|
||||
g:EclimEchoHighlight vim/core/eclim.txt /*g:EclimEchoHighlight*
|
||||
g:EclimErrorHighlight vim/core/eclim.txt /*g:EclimErrorHighlight*
|
||||
g:EclimFatalHighlight vim/core/eclim.txt /*g:EclimFatalHighlight*
|
||||
g:EclimHistoryDiffOrientation vim/core/history.txt /*g:EclimHistoryDiffOrientation*
|
||||
g:EclimHtmlValidate vim/html/index.txt /*g:EclimHtmlValidate*
|
||||
g:EclimInfoHighlight vim/core/eclim.txt /*g:EclimInfoHighlight*
|
||||
g:EclimJavaCallHierarchyDefaultAction vim/java/inspection.txt /*g:EclimJavaCallHierarchyDefaultAction*
|
||||
g:EclimJavaCompleteCaseSensitive vim/java/complete.txt /*g:EclimJavaCompleteCaseSensitive*
|
||||
g:EclimJavaDocSearchSingleResult vim/java/javadoc.txt /*g:EclimJavaDocSearchSingleResult*
|
||||
g:EclimJavaHierarchyDefaultAction vim/java/inspection.txt /*g:EclimJavaHierarchyDefaultAction*
|
||||
g:EclimJavaSearchMapping vim/java/search.txt /*g:EclimJavaSearchMapping*
|
||||
g:EclimJavaSearchSingleResult vim/java/search.txt /*g:EclimJavaSearchSingleResult*
|
||||
g:EclimJavaSrcValidate vim/java/validate.txt /*g:EclimJavaSrcValidate*
|
||||
g:EclimJavascriptLintConf vim/javascript/index.txt /*g:EclimJavascriptLintConf*
|
||||
g:EclimJavascriptValidate vim/javascript/index.txt /*g:EclimJavascriptValidate*
|
||||
g:EclimLocateFileCaseInsensitive vim/core/locate.txt /*g:EclimLocateFileCaseInsensitive*
|
||||
g:EclimLocateFileDefaultAction vim/core/locate.txt /*g:EclimLocateFileDefaultAction*
|
||||
g:EclimLocateFileFuzzy vim/core/locate.txt /*g:EclimLocateFileFuzzy*
|
||||
g:EclimLocateFileScope vim/core/locate.txt /*g:EclimLocateFileScope*
|
||||
g:EclimLog4jValidate vim/java/logging.txt /*g:EclimLog4jValidate*
|
||||
g:EclimLogLevel vim/core/eclim.txt /*g:EclimLogLevel*
|
||||
g:EclimLoggingDisabled vim/java/logging.txt /*g:EclimLoggingDisabled*
|
||||
g:EclimMakeLCD vim/core/eclim.txt /*g:EclimMakeLCD*
|
||||
g:EclimMenus vim/core/eclim.txt /*g:EclimMenus*
|
||||
g:EclimOnlyExclude vim/core/util.txt /*g:EclimOnlyExclude*
|
||||
g:EclimOnlyExcludeFixed vim/core/util.txt /*g:EclimOnlyExcludeFixed*
|
||||
g:EclimOpenUrlInVimAction vim/core/util.txt /*g:EclimOpenUrlInVimAction*
|
||||
g:EclimOpenUrlInVimPatterns vim/core/util.txt /*g:EclimOpenUrlInVimPatterns*
|
||||
g:EclimPhpSearchSingleResult vim/php/search.txt /*g:EclimPhpSearchSingleResult*
|
||||
g:EclimPhpValidate vim/php/validate.txt /*g:EclimPhpValidate*
|
||||
g:EclimProblemsQuickFixOpen vim/core/project.txt /*g:EclimProblemsQuickFixOpen*
|
||||
g:EclimProjectKeepLocalHistory vim/core/history.txt /*g:EclimProjectKeepLocalHistory*
|
||||
g:EclimProjectProblemsUpdateOnSave vim/core/project.txt /*g:EclimProjectProblemsUpdateOnSave*
|
||||
g:EclimProjectStatusLine vim/core/project.txt /*g:EclimProjectStatusLine*
|
||||
g:EclimProjectTabTreeAutoOpen vim/core/project.txt /*g:EclimProjectTabTreeAutoOpen*
|
||||
g:EclimProjectTreeActions vim/core/project.txt /*g:EclimProjectTreeActions*
|
||||
g:EclimProjectTreeAutoOpen vim/core/project.txt /*g:EclimProjectTreeAutoOpen*
|
||||
g:EclimProjectTreeAutoOpenProjects vim/core/project.txt /*g:EclimProjectTreeAutoOpenProjects*
|
||||
g:EclimProjectTreeExpandPathOnOpen vim/core/project.txt /*g:EclimProjectTreeExpandPathOnOpen*
|
||||
g:EclimProjectTreePathEcho vim/core/project.txt /*g:EclimProjectTreePathEcho*
|
||||
g:EclimProjectTreeSharedInstance vim/core/project.txt /*g:EclimProjectTreeSharedInstance*
|
||||
g:EclimPythonInterpreter vim/python/django.txt /*g:EclimPythonInterpreter*
|
||||
g:EclimPythonSearchSingleResult vim/python/search.txt /*g:EclimPythonSearchSingleResult*
|
||||
g:EclimPythonValidate vim/python/validate.txt /*g:EclimPythonValidate*
|
||||
g:EclimRefactorDiffOrientation vim/refactoring.txt /*g:EclimRefactorDiffOrientation*
|
||||
g:EclimRefactorDiffOrientation_java vim/java/refactor.txt /*g:EclimRefactorDiffOrientation_java*
|
||||
g:EclimRubySearchSingleResult vim/ruby/search.txt /*g:EclimRubySearchSingleResult*
|
||||
g:EclimRubyValidate vim/ruby/validate.txt /*g:EclimRubyValidate*
|
||||
g:EclimScalaSearchSingleResult vim/scala/search.txt /*g:EclimScalaSearchSingleResult*
|
||||
g:EclimScalaValidate vim/scala/validate.txt /*g:EclimScalaValidate*
|
||||
g:EclimShowCurrentError vim/core/eclim.txt /*g:EclimShowCurrentError*
|
||||
g:EclimSignLevel vim/core/eclim.txt /*g:EclimSignLevel*
|
||||
g:EclimTodoSearchExtensions vim/core/project.txt /*g:EclimTodoSearchExtensions*
|
||||
g:EclimTodoSearchPattern vim/core/project.txt /*g:EclimTodoSearchPattern*
|
||||
g:EclimTraceHighlight vim/core/eclim.txt /*g:EclimTraceHighlight*
|
||||
g:EclimWarningHighlight vim/core/eclim.txt /*g:EclimWarningHighlight*
|
||||
g:EclimWebXmlValidate vim/java/webxml.txt /*g:EclimWebXmlValidate*
|
||||
g:EclimXmlValidate vim/xml/index.txt /*g:EclimXmlValidate*
|
||||
g:EclimXsdValidate vim/xml/index.txt /*g:EclimXsdValidate*
|
||||
g:HtmlDjangoCompleteEndTag vim/python/django.txt /*g:HtmlDjangoCompleteEndTag*
|
||||
g:HtmlDjangoUserBodyElements vim/python/django.txt /*g:HtmlDjangoUserBodyElements*
|
||||
g:HtmlDjangoUserFilters vim/python/django.txt /*g:HtmlDjangoUserFilters*
|
||||
g:HtmlDjangoUserTags vim/python/django.txt /*g:HtmlDjangoUserTags*
|
||||
gettinghelp gettinghelp.txt /*gettinghelp*
|
||||
gettingstarted gettingstarted.txt /*gettingstarted*
|
||||
gettingstarted-android gettingstarted.txt /*gettingstarted-android*
|
||||
gettingstarted-coding gettingstarted.txt /*gettingstarted-coding*
|
||||
gettingstarted-create gettingstarted.txt /*gettingstarted-create*
|
||||
gettingstarted-maven gettingstarted.txt /*gettingstarted-maven*
|
||||
gvim-embedded eclimd.txt /*gvim-embedded*
|
||||
html vim/html/index.txt /*html*
|
||||
htmldjango vim/python/django.txt /*htmldjango*
|
||||
index index.txt /*index*
|
||||
install install.txt /*install*
|
||||
install-headless install.txt /*install-headless*
|
||||
install-source install.txt /*install-source*
|
||||
installer install.txt /*installer*
|
||||
installer-automated install.txt /*installer-automated*
|
||||
installer-issues install.txt /*installer-issues*
|
||||
installer-proxy install.txt /*installer-proxy*
|
||||
log4j vim/java/logging.txt /*log4j*
|
||||
org.eclim.java.checkstyle.config vim/java/validate.txt /*org.eclim.java.checkstyle.config*
|
||||
org.eclim.java.checkstyle.onvalidate vim/java/validate.txt /*org.eclim.java.checkstyle.onvalidate*
|
||||
org.eclim.java.checkstyle.properties vim/java/validate.txt /*org.eclim.java.checkstyle.properties*
|
||||
org.eclim.java.import.exclude vim/java/import.txt /*org.eclim.java.import.exclude*
|
||||
org.eclim.java.import.package_separation_level vim/java/import.txt /*org.eclim.java.import.package_separation_level*
|
||||
org.eclim.java.junit.envvars vim/java/unittests.txt /*org.eclim.java.junit.envvars*
|
||||
org.eclim.java.junit.jvmargs vim/java/unittests.txt /*org.eclim.java.junit.jvmargs*
|
||||
org.eclim.java.junit.output_dir vim/java/unittests.txt /*org.eclim.java.junit.output_dir*
|
||||
org.eclim.java.junit.sysprops vim/java/unittests.txt /*org.eclim.java.junit.sysprops*
|
||||
org.eclim.java.logging.impl vim/java/logging.txt /*org.eclim.java.logging.impl*
|
||||
org.eclim.java.logging.template vim/java/logging.txt /*org.eclim.java.logging.template*
|
||||
org.eclim.java.run.mainclass vim/java/java.txt /*org.eclim.java.run.mainclass*
|
||||
org.eclim.project.version vim/core/eclim.txt /*org.eclim.project.version*
|
||||
org.eclim.user.email vim/core/eclim.txt /*org.eclim.user.email*
|
||||
org.eclim.user.name vim/core/eclim.txt /*org.eclim.user.name*
|
||||
org.eclipse.jdt.core.compiler.source vim/java/validate.txt /*org.eclipse.jdt.core.compiler.source*
|
||||
org.eclipse.jdt.ui.importorder vim/java/import.txt /*org.eclipse.jdt.ui.importorder*
|
||||
pid eclimd.txt /*pid*
|
||||
python-rope vim/python/index.txt /*python-rope*
|
||||
relatedprojects relatedprojects.txt /*relatedprojects*
|
||||
troubleshooting faq.txt /*troubleshooting*
|
||||
ts_completion faq.txt /*ts_completion*
|
||||
ts_exception faq.txt /*ts_exception*
|
||||
ts_ftplugin faq.txt /*ts_ftplugin*
|
||||
ts_incompatible_plugins faq.txt /*ts_incompatible_plugins*
|
||||
ts_signs_misplaced faq.txt /*ts_signs_misplaced*
|
||||
ts_workspace faq.txt /*ts_workspace*
|
||||
uninstall install.txt /*uninstall*
|
||||
uninstall-automated install.txt /*uninstall-automated*
|
||||
vim-c-complete vim/c/complete.txt /*vim-c-complete*
|
||||
vim-c-index vim/c/index.txt /*vim-c-index*
|
||||
vim-c-inspection vim/c/inspection.txt /*vim-c-inspection*
|
||||
vim-c-project vim/c/project.txt /*vim-c-project*
|
||||
vim-c-search vim/c/search.txt /*vim-c-search*
|
||||
vim-c-validate vim/c/validate.txt /*vim-c-validate*
|
||||
vim-code_completion vim/code_completion.txt /*vim-code_completion*
|
||||
vim-core-eclim vim/core/eclim.txt /*vim-core-eclim*
|
||||
vim-core-history vim/core/history.txt /*vim-core-history*
|
||||
vim-core-index vim/core/index.txt /*vim-core-index*
|
||||
vim-core-locate vim/core/locate.txt /*vim-core-locate*
|
||||
vim-core-project vim/core/project.txt /*vim-core-project*
|
||||
vim-core-util vim/core/util.txt /*vim-core-util*
|
||||
vim-dltk-buildpath vim/dltk/buildpath.txt /*vim-dltk-buildpath*
|
||||
vim-html-index vim/html/index.txt /*vim-html-index*
|
||||
vim-index vim/index.txt /*vim-index*
|
||||
vim-java-ant vim/java/ant.txt /*vim-java-ant*
|
||||
vim-java-classpath vim/java/classpath.txt /*vim-java-classpath*
|
||||
vim-java-complete vim/java/complete.txt /*vim-java-complete*
|
||||
vim-java-format vim/java/format.txt /*vim-java-format*
|
||||
vim-java-import vim/java/import.txt /*vim-java-import*
|
||||
vim-java-index vim/java/index.txt /*vim-java-index*
|
||||
vim-java-inspection vim/java/inspection.txt /*vim-java-inspection*
|
||||
vim-java-java vim/java/java.txt /*vim-java-java*
|
||||
vim-java-javadoc vim/java/javadoc.txt /*vim-java-javadoc*
|
||||
vim-java-logging vim/java/logging.txt /*vim-java-logging*
|
||||
vim-java-maven vim/java/maven.txt /*vim-java-maven*
|
||||
vim-java-methods vim/java/methods.txt /*vim-java-methods*
|
||||
vim-java-refactor vim/java/refactor.txt /*vim-java-refactor*
|
||||
vim-java-search vim/java/search.txt /*vim-java-search*
|
||||
vim-java-unittests vim/java/unittests.txt /*vim-java-unittests*
|
||||
vim-java-validate vim/java/validate.txt /*vim-java-validate*
|
||||
vim-java-webxml vim/java/webxml.txt /*vim-java-webxml*
|
||||
vim-javascript-index vim/javascript/index.txt /*vim-javascript-index*
|
||||
vim-php-buildpath vim/php/buildpath.txt /*vim-php-buildpath*
|
||||
vim-php-complete vim/php/complete.txt /*vim-php-complete*
|
||||
vim-php-index vim/php/index.txt /*vim-php-index*
|
||||
vim-php-search vim/php/search.txt /*vim-php-search*
|
||||
vim-php-validate vim/php/validate.txt /*vim-php-validate*
|
||||
vim-python-complete vim/python/complete.txt /*vim-python-complete*
|
||||
vim-python-django vim/python/django.txt /*vim-python-django*
|
||||
vim-python-index vim/python/index.txt /*vim-python-index*
|
||||
vim-python-search vim/python/search.txt /*vim-python-search*
|
||||
vim-python-validate vim/python/validate.txt /*vim-python-validate*
|
||||
vim-refactoring vim/refactoring.txt /*vim-refactoring*
|
||||
vim-ruby-buildpath vim/ruby/buildpath.txt /*vim-ruby-buildpath*
|
||||
vim-ruby-complete vim/ruby/complete.txt /*vim-ruby-complete*
|
||||
vim-ruby-index vim/ruby/index.txt /*vim-ruby-index*
|
||||
vim-ruby-search vim/ruby/search.txt /*vim-ruby-search*
|
||||
vim-ruby-validate vim/ruby/validate.txt /*vim-ruby-validate*
|
||||
vim-scala-complete vim/scala/complete.txt /*vim-scala-complete*
|
||||
vim-scala-index vim/scala/index.txt /*vim-scala-index*
|
||||
vim-scala-search vim/scala/search.txt /*vim-scala-search*
|
||||
vim-scala-validate vim/scala/validate.txt /*vim-scala-validate*
|
||||
vim-settings vim/settings.txt /*vim-settings*
|
||||
vim-xml-index vim/xml/index.txt /*vim-xml-index*
|
||||
xml vim/xml/index.txt /*xml*
|
||||
xml-validation vim/xml/index.txt /*xml-validation*
|
||||
xsd vim/xml/index.txt /*xsd*
|
||||
24
.vim/bundle/eclim/eclim/doc/vim/c/complete.txt
Normal file
24
.vim/bundle/eclim/eclim/doc/vim/c/complete.txt
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
*vim-c-complete*
|
||||
|
||||
C/C++ Code Completion
|
||||
*********************
|
||||
|
||||
C/C++ code completion uses the standard Vim code completion mechanism
|
||||
(|vim-code_completion|) like so:
|
||||
|
||||
>
|
||||
|
||||
#include <st<C-X><C-U>
|
||||
#include <stio.h>
|
||||
|
||||
int main(void) {
|
||||
pu<C-X><C-U>
|
||||
puts(
|
||||
puts("Hello World");
|
||||
return EX<C-X><C-U>
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
<
|
||||
|
||||
vim:ft=eclimhelp
|
||||
31
.vim/bundle/eclim/eclim/doc/vim/c/index.txt
Normal file
31
.vim/bundle/eclim/eclim/doc/vim/c/index.txt
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
*vim-c-index*
|
||||
|
||||
C/C++
|
||||
*****
|
||||
|
||||
|
||||
Features
|
||||
========
|
||||
|
||||
- C/C++ Project Configuration (vim-c-project)
|
||||
- C/C++ Code Completion (vim-c-complete)
|
||||
- C/C++ Validation (vim-c-validate)
|
||||
- C/C++ Search (vim-c-search)
|
||||
- C/C++ Code Inspection (vim-c-inspection)
|
||||
|
||||
Suggested Mappings
|
||||
==================
|
||||
|
||||
Here are some mappings for the c/c++ funtionality provided by eclim.
|
||||
To make use of these mappings, simply create a ftplugin file for c/cpp
|
||||
and place your mappings there (:help ftplugin-name).
|
||||
|
||||
- The following mapping allows you to simply hit <enter> on an element
|
||||
to perform a search to find it.
|
||||
|
||||
>
|
||||
nnoremap <silent> <buffer> <cr> :CSearchContext<cr>
|
||||
|
||||
<
|
||||
|
||||
vim:ft=eclimhelp
|
||||
64
.vim/bundle/eclim/eclim/doc/vim/c/inspection.txt
Normal file
64
.vim/bundle/eclim/eclim/doc/vim/c/inspection.txt
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
*vim-c-inspection*
|
||||
|
||||
*:CCallHierarchy*
|
||||
|
||||
|
||||
C/C++ Code Inspection
|
||||
*********************
|
||||
|
||||
|
||||
Call Hierarchy
|
||||
==============
|
||||
|
||||
When viewing a c or c++ source file you can view the call hierarchy of
|
||||
a function or method by issuing the command :CCallHierarchy. This
|
||||
will open a temporary buffer with an inversed tree view of the
|
||||
hierarchy of callers of the requested function or method.
|
||||
|
||||
>
|
||||
|
||||
fun2(int)
|
||||
fun1(int)
|
||||
main()
|
||||
fun3(int)
|
||||
fun3(int)
|
||||
|
||||
<
|
||||
|
||||
|
||||
While you are in the hierarchy tree buffer, you can jump to the call
|
||||
under the cursor using one of the following key bindings:
|
||||
|
||||
- <cr> - open the type using the (default action).
|
||||
|
||||
- E - open the type via :edit
|
||||
|
||||
- S - open the type via :split
|
||||
|
||||
- T - open the type via :tabnew
|
||||
|
||||
- ? - view help buffer
|
||||
|
||||
:CCallHierarchy can also be used to view the callees for a function or
|
||||
method by invoking the command with a !:
|
||||
|
||||
>
|
||||
|
||||
:CCallHierarchy!
|
||||
|
||||
<
|
||||
|
||||
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
Vim Settings (|vim-settings|)
|
||||
|
||||
*g:EclimCCallHierarchyDefaultAction*
|
||||
|
||||
- g:EclimCCallHierarchyDefaultAction (defaults to 'split') -
|
||||
Determines the command used to open the file when hitting <enter> on
|
||||
an entry in the hierarchy buffer.
|
||||
|
||||
vim:ft=eclimhelp
|
||||
61
.vim/bundle/eclim/eclim/doc/vim/c/project.txt
Normal file
61
.vim/bundle/eclim/eclim/doc/vim/c/project.txt
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
*vim-c-project*
|
||||
|
||||
*:CProjectConfigs*
|
||||
|
||||
|
||||
C/C++ Project Configuration
|
||||
***************************
|
||||
|
||||
The eclipse cdt provides a large set of configuration support for your
|
||||
c/c++ projects. Eclim exposes a subset of these to you using the
|
||||
:CProjectConfigs command:
|
||||
|
||||
>
|
||||
|
||||
:CProjectConfigs
|
||||
|
||||
" or if you are outside of the project
|
||||
:CProjectConfigs my_c_project
|
||||
|
||||
<
|
||||
|
||||
|
||||
This command will open a temporary buffer displaying some of the cdt
|
||||
configuration values available to you. In this buffer you can add or
|
||||
remove source directory references, include path references, and
|
||||
symbols.
|
||||
|
||||
Here is a small example of what the contents may look like:
|
||||
|
||||
>
|
||||
|
||||
Config: Linux GCC
|
||||
|
||||
Sources: |add|
|
||||
dir: src
|
||||
|
||||
Tool: GCC C Compiler
|
||||
Includes: |add|
|
||||
path: "${workspace_loc:/my_c_project/includes}"
|
||||
Symbols: |add|
|
||||
|
||||
Tool: GCC Assembler
|
||||
Includes: |add|
|
||||
|
||||
<
|
||||
|
||||
|
||||
To add a source directory, include path, or symbol, simply move the
|
||||
cursor over the relevant "|add|" link and hit <enter>. You will then
|
||||
be prompted to enter an appropriate value. For your convenience, tab
|
||||
completion is provided where possible.
|
||||
|
||||
Note: Despite the odd looking value in the includes path section above, to
|
||||
add the entry you simply need to supply the project relative path,
|
||||
"includes/" in this case, when prompted by the add command.
|
||||
|
||||
If at any point you would like to remove a value, you can move the
|
||||
cursor over the line of the value you would like to remove and hit D
|
||||
(shift-d) to delete the entry.
|
||||
|
||||
vim:ft=eclimhelp
|
||||
153
.vim/bundle/eclim/eclim/doc/vim/c/search.txt
Normal file
153
.vim/bundle/eclim/eclim/doc/vim/c/search.txt
Normal file
|
|
@ -0,0 +1,153 @@
|
|||
*vim-c-search*
|
||||
|
||||
C/C++ Search
|
||||
************
|
||||
|
||||
*:CSearch*
|
||||
|
||||
|
||||
Pattern Search
|
||||
==============
|
||||
|
||||
Pattern searching provides a means to widen a search beyond a single
|
||||
element. A pattern search can be executed using the command
|
||||
|
||||
:CSearch -p <pattern> [-t <type> -s <scope> -x <context> -i]
|
||||
|
||||
All of the results will be placed into the current window's location
|
||||
list (:help location-list) so that you can easily navigate the
|
||||
results.
|
||||
|
||||
Vim command completion is supported through out the command with the
|
||||
exception of the pattern to search for.
|
||||
|
||||
>
|
||||
|
||||
:CSearch <Tab>
|
||||
:CSearch -p MyClass* <Tab>
|
||||
:CSearch -p MyClass* -t <Tab>
|
||||
:CSearch -p MyClass* -t class <Tab>
|
||||
:CSearch -p MyClass* -t class -s <Tab>
|
||||
:CSearch -p MyClass* -t class -s project
|
||||
:CSearch -p MyClass* -t class -s project <Tab>
|
||||
:CSearch -p MyClass* -t class -s project -x <Tab>
|
||||
:CSearch -p MyClass* -t class -s project -x declarations
|
||||
|
||||
<
|
||||
|
||||
|
||||
- -p <pattern>: The pattern to search for.
|
||||
|
||||
Ex.
|
||||
|
||||
>
|
||||
MyClass
|
||||
myFunction
|
||||
my*
|
||||
|
||||
<
|
||||
|
||||
- -t <type> (Default: all): The type of element to search for where
|
||||
possible types include
|
||||
|
||||
- class_struct
|
||||
|
||||
- function
|
||||
|
||||
- variable
|
||||
|
||||
- union
|
||||
|
||||
- method
|
||||
|
||||
- field
|
||||
|
||||
- enum
|
||||
|
||||
- enumerator
|
||||
|
||||
- namespace
|
||||
|
||||
- typedef
|
||||
|
||||
- macro
|
||||
|
||||
- -s <scope> (Default: all): The scope of the search where possible
|
||||
scope values include
|
||||
|
||||
- all - Search the whole workspace.
|
||||
|
||||
- project - Search the current project, dependent projects, and
|
||||
include paths.
|
||||
|
||||
- -x <context> (Default: declarations): The context of the search,
|
||||
where possible context values include
|
||||
|
||||
- all - Search for declarations and references.
|
||||
|
||||
- declarations - Search for declarations only.
|
||||
|
||||
- references - Search for all references.
|
||||
|
||||
- -i: Ignore case when searching.
|
||||
|
||||
|
||||
Element Search
|
||||
==============
|
||||
|
||||
Element searching allows you to place the cursor over just about any
|
||||
element in a source file (method call, class name, constant) and
|
||||
perform a search for that element. Performing an element search is
|
||||
the same as performing a pattern search with the exception that you do
|
||||
not specify the -p option since the element under the cursor will be
|
||||
searched for instead.
|
||||
|
||||
If only one result is found and that result is in the current source
|
||||
file, the cursor will be moved to the element found. Otherwise, on
|
||||
single result matches, the value of |g:EclimCSearchSingleResult| will
|
||||
be consulted for the action to take. If there are multiple results,
|
||||
the location list will be opened with the list of results.
|
||||
|
||||
*:CSearchContext*
|
||||
|
||||
As a convenience eclim also provides the command :CSearchContext.
|
||||
This command accepts no arguments and will perform the appropriate
|
||||
search depending on the context of the element under the cursor.
|
||||
|
||||
- If the cursor is on an #include name, it will search the configured
|
||||
include path for the file.
|
||||
|
||||
- Otherwise, it will search for the definition of the element (if the
|
||||
cursor is on the definition, then it will search for the
|
||||
declaration).
|
||||
|
||||
|
||||
Configuration
|
||||
=============
|
||||
|
||||
Vim Settings (|vim-settings|)
|
||||
|
||||
*g:EclimCSearchSingleResult*
|
||||
|
||||
- g:EclimCSearchSingleResult (Default: 'split') - Determines what
|
||||
action to take when a only a single result is found.
|
||||
|
||||
Possible values include:
|
||||
|
||||
- 'split' - open the result in a new window via "split".
|
||||
|
||||
- 'edit' - open the result in the current window.
|
||||
|
||||
- 'tabnew' - open the result in a new tab.
|
||||
|
||||
- 'lopen' - open the location list to display the result.
|
||||
|
||||
This setting overrides the global default for all supported language
|
||||
types which can be set using the g:EclimDefaultFileOpenAction
|
||||
setting which accepts the same possible values.
|
||||
|
||||
- g:EclimLocationListHeight (Default: 10) - Sets the height in lines
|
||||
of the location list window when eclim opens it to display search
|
||||
results.
|
||||
|
||||
vim:ft=eclimhelp
|
||||
14
.vim/bundle/eclim/eclim/doc/vim/c/tags
Normal file
14
.vim/bundle/eclim/eclim/doc/vim/c/tags
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
:CCallHierarchy inspection.txt /*:CCallHierarchy*
|
||||
:CProjectConfigs project.txt /*:CProjectConfigs*
|
||||
:CSearch search.txt /*:CSearch*
|
||||
:CSearchContext search.txt /*:CSearchContext*
|
||||
:Validate_c validate.txt /*:Validate_c*
|
||||
g:EclimCCallHierarchyDefaultAction inspection.txt /*g:EclimCCallHierarchyDefaultAction*
|
||||
g:EclimCSearchSingleResult search.txt /*g:EclimCSearchSingleResult*
|
||||
g:EclimCValidate validate.txt /*g:EclimCValidate*
|
||||
vim-c-complete complete.txt /*vim-c-complete*
|
||||
vim-c-index index.txt /*vim-c-index*
|
||||
vim-c-inspection inspection.txt /*vim-c-inspection*
|
||||
vim-c-project project.txt /*vim-c-project*
|
||||
vim-c-search search.txt /*vim-c-search*
|
||||
vim-c-validate validate.txt /*vim-c-validate*
|
||||
36
.vim/bundle/eclim/eclim/doc/vim/c/validate.txt
Normal file
36
.vim/bundle/eclim/eclim/doc/vim/c/validate.txt
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
*vim-c-validate*
|
||||
|
||||
*:Validate_c*
|
||||
|
||||
|
||||
C/C++ Validation
|
||||
****************
|
||||
|
||||
When saving a c/c++ source file that resides in a project, eclim will
|
||||
update that source file in Eclipse and will report any validation
|
||||
errors found. Any errors will be placed in the current window's
|
||||
location list (:help location-list) and the corresponding lines in the
|
||||
source file will be marked via Vim's :sign functionality with '>>'
|
||||
markers in the left margin.
|
||||
|
||||
Automatic validation of c/c++ source files can be disabled via the
|
||||
g:EclimCValidate variable (described below). If you choose to disable
|
||||
automatic validation, you can still use the :Validate command to
|
||||
manually validate the current file.
|
||||
|
||||
|
||||
Configuration
|
||||
=============
|
||||
|
||||
Vim Settings (|vim-settings|)
|
||||
|
||||
*g:EclimCValidate*
|
||||
|
||||
- g:EclimCValidate (Default: 1) - If set to 0, disables source code
|
||||
validation.
|
||||
|
||||
- g:EclimValidateSortResults (Default: 'occurrence') - If set to
|
||||
'severity', the validation results will be sorted by severity
|
||||
(errors > warnings > info > etc.)
|
||||
|
||||
vim:ft=eclimhelp
|
||||
90
.vim/bundle/eclim/eclim/doc/vim/code_completion.txt
Normal file
90
.vim/bundle/eclim/eclim/doc/vim/code_completion.txt
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
*vim-code_completion*
|
||||
|
||||
Code Completion
|
||||
***************
|
||||
|
||||
All the code completion functionality provided by eclim (ant, java,
|
||||
etc) makes use of the new "User Defined Completion" added to Vim 7.
|
||||
To initiate code completion enter insert mode and type Ctrl-X Ctrl-U.
|
||||
By default Vim will open a popup if there is more than one completion.
|
||||
|
||||
*g:EclimCompletionMethod*
|
||||
|
||||
Note: If you would prefer to have eclim use vim's omni code completion
|
||||
instead, you can add the following to your vimrc:>
|
||||
|
||||
let g:EclimCompletionMethod = 'omnifunc'
|
||||
|
||||
<
|
||||
|
||||
|
||||
When using omnifunc you will use Ctrl-X Ctrl-O to start code
|
||||
completion.
|
||||
|
||||
Example with java completion
|
||||
|
||||
[image]
|
||||
|
||||
Once you have started the completion you can use Ctrl-N to proceed to
|
||||
the next match and Ctrl-P to move to the previous match.
|
||||
|
||||
If you are like me and you find those key strokes a bit cumbersome,
|
||||
then you might want to check out one of the following plugins which
|
||||
can make completion usage less cumbersome:
|
||||
|
||||
- SuperTab (https://github.com/ervandew/supertab) This plugin's aim is
|
||||
to allow you to use <tab> for all your code completion needs.
|
||||
|
||||
- AutoComplPop (https://bitbucket.org/ns9tks/vim-autocomplpop) This
|
||||
plugin will automatically open the completion popup for you after
|
||||
you've typed a preconfigured number of characters. You can use
|
||||
AutoComplPop in lieu of, on in conjunction with SuperTab.
|
||||
|
||||
AutoComplPop by default only supports triggering code completion for
|
||||
file types who have an omni completion that ships with vim, but you
|
||||
can configure it to support eclim code completion. Here is an
|
||||
example of some vim script you can add to your vimrc to enabled
|
||||
AutoComlPop for java file types (this example will trigger the
|
||||
completion popup when at least 3 characters have been typed after a
|
||||
dot, but you can tweak this to your tastes):
|
||||
|
||||
>
|
||||
let g:acp_behaviorJavaEclimLength = 3
|
||||
function MeetsForJavaEclim(context)
|
||||
return g:acp_behaviorJavaEclimLength >= 0 &&
|
||||
\ a:context =~ '\k\.\k\{' . g:acp_behaviorJavaEclimLength . ',}$'
|
||||
endfunction
|
||||
let g:acp_behavior = {
|
||||
\ 'java': [{
|
||||
\ 'command': "\<c-x>\<c-u>",
|
||||
\ 'completefunc' : 'eclim#java#complete#CodeComplete',
|
||||
\ 'meets' : 'MeetsForJavaEclim',
|
||||
\ }]
|
||||
\ }
|
||||
|
||||
<
|
||||
|
||||
- YouCompleteMe (https://github.com/Valloric/YouCompleteMe): Like
|
||||
AutoComplPop, YouCompleteMe will automatically open the completion
|
||||
popup for you and it also adds fuzzy matching of completion results.
|
||||
This plugin does have a compiled component to it so be sure to read
|
||||
their install docs thoroughly.
|
||||
|
||||
Once installed, you'll need to add the following to your vimrc so
|
||||
that eclim and YouCompleteMe play nice together:
|
||||
|
||||
>
|
||||
let g:EclimCompletionMethod = 'omnifunc'
|
||||
|
||||
<
|
||||
|
||||
To find out more about Vim's insert completion execute the following
|
||||
from within Vim:
|
||||
|
||||
>
|
||||
|
||||
:h ins-completion
|
||||
|
||||
<
|
||||
|
||||
vim:ft=eclimhelp
|
||||
202
.vim/bundle/eclim/eclim/doc/vim/core/eclim.txt
Normal file
202
.vim/bundle/eclim/eclim/doc/vim/core/eclim.txt
Normal file
|
|
@ -0,0 +1,202 @@
|
|||
*vim-core-eclim*
|
||||
|
||||
Eclim Manage / Config
|
||||
*********************
|
||||
|
||||
Below is a list of the core commands and configuration for eclim
|
||||
inside of vim.
|
||||
|
||||
|
||||
Commands
|
||||
========
|
||||
|
||||
*:PingEclim*
|
||||
|
||||
- :PingEclim - Pings eclimd to see if it is up and running.
|
||||
|
||||
*:ShutdownEclim*
|
||||
|
||||
- :ShutdownEclim - Shuts down the current running eclimd instance.
|
||||
|
||||
*:EclimSettings*
|
||||
|
||||
- :EclimSettings - Allows you to view / edit the global settings
|
||||
(|vim-settings|). For project level settings see the
|
||||
|:ProjectSettings| command on the project documentation page
|
||||
(|vim-core-project|).
|
||||
|
||||
*:EclimDisable*
|
||||
|
||||
- :EclimDisable - Allows you to temporarily disable all communication
|
||||
with eclimd for the current vim session. Useful if you need to
|
||||
shutdown eclimd for one reason or antoher, and would like to disable
|
||||
vim's attempts to communicate with the non-existant server.
|
||||
|
||||
*:EclimEnable*
|
||||
|
||||
- :EclimEnable - Re-enables communication with eclimd (the converse of
|
||||
:EclimDisable).
|
||||
|
||||
*:EclimHelp*
|
||||
|
||||
- :EclimHelp [<topic>] - Similar to vim's :help command, with the
|
||||
exception that this command is limited to opening topics for eclim.
|
||||
|
||||
*:EclimHelpGrep*
|
||||
|
||||
- :EclimHelpGrep /<pattern>/ - Command which allows you to search the
|
||||
eclim help files via vimgrep.
|
||||
|
||||
Ex.
|
||||
|
||||
>
|
||||
:EclimHelpGrep /completion/
|
||||
|
||||
<
|
||||
|
||||
|
||||
Configuration
|
||||
=============
|
||||
|
||||
Eclim Settings (|vim-settings|)
|
||||
|
||||
*org.eclim.user.name*
|
||||
|
||||
- org.eclim.user.name Should be set to your name. Used by various
|
||||
commands that add contact or author information to a file.
|
||||
|
||||
*org.eclim.user.email*
|
||||
|
||||
- org.eclim.user.email Should be set to the email address where you
|
||||
can be contacted. Used by various commands that add contact or
|
||||
author information to a file.
|
||||
|
||||
*org.eclim.project.version*
|
||||
|
||||
- org.eclim.project.version Should be set to the version number of
|
||||
your project. This is used by various commands that add version
|
||||
info to a file or utilize the version number in some other manner.
|
||||
|
||||
Defaults to "1.0".
|
||||
|
||||
Vim Settings (|vim-settings|)
|
||||
|
||||
The following is a list of some of the common Vim variables available.
|
||||
|
||||
*g:EclimLogLevel*
|
||||
|
||||
- g:EclimLogLevel (Default: 4)
|
||||
|
||||
Much like the Vim 'verbose' option, this variable allows you to
|
||||
control the level of output from eclim as follows:
|
||||
|
||||
- <= 0: No output.
|
||||
|
||||
- >= 1: Fatal errors.
|
||||
|
||||
- >= 2: Errors.
|
||||
|
||||
- >= 3: Warning messages.
|
||||
|
||||
- >= 4: Info messages.
|
||||
|
||||
- >= 5: Debug messages.
|
||||
|
||||
- >= 6: Trace messages.
|
||||
|
||||
Each level also has a corresponding variable to set the highlighting
|
||||
group used for the text.
|
||||
|
||||
*g:EclimFatalHighlight*
|
||||
- g:EclimFatalHighlight (Default: "Error")
|
||||
|
||||
*g:EclimErrorHighlight*
|
||||
- g:EclimErrorHighlight (Default: "Error")
|
||||
|
||||
*g:EclimWarningHighlight*
|
||||
- g:EclimWarningHighlight (Default: "WarningMsg")
|
||||
|
||||
*g:EclimInfoHighlight*
|
||||
- g:EclimInfoHighlight (Default: "Statement")
|
||||
|
||||
*g:EclimDebugHighlight*
|
||||
- g:EclimDebugHighlight (Default: "Normal")
|
||||
|
||||
*g:EclimTraceHighlight*
|
||||
- g:EclimTraceHighlight (Default: "Normal")
|
||||
|
||||
*g:EclimSignLevel*
|
||||
|
||||
- g:EclimSignLevel (Default: 5)
|
||||
|
||||
Behaves just like g:EclimLogLevel except this applies to placing of
|
||||
Vim signs for displaying validation errors / warnings, or marking
|
||||
:[vim]grep matches.
|
||||
|
||||
The resulting signs also use the same highlighting variables above.
|
||||
|
||||
*g:EclimEchoHighlight*
|
||||
|
||||
- g:EclimEchoHighlight (Default: "Statement")
|
||||
|
||||
Determines which highlight group will be used for informative
|
||||
messages.
|
||||
|
||||
*g:EclimBrowser*
|
||||
|
||||
- g:EclimBrowser (Default: Dependent on OS)
|
||||
|
||||
Configures the external web browser to use when opening urls. By
|
||||
default eclim will attempt to set a default browser based on your
|
||||
system, but if it cannot find a compatible browser, you will need to
|
||||
set one in your vimrc.
|
||||
|
||||
- Firefox
|
||||
let g:EclimBrowser = 'firefox'
|
||||
|
||||
- Mozilla
|
||||
let g:EclimBrowser = 'mozilla'
|
||||
|
||||
- Opera
|
||||
let g:EclimBrowser = 'opera'
|
||||
|
||||
- IE
|
||||
let g:EclimBrowser = 'iexplore'
|
||||
|
||||
Note: The above examples assume that the browser executable is in
|
||||
your path. On windows machines they won't be by default, so you will
|
||||
need to add them.
|
||||
|
||||
*g:EclimShowCurrentError*
|
||||
|
||||
- g:EclimShowCurrentError (Default: 1)
|
||||
|
||||
This variable determines whether or not a CursorHold autocommand is
|
||||
created that will echo the error associated with the current line if
|
||||
any error exists. Setting this variable to 0 disables this feature.
|
||||
|
||||
*g:EclimMakeLCD*
|
||||
|
||||
- g:EclimMakeLCD (Default: 1)
|
||||
|
||||
When set to a non-0 value, all eclim based make commands (:Ant,
|
||||
:Maven, :Mvn, etc) will change to the current file's project root
|
||||
before executing.
|
||||
|
||||
Enabling this has the benefit of allowing you to run these commands
|
||||
from any file regardless of where it was opened from without having
|
||||
to worry about the directory it is executing from. For example if
|
||||
you have a file open from project A and split a file from project B,
|
||||
you can execute :Ant from the project B file and it will utilize
|
||||
project B's build.xml even though your current working directory is
|
||||
in project A.
|
||||
|
||||
*g:EclimMenus*
|
||||
|
||||
- g:EclimMenus (Default: 1)
|
||||
|
||||
When set to a non-0 value, enabled auto generation of gvim menus
|
||||
(under Plugin.eclim) for each eclim command available for the
|
||||
current buffer.
|
||||
|
||||
vim:ft=eclimhelp
|
||||
90
.vim/bundle/eclim/eclim/doc/vim/core/history.txt
Normal file
90
.vim/bundle/eclim/eclim/doc/vim/core/history.txt
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
*vim-core-history*
|
||||
|
||||
Eclipse Local History
|
||||
*********************
|
||||
|
||||
Eclipse provides a feature called local history, which is basically a
|
||||
simplistic version control system that is updated every time you save
|
||||
a file. Using this local history, you can view diffs against
|
||||
previously saved versions of your file or revert to one of those
|
||||
revisions.
|
||||
|
||||
Eclim supports updating eclipse's local history when writing files
|
||||
from vim, but by default this feature is disabled unless gvim was
|
||||
started from the eclipse gui, in which case eclim will honor the
|
||||
default eclipse editor behavior and update the local history. You can
|
||||
turn this feature on in all cases by adding the following to your
|
||||
vimrc:
|
||||
|
||||
>
|
||||
|
||||
let g:EclimProjectKeepLocalHistory = 1
|
||||
|
||||
<
|
||||
|
||||
|
||||
*:History*
|
||||
|
||||
:History - Opens a temporary buffer showing the local history for the
|
||||
current file. In this buffer you can perform the following actions
|
||||
using the specified key bindings:
|
||||
|
||||
- <cr> - view the contents of the revision under the cursor.
|
||||
|
||||
- d - diff the revision under the cursor against the current contents.
|
||||
|
||||
- r - revert the current file to the revision under the cursor.
|
||||
|
||||
- c - clear the local history for the file.
|
||||
|
||||
*:HistoryClear*
|
||||
|
||||
:HistoryClear[!] - Clears the local history for the current file.
|
||||
When the bang (!) is supplied, you are not prompted before clearing
|
||||
the history.
|
||||
|
||||
*:HistoryDiffNext*
|
||||
|
||||
:HistoryDiffNext - While the history buffer is open, this command
|
||||
allows you to diff the current file against the next entry in the
|
||||
history stack.
|
||||
|
||||
*:HistoryDiffPrev*
|
||||
|
||||
:HistoryDiffPrev - Just like :HistoryDiffNext but diffs against the
|
||||
previous entry in the stack.
|
||||
|
||||
|
||||
Configuration
|
||||
=============
|
||||
|
||||
Eclipse Settings
|
||||
|
||||
- When writing to the local history, eclim simply proxies the request
|
||||
to eclipse, so all eclipse settings are honored. To modify these
|
||||
settings you currently have to do so inside of the eclipse gui.
|
||||
First shut down eclimd if you are running a headless version, then
|
||||
open the eclipse gui and navigate to:
|
||||
|
||||
Window ‣ Preferences ‣ General ‣ Workspace ‣ Local History
|
||||
|
||||
And there you can edit your settings as necessary.
|
||||
|
||||
Vim Settings (|vim-settings|)
|
||||
|
||||
*g:EclimProjectKeepLocalHistory*
|
||||
|
||||
- g:EclimProjectKeepLocalHistory (Default: 0) - Controls whether
|
||||
writes in vim will update the eclipse local history. This is
|
||||
disabled by default unless gvim was started from the eclipse gui, in
|
||||
which case eclim will honor the default eclipse editor behavior and
|
||||
update the local history.
|
||||
|
||||
*g:EclimHistoryDiffOrientation*
|
||||
|
||||
- g:EclimHistoryDiffOrientation (Default: 'vertical') - When
|
||||
initiating diffs, this setting controls whether the diff window is
|
||||
opened as a horizontal split or vertical. Supported values include
|
||||
'horizontal' and 'vertical'.
|
||||
|
||||
vim:ft=eclimhelp
|
||||
12
.vim/bundle/eclim/eclim/doc/vim/core/index.txt
Normal file
12
.vim/bundle/eclim/eclim/doc/vim/core/index.txt
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
*vim-core-index*
|
||||
|
||||
Core Functionality
|
||||
******************
|
||||
|
||||
- Eclim Manage / Config (vim-core-eclim)
|
||||
- Eclipse Project Management (vim-core-project)
|
||||
- Eclipse Local History (vim-core-history)
|
||||
- Locate File (vim-core-locate)
|
||||
- Utility Commands (vim-core-util)
|
||||
|
||||
vim:ft=eclimhelp
|
||||
134
.vim/bundle/eclim/eclim/doc/vim/core/locate.txt
Normal file
134
.vim/bundle/eclim/eclim/doc/vim/core/locate.txt
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
*vim-core-locate*
|
||||
|
||||
*:LocateFile*
|
||||
|
||||
|
||||
Locate File
|
||||
***********
|
||||
|
||||
Eclim provides the :LocateFile command to allow you to quickly find
|
||||
and open files or buffers.
|
||||
|
||||
- :LocateFile [file_pattern] - Attempts to locate the supplied file
|
||||
pattern or if no argument is supplied, opens a temporary window
|
||||
where the text you type is turned into a pattern and search results
|
||||
are presented as you type.
|
||||
|
||||
[image]
|
||||
While in this completion mode the following key bindings are
|
||||
available:
|
||||
- <esc> - close the search window without selecting a file
|
||||
|
||||
- <tab> or <down> - cycle forward through the results
|
||||
|
||||
- <shift><tab> or <up> - cycle backwards through the results
|
||||
|
||||
- <enter> - open the selected file using the default action
|
||||
|
||||
- <ctrl>e - open the selected file via :edit
|
||||
|
||||
- <ctrl>s - open the selected file via :split
|
||||
|
||||
- <ctrl>t - open the selected file via :tabnew
|
||||
|
||||
- <ctrl>l - switch the locate scope
|
||||
|
||||
- <ctrl>h - toggle the help buffer
|
||||
|
||||
By default, the search string accepted by the completion mode is
|
||||
intended to be just portions of the file name you are looking for,
|
||||
which is then automatically expanded in an effort to help you find
|
||||
the file with the fewest keystrokes possible.
|
||||
|
||||
The argument version of :LocateFile on the other hand, accepts a
|
||||
hybrid glob/regex pattern. The glob portion allows you to use * and
|
||||
** to match portions of a path or traverse multiple directories.
|
||||
You can mix * and ** with standard perl compatible regex operators
|
||||
to construct your search pattern.
|
||||
|
||||
If you prefer the more explicit patterns supported by the argument
|
||||
version of :LocateFile over the default "fuzzy" pattern supported by
|
||||
the completion version of :LocateFile, then you can turn off the
|
||||
fuzzy matching support using the g:EclimLocateFileFuzzy variable
|
||||
described below.
|
||||
|
||||
By default, all searching by both variants of this command is
|
||||
limited to the current project and any projects listed as
|
||||
dependencies, but you can widen the search scope to include all open
|
||||
projects by setting g:EclimLocateFileScope to 'workspace', which is
|
||||
the default scope when :LocateFile is executed outside of a project.
|
||||
|
||||
In addition to the 'project' and 'workspace' scopes, :LocateFile
|
||||
also supports the following scopes:
|
||||
|
||||
- buffers: search listed buffers
|
||||
|
||||
- quickfix: search the quickfix results
|
||||
|
||||
Note: For performance reasons, locating files in the 'project' and
|
||||
'workspace' scopes depends on eclipse being aware of all your
|
||||
project files. For the most part this is handled automatically as
|
||||
you create and edit files within vim. However, actions you take
|
||||
outside of vim or eclipse (moving/removing files, updates from a
|
||||
version control system, etc.) will not be visible until you force
|
||||
a project refresh via |:ProjectRefresh|.
|
||||
|
||||
Note: If you would like to use :LocateFile even when eclimd is not
|
||||
running or for projects not known to eclim, one option would be to
|
||||
install the silver searcher
|
||||
(https://github.com/ggreer/the_silver_searcher), then install my
|
||||
ag plugin (https://github.com/ervandew/ag), and configure eclim to
|
||||
use the plugin as the fallback default:>
|
||||
|
||||
let g:EclimLocateFileNonProjectScope = 'ag'
|
||||
|
||||
<
|
||||
|
||||
|
||||
Configuration
|
||||
|
||||
Vim Settings (|vim-settings|)
|
||||
|
||||
*g:EclimLocateFileDefaultAction*
|
||||
- g:EclimLocateFileDefaultAction (Default: 'split') - Determines the
|
||||
command used to open the file when hitting <enter> on an entry in
|
||||
the locate file results.
|
||||
|
||||
*g:EclimLocateFileScope*
|
||||
- g:EclimLocateFileScope (Default: 'project') - Determines the scope
|
||||
for which to search for files.
|
||||
|
||||
- 'project': search only the current project and its dependencies.
|
||||
|
||||
- 'workspace': search the entire workspace (all open projects).
|
||||
|
||||
- 'buffers': search listed buffers
|
||||
|
||||
- 'quickfix': search the quickfix results
|
||||
|
||||
- 'vcsmodified': search files reported by your vcs as modified or
|
||||
untracked.
|
||||
|
||||
*g:EclimLocateFileFuzzy*
|
||||
- g:EclimLocateFileFuzzy (Default: 1) - Determines whether or not
|
||||
'fuzzy' searching will be used on the no argument version of
|
||||
:LocateFile.
|
||||
|
||||
*g:EclimLocateFileCaseInsensitive*
|
||||
- g:EclimLocateFileCaseInsensitive (Default: 'lower') - Determines
|
||||
when case insensitive searching is performed.
|
||||
|
||||
- 'lower': when the search string is all lower case the search
|
||||
will be case insensitive, but if one or more capital letters are
|
||||
present, then the search will be case sensitive.
|
||||
|
||||
- 'always': searching will always be case insensitive.
|
||||
|
||||
- 'never': searching will never be case insensitive.
|
||||
|
||||
Note: Search Filters: eclim does not yet expose the ability to add
|
||||
filters should you want to ignore certain directories, but you can
|
||||
configure this ability from within Eclipse:<right click on your
|
||||
project> ‣ Properties ‣ Resource ‣ Resource Filters
|
||||
|
||||
vim:ft=eclimhelp
|
||||
516
.vim/bundle/eclim/eclim/doc/vim/core/project.txt
Normal file
516
.vim/bundle/eclim/eclim/doc/vim/core/project.txt
Normal file
File diff suppressed because it is too large
Load diff
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue