Skip to content

docs: clarify on_attach example, quick start #2165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Apr 29, 2023

Conversation

alex-courtis
Copy link
Member

@alex-courtis alex-courtis commented Apr 24, 2023

There is a little confusion around how to change the default mappings (briefly glimpsed on matrix chat). Added more examples.

Clarified quick start.

Build a user readable, linked table for mappings as an alternative to the default on_attach. Did not include it as I couldn't find a sensible place. Thoughts @gegoune ?

`<C-]>`           CD                      |nvim-tree-api.tree.change_root_to_node()|
`<C-e>`           Open: In Place          |nvim-tree-api.node.open.replace_tree_buffer()|
`<C-k>`           Info                    |nvim-tree-api.node.show_info_popup()|
`<C-r>`           Rename: Omit Filename   |nvim-tree-api.fs.rename_sub()|
`<C-t>`           Open: New Tab           |nvim-tree-api.node.open.tab()|
`<C-v>`           Open: Vertical Split    |nvim-tree-api.node.open.vertical()|
`<C-x>`           Open: Horizontal Split  |nvim-tree-api.node.open.horizontal()|
`<BS>`            Close Directory         |nvim-tree-api.node.navigate.parent_close()|
`<CR>`            Open                    |nvim-tree-api.node.open.edit()|
`<Tab>`           Open Preview            |nvim-tree-api.node.open.preview()|
`>`               Next Sibling            |nvim-tree-api.node.navigate.sibling.next()|
`<`               Previous Sibling        |nvim-tree-api.node.navigate.sibling.prev()|
`.`               Run Command             |nvim-tree-api.node.run.cmd()|
`-`               Up                      |nvim-tree-api.tree.change_root_to_parent()|
`a`               Create                  |nvim-tree-api.fs.create()|
`bmv`             Move Bookmarked         |nvim-tree-api.marks.bulk.move()|
`B`               Toggle No Buffer        |nvim-tree-api.tree.toggle_no_buffer_filter()|
`c`               Copy                    |nvim-tree-api.fs.copy.node()|
`C`               Toggle Git Clean        |nvim-tree-api.tree.toggle_git_clean_filter()|
`[c`              Prev Git                |nvim-tree-api.node.navigate.git.prev()|
`]c`              Next Git                |nvim-tree-api.node.navigate.git.next()|
`d`               Delete                  |nvim-tree-api.fs.remove()|
`D`               Trash                   |nvim-tree-api.fs.trash()|
`E`               Expand All              |nvim-tree-api.tree.expand_all()|
`e`               Rename: Basename        |nvim-tree-api.fs.rename_basename()|
`]e`              Next Diagnostic         |nvim-tree-api.node.navigate.diagnostics.next()|
`[e`              Prev Diagnostic         |nvim-tree-api.node.navigate.diagnostics.prev()|
`F`               Clean Filter            |nvim-tree-api.live_filter.clear()|
`f`               Filter                  |nvim-tree-api.live_filter.start()|
`g?`              Help                    |nvim-tree-api.tree.toggle_help()|
`gy`              Copy Absolute Path      |nvim-tree-api.fs.copy.absolute_path()|
`H`               Toggle Dotfiles         |nvim-tree-api.tree.toggle_hidden_filter()|
`I`               Toggle Git Ignore       |nvim-tree-api.tree.toggle_gitignore_filter()|
`J`               Last Sibling            |nvim-tree-api.node.navigate.sibling.last()|
`K`               First Sibling           |nvim-tree-api.node.navigate.sibling.first()|
`m`               Toggle Bookmark         |nvim-tree-api.marks.toggle()|
`o`               Open                    |nvim-tree-api.node.open.edit()|
`O`               Open: No Window Picker  |nvim-tree-api.node.open.no_window_picker()|
`p`               Paste                   |nvim-tree-api.fs.paste()|
`P`               Parent Directory        |nvim-tree-api.node.navigate.parent()|
`q`               Close                   |nvim-tree-api.tree.close()|
`r`               Rename                  |nvim-tree-api.fs.rename()|
`R`               Refresh                 |nvim-tree-api.tree.reload()|
`s`               Run System              |nvim-tree-api.node.run.system()|
`S`               Search                  |nvim-tree-api.tree.search_node()|
`U`               Toggle Hidden           |nvim-tree-api.tree.toggle_custom_filter()|
`W`               Collapse                |nvim-tree-api.tree.collapse_all()|
`x`               Cut                     |nvim-tree-api.fs.cut()|
`y`               Copy Name               |nvim-tree-api.fs.copy.filename()|
`Y`               Copy Relative Path      |nvim-tree-api.fs.copy.relative_path()|
`<2-LeftMouse>`   Open                    |nvim-tree-api.node.open.edit()|
`<2-RightMouse>`  CD                      |nvim-tree-api.tree.change_root_to_node()|

@alex-courtis alex-courtis changed the title doc: clarify on_attach example, quick start docs: clarify on_attach example, quick start Apr 24, 2023
@gegoune
Copy link
Collaborator

gegoune commented Apr 25, 2023

LGTM. I think we should provide user readable list of default mappings coming from default_on_attach() as some users might rely on it and it's good for discoverability.

@hinell if you have any mapping related suggestion this is a good place for it.

@hinell
Copy link
Contributor

hinell commented Apr 28, 2023

LGTM

@alex-courtis
Copy link
Member Author

LGTM. I think we should provide user readable list of default mappings coming from default_on_attach() as some users might rely on it and it's good for discoverability.

Stuck them in quick start. The mappings sections were too big...

@alex-courtis alex-courtis merged commit 74996b8 into master Apr 29, 2023
@alex-courtis alex-courtis deleted the doc-more-default-mappings branch April 29, 2023 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants