CARVIEW |
Select Language
HTTP/2 200
date: Tue, 22 Jul 2025 11:49:39 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/neovim/neovim.git
etag: W/"5eabc76e8e8b7875a3a3323c6fc7c370"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=CnLaRJJv7qP4K%2Bv9wKe53XtMhAXPEqELYvTiia75W%2F%2BuaVzi6f%2F%2FbzxucpwHICsJQXA4i52YerviQk20YSLjC0V8kBcdFzhaVzmYWenOOr51F%2F0R%2B411hv%2BooYRjCd3dk46BKIvEekf%2FYgT5jjZRKl4MfzAoFAv%2BW4v0G6kNE4lg00pP3IsgimGa%2F%2BRDcw3oAjnN%2BuDWeU7R8bh%2B3ez05IipwWrJJ%2FWo1KdowTNOmCEpHmCCq8v1EgBZnJRwny%2F2yzZPbRB1Gx%2FhlTSFM375Xw%3D%3D--7qWd2jh4nXmx8gEm--uBk6%2BIEIdZJrYOOEtOUPmw%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.820081258.1753184976; Path=/; Domain=github.com; Expires=Wed, 22 Jul 2026 11:49:36 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Wed, 22 Jul 2026 11:49:36 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: A526:27D749:7046C8:7CFD6F:687F7AD0
feat(api): add support for lua function & description in keymap · neovim/neovim@b411f43 · GitHub
Copy file name to clipboardExpand all lines: src/nvim/api/private/helpers.c
Skip to content
Navigation Menu
{{ message }}
-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Commit b411f43
committed
feat(api): add support for lua function & description in keymap
Behavioral changes:
1. Added support for lua function in keymaps in
--------------------------------------------
- nvim_set_keymap
Can set lua function as keymap rhs like following:
```lua
vim.api.nvim_{buf_}set_keymap('n', '<leader>lr', '', {callback = vim.lsp.buf.references})
```
Note: lua function can only be set from lua . If api function being
called from viml or over rpc this option isn't available.
- nvim_{buf_}get_keymap
When called from lua, lua function is returned is `callback` key .
But in other cases callback contains number of the function ref.
- :umap, nvim_del_keymap & nvim_buf_del_keymap clears lua keymaps correctly.
- :map commands for displaing rhs .
For lua keymaps rhs is displayed as <Lua function ref_no>
Note: lua keymap cannot be set through viml command / functions.
- mapargs()
When dict is false it returns string in `<Lua function ref_no>`
format (same format as :map commands).
When dict is true it returns ref_no number in `callback` key.
- mapcheck()
returns string in `<Lua function ref_no>` format (same format as :map commands).
2. Added support for keymap description
---------------------------------------
- nvim_{buf_}set_keymap: added `desc` option in opts table .
```lua
vim.api.nvim_set_keymap('n', '<leader>w', '<cmd>w<cr>', {desc='Save current file'})
```
- nvim_{buf_}get_keymap: contains `desc` in returned list.
- commands like `:nmap <leader>w` will show description in a new line below rhs.
- `maparg()` return dict contains `desc`.1 parent 5c1b8b7 commit b411f43Copy full SHA for b411f43
File tree
Expand file treeCollapse file tree
16 files changed
+460
-69
lines changedFilter options
- runtime/doc
- src/nvim
- api
- private
- eval
- test/functional/api
Expand file treeCollapse file tree
16 files changed
+460
-69
lines changed+5-2Lines changed: 5 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1580 | 1580 |
| |
1581 | 1581 |
| |
1582 | 1582 |
| |
1583 |
| - | |
1584 |
| - | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
1585 | 1588 |
| |
1586 | 1589 |
| |
1587 | 1590 |
| |
|
+2-2Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
835 | 835 |
| |
836 | 836 |
| |
837 | 837 |
| |
838 |
| - | |
| 838 | + | |
839 | 839 |
| |
840 | 840 |
| |
841 | 841 |
| |
| |||
844 | 844 |
| |
845 | 845 |
| |
846 | 846 |
| |
847 |
| - | |
| 847 | + | |
848 | 848 |
| |
849 | 849 |
| |
850 | 850 |
| |
|
+2Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
29 | 29 |
| |
30 | 30 |
| |
31 | 31 |
| |
| 32 | + | |
| 33 | + | |
32 | 34 |
| |
33 | 35 |
| |
34 | 36 |
| |
|
src/nvim/api/private/helpers.c
Copy file name to clipboardExpand all lines: src/nvim/api/private/helpers.c+37-9Lines changed: 37 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
594 | 594 |
| |
595 | 595 |
| |
596 | 596 |
| |
| 597 | + | |
597 | 598 |
| |
598 | 599 |
| |
599 | 600 |
| |
| |||
604 | 605 |
| |
605 | 606 |
| |
606 | 607 |
| |
| 608 | + | |
| 609 | + | |
| 610 | + | |
607 | 611 |
| |
608 | 612 |
| |
609 | 613 |
| |
| |||
623 | 627 |
| |
624 | 628 |
| |
625 | 629 |
| |
626 |
| - | |
| 630 | + | |
627 | 631 |
| |
628 |
| - | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
629 | 637 |
| |
630 | 638 |
| |
631 | 639 |
| |
| |||
658 | 666 |
| |
659 | 667 |
| |
660 | 668 |
| |
661 |
| - | |
| 669 | + | |
| 670 | + | |
662 | 671 |
| |
663 | 672 |
| |
664 | 673 |
| |
| |||
668 | 677 |
| |
669 | 678 |
| |
670 | 679 |
| |
671 |
| - | |
672 |
| - | |
673 |
| - | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
674 | 687 |
| |
675 | 688 |
| |
676 | 689 |
| |
| |||
700 | 713 |
| |
701 | 714 |
| |
702 | 715 |
| |
| 716 | + | |
703 | 717 |
| |
| 718 | + | |
704 | 719 |
| |
705 | 720 |
| |
| 721 | + | |
706 | 722 |
| |
707 | 723 |
| |
708 | 724 |
| |
| |||
1052 | 1068 |
| |
1053 | 1069 |
| |
1054 | 1070 |
| |
| 1071 | + | |
1055 | 1072 |
| |
1056 |
| - | |
| 1073 | + | |
1057 | 1074 |
| |
1058 | 1075 |
| |
1059 | 1076 |
| |
| |||
1073 | 1090 |
| |
1074 | 1091 |
| |
1075 | 1092 |
| |
1076 |
| - | |
1077 |
| - | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
1078 | 1106 |
| |
1079 | 1107 |
| |
1080 | 1108 |
| |
|
+6-3Lines changed: 6 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1538 | 1538 |
| |
1539 | 1539 |
| |
1540 | 1540 |
| |
1541 |
| - | |
| 1541 | + | |
1542 | 1542 |
| |
1543 | 1543 |
| |
1544 |
| - | |
| 1544 | + | |
1545 | 1545 |
| |
1546 | 1546 |
| |
1547 | 1547 |
| |
| |||
1566 | 1566 |
| |
1567 | 1567 |
| |
1568 | 1568 |
| |
1569 |
| - | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
1570 | 1573 |
| |
1571 | 1574 |
| |
1572 | 1575 |
| |
|
+2Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
352 | 352 |
| |
353 | 353 |
| |
354 | 354 |
| |
| 355 | + | |
355 | 356 |
| |
356 | 357 |
| |
357 | 358 |
| |
358 | 359 |
| |
359 | 360 |
| |
360 | 361 |
| |
361 | 362 |
| |
| 363 | + | |
362 | 364 |
| |
363 | 365 |
| |
364 | 366 |
| |
|
+4Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1076 | 1076 |
| |
1077 | 1077 |
| |
1078 | 1078 |
| |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
1079 | 1083 |
| |
1080 | 1084 |
| |
1081 | 1085 |
| |
|
+12-5Lines changed: 12 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7299 | 7299 |
| |
7300 | 7300 |
| |
7301 | 7301 |
| |
7302 |
| - | |
7303 |
| - | |
| 7302 | + | |
| 7303 | + | |
7304 | 7304 |
| |
7305 |
| - | |
7306 |
| - | |
7307 |
| - | |
| 7305 | + | |
| 7306 | + | |
| 7307 | + | |
| 7308 | + | |
| 7309 | + | |
| 7310 | + | |
| 7311 | + | |
| 7312 | + | |
| 7313 | + | |
| 7314 | + | |
7308 | 7315 |
| |
7309 | 7316 |
| |
7310 | 7317 |
| |
|
+8-2Lines changed: 8 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5980 | 5980 |
| |
5981 | 5981 |
| |
5982 | 5982 |
| |
| 5983 | + | |
5983 | 5984 |
| |
5984 | 5985 |
| |
5985 | 5986 |
| |
| |||
6016 | 6017 |
| |
6017 | 6018 |
| |
6018 | 6019 |
| |
6019 |
| - | |
| 6020 | + | |
6020 | 6021 |
| |
6021 | 6022 |
| |
6022 | 6023 |
| |
| |||
6027 | 6028 |
| |
6028 | 6029 |
| |
6029 | 6030 |
| |
| 6031 | + | |
| 6032 | + | |
| 6033 | + | |
| 6034 | + | |
| 6035 | + | |
6030 | 6036 |
| |
6031 | 6037 |
| |
6032 | 6038 |
| |
6033 |
| - | |
| 6039 | + | |
6034 | 6040 |
| |
6035 | 6041 |
| |
6036 | 6042 |
| |
|
+4-2Lines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1024 | 1024 |
| |
1025 | 1025 |
| |
1026 | 1026 |
| |
1027 |
| - | |
| 1027 | + | |
1028 | 1028 |
| |
1029 | 1029 |
| |
1030 |
| - | |
| 1030 | + | |
1031 | 1031 |
| |
| 1032 | + | |
| 1033 | + | |
1032 | 1034 |
| |
1033 | 1035 |
| |
1034 | 1036 |
| |
|
You can’t perform that action at this time.
0 commit comments