feat: allow number and relativenumber settings (#762)
This commit is contained in:
parent
f2f1a34733
commit
9db956fab7
@ -88,7 +88,9 @@ require'nvim-tree'.setup {
|
|||||||
mappings = {
|
mappings = {
|
||||||
custom_only = false,
|
custom_only = false,
|
||||||
list = {}
|
list = {}
|
||||||
}
|
},
|
||||||
|
number = false,
|
||||||
|
relativenumber = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
@ -110,14 +110,16 @@ function.
|
|||||||
height = 30,
|
height = 30,
|
||||||
side = 'left',
|
side = 'left',
|
||||||
auto_resize = false,
|
auto_resize = false,
|
||||||
|
number = false,
|
||||||
|
relativenumber = false,
|
||||||
mappings = {
|
mappings = {
|
||||||
custom_only = false,
|
custom_only = false,
|
||||||
list = {}
|
list = {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
filters = {
|
filters = {
|
||||||
dotfiles = false,
|
dotfiles = false,
|
||||||
custom = {}
|
custom = {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
<
|
<
|
||||||
@ -287,6 +289,16 @@ Here is a list of the options available in the setup call:
|
|||||||
type: `boolean`
|
type: `boolean`
|
||||||
default: false
|
default: false
|
||||||
|
|
||||||
|
- |view.number|: print the line number in front of each line.
|
||||||
|
type: `boolean`
|
||||||
|
default: false
|
||||||
|
|
||||||
|
- |view.relativenumber|: show the line number relative to the line with the
|
||||||
|
cursor in front of each line. If the option `view.number` is also `true`,
|
||||||
|
the number on the cursor line will be the line number instead of `0`.
|
||||||
|
type: `boolean`
|
||||||
|
default: false
|
||||||
|
|
||||||
- |view.mappings|: configuration options for keymaps
|
- |view.mappings|: configuration options for keymaps
|
||||||
|
|
||||||
- |view.mappings.custom_only|: will use only the provided user mappings and not the default
|
- |view.mappings.custom_only|: will use only the provided user mappings and not the default
|
||||||
|
|||||||
@ -114,7 +114,9 @@ local DEFAULT_CONFIG = {
|
|||||||
mappings = {
|
mappings = {
|
||||||
custom_only = false,
|
custom_only = false,
|
||||||
list = {}
|
list = {}
|
||||||
}
|
},
|
||||||
|
number = false,
|
||||||
|
relativenumber = false
|
||||||
}
|
}
|
||||||
|
|
||||||
local function merge_mappings(user_mappings)
|
local function merge_mappings(user_mappings)
|
||||||
@ -147,6 +149,8 @@ function M.setup(opts)
|
|||||||
M.View.height = options.height
|
M.View.height = options.height
|
||||||
M.View.hide_root_folder = options.hide_root_folder
|
M.View.hide_root_folder = options.hide_root_folder
|
||||||
M.View.auto_resize = opts.auto_resize
|
M.View.auto_resize = opts.auto_resize
|
||||||
|
M.View.winopts.number = options.number
|
||||||
|
M.View.winopts.relativenumber = options.relativenumber
|
||||||
if options.mappings.custom_only then
|
if options.mappings.custom_only then
|
||||||
M.View.mappings = options.mappings.list
|
M.View.mappings = options.mappings.list
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user