Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
tme_rc
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Evans, Thomas
tme_rc
Commits
22202caa
Commit
22202caa
authored
6 years ago
by
Evans, Thomas
Browse files
Options
Downloads
Patches
Plain Diff
Updated README.
parent
a76e3c73
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+111
-11
111 additions, 11 deletions
README.md
with
111 additions
and
11 deletions
README.md
+
111
−
11
View file @
22202caa
...
...
@@ -15,12 +15,8 @@ These packages can be easily turned off by uncommenting the representative lines
in
`lisp/base.el`
. If you want to install them there is an install script in
`emacs/packages/emacs-pkgs`
.
We also use the
**Emacs**
package manager (ELPA and MELPA) to install the
following packages that are loaded in the
`init.el`
files:
*
ecb
*
auctex
*
auto-complete
We also use the
**Emacs**
package manager (ELPA and MELPA) to install
additional packages that are loaded in the
`init.el`
files.
To install packages for the first time, I have provided a "clean" init file,
`lisp/init-first.el`
. To use the package manager
...
...
@@ -33,13 +29,13 @@ Then, start emacs and run `M-x package-list-packages`. From there you can select
the packages you want to install. The packages that I install are:
```
lisp
markdown-mode
cmake-mode
ecb
auto-complete
gitconfig-mode
auctex
company-irony
irony
yaml-mode
markdown-mode
cmake-mode
ecb
auto-complete
gitconfig-mode
auctex
```
Most of the packages will be activated automatically. However, for others some
options may need to be set in your
`init.el`
file. For the above packages, I have
provided workable settings in my init files.
To use these set an appropriate
`init.el`
from either
`linux`
or
`macosx`
. For
example, I usually set
provided workable settings in my init files. To use these set an appropriate
`init.el`
from either
`linux`
or
`macosx`
. For example, I usually set
```
sh
ln
-s
macosx/init-large.el init.el
...
...
@@ -53,7 +49,7 @@ When I am configuring on a MACOSX machine with a large full screen monitor.
(
custom-set-variables
'
(
package-selected-packages
(
quote
(
markdown-mode
cmake-mode
ecb
auto-complete
gitconfig-mode
auctex
))))
(
company-irony
irony
yaml-mode
markdown-mode
cmake-mode
ecb
auto-complete
gitconfig-mode
auctex
))))
```
I have this hardcoded in my
`init.el`
paths. If you add additional packages make
...
...
@@ -72,3 +68,107 @@ You will need to set `nemesis-path`, e.g. in `linux/init-emmet.el` I set
```
lisp
(
setq
nemesis-path
"/home/9te/environment/emacs"
)
```
Most of the packages are setup in the
`lisp/base.el`
file. Peruse that to see
the configurations and tune to your taste. I set paths that are used in
`lisp/base.el`
inside of the appropriate machine-specific configurations. A
good example of this (for MacOSX) is to look in
`macosx/local.el`
.
### Setting up Company
First load the packages through ELPA (getting
`company irony`
gets
`irony`
):
```
lisp
M-x
package-install
RET
company-irony
RET
```
Company is the Emacs "complete anything" mode. It is setup in
`base.el`
using
```
lisp
(
add-hook
'after-init-hook
'global-company-mode
)
```
Note that this adds
`company`
to every mode. The link to
`company-irony`
can
be found
[
here
](
https://github.com/Sarcasm/company-irony
)
.
`irony`
is a package that uses
`libclang`
to do command-line completion in
C/C++ code. Get
`irony`
through ELPA:
```
lisp
M-x
package-install
RET
irony
RET
```
To setup
`irony`
see the following to
`base.el`
:
```
lisp
(
add-hook
'c++-mode-hook
'irony-mode
)
(
add-hook
'c-mode-hook
'irony-mode
)
(
add-hook
'irony-mode-hook
'irony-cdb-autosetup-compile-options
)
(
eval-after-load
'company
'
(
add-to-list
'company-backends
'company-irony
))
```
I also added a diagnostic to check settings:
```
lisp
(
defun
irony-check-diagnostic
()
(
interactive
)
(
irony-cdb-json--ensure-project-alist-loaded
)
(
irony--aif
(
irony-cdb-json--locate-db
)
(
progn
(
message
"I: found compilation database: %s"
it
)
(
let
((
db
(
irony-cdb-json--load-db
it
)))
(
irony--aif
(
irony-cdb-json--exact-flags
db
)
(
progn
(
message
"I: found exact match: %s"
it
)
it
)
(
let
((
dir-cdb
(
irony-cdb-json--compute-directory-cdb
db
)))
(
irony--aif
(
irony-cdb-json--guess-flags
dir-cdb
)
(
message
"I: found by guessing: %s"
it
)
(
message
"E: guessing failed"
))))))
(
message
"E: failed to locate compilation database"
)))
```
### Configuring the Irony Server
When a C/C++ (or any other mode where
`irony`
is turned on) starts, it runs a
utility "server" program called
`irony-server`
. You can see it running when
editing a C/C++ file by looking at
`top`
. It will turn off after exiting the
current file.
To build the server, you can run (from within
`emacs`
) the following:
```
lisp
M-x
irony-install-server
RET
```
The default location for the install is in
`.emacs.d/irony`
. However, I wanted
to make sure that it used the latest
`libclang`
so I manually built it using
the following:
```
> CXX=/opt/local/bin/clang++-mp-6.0 CC=/opt/local/bin/clang-mp-6.0 cmake -DCMAKE_INSTALL_PREFIX=/Users/9te/.emacs.d/irony /Users/9te/.emacs.d/elpa/irony-20181030.834/server
> cmake --build . --use-stderr --config Release --target install
```
Finally, you have to add the
`SOURCE`
and
`COMPILE_COMMANDS`
to
`irony`
. The
compile commands live in the
`compile_command.json`
file that is produced by
`cmake`
by setting:
```
cmake
SET
(
CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE BOOL
""
)
```
So, e.g. run
`M-x irony-cdb-json-add-compile-commands-path RET`
to add the
location of your source and build (where the
`compile_command.json`
file is
stored. You can see what
`irony`
has stored for the current settings by
looking at
`irony/cdb-json-projects`
.
There is a group for customizing
`irony`
behavior further,
`M-x
customize-group RET irony RET`
.
The link to
`irony`
is
[
here
](
https://github.com/Sarcasm/irony-mode
)
. A
useful debugging post can be found
[
here
](
https://github.com/Sarcasm/irony-mode/issues/190
)
.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment