-
Notifications
You must be signed in to change notification settings - Fork 29
add new post #221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add new post #221
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
--- | ||
layout: blog | ||
category: blog | ||
title: Vim 8.0 released | ||
|
||
--- | ||
昨日 9/13、前バージョンから10年の歳月を経て Vim の最新版である Vim 8.0 がリリースされました。 | ||
|
||
Vim 8.0 の大きな変更点としては、まず多くのバグ修正が上げられます。7.4 に存在した数多くの問題が修正されています。 | ||
|
||
また以下の素晴らしい機能拡張も行われました。 | ||
|
||
## チャネルによる非同期 I/O のサポート (Channel) | ||
|
||
バックグラウンドプロセスと非同期にメッセージを交換できる仕組みを実装しました。JSON で通信するサーバと対話する事も出来ます。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be 受動態 |
||
|
||
詳しくは `:help channel` を参照して下さい。 | ||
|
||
## ジョブ (Job) | ||
|
||
これまで外部コマンドを実行する際にブロックしていましたが、ジョブ機能の追加により非同期にコマンドを実行する事ができる様になりました。また channel 機能を使って標準入出力を経由し、非同期にメッセージを交換できます。 | ||
|
||
詳しくは `:help job` を参照して下さい。 | ||
|
||
## タイマー (Timer) | ||
|
||
非同期にタイマーを実行できます。 | ||
|
||
```vim | ||
let tempTimer = timer_start(4000, 'CheckTemp') | ||
``` | ||
|
||
この例では 4000 ミリ秒毎に CheckTemp 関数が実行されます。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
かと。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
|
||
詳しくは `:help timer` を参照して下さい。 | ||
|
||
## パーシャル (Partial) | ||
|
||
Vim には元々、関数リファレンスが実装されていますが、引数および辞書を保持した状態で関数を参照できます。 | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 引数の一部およびself辞書 ? 意見募集 |
||
上記のタイマーの例を使う場合、下記のコードでは CheckTemp 関数の第一引数に任意の引数を割り当てられます。 | ||
|
||
```vim | ||
let tempTimer = timer_start(4000, function('CheckTemp', ['out'])) | ||
``` | ||
|
||
詳しくは `:help Partial` を参照して下さい。 | ||
|
||
## ラムダ (Lambda)、クロージャ (Closure) | ||
|
||
これまで sort 関数や filter 関数に関数を指定したい場合は、別途名前付きの関数を用意しなければなりませんでしたが、Lambda を指定できる様になりました。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
sort xに比較関数を指定したり、filter に適用関数を指定したい場合には |
||
|
||
```vim | ||
call filter(mylist, {idx, val -> val > 20}) | ||
``` | ||
|
||
また Lambda ではスコープ内変数が参照できるので Closure として振る舞えます。 | ||
|
||
```vim | ||
function Foo(arg) | ||
let i = 3 | ||
return {x -> x + i - a:arg} | ||
endfunction | ||
let Bar = Foo(4) | ||
echo Bar(6) | ||
``` | ||
|
||
詳しくは `:help lambda` および `:help closure` を参照して下さい。 | ||
|
||
## パッケージ (Packages) | ||
|
||
近年では多くの Vim プラグインがディレクトリ単位で配布されているため、簡単に追加と削除が行える仕組みが追加されました。 | ||
|
||
詳しくは `:help packages` を参照して下さい。 | ||
|
||
## 新しいスタイルのテスト (New Style Tests) | ||
|
||
これは Vim 開発者の為の機能ですが、これまでは体系だったテストフレームワークが提供されてこなかった為に可読性の低いテストが行われてきました。Vim 8.0 では テスト専用の API が用意され、より可読性の高いテストが実施されます。 | ||
|
||
詳しくは `:help test-functions` を参照して下さい。 | ||
|
||
## ウィンドウID (Window IDs) | ||
|
||
これまでのウィンドウ管理は、オープンしたりクローズしたり、移動を行うと番号が変更される数値の体系で管理されてきました。新しい API によりユニークなIDが付与される様になります。 | ||
|
||
詳しくは `:help win_getid()` および `:help win_id2win()` を参照して下さい。 | ||
|
||
## タイムスタンプを使用した Viminfo (Viminfo uses timestamp) | ||
|
||
これまでの viminfo は最終の変更のみが書き込まれていましたが、タイムスタンプを用いて直近の幾らかのアイテムが保存される様になりました。 | ||
|
||
詳しくは `:help viminfo-timestamp` を参照して下さい。 | ||
|
||
## インデントを付けて折り返し (Wrapping lines with indent) | ||
|
||
`breakindent` オプションにより折り返された行にインデントが付けられる様になりました。 | ||
|
||
詳しくは `:help breakindent` を参照して下さい。 | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 空行削除 |
||
## Windows での DirectX サポート (Windows: DirectX support) | ||
|
||
`renderoptions` オプションが追加され、DirectX (DirectWrite) により文字が描画できる様になりました。 | ||
|
||
詳しくは `:help renderoptions` を参照して下さい。 | ||
|
||
## GTK+ 3 サポート (GTK+ 3 support) | ||
|
||
挙動の異なりにより多くの技術的な障壁がありましたが、GTK+ 3 での動作が GTK+ 2 同等となりました。configure を実行時に GTK+ 2 と GTK+ 3 が両方入っている場合には未だ GTK+ 2 が選択されます。詳しくは src/Makefile を参照して下さい。 | ||
|
||
その他の詳細は `:help gui-x11-compiling` を参照して下さい。 | ||
|
||
## ビジュアル選択時の CTRL-A/CTRL-X | ||
|
||
こちらは vim-jp の記事を参照して下さい。 | ||
|
||
[Visual モード時の CTRL-A/CTRL-X について](http://vim-jp.org/blog/2015/06/30/visual-ctrl-a-ctrl-x.html) | ||
|
||
その他、数えきれないほどのバグが修正されています。vim-dev で活躍する開発者の方々に感謝します。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. もう少しコメントたしたい。 |
||
|
||
Happy Vim Life |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
昨日違う