Linuxで完全なソート/フォーマットを行うためのコマンド

Linuxで完全なソート/フォーマットを行うためのコマンド

このような文字があります。

Transport Layer Security (TLS) and its predecessor 
Secure Sockets Layer (SSL)
 are cryptographic presentation protocols used in the telecommunications field

私はこの「完璧な」形式が欲しい

 Transport Layer Security (TLS) and its predecessor Secure Sockets Layer (SSL)
 are cryptographic presentation protocols used in the telecommunications field

「文法基準」は重要ではない

この例は次のとおりです。

 Transport Layer Security (TLS) and its predecessor Secure Sockets Layer (SSL
 ) are cryptographic presentation protocols used in the telecommunications fi
 eld

私はコマンドを試しました

fmt -w 77

そして

par

しかし、結果は私が望むものではありません。どんな提案がありますか?私は通常vimを使用しているので、vimコマンドも受け入れられますが、どのエディタでもエディタなしで外部コマンドを使用する方が良いでしょう。 vimを使用してこの方法を試しました。

set formatprg=par\ j1w77

しかし、gq結果は私が望むものではありません。

ベストアンサー1

解決方法はCASユーザーのコメントにあります

export PARINIT="rTbgqR B=.,?_A_a Q=_s>| w78"

文字記号78の後に「切り抜く」には、vimを開き、テキストを選択してを押しますgq。うまくいきます。

おすすめ記事