|
5 | 5 | Some niceties for using Vim with the AngularJS framework. See the [screencast][screencast]. |
6 | 6 |
|
7 | 7 | The [canonical "what editor should I use for Angular?" post][editorchoice] |
8 | | -pretty squarely lands on Webstorm/IntelliJ as the peoples' choice |
| 8 | +pretty squarely lands on Webstorm/IntelliJ as the peoples' choice |
9 | 9 | (12 people), but Vim is right there tied for second place along with |
10 | 10 | NetBeans and Sublime (four people each as of April, 2014) in this |
11 | 11 | super-scientific analysis. And don't make me quote [Tim Pope][tpope] on |
@@ -35,9 +35,9 @@ So why was this plugin written at all? I'm glad you asked! |
35 | 35 |
|
36 | 36 | A, the "alternate" file, has been mapped to take you from your code to the |
37 | 37 | corresponding test file, or from your test file to the corresponding |
38 | | -implementation file. For example, if you're in app/js/rock-socks.js, and |
| 38 | +implementation file. For example, if you're in app/js/rock-socks.js, and |
39 | 39 | you hammer :A, you will be taken to test/spec/rock-socks.js, if such a file |
40 | | -exists. Some other common directory structure conventions in the angular |
| 40 | +exists. Some other common directory structure conventions in the angular |
41 | 41 | community, such as app/src and test/unit, are also supported. |
42 | 42 |
|
43 | 43 | If the convention you use doesn't work out of the box, you can specify your |
@@ -69,7 +69,7 @@ if (true) { |
69 | 69 | file called awesome-service.js somewhere in a subdirectory of your path, |
70 | 70 | you will be taken there. The default behavior of gf can also be quite |
71 | 71 | useful in the context of an angular app, since file paths appear in views |
72 | | -(with ng-include src="full/path.html) and directives (with templateUrl: |
| 72 | +(with ng-include src="full/path.html) and directives (with templateUrl: |
73 | 73 | 'src/myapp/modules/main/views//prompt-list.html', so an |
74 | 74 | attempt has been made to allow this to work as well. If all that is missing |
75 | 75 | from a template path is the "app" directory (which is a common value for |
@@ -116,35 +116,46 @@ focus in on just one spec at a time (and one spec generally runs way fast). |
116 | 116 | So, if you're anywhere inside a spec: |
117 | 117 |
|
118 | 118 | :AngularRunSpec |
119 | | - |
| 119 | + |
120 | 120 | or the "run spec" mapping: |
121 | 121 |
|
122 | 122 | <leader>rs |
123 | | - |
| 123 | + |
124 | 124 | will toggle the spec between "it" and "iit." This works especially well if |
125 | 125 | you have a karma watch going, as shown in the [screencast][screencast]. |
126 | 126 |
|
127 | 127 | You are able to do the same with a describe block using the run block command: |
128 | | - |
| 128 | + |
129 | 129 | :AngularRunSpecBlock |
130 | 130 |
|
131 | 131 | or the corresponding mapping: |
132 | 132 |
|
133 | 133 | <leader>rb |
134 | 134 |
|
135 | | -### Syntastic syntax checker ignores |
| 135 | +### Syntastic syntax checker customization |
136 | 136 |
|
137 | 137 | You know how you use syntastic to check your syntax as you edit, because |
138 | 138 | it works for pretty much any language and is awesome? When you use angular |
139 | 139 | directives (like ng-app, ng-repeat, and even library directives like |
140 | | -ui-view), the html tidy check will complain. This is fixed out of the box, |
141 | | -and you can use the same mechanism to make syntastic aware of your own |
142 | | -directives by specifying exclusions in your .vimrc like this: |
| 140 | +ui-view), the html tidy check will complain. This is fixed out of the box. |
| 141 | + |
| 142 | +Use the same mechanism to make syntastic aware of your own directives by |
| 143 | +specifying exclusions in your .vimrc like this: |
143 | 144 |
|
144 | 145 | ``` |
145 | 146 | let g:syntastic_html_tidy_ignore_errors = ['proprietary attribute "myhotcompany-'] |
146 | 147 | ``` |
147 | 148 |
|
| 149 | +Some angular directives can also be used as custom elements (i.e. ng-include, |
| 150 | +ng-form). These are added to the list of allowed tags by default. In order |
| 151 | +to make syntastic recognize your additional blocklevel tags define them in your |
| 152 | +.vimrc before the plugin is loaded: |
| 153 | + |
| 154 | +``` |
| 155 | +let g:syntastic_html_tidy_blocklevel_tags = ['myCustomTag'] |
| 156 | +``` |
| 157 | + |
| 158 | + |
148 | 159 | ## Installation |
149 | 160 |
|
150 | 161 | * Using [Pathogen][pathogen], run the following commands: |
|
0 commit comments