|
3 | 3 | helpname: 'develop'
|
4 | 4 | ---
|
5 | 5 | <div id='vimCodeElement'>
|
6 |
| -<a class="Constant" href="develop.html" name="develop.txt">develop.txt</a> For <span class="Identifier">Vim バージョン 9.1.</span> Last change: 2025 Apr 18<br> |
| 6 | +<a class="Constant" href="develop.html" name="develop.txt">develop.txt</a> For <span class="Identifier">Vim バージョン 9.1.</span> Last change: 2025 May 05<br> |
7 | 7 | <br>
|
8 | 8 | <br>
|
9 | 9 | <span class="Identifier">VIMリファレンスマニュアル by Bram Moolenaar</span><br>
|
|
222 | 222 | Marriott)<br>
|
223 | 223 | <br>
|
224 | 224 | <br>
|
225 |
| -<span class="Statement">コメント</span> <a class="Constant" href="develop.html#style-comments" name="style-comments">style-comments</a><br> |
| 225 | +<span class="Statement">コメント</span> <a class="Constant" href="develop.html#style-comments" name="style-comments">style-comments</a><br> |
226 | 226 | <br>
|
227 | 227 | 関数本体内に複数行のコメントを入れないようにすること。関数が非常に複雑で、一部<br>
|
228 | 228 | を個別にコメントする必要がある場合は、関数の構造を再検討する必要がある。<br>
|
|
237 | 237 | <br>
|
238 | 238 | <br>
|
239 | 239 | <br>
|
240 |
| -<span class="Statement">インデント</span> <a class="Constant" href="develop.html#style-indentation" name="style-indentation">style-indentation</a><br> |
| 240 | +<span class="Statement">インデント</span> <a class="Constant" href="develop.html#style-indentation" name="style-indentation">style-indentation</a><br> |
241 | 241 | <br>
|
242 | 242 | コードのインデントには 4 つのスペースを使用する。Vim を使用してソースを編集し<br>
|
243 | 243 | ている場合は、<a class="Identifier" href="options.html#modeline">modeline</a> があるため何もする必要はない。<br>
|
244 | 244 | <br>
|
245 | 245 | 他のエディタの場合は、リポジトリのルートに <span class="Comment">.editorconfig</span> が提供される。<br>
|
246 | 246 | <br>
|
247 | 247 | <br>
|
248 |
| -<span class="Statement">宣言</span> <a class="Constant" href="develop.html#style-declarations" name="style-declarations">style-declarations</a><br> |
| 248 | +<span class="Statement">宣言</span> <a class="Constant" href="develop.html#style-declarations" name="style-declarations">style-declarations</a><br> |
249 | 249 | <br>
|
250 | 250 | 可能であれば、ガード内で <a class="Comment" href="eval.html#:for">for</a> ループ変数を宣言する:<br>
|
251 | 251 | OK:<br>
|
|
265 | 265 | int *ptr;</div>
|
266 | 266 | <br>
|
267 | 267 | <br>
|
268 |
| -<br> |
269 |
| -<span class="Statement">括弧</span> <a class="Constant" href="develop.html#style-braces" name="style-braces">style-braces</a><br> |
| 268 | +<span class="Statement">括弧</span> <a class="Constant" href="develop.html#style-braces" name="style-braces">style-braces</a><br> |
270 | 269 | <br>
|
271 | 270 | すべての波括弧は改行しなければならない:<br>
|
272 | 271 | OK:<br>
|
273 | 272 | <div class="helpExample"> if (cond)<br>
|
274 | 273 | {<br>
|
275 |
| - cmd;<br> |
276 |
| - cmd;<br> |
| 274 | + cmd;<br> |
| 275 | + cmd;<br> |
277 | 276 | }<br>
|
278 | 277 | else<br>
|
279 | 278 | {<br>
|
280 |
| - cmd;<br> |
281 |
| - cmd;<br> |
| 279 | + cmd;<br> |
| 280 | + cmd;<br> |
282 | 281 | }</div>
|
283 | 282 | <br>
|
284 | 283 | 間違い:<br>
|
285 | 284 | <div class="helpExample"> if (cond) {<br>
|
286 |
| - cmd;<br> |
287 |
| - cmd;<br> |
| 285 | + cmd;<br> |
| 286 | + cmd;<br> |
288 | 287 | } else {<br>
|
289 |
| - cmd;<br> |
290 |
| - cmd;<br> |
| 288 | + cmd;<br> |
| 289 | + cmd;<br> |
291 | 290 | }</div>
|
292 | 291 | <br>
|
293 | 292 | OK:<br>
|
294 | 293 | <div class="helpExample"> while (cond)<br>
|
295 | 294 | {<br>
|
296 | 295 | cmd;<br>
|
297 |
| - }</div> |
298 |
| -<br> |
299 |
| -間違い:<br> |
300 |
| -<div class="helpExample"> while (cond) {<br> |
301 | 296 | cmd;<br>
|
302 | 297 | }</div>
|
303 | 298 | <br>
|
304 |
| -ブロックがコメントを含めて 1 行の場合は、波括弧は省略できる。<br> |
305 |
| -OK:<br> |
306 |
| -<div class="helpExample"> if (cond)<br> |
307 |
| - cmd;<br> |
308 |
| - else<br> |
309 |
| - cmd;</div> |
310 |
| -<br> |
311 | 299 | 間違い:<br>
|
312 |
| -<div class="helpExample"> if (cond)<br> |
313 |
| - /*<br> |
314 |
| - * comment<br> |
315 |
| - */<br> |
316 |
| - cmd;<br> |
317 |
| - else<br> |
318 |
| - cmd;</div> |
319 |
| -<br> |
320 |
| -<a class="Comment" href="eval.html#:if">if</a>/<a class="Comment" href="eval.html#:else">else</a> の一方のブロックに波括弧がある場合は、もう一方のブロックにも波括弧<br> |
321 |
| -が必要である。<br> |
322 |
| -OK:<br> |
323 |
| -<div class="helpExample"> if (cond)<br> |
324 |
| - {<br> |
325 |
| - cmd;<br> |
326 |
| - }<br> |
327 |
| - else<br> |
328 |
| - {<br> |
| 300 | +<div class="helpExample"> while (cond) {<br> |
329 | 301 | cmd;<br>
|
330 | 302 | cmd;<br>
|
331 | 303 | }</div>
|
332 | 304 | <br>
|
333 |
| -間違い:<br> |
334 |
| -<div class="helpExample"> if (cond)<br> |
335 |
| - cmd;<br> |
336 |
| - else<br> |
| 305 | +OK:<br> |
| 306 | +<div class="helpExample"> do<br> |
337 | 307 | {<br>
|
338 | 308 | cmd;<br>
|
339 | 309 | cmd;<br>
|
340 |
| - }</div> |
| 310 | + } while (cond);</div> |
341 | 311 | <br>
|
342 |
| -<div class="helpExample"> if (cond)<br> |
| 312 | +または<br> |
| 313 | +<div class="helpExample"> do<br> |
343 | 314 | {<br>
|
344 | 315 | cmd;<br>
|
345 | 316 | cmd;<br>
|
346 | 317 | }<br>
|
347 |
| - else<br> |
348 |
| - cmd;</div> |
349 |
| -<br> |
350 |
| -OK:<br> |
351 |
| -<div class="helpExample"> while (cond)<br> |
352 |
| - cmd;</div> |
| 318 | + while (cond);</div> |
353 | 319 | <br>
|
354 | 320 | 間違い:<br>
|
355 |
| -<br> |
356 |
| -<div class="helpExample"> while (cond)<br> |
357 |
| - if (cond)<br> |
358 |
| - cmd;</div> |
359 |
| -<br> |
| 321 | +<div class="helpExample"> do {<br> |
| 322 | + cmd;<br> |
| 323 | + cmd;<br> |
| 324 | + } while (cond);</div> |
360 | 325 | <br>
|
361 | 326 | <br>
|
362 | 327 | <span class="Statement">型</span> <a class="Constant" href="develop.html#style-types" name="style-types">style-types</a><br>
|
363 | 328 | <br>
|
364 |
| -記述的な型を使用すること。それらのリストは src/structs.h ファイル内、またはお<br> |
365 |
| -そらく作業中のファイルの typedef 内にある。<br> |
366 |
| -<br> |
367 |
| -<span class="Todo">Note</span> すべてのカスタム型には「_T」という接尾辞が付けられることに注意<br> |
368 |
| -<br> |
369 |
| -OK:<br> |
370 |
| -<div class="helpExample"> int is_valid_line_number(linenr_T lnum);</div> |
371 |
| -<br> |
372 |
| -間違い:<br> |
373 |
| -<div class="helpExample"> int is_valid_line_number(unsigned long lnum);</div> |
| 329 | +説明的な型を使用すること。これらは src/vim.h や src/structs.h などで定義されて<br> |
| 330 | +いる。<br> |
| 331 | +<span class="Todo">Note</span> すべてのカスタム型には "_T" という接尾辞が付けられることに注意<br> |
374 | 332 | <br>
|
| 333 | +例:<br> |
| 334 | +<div class="helpExample"> linenr_T<br> |
| 335 | + buf_T<br> |
| 336 | + pos_T</div> |
375 | 337 | <br>
|
376 | 338 | <br>
|
377 | 339 | <span class="Statement">空白と句読法</span> <a class="Constant" href="develop.html#style-spaces" name="style-spaces">style-spaces</a><br>
|
|
393 | 355 | <br>
|
394 | 356 | '=', '+', '/' 等の前後に空白を入れる。<br>
|
395 | 357 | <br>
|
396 |
| -間違い: var=a*5;<br> |
397 | 358 | OK: var = a * 5;<br>
|
| 359 | +間違い: var=a*5;<br> |
398 | 360 | <br>
|
399 | 361 | 似たような動作をグループ化するには、空行を使う。<br>
|
400 | 362 | <br>
|
|
419 | 381 | while (buf != NULL && !got_int)</div>
|
420 | 382 | <br>
|
421 | 383 | <br>
|
422 |
| -<br> |
423 | 384 | <span class="Statement">関数</span> <a class="Constant" href="develop.html#style-functions" name="style-functions">style-functions</a><br>
|
424 | 385 | <br>
|
425 | 386 | 関数宣言は、戻り値の型を別のインデントされた行に記述して使用する:<br>
|
|
573 | 534 | ンドウ、xtermのウィンドウ、Vimのバッファを表示するウィンドウなど。<br>
|
574 | 535 | <br>
|
575 | 536 | 混乱を避けるため、時にウィンドウと呼ばれる他の物には別の名前が付けられている。<br>
|
576 |
| -ここに関連する物の概観を示す。<br> |
| 537 | +ここに関連する物の概観を示す:<br> |
577 | 538 | <br>
|
578 | 539 | スクリーン(screen) ディスプレイ全体。GUIでは例えば1024x768ピクセルの画<br>
|
579 | 540 | 面。Vimシェルはスクリーン全体を使うことも一部を使う<br>
|
580 | 541 | こともできる。<br>
|
581 |
| -<br> |
582 | 542 | シェル(shell) Vimアプリケーション。スクリーン全体(例えばコンソール<br>
|
583 | 543 | で実行した時)、あるいはその一部(xtermやGUI)。<br>
|
584 |
| -<br> |
585 | 544 | ウィンドウ(window) バッファの表示画面。Vimは複数のウィンドウを持つこと<br>
|
586 | 545 | ができる。ウィンドウはコマンドラインやメニューバー、<br>
|
587 | 546 | ツールバーなどといっしょに表示される。これらはシェル<br>
|
588 | 547 | に納まる。<br>
|
589 | 548 | <br>
|
| 549 | +<br> |
590 | 550 | スペルチェック <a class="Constant" href="develop.html#develop-spell" name="develop-spell">develop-spell</a><br>
|
591 | 551 | <br>
|
592 | 552 | Vim にスペルチェックを追加することになったとき、利用可能なスペルチェックのライ<br>
|
|
0 commit comments