2017-07-03 6 views
2

vim入力フィールドにパスワードを入力している間は、表示しないでください(または、*******などが表示されるはずです)。これをどのように達成するのですか?vimscriptの入力のように 'パスワード'を取る方法は?

+1

をしかし、あなたはそれをやっていない考慮する必要があります! https://www.nngroup.com/articles/stop-password-masking/ – JeffUK

答えて

2

あなたはinputsecret()機能を使用して試みることができる::h inputsecret(から関数の

let username = inputsecret('Enter username: ') 
let passw = inputsecret('Enter password: ') 

説明:「その男」に申し訳ありません

inputsecret({prompt} [, {text}])   *inputsecret()* 
    This function acts much like the |input()| function with but 
    two exceptions: 
    a) the user's response will be displayed as a sequence of 
    asterisks ("*") thereby keeping the entry secret, and 
    b) the user's response will not be recorded on the input 
    |history| stack. 
    The result is a String, which is whatever the user actually 
    typed on the command-line in response to the issued prompt. 
    NOTE: Command-line completion is not supported. 
関連する問題