Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
162 changes: 83 additions & 79 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,87 +243,91 @@ You can find these in [`project/config/defaults.lua`](./lua/project/config/defau

```lua
{
---@param target_dir string
---@param method string
before_attach = function(target_dir, method) end,
---@param dir string
---@param method string
on_attach = function(dir, method) end,
use_lsp = true,
manual_mode = false,
patterns = { ---@type string[]
'.git',
'.github',
'_darcs',
'.hg',
'.bzr',
'.svn',
'Pipfile',
'pyproject.toml',
'.pre-commit-config.yaml',
'.pre-commit-config.yml',
'.csproj',
'.sln',
'.nvim.lua',
},
allow_patterns_for_lsp = false,
allow_different_owners = false,
enable_autochdir = false,
show_hidden = false,
ignore_lsp = {}, ---@type string[]
exclude_dirs = {}, ---@type string[]
silent_chdir = true,
scope_chdir = 'global', ---@type 'global'|'tab'|'win'
datapath = vim.fn.stdpath('data'),
historysize = 100,
log = { ---@type Project.Config.Logging
enabled = false,
max_size = 1.1,
logpath = vim.fn.stdpath('state'),
},
fzf_lua = { enabled = false }, ---@type Project.Config.FzfLua
disable_on = {
ft = { -- `filetype`
'',
'NvimTree',
'TelescopePrompt',
'TelescopeResults',
'alpha',
'checkhealth',
'lazy',
'log',
'ministarter',
'neo-tree',
'notify',
'nvim-pack',
'packer',
'qf',
},
bt = { 'help', 'nofile', 'nowrite', 'terminal' },
---@param target_dir string
---@param method string
before_attach = function(target_dir, method) end,
---@param dir string
---@param method string
on_attach = function(dir, method) end,
lsp = { ---@type Project.Config.LSP
enabled = true, ---@type boolean
ignore = {}, ---@type string[]
use_pattern_matching = false, ---@type boolean
-- WARNING: USE AT YOUR OWN DISCRETION!!!!
no_fallback = false, ---@type boolean
},
manual_mode = false,
patterns = { ---@type string[]
'.git',
'.github',
'_darcs',
'.hg',
'.bzr',
'.svn',
'Pipfile',
'pyproject.toml',
'.pre-commit-config.yaml',
'.pre-commit-config.yml',
'.csproj',
'.sln',
'.nvim.lua',
},
allow_different_owners = false,
enable_autochdir = false,
show_hidden = false,
exclude_dirs = {}, ---@type string[]
silent_chdir = true,
scope_chdir = 'global', ---@type 'global'|'tab'|'win'
datapath = vim.fn.stdpath('data'),
historysize = 100,
log = { ---@type Project.Config.Logging
enabled = false,
max_size = 1.1,
logpath = vim.fn.stdpath('state'),
},
fzf_lua = { enabled = false }, ---@type Project.Config.FzfLua
disable_on = {
ft = { -- `filetype`
'',
'NvimTree',
'TelescopePrompt',
'TelescopeResults',
'alpha',
'checkhealth',
'lazy',
'log',
'ministarter',
'neo-tree',
'notify',
'nvim-pack',
'packer',
'qf',
},
telescope = { ---@type Project.Config.Telescope
sort = 'newest', ---@type 'oldest'|'newest'
prefer_file_browser = false,
disable_file_picker = false,
mappings = { ---@type table<'n'|'i', table<string, Project.Telescope.ActionNames>>
n = {
b = 'browse_project_files',
d = 'delete_project',
f = 'find_project_files',
r = 'recent_project_files',
s = 'search_in_project_files',
w = 'change_working_directory',
},
i = {
['<C-b>'] = 'browse_project_files',
['<C-d>'] = 'delete_project',
['<C-f>'] = 'find_project_files',
['<C-r>'] = 'recent_project_files',
['<C-s>'] = 'search_in_project_files',
['<C-w>'] = 'change_working_directory',
},
},
bt = { 'help', 'nofile', 'nowrite', 'terminal' },
},
telescope = { ---@type Project.Config.Telescope
sort = 'newest', ---@type 'oldest'|'newest'
prefer_file_browser = false,
disable_file_picker = false,
mappings = { ---@type table<'n'|'i', table<string, Project.Telescope.ActionNames>>
n = {
b = 'browse_project_files',
d = 'delete_project',
f = 'find_project_files',
r = 'recent_project_files',
s = 'search_in_project_files',
w = 'change_working_directory',
},
i = {
['<C-b>'] = 'browse_project_files',
['<C-d>'] = 'delete_project',
['<C-f>'] = 'find_project_files',
['<C-r>'] = 'recent_project_files',
['<C-s>'] = 'search_in_project_files',
['<C-w>'] = 'change_working_directory',
},
},
},
}
```

Expand Down
121 changes: 73 additions & 48 deletions doc/project-nvim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ Table of Contents *project-nvim.toc*
2.5 luarocks |project-nvim.install-luarocks|
3. project-nvim.setup |project-nvim.setup|
3.1. `Project.Config.Options` |Project.Config.Options|
3.2. `Project.Config.Telescope` |Project.Config.Telescope|
3.3. `Project.Config.FzfLua` |Project.Config.FzfLua|
3.4. `Project.Config.Logging` |Project.Config.Logging|
3.2. `Project.Config.LSP` |Project.Config.LSP|
3.3. `Project.Config.Telescope` |Project.Config.Telescope|
3.4. `Project.Config.FzfLua` |Project.Config.FzfLua|
3.5. `Project.Config.Logging` |Project.Config.Logging|
4. Pattern Matching |project-nvim.pattern-matching|
5. Nvim Tree |project-nvim.nvim-tree|
6. Neo Tree |project-nvim.neo-tree|
Expand Down Expand Up @@ -186,12 +187,6 @@ Table of Contents *project-nvim.toc*
3.1 `Project.Config.Options` *Project.Config.Options*
*project-nvim.setup-options*

* {log} (|Project.Options.Logging|)
Options for logging.

Default: |Project.Options.Logging| ~



* {disable_on} (`{ ft: string[], bt: string[] }`)
CREDITS TO @Zeioth! ~
Expand All @@ -215,16 +210,6 @@ Table of Contents *project-nvim.toc*
Default: `false` ~


* {use_lsp} (boolean)
If `true` then LSP-based method detection
will take precedence over traditional
pattern matching.
See |project-nvim.pattern-matching|
for more info

Default: `true` ~


* {patterns} (`string[]`)
All the patterns used to detect the root dir.
See |project-nvim.pattern-matching| for more
Expand All @@ -242,23 +227,6 @@ Table of Contents *project-nvim.toc*
keep this empty!


* {allow_patterns_for_lsp} (boolean)
Sets whether to use Pattern Matching rules
to the LSP client.

If `false` the Pattern Matching will
only apply to normal pattern matching.
If `true` the {patterns} setting will
also filter your LSP's `root_dir`,
assuming there is one and {use_lsp}
is set to `true`.

See |project-nvim.pattern-matching| for more
info on pattern matching

Default: `false` ~


* {allow_different_owners} (boolean)
Determines whether a project will be
added if its project root is owned
Expand Down Expand Up @@ -297,6 +265,14 @@ Table of Contents *project-nvim.toc*
Default: `false` ~


* {lsp} (|Project.Config.LSP|)
Table containing all the
LSP-adjacent options.

See |Project.Config.LSP| for more
details


* {telescope} (|Project.Config.Telescope|)
Table of options used for
the telescope picker.
Expand All @@ -313,14 +289,11 @@ Table of Contents *project-nvim.toc*
details


* {ignore_lsp} (`string[]`)
Table of LSP clients to ignore by name,
e.g. `{ 'efm', ... }`

If you have `nvim-lspconfig` installed you can
look up |lspconfig-all| for a list of servers
* {log} (|Project.Options.Logging|)
Options for logging.

Default: `{}` ~
See |Project.Config.Logging| for more
details


* {exclude_dirs} (`string[]`)
Expand Down Expand Up @@ -354,15 +327,15 @@ Table of Contents *project-nvim.toc*
Default: `'global'` ~


* {before_attach} (`fun(target_dir?: string, method?: string)`)
* {before_attach} (`fun(target_dir: string, method: string)`)
Hook to run before attaching to a new project.
It optionally recieves `target_dir` and
the `method` used to change directory

Default: empty function ~


* {on_attach} (`fun(dir?: string, method?: string)`)
* {on_attach} (`fun(dir: string, method: string)`)
Hook to run after attaching to a new project.
It optionally recieves `dir` and
the `method` used to change directory.
Expand All @@ -384,7 +357,59 @@ Table of Contents *project-nvim.toc*


------------------------------------------------------------------------------
3.2 `Project.Config.Telescope` *Project.Config.Telescope*
3.2 `Project.Config.LSP` *Project.Config.LSP*
*project-nvim.lsp-config*


* {enabled} (boolean)
If `true` then LSP-based method detection
will take precedence over traditional
pattern matching.
See |project-nvim.pattern-matching|
for more info

Default: `true` ~


* {ignore} (`string[]`)
Table of LSP clients to ignore by name,
e.g. `{ 'efm', ... }`

If you have `nvim-lspconfig` installed you can
look up |lspconfig-all| for a list of servers

Default: `{}` ~


* {no_fallback} (boolean)
If `true` then LSP-based method detection
will not be compared with
pattern-matching-based detection.

WARNING: USE AT YOUR OWN DISCRETION! ~

Default: `false` ~


* {use_pattern_matching} (boolean)
Sets whether to use Pattern Matching rules
to the LSP client.

If `false` the Pattern Matching will
only apply to normal pattern matching.
If `true` the {patterns} setting will
also filter your LSP's `root_dir`,
assuming there is one and {lsp.enabled}
is set to `true`.

See |project-nvim.pattern-matching| for more
info on pattern matching

Default: `false` ~


------------------------------------------------------------------------------
3.3 `Project.Config.Telescope` *Project.Config.Telescope*
*project-nvim.telescope-config*


Expand Down Expand Up @@ -425,7 +450,7 @@ Table of Contents *project-nvim.toc*


------------------------------------------------------------------------------
3.3 `Project.Config.FzfLua` *Project.Config.FzfLua*
3.4 `Project.Config.FzfLua` *Project.Config.FzfLua*
*project-nvim.fzf-lua-config*

* {enabled} (boolean)
Expand All @@ -438,7 +463,7 @@ Table of Contents *project-nvim.toc*


------------------------------------------------------------------------------
3.4 `Project.Config.Logging` *Project.Config.Logging*
3.5 `Project.Config.Logging` *Project.Config.Logging*
*project-nvim.logging-config*

* {enabled} (boolean)
Expand Down
Loading