aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/highlight.lua
diff options
context:
space:
mode:
authorWilliam Chargin <wchargin@gmail.com>2021-10-19 07:24:43 -0700
committerGitHub <noreply@github.com>2021-10-19 07:24:43 -0700
commit9fb0f12357b663fd8571010b2b8659a063af253e (patch)
treec5afbb87de4fc23215241a6060b9bcca23400f39 /runtime/lua/vim/highlight.lua
parentaac15cf4ade5cb67000abe171ff8e2060b78907e (diff)
downloadrneovim-9fb0f12357b663fd8571010b2b8659a063af253e.tar.gz
rneovim-9fb0f12357b663fd8571010b2b8659a063af253e.tar.bz2
rneovim-9fb0f12357b663fd8571010b2b8659a063af253e.zip
feat(man.vim): convert spaces to underscores #16068
PostgreSQL ships with man pages for SQL statements like `CREATE TABLE`, which are provided with underscores as `man 7 CREATE_TABLE`. This patch updates `man#open_page` (as used by `:Man`) such that visually selecting the words `CREATE TABLE` in SQL code and pressing `K` properly opens the desired man page. Writing `:Man CREATE TABLE` still does not work, since `CREATE` is interpreted as a section name. (Similarly, `:Man CREATE TABLE AS` fails because there are too many arguments to `:Man`.) But this is okay, because if you're typing it anyway then you can just enter underscores and also tab-completion properly suggests `:Man CREATE_TABLE(7)`. This is a bit bespoke, but my box has over 9000 man pages (as reported by `man -k '' | wc -l`), and not one of them has a space in the man page name, whereas the Postgres manuals do exist and are actually useful. Test Plan: On a machine with Postgres manual pages, running nvim -u NORC +'exe "norm iCREATE TABLE foo(x int);" | norm 0veeK' should open the appropriate man page. wchargin-branch: man-spaces-to-underscores
Diffstat (limited to 'runtime/lua/vim/highlight.lua')
0 files changed, 0 insertions, 0 deletions