Skip to content

Commit

Permalink
docs: documentation cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cseickel committed Jan 8, 2022
1 parent ea231dd commit cfe099d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 13 deletions.
14 changes: 7 additions & 7 deletions doc/neo-tree.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ Other Sources ....... |Neo-tree-Sources|

INTRODUCTION *Neo-tree-Introduction*

Neo-tree is a plugin for nvim that can display tree structures in a sidebar.
The current version supports one source, which is a filesystem browser. Future
versions will add suport for other sources.
Neo-tree is a plugin for nvim that can display tree structures in a sidebar or
a floating window. The current version includes a filesystem browser and a
buffer list.


COMMANDS *Neo-tree-Commands*
Expand All @@ -36,14 +36,14 @@ NeoTreeFocus will open the sidebar and focus it if it is closed, and just switch
to the neo-tree window if it is already open. Takes an optional argument to
specify the source to focus, such as `filesystem` or `buffers`.

If you specify `window.position: floating` in your configuration, this will
If you specify `window.position: float` in your configuration, this will
act like |NeoTreeFloat| but will not reveal the current file.

|NeoTreeShow| *NeoTreeShow*
You can also use NeoTreeShow which will open the tree, but leave the current
window focused. Takes an optional argument to specify the source to show.

If you specify `window.position: floating` in your configuration, this will
If you specify `window.position: float` in your configuration, this will
act like |NeoTreeFloat| but will not reveal the current file.

|NeoTreeReveal| *NeoTreeReveal*
Expand Down Expand Up @@ -160,9 +160,9 @@ require("neo-tree").setup({
-- see https://github.com/MunifTanjim/nui.nvim/tree/main/lua/nui/popup
-- for possible options. These can also be functions that return these
-- options.
position = "left", -- left, right, floating
position = "left", -- left, right, float
width = 40, -- applies to left and right positions
-- settings that apply to floating position only
-- settings that apply to float position only
popop = {
size = {
height = "80%",
Expand Down
5 changes: 2 additions & 3 deletions lua/neo-tree/sources/buffers/defaults.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
local highlights = require('neo-tree.ui.highlights')
local components = require('neo-tree.sources.buffers.components')

local filesystem = {
local buffers = {
window = {
position = "left",
width = 40,
Expand Down Expand Up @@ -62,4 +61,4 @@ local filesystem = {
}
}

return filesystem
return buffers
6 changes: 6 additions & 0 deletions lua/neo-tree/sources/example/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ M.close = function()
renderer.close(state)
end

M.float = function()
local state = get_state()
state.force_float = true
M.navigate(state.path)
end

M.focus = function()
local state = get_state()
if renderer.window_exists(state) then
Expand Down
4 changes: 2 additions & 2 deletions lua/neo-tree/sources/filesystem/defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ local filesystem = {
-- see https://github.com/MunifTanjim/nui.nvim/tree/main/lua/nui/popup
-- for possible options. These can also be functions that return these
-- options.
position = "left", -- left, right, floating
position = "left", -- left, right, float
width = 40, -- applies to left and right positions
-- settings that apply to floating position only
-- settings that apply to float position only
popup = {
size = {
height = "80%",
Expand Down
2 changes: 1 addition & 1 deletion lua/neo-tree/sources/filesystem/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ end
M.navigate = function(path, path_to_reveal, callback)
local state = get_state()
local pos = utils.get_value(state, "window.position", "left")
local was_float = state.force_float or pos == "floating"
local was_float = state.force_float or pos == "float"
local path_changed = false
if path == nil then
path = vim.fn.getcwd()
Expand Down

0 comments on commit cfe099d

Please sign in to comment.