8
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Vimでカーソル配下の文字コードを取得

Last updated at Posted at 2014-01-15

ノーマルモードでgaまたは
コマンドモードの:asで取得可能

:as[cii]                                                ga :as :ascii
ga                      カーソル位置の文字の文字コードを、10/16/8 進数で表示し
                        ます。カーソルが 'R' の上にあるときは次のように表示さ
                        れます:
                                <R>  82,  Hex 52,  Octal 122
                        ASCII 以外の文字がオプション 'isprint' に設定されてい
                        て、表示可能になっている場合には、特殊な表示形式もいっ
                        しょに表示されます。文字コードが 127 より大きいときに
                        は <M-x> という形式も表示されます。例:
                                <~A>  <M-^A>  129,  Hex 81,  Octal 201
                                <p>  <|~>  <M-~>  254,  Hex fe,  Octal 376
                        (<p> には実際の特殊文字が表示されます。)
                        ファイル中の <Nul> 文字は内部的には <NL> として保存さ
                        れていますが、次のように表示されます:
                                <^@>  0,  Hex 00,  Octal 000
                        合成文字も表示されます。'maxcombine' の設定は影響しま
                        せん。
                        覚え方: Get Ascii value (ASCIIコードを取得)

覚え方

Get Ascii value

参考

:help ga

その他

ファイル全体で調査したい場合はVim付属のxxdコマンドでも調査可能。

8
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?