Skip to content

Commit 4e41b0d

Browse files
author
skywind3000
committed
Add special key names and display values for function keys in the script
1 parent 518dd68 commit 4e41b0d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

autoload/navigator/charname.vim

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
" charkey.vim -
55
"
66
" Created by skywind on 2022/10/26
7-
" Last Modified: 2022/10/26 22:06
7+
" Last Modified: 2024/02/22 22:19
88
"
99
"======================================================================
1010

@@ -53,6 +53,12 @@ for key in range(10)
5353
let pending += [nr2char(char2nr('0') + key)]
5454
endfor
5555

56+
for i in range(12)
57+
let nn = i + 1
58+
let cc = eval('"\<f' . nn . '>"')
59+
let s:special_names[cc] = printf('<f%d>', nn)
60+
endfor
61+
5662
for ch in pending
5763
let cc = eval('"\<c-' . ch . '>"')
5864
if !has_key(s:special_names, cc)
@@ -98,6 +104,11 @@ let s:char_display = {
98104
\ "<del>" : "DEL",
99105
\ }
100106

107+
for i in range(12)
108+
let n = i + 1
109+
let s:char_display[printf('<f%d>', n)] = 'F' . n
110+
endfor
111+
101112

102113
"----------------------------------------------------------------------
103114
" translate from key-name '<esc>' to key-code '\<esc>'

0 commit comments

Comments
 (0)