@@ -8,16 +8,21 @@ avoid laborious task of finding and tuning of plugins/themes.
88## Features
99 * Navigation
1010 * Jump to module/function definitions
11- * Module/function/callback window for navigating in single file
11+ * Module/function/callback list window for navigating in single file
1212 * Fuzzy search by function/module name in file
1313 * Fuzzy filename search in project
1414 * Navigation to Elixir/Erlang source code
1515 * Editing
16- * Line comment/uncomment
16+ * Automatic folding of functions and tests
17+ * Line comment/uncomment shortcuts
1718 * Autocompletion of module/function names
1819 * Autodetection of spacing format in your project (tab/spaces)
1920 * Removal of trailing spaces
2021 * Reformatting code (hashes, assignments, etc)
22+ * Compile and testing
23+ * Compile project from and jump to errors/warnings
24+ * Run ExUnit tests and jump to errors
25+ * Run ExUnit tests on source save and just to errors
2126 * Other
2227 * Colorschemes for Elixir programming
2328 * Git integration directly from Vim.
@@ -26,7 +31,22 @@ avoid laborious task of finding and tuning of plugins/themes.
2631 * Clutter free vim-airline settings
2732
2833
29- See sections below for usage instructions and shortcuts.
34+ See [ cheat sheet] ( CHEATSHEET.md ) for quick overview of functionality and shortcuts offered.
35+ Read below for detailed usage instructions.
36+
37+ ## Motivation
38+
39+ Finding, installing and tuning Vim plugins can be quite frustating and time
40+ consuming task. Especially making sure they do not conflict with each other
41+ and that they use consistent shortcuts.
42+
43+ Also it is easy to miss some useful ones in a wast variety of Vim plugins.
44+ Vim-Ide-Elixir offers curated set of plugins, which are tuned to seamlessly
45+ work together. Also some new pluging/settings provided for more comfortable
46+ work.
47+
48+ Plugin updates also come in (tested) bundles, which assures that changes in one
49+ plugin will not break others.
3050
3151## Installation
3252
@@ -38,15 +58,24 @@ Following command with download plugin and all extras it uses.
3858cd ~ /.vim/bundle
3959git clone https://github.com/gasparch/vim-ide-elixir.git vim-ide-elixir
4060cd ~ /.vim/bundle/vim-ide-elixir
41- git submodule update --init --recursive
61+ ./install.sh
4262```
4363
64+ Follow instructions of install script.
65+
66+ ** Manually install**
67+
4468Update your ` ~/.vimrc ` to contain following line instead of just ` pathogen#infect ` .
4569
4670``` vim
4771execute pathogen#infect("bundle/{}", "bundle/vim-ide-elixir/bundle/{}")
4872```
4973
74+ Also in the very end of the file add
75+ ``` vim
76+ call vimide#init()
77+ ```
78+
5079### Installing required utilities
5180
5281In order to properly work this plugin requires number of additional programs installed.
@@ -73,20 +102,126 @@ Run provided script to automatically check out matching Erlang/OTP and Elixir ve
73102## Updating plugin & submodules
74103``` sh
75104cd ~ /.vim/bundle/vim-ide-elixir
76- git pull
77- git submodule update --remote --merge
105+ ./update.sh
78106```
79107
108+ ## Editing
109+
110+ Vim-Elixir-IDE tries to smart guess your tabulation settings and set it for the
111+ file using [ vim-sleuth] ( https://github.com/tpope/vim-sleuth ) .
112+
80113## Source browsing
81114
82- Tagbar most of the time shows correct arity on functions and does not report multiple function clauses.
83- GenServer callbacks moved to separate group.
115+ Tagbar most of the time shows correct arity on functions and does not report
116+ multiple function clauses. GenServer callbacks moved to separate group.
117+
118+ ## Compiler and ExUnit integration
119+
120+ Compiler and ExUnit integration provided with vim-elixir-exunit module, which
121+ is designed to work with vim-elixir-ide. All commands can be executed in any
122+ subdirectory of project, it will find closest ` mix.exs ` in file hierarchy.
123+
124+ Following commands and shortcuts are available:
125+
126+ #### Compiling project
127+
128+ * ` :make ` will invoke ` mix compile ` and show only errors in quickfix list.
129+ Normal ` :cl ` ` :copen ` ` :cnext ` ` :cprev ` commands are available, but use of
130+ ` [e ` and ` ]e ` is recommended.
131+ * ` :cw ` is redefined to show quickfix window always at bottom, even if split exists.
132+ * ` :MixCompile ` will compile files (` mix compile ` ) and show errors and warnings.
133+ All messages are loaded in quickfix.
134+ * ` :MixCompile! ` will recompile all project (` mix compile --force ` ) and show
135+ errors and warnings. All messages are loaded in quickfix.
136+ * ` <Leader>xc ` and ` <Leader>x! ` invoke ` :MixCompile ` and ` :MixCompile! ` respectively
137+ * ` [e ` and ` ]e ` provide smart navigation between errors/warnings in quickfix,
138+ also trying to jump to correct column name (e.g. identificator if warning is
139+ 'variable foo is not used').
140+
141+
142+ #### Running ExUnit
143+
144+ All ExUnit commands suppress warning messages in quickfix window. If you want
145+ to check warnings in project - use compile commands above. ExUnit output is
146+ cluttered by itself, so no need to add more information with warnings.
147+
148+ I recommend Vim8.x + XTerm as you can have much more with it - see below.
149+
150+ ** Functionality for Vim version 7.x:**
151+
152+ * ` ExUnitQfRunAll ` or ` <Leader>xa ` runs ExUnit tests on whole project
153+ (` mix test ` ) and shows output in quickfix window
154+ * ` ExUnitQfRunFile ` or ` <Leader>xf ` runs ExUnit tests on current file
155+ (` mix test path/to/file ` ) and shows output in quickfix window
156+ * ` ExUnitQfRunLine ` or ` <Leader>xl ` runs ExUnit tests on current line of
157+ current file, effectively running just one test.
158+ (` mix test path/to/file.exs:123 ` ) and shows output in quickfix window
159+ * ` ExUnitQfRunRerun ` or ` <Leader>xx ` repeats last executed command (ExUnitQfRunAll/File/Line)
160+
161+ You can navigate with ` [e ` and ` ]e ` between errors. Both test name and exact
162+ failed assert lines are available in quickfix list. Latter is more useful most of the time.
163+
164+ Use ` :copen ` or ` :cw ` to check quickfix window, because most relevant ExUnit
165+ output is available there as well, g.e. assert failure messages, crash messages
166+ and etc.
167+
168+ Some less relevant ExUnit output (like GenServer crash logs and etc) are
169+ stripped to preserve space in quickfix window.
170+
171+
172+ ** Functionality for Vim version 8.x:**
173+
174+ Vim 8 brings asynchronous jobs and allows to build much more real IDE-like experience.
175+
176+ This mode allows you to start XTerm (or any other terminal emulator) next to
177+ your Vim/GVim instance and have all output of ExUnit shown there, while also
178+ having possiblity to jump over errors using quickfix. This also allows you to
179+ close/reopen Vim/GVim without closing XTerm and still have output in it.
180+ Basically you position it once on your screen and then you are free to run
181+ open and close Vim as much times as you want.
182+
183+ Also this mode automatically re-runs your tests on any Elixir files saved in
184+ the project, removing hassle of switching and running them by hand.
185+
186+ Test run status is shown in status line, so you don't need to check it manually.
187+
188+ To check which test is executing now, especially if you just re-run it, see
189+ XTerm window title - it shows text like 'ExUnit test/foo\_ test.esx'.
190+
191+ If you combine that with [ ex\_ unit\_ notifier] ( https://github.com/navinpeiris/ex_unit_notifier ) it
192+ becomes very easy to see if your tests fail or pass.
193+
194+ Available commands:
195+
196+ * ` ExUnitWatchAll ` or ` <Leader>wa ` runs ExUnit tests on whole project
197+ (` mix test ` ) and shows output in xterm + quickfix window
198+ * ` ExUnitWatchFile ` or ` <Leader>wf ` runs ExUnit tests on current file
199+ (` mix test path/to/file ` ) and shows output xterm + in quickfix window
200+ * ` ExUnitWatchLine ` or ` <Leader>wl ` runs ExUnit tests on current line of
201+ current file, effectively running just one test.
202+ (` mix test path/to/file.exs:123 ` ) and shows output in xterm + quickfix window
203+ * ` ExUnitWatchRerun ` or ` <Leader>ww ` runs again last executed command
204+ (ExUnitWatchAll/File/Line). Most probably you do not need to run it manually,
205+ as it is executed on each save of Elixir file in current project.
206+ * ` ExUnitWatchStop ` or ` <Leader>ws ` or ` <Leader>wc ` (both stop/cancel mnemonics) stops
207+ automatic execution of tests on save.
208+
209+ Use ` [e ` and ` ]e ` to navigate test errors.
210+
211+
212+ ** Note**
213+
214+ All ` mix test ` commands executed with ` --seed 0 ` parameter which forces
215+ execution from top to down of test file. If you want randomized execution
216+ sequence to check hidden errors in tests - you will need to run tests
217+ manually.
218+
219+
220+
221+
222+
84223
85- ## Shortcuts
86224
87- ` F4 ` for opening Tagbar.
88- ` Ctrl-@ ` to use Ctrl-P search on function names and quick jump on them
89- ` <Leader>l ` to fuzzy search text in file
90225
91226
92227
0 commit comments