Skip to content

Nanoteck137/sobble.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

sobble.nvim

Quick project opener for Neovim

Getting Started

Required dependencies

Optional dependencies

Installation

Using packer.nvim

use {
    'nanoteck137/sobble.nvim'
    requires = { { 'nvim-lua/plenary.nvim' } }
}

Using vim-plug

Plug 'nvim-lua/plenary.nvim'
Plug 'nanoteck137/sobble.nvim'

Usage

Setup

require('sobble').setup {
    config_path = 'path to config'
}

-- Example
require('sobble').setup {
    config_path = '~/projects.json'
}

Config

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"
    }
]

Usage with Telescope

-- Load the sobble telescope extension
-- Required to use :Telescope sobble
require('telescope').load_extension('sobble')
" Easiest way to use the plugin
:Telescope sobble

API

-- 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)

Authors

Patrik Millvik Rosenström patrik.millvik@gmail.com

License

This project is licensed under the MIT License - see the LICENSE file for details

About

Quick project opener for Neovim

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages