Quick project opener for Neovim
- nvim-lua/plenary.nvim is required.
Using packer.nvim
use {
'nanoteck137/sobble.nvim'
requires = { { 'nvim-lua/plenary.nvim' } }
}
Using vim-plug
Plug 'nvim-lua/plenary.nvim'
Plug 'nanoteck137/sobble.nvim'
require('sobble').setup {
config_path = 'path to config'
}
-- Example
require('sobble').setup {
config_path = '~/projects.json'
}
Example config json file
[
{
"title": "Example Project",
"cwd": "~/some_project",
"open_file": "src/main.rs",
}
]
You can even add custom properties to the project and query them in Neovim
[
{
"title": "Example Project",
"cwd": "~/some_project",
"open_file": "src/main.rs",
"custom_property": "example"
}
]
-- Load the sobble telescope extension
-- Required to use :Telescope sobble
require('telescope').load_extension('sobble')
" Easiest way to use the plugin
:Telescope sobble
-- Get all the projects
local projects = require('sobble').get_projects()
-- Load project
require('sobble').load_project(projects[1])
You can access the current loaded project in the tab page with this example
-- Access the project loaded in the tab,
-- returns nil if no project is loaded
local current_project = vim.t.sobble_current_project
-- Print the title of the currenly loaded project
print(current_project.title)
-- Access custom properties like this
print(current_project.custom_property)
Patrik Millvik Rosenström patrik.millvik@gmail.com
This project is licensed under the MIT License - see the LICENSE file for details