-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- rename scripts dir to docgen - slightly change placeholder syntax - move duplicate static docs into separate files
- Loading branch information
Showing
17 changed files
with
385 additions
and
430 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,5 @@ test: | |
|
||
.PHONY: doc | ||
doc: | ||
./scripts/gen_doc.lua | ||
./docgen/gen_doc.lua | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
local crates = require('crates') | ||
local opts = { silent = true } | ||
|
||
vim.keymap.set('n', '<leader>ct', crates.toggle, opts) | ||
vim.keymap.set('n', '<leader>cr', crates.reload, opts) | ||
|
||
vim.keymap.set('n', '<leader>cv', crates.show_versions_popup, opts) | ||
vim.keymap.set('n', '<leader>cf', crates.show_features_popup, opts) | ||
vim.keymap.set('n', '<leader>cd', crates.show_dependencies_popup, opts) | ||
|
||
vim.keymap.set('n', '<leader>cu', crates.update_crate, opts) | ||
vim.keymap.set('v', '<leader>cu', crates.update_crates, opts) | ||
vim.keymap.set('n', '<leader>ca', crates.update_all_crates, opts) | ||
vim.keymap.set('n', '<leader>cU', crates.upgrade_crate, opts) | ||
vim.keymap.set('v', '<leader>cU', crates.upgrade_crates, opts) | ||
vim.keymap.set('n', '<leader>cA', crates.upgrade_all_crates, opts) | ||
|
||
vim.keymap.set('n', '<leader>ce', crates.expand_plain_crate_to_inline_table, opts) | ||
vim.keymap.set('n', '<leader>cE', crates.extract_crate_into_table, opts) | ||
|
||
vim.keymap.set('n', '<leader>cH', crates.open_homepage, opts) | ||
vim.keymap.set('n', '<leader>cR', crates.open_repository, opts) | ||
vim.keymap.set('n', '<leader>cD', crates.open_documentation, opts) | ||
vim.keymap.set('n', '<leader>cC', crates.open_crates_io, opts) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
nnoremap <silent> <leader>ct :lua require('crates').toggle()<cr> | ||
nnoremap <silent> <leader>cr :lua require('crates').reload()<cr> | ||
nnoremap <silent> <leader>cv :lua require('crates').show_versions_popup()<cr> | ||
nnoremap <silent> <leader>cf :lua require('crates').show_features_popup()<cr> | ||
nnoremap <silent> <leader>cd :lua require('crates').show_dependencies_popup()<cr> | ||
nnoremap <silent> <leader>cu :lua require('crates').update_crate()<cr> | ||
vnoremap <silent> <leader>cu :lua require('crates').update_crates()<cr> | ||
nnoremap <silent> <leader>ca :lua require('crates').update_all_crates()<cr> | ||
nnoremap <silent> <leader>cU :lua require('crates').upgrade_crate()<cr> | ||
vnoremap <silent> <leader>cU :lua require('crates').upgrade_crates()<cr> | ||
nnoremap <silent> <leader>cA :lua require('crates').upgrade_all_crates()<cr> | ||
nnoremap <silent> <leader>ce :lua require('crates').expand_plain_crate_to_inline_table()<cr> | ||
nnoremap <silent> <leader>cE :lua require('crates').extract_crate_into_table()<cr> | ||
nnoremap <silent> <leader>cH :lua require('crates').open_homepage()<cr> | ||
nnoremap <silent> <leader>cR :lua require('crates').open_repository()<cr> | ||
nnoremap <silent> <leader>cD :lua require('crates').open_documentation()<cr> | ||
nnoremap <silent> <leader>cC :lua require('crates').open_crates_io()<cr> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
local function show_documentation() | ||
local filetype = vim.bo.filetype | ||
if vim.tbl_contains({ 'vim','help' }, filetype) then | ||
vim.cmd('h '..vim.fn.expand('<cword>')) | ||
elseif vim.tbl_contains({ 'man' }, filetype) then | ||
vim.cmd('Man '..vim.fn.expand('<cword>')) | ||
elseif vim.fn.expand('%:t') == 'Cargo.toml' and require('crates').popup_available() then | ||
require('crates').show_popup() | ||
else | ||
vim.lsp.buf.hover() | ||
end | ||
end | ||
|
||
vim.keymap.set('n', 'K', show_documentation, { silent = true }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
nnoremap <silent> K :call <SID>show_documentation()<cr> | ||
function! s:show_documentation() | ||
if (index(['vim','help'], &filetype) >= 0) | ||
execute 'h '.expand('<cword>') | ||
elseif (index(['man'], &filetype) >= 0) | ||
execute 'Man '.expand('<cword>') | ||
elseif (expand('%:t') == 'Cargo.toml' && luaeval('require("crates").popup_available()')) | ||
lua require('crates').show_popup() | ||
else | ||
lua vim.lsp.buf.hover() | ||
endif | ||
endfunction |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
*crates.txt* Crates | ||
*crates.nvim* | ||
|
||
Author: Tobias Schmitz <tobiasschmitz2001@gmail.com> | ||
Version: <VERSION> | ||
Homepage: <https://github.com/saecki/crates.nvim> | ||
License: MIT license | ||
|
||
============================================================================== | ||
INTRODUCTION *crates* | ||
|
||
Crates is a plugin that helps managing crates.io dependencies. | ||
It can display a crate's versions and features and allows you to update, | ||
upgrade, select, enable or disable them. | ||
|
||
============================================================================== | ||
USAGE *crates-usage* | ||
|
||
Basic setup. | ||
> | ||
require('crates').setup() | ||
< | ||
|
||
Setup for plain text (without patched font). | ||
> | ||
require('crates').setup { | ||
<SHARED:plain_text_config.lua> | ||
} | ||
< | ||
|
||
Setup with default options. | ||
Note the icons in the default config require a patched font, if you don't have | ||
one use the plain text config. | ||
For more information about individual config options see |crates-config|. | ||
> | ||
require('crates').setup { | ||
<SHARED:DEFAULT_CONFIGURATION> | ||
} | ||
< | ||
|
||
============================================================================== | ||
MAPPINGS *crates-mappings* | ||
|
||
Note crates doesn't use any global key mappings by default. | ||
|
||
But here are some recommended ones. | ||
For more information about the lua function see |crates-functions|. | ||
> | ||
<SHARED:keymaps.lua> | ||
< | ||
|
||
And here are the same ones in vimscript. | ||
> | ||
<SHARED:keymaps.vim> | ||
< | ||
|
||
To integrate the crates popup in an idiomatic way into your configuration, you | ||
might want to use one of the following snippets for contextual documentation. | ||
|
||
How you might integrate `show_popup` into your `init.vim`. | ||
> | ||
<SHARED:show_docs.vim> | ||
< | ||
|
||
How you might integrate `show_popup` into your `init.lua`. | ||
> | ||
<SHARED:show_docs.lua> | ||
< | ||
|
||
============================================================================== | ||
FUNCTIONS *crates-functions* | ||
|
||
All of these functions are members of the `crates` root module. | ||
They can be accessed like this. | ||
> | ||
require('crates').function_name() | ||
< | ||
|
||
<SHARED:FUNCTIONS> | ||
============================================================================== | ||
CONFIGURATION *crates-config* | ||
|
||
This section describes the configuration options which can be passed to | ||
`crates.setup()`. Note the type `section` indicates that the field | ||
is a table with subfields which will be extended with their default values, if | ||
not specified. | ||
|
||
<SHARED:CONFIGURATION> | ||
|
||
============================================================================== | ||
HIGHLIGHTS *crates-highlights* | ||
|
||
This is a list of the default highlight groups used by crates.nvim. To change | ||
them, you can either overwrite them or use different ones in | ||
|crates-config-highlight| and |crates-config-popup-highlight|. | ||
|
||
<SHARED:HIGHLIGHTS> | ||
|
||
vim:tw=78:ts=8:ft=help:norl: |
Oops, something went wrong.