Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Commit

Permalink
add new method of registering + viewing/editing eclim vim side settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ervandew committed Apr 14, 2014
1 parent c7c01a0 commit 67a4bb3
Show file tree
Hide file tree
Showing 63 changed files with 1,140 additions and 886 deletions.
13 changes: 13 additions & 0 deletions doc/content/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,19 @@
History of Changes
==================

.. _2.3.5:

2.3.5 (XXX. XX, 2014)
---------------------

Eclim:
- **:EclimSettings** renamed to **:WorkspaceSettings** to better reflect what
is being edited.
- Added :ref:`:VimSettings <:VimSettings>` command to make viewing/editing of
eclim's vim client settings easier.

| :gitlog:`Git Log (2.3.5) <2.3.4...2.3.5>`
.. _2.3.4:

2.3.4 (Apr. 12, 2014)
Expand Down
2 changes: 2 additions & 0 deletions doc/content/cheatsheet.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ Global Commands

- :ref:`:PingEclim <:PingEclim>` - Pings eclimd server.
- :ref:`:ShutdownEclim <:ShutdownEclim>` - Shuts down eclimd server.
- :ref:`:VimSettings <:VimSettings>` -
View / edit eclim's vim client settings.
- :ref:`:WorkspaceSettings <:WorkspaceSettings>` -
View / edit global workspace settings.
- :ref:`:EclimDisable <:EclimDisable>` -
Expand Down
6 changes: 3 additions & 3 deletions doc/content/faq.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. Copyright (C) 2005 - 2012 Eric Van Dewoestine
.. Copyright (C) 2005 - 2014 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
Expand Down Expand Up @@ -200,7 +200,7 @@ log level at any time by running:

.. code-block:: vim
:let g:EclimLogLevel = 10
:let g:EclimLogLevel = 'trace'
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
Expand Down Expand Up @@ -310,7 +310,7 @@ details which you can do by enabling eclim debugging in vim:

.. code-block:: vim
:let g:EclimLogLevel = 10
:let g:EclimLogLevel = 'trace'
Then you can perform the same action that triggered the error again. This time
you should receive the full stack trace of the error.
Expand Down
65 changes: 32 additions & 33 deletions doc/content/vim/core/eclim.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ Commands
- **:ShutdownEclim** -
Shuts down the current running eclimd instance.

.. _\:VimSettings:

- **:VimSettings** -
Allows you to view and edit all of eclim's vim client settings. Settings
edited here will be stored at ``$HOME/.eclim/.eclim_settings``.

.. note::

If you have any ``g:EclimXXX`` settings in your vimrc or equivalent, those
will take precedence over any settings edited using **:VimSettings**.

.. _\:WorkspaceSettings:

- **:WorkspaceSettings** -
Expand Down Expand Up @@ -100,63 +111,51 @@ The following is a list of some of the common Vim variables available.

.. _g\:EclimLogLevel:

- **g:EclimLogLevel** (Default: 4)
- **g:EclimLogLevel** (Default: 'info')

Much like the Vim 'verbose' option, this variable allows you to
control the level of output from eclim as follows\:
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.
- 'trace' - Show all trace, debug, info, warning, and error messages.
- 'debug' - Show all debug, info, warning, and error messages.
- 'info' - Show all info, warning, and error messages.
- 'warning' - Show only warning, and error messages.
- 'error' - Show only error messages.
- 'off' - Don't display any messages.

Each level also has a corresponding variable to set the highlighting group
used for the text.

.. _g\:EclimFatalHighlight:

- **g:EclimFatalHighlight** (Default: "Error")
.. _g\:EclimHighlightError:

.. _g\:EclimErrorHighlight:
- **g:EclimHighlightError** (Default: "Error")

- **g:EclimErrorHighlight** (Default: "Error")
.. _g\:EclimHighlightWarning:

.. _g\:EclimWarningHighlight:
- **g:EclimHighlightWarning** (Default: "WarningMsg")

- **g:EclimWarningHighlight** (Default: "WarningMsg")
.. _g\:EclimHighlightInfo:

.. _g\:EclimInfoHighlight:
- **g:EclimHighlightInfo** (Default: "Statement")

- **g:EclimInfoHighlight** (Default: "Statement")
.. _g\:EclimHighlightDebug:

.. _g\:EclimDebugHighlight:
- **g:EclimHighlightDebug** (Default: "Normal")

- **g:EclimDebugHighlight** (Default: "Normal")
.. _g\:EclimHighlightTrace:

.. _g\:EclimTraceHighlight:

- **g:EclimTraceHighlight** (Default: "Normal")
- **g:EclimHighlightTrace** (Default: "Normal")

.. _g\:EclimSignLevel:

- **g:EclimSignLevel** (Default: 5)
- **g:EclimSignLevel** (Default: 'info')

Behaves just like **g:EclimLogLevel** except this applies
to placing of Vim signs for displaying validation errors / warnings,
or marking :[vim]grep matches.
or marking quickfix/location list entries.

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)
Expand Down
6 changes: 3 additions & 3 deletions doc/content/vim/core/history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ adding the following to your vimrc:

.. code-block:: vim
let g:EclimProjectKeepLocalHistory = 1
let g:EclimKeepLocalHistory = 1
.. _\:History:
Expand Down Expand Up @@ -76,9 +76,9 @@ Eclipse Settings

:doc:`Vim Settings </vim/settings>`

.. _g\:EclimProjectKeepLocalHistory:
.. _g\:EclimKeepLocalHistory:

- **g:EclimProjectKeepLocalHistory (Default: 0)** -
- **g:EclimKeepLocalHistory (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
Expand Down
4 changes: 2 additions & 2 deletions doc/content/vim/core/project.rst
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@ Vim's command line completion to complete the project name.

:doc:`Vim Settings </vim/settings>`

.. _g\:EclimProblemsQuickFixOpen:
.. _g\:EclimProjectProblemsQuickFixOpen:

- **g:EclimProblemsQuickFixOpen** (Default: 'botright copen')
- **g:EclimProjectProblemsQuickFixOpen** (Default: 'botright copen')

Specified the command used to open the quickfix window when executing the
:ref`:ProjectProblems` command.
Expand Down
61 changes: 20 additions & 41 deletions doc/content/vim/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,51 +19,30 @@ Settings
========

Certain aspects of eclim can be controlled by modifying one or more
settings.
settings. There are two types of settings available:

There are two types of settings available:
Eclim daemon settings
---------------------

- **Global workspace / project settings.**
These are settings that reside in your Eclipse workspace or project and are used
to configure the behavior of the eclim daemon, independent of which client you
use (vim, emacs, etc).

These are settings that reside in your Eclipse workspace and are used to
control certain aspects of the eclim server's behavior. These settings
can be viewed and modified using one of the following commands:
These settings can be viewed and modified using one of the following commands:

- :ref:`:WorkspaceSettings`
- :ref:`:ProjectSettings`
- :ref:`:WorkspaceSettings`: Edit non-project dependent settings, or define
defaults for settings not overridden at the project level.
- :ref:`:ProjectSettings`: Define the settings for the current project.

- **Vim global variable settings.**
Vim client settings
-------------------

These are your typical global Vim variables which can be set within your
vimrc file.
These are the settings you use to control how vim (the primary eclimd client)
behaves. You can edit these settings one of two ways:

Given these two types, you may be ask, why do we need two? Or, when a new
setting is added, how do you decide which type to make it?

The reasoning behind having two types is that there are some settings that may
vary from one project to another. For instance, I may have one project that
can be used in jdk 1.3 and utilizes log4j for logging, while another project of
mine requires jdk 1.4 and utilizes slf4j for logging. Instances like this
require that each project be capable of storing their own settings. Rather
than reinvent this support in Vim, we utilize Eclipse's built in preferences
system.

If the Eclipse preferences system can store project level and global settings,
why not make all the eclim settings of this type? Well, the downside to
Eclipse preferences system is that an Eclipse instance must be running to
obtain the value of that preference. Eclim however, requires access to many
settings, regardless of whether Eclipse is running or not. So, to ensure that
these settings are always available, we utilize the standard Vim global
variable support.

When adding a new setting, deciding between an Eclipse preference or a Vim
global variable is a matter of answering the following:

- Will this setting vary from one project to another?

Yes: Add this setting an Eclipse preference.

- Does eclim need access to this setting regardless of whether an Eclipse
instance is running or not?

Yes: Add this setting a Vim global variable.
- :ref:`:VimSettings`: Allows you to view and edit all of eclim's vim client
settings. Settings edited here will be stored at
``$HOME/.eclim/.eclim_settings``.
- Alternately, you can add the equivalent ``g:EclimXXX`` setting to your vimrc
or an ftplugin file, and that setting will take precedence over any value set
using **:VimSettings**.
21 changes: 3 additions & 18 deletions org.eclim.cdt/vim/eclim/autoload/eclim/c/complete.vim
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
" Author: Eric Van Dewoestine
"
" Description: {{{
" see http://eclim.org/vim/c/complete.html
" License: {{{
"
" License:
"
" Copyright (C) 2005 - 2012 Eric Van Dewoestine
" Copyright (C) 2005 - 2014 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
Expand All @@ -22,25 +19,13 @@
"
" }}}

" Global Varables {{{
if !exists("g:EclimCCompleteLayout")
if &completeopt !~ 'preview' && &completeopt =~ 'menu'
let g:EclimCCompleteLayout = 'standard'
else
let g:EclimCCompleteLayout = 'compact'
endif
endif
" }}}

" Script Varables {{{
let s:complete_command =
\ '-command c_complete -p "<project>" -f "<file>" ' .
\ '-o <offset> -e <encoding> -l <layout>'
" }}}

" CodeComplete(findstart, base) {{{
" Handles code completion.
function! eclim#c#complete#CodeComplete(findstart, base)
function! eclim#c#complete#CodeComplete(findstart, base) " {{{
return eclim#lang#CodeComplete(
\ s:complete_command, a:findstart, a:base,
\ {'temp': 0, 'layout': g:EclimCCompleteLayout})
Expand Down
9 changes: 1 addition & 8 deletions org.eclim.cdt/vim/eclim/autoload/eclim/c/search.vim
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"
" License:
"
" Copyright (C) 2005 - 2013 Eric Van Dewoestine
" Copyright (C) 2005 - 2014 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
Expand All @@ -22,13 +22,6 @@
"
" }}}

" Global Varables {{{
if !exists("g:EclimCSearchSingleResult")
" possible values ('split', 'edit', 'lopen')
let g:EclimCSearchSingleResult = g:EclimDefaultFileOpenAction
endif
" }}}

" Script Varables {{{
let s:search = '-command c_search'
let s:includepaths = '-command c_includepaths -p "<project>"'
Expand Down
20 changes: 0 additions & 20 deletions org.eclim.cdt/vim/eclim/ftplugin/c.vim
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,6 @@
"
" }}}

" Global Variables {{{

if !exists("g:EclimCValidate")
let g:EclimCValidate = 1
endif

if !exists("g:EclimCSyntasticEnabled")
let g:EclimCSyntasticEnabled = 0
endif

if !exists("g:EclimCppSyntasticEnabled")
let g:EclimCppSyntasticEnabled = 0
endif

if !exists('g:EclimCCallHierarchyDefaultAction')
let g:EclimCCallHierarchyDefaultAction = g:EclimDefaultFileOpenAction
endif

" }}}

" Options {{{

exec 'setlocal ' . g:EclimCompletionMethod . '=eclim#c#complete#CodeComplete'
Expand Down
Loading

0 comments on commit 67a4bb3

Please sign in to comment.