Skip to content

Commit

Permalink
docs: add vimdoc
Browse files Browse the repository at this point in the history
`:h one.nvim`, `:h one-keymaps`
  • Loading branch information
adoyle-h committed Sep 30, 2023
1 parent 78e2768 commit aef3283
Show file tree
Hide file tree
Showing 8 changed files with 674 additions and 8 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,8 @@ $(BUMP_TARGETS):
# @desc Generate and update the CHANGELOG file
changelog:
$(MAKE) CHANGELOG NEXT_VERSION=$(shell cat VERSION)

.PHONY: vimdoctags
vimdoctags:
@nvim --cmd 'helptags ./doc/' --cmd 'q!'
@echo Generated: ./doc/tags
594 changes: 594 additions & 0 deletions doc/one.txt

Large diffs are not rendered by default.

60 changes: 60 additions & 0 deletions doc/tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
:OneReset one.txt /*:OneReset*
:OneShowConfig one.txt /*:OneShowConfig*
:OneShowPlugins one.txt /*:OneShowPlugins*
:OneUpdate one.txt /*:OneUpdate*
<space>k one.txt /*<space>k*
one-commands one.txt /*one-commands*
one-contents one.txt /*one-contents*
one-keymaps one.txt /*one-keymaps*
one-keymaps-buffer-line one.txt /*one-keymaps-buffer-line*
one-keymaps-coding one.txt /*one-keymaps-coding*
one-keymaps-comments one.txt /*one-keymaps-comments*
one-keymaps-completion one.txt /*one-keymaps-completion*
one-keymaps-copy one.txt /*one-keymaps-copy*
one-keymaps-dap one.txt /*one-keymaps-dap*
one-keymaps-design-principles one.txt /*one-keymaps-design-principles*
one-keymaps-diagnostic one.txt /*one-keymaps-diagnostic*
one-keymaps-diff one.txt /*one-keymaps-diff*
one-keymaps-edit one.txt /*one-keymaps-edit*
one-keymaps-file-explorer one.txt /*one-keymaps-file-explorer*
one-keymaps-fold one.txt /*one-keymaps-fold*
one-keymaps-format one.txt /*one-keymaps-format*
one-keymaps-general one.txt /*one-keymaps-general*
one-keymaps-git one.txt /*one-keymaps-git*
one-keymaps-gutter one.txt /*one-keymaps-gutter*
one-keymaps-highlight one.txt /*one-keymaps-highlight*
one-keymaps-indent one.txt /*one-keymaps-indent*
one-keymaps-jump one.txt /*one-keymaps-jump*
one-keymaps-lsp one.txt /*one-keymaps-lsp*
one-keymaps-marks one.txt /*one-keymaps-marks*
one-keymaps-motion one.txt /*one-keymaps-motion*
one-keymaps-open one.txt /*one-keymaps-open*
one-keymaps-paste one.txt /*one-keymaps-paste*
one-keymaps-pickers one.txt /*one-keymaps-pickers*
one-keymaps-scroll one.txt /*one-keymaps-scroll*
one-keymaps-search one.txt /*one-keymaps-search*
one-keymaps-select one.txt /*one-keymaps-select*
one-keymaps-swap one.txt /*one-keymaps-swap*
one-keymaps-tabpage one.txt /*one-keymaps-tabpage*
one-keymaps-telescope one.txt /*one-keymaps-telescope*
one-keymaps-terminal one.txt /*one-keymaps-terminal*
one-keymaps-trouble one.txt /*one-keymaps-trouble*
one-keymaps-uncategory one.txt /*one-keymaps-uncategory*
one-keymaps-window one.txt /*one-keymaps-window*
one-keymaps-word-case one.txt /*one-keymaps-word-case*
one-keymaps-write one.txt /*one-keymaps-write*
one-lua one.txt /*one-lua*
one-options one.txt /*one-options*
one-usages one.txt /*one-usages*
one.CM one.txt /*one.CM*
one.CM.config one.txt /*one.CM.config*
one.FT one.txt /*one.FT*
one.PM one.txt /*one.PM*
one.consts one.txt /*one.consts*
one.nvim one.txt /*one.nvim*
one.reset one.txt /*one.reset*
one.setup one.txt /*one.setup*
one.showConfig one.txt /*one.showConfig*
one.showPlugins one.txt /*one.showPlugins*
one.update one.txt /*one.update*
one.util one.txt /*one.util*
10 changes: 6 additions & 4 deletions doc/usage/keymaps.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Default Keymaps

List basic keymaps for novices.
Press `<space>k` to see all keymaps in nvim.
This document only list basic keymaps for novices.

Press `<space>k` to query all keymaps in nvim.
Or press `:h one-keymaps` to see the keymaps document.

## Keymaps Design Principles

- Prefixed `<leader>` to functions.
- Prefixed `<leader>` (defaults `;`) to functions.
- Prefixed `<space>` to open/toggle window, and change mode.
- Prefixed `<M->` for shortcuts/toggle. Some keymaps can hold on.
- Prefixed `g` for goto/jump/search/lsp.
Expand Down Expand Up @@ -259,7 +261,7 @@ If bufferline plugin enabled:
- `<leader>9` = Select 9th buffer
- `<leader>0` = Select last buffer

## Tab
## Tabpage

- `<C-t>n` = Open new tab
- `<C-t>x` = Close tab
Expand Down
2 changes: 1 addition & 1 deletion doc/usage/keymaps.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

记录了常用的快捷键。详见 [./keymaps.md](./keymaps.md)(懒得翻译)。

在 nvim 按下 `<space>k` 可查询所有快捷键。
在 nvim 按下 `<space>k` 可查询所有快捷键。或者 `:h one-keymaps` 可查看快捷键文档。
3 changes: 2 additions & 1 deletion doc/user-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

[English](./user-config.md) | [中文](./user-config.zh.md)

Set your config to override default configs.
All config options are optional.
Set your options to override default configs.

```lua
require('one').setup {
Expand Down
1 change: 1 addition & 0 deletions doc/user-config.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[English](./user-config.md) | [中文](./user-config.zh.md)

所有配置选项都是可选的。
你可以传入自定义配置来覆盖默认配置。

```lua
Expand Down
7 changes: 5 additions & 2 deletions lua/one/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ end
-- @param [opts] {table}
-- @param [opts.config] {table}
-- @param [opts.configFn] {function(config):table}
-- The returned table will be merged into config.
-- @param [opts.onlyPlugins] {string[]|nil}
-- It's useful for debug. Defaults to nil.
-- If set empty table, all builtin and user-defined plugins are disabled.
-- If set non-empty table, only these plugins are not disabled.
-- @param [opts.plugins] {PlugOpts[]|function(builtin: function(path: string):PlugOpts, config: Config):PlugOpts[]}
-- If passed a function, the first parameter is used to get the builtin PlugOpts.
-- The second parameter is the config of framework.
-- If passed a function, the first parameter is used to get the builtin PlugOpts.
-- The second parameter is the config of framework.
One.setup = function(opts)
preset()

Expand All @@ -50,6 +51,8 @@ One.setup = function(opts)

PM.setup(opts)
FT.setup()

vim.opt.rtp:append(consts.ONE_DIR)
end

return One

0 comments on commit aef3283

Please sign in to comment.