Skip to content

ryansch/habitats.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

habitats.nvim

"Habitats" for your neovim projects

📦 Installation

Install the plugin with your preferred package manager:

  {
    "ryansch/habitats.nvim",

    dependencies = {
      "nvim-lua/plenary.nvim",
      "nvim-telescope/telescope-file-browser.nvim",
      "natecraddock/sessions.nvim",
      "natecraddock/workspaces.nvim",
    },

    event = "VeryLazy",

    keys = {
      {
        "<leader>oh",
        function()
          require("telescope").extensions.habitats.habitats()
        end,
        desc = "Habitats",
      },
    },

    config = function(_, opts)
      require("habitats").setup(opts)
      require("telescope").load_extension("habitats")
    end,
  },

⚙️ Configuration

habitats.nvim comes with the following defaults:

  {
    "ryansch/habitats.nvim",

    dependencies = {
      "nvim-lua/plenary.nvim",
      "nvim-telescope/telescope-file-browser.nvim",
      "natecraddock/sessions.nvim",
      "natecraddock/workspaces.nvim",
    },

    event = "VeryLazy",

    keys = {
      {
        "<leader>oh",
        function()
          require("telescope").extensions.habitats.habitats()
        end,
        desc = "Habitats",
      },
    },

    opts = {
      path = Path:new(vim.fn.stdpath("data"), "habitats.nvim"),
      global_cd = true,
      sort = true,
      notify_info = true,
      log_level = "info",
      sessionoptions = "curdir,folds,help,tabpages,winsize",

      hooks = {
        add = {},
        remove = {},
        rename = {},
        open_pre = {},
        open = {},
      },
    },

    config = function(_, opts)
      require("habitats").setup(opts)
      require("telescope").load_extension("habitats")
    end,
  },

Additionally you can add it to your dashboard like so:

  {
    "goolord/alpha-nvim",
    opts = function(_, dashboard)
      local button = dashboard.button("h", "" .. " Habitats", ":Telescope habitats <CR>")
      button.opts.hl = "AlphaButtons"
      button.opts.hl_shortcut = "AlphaShortcut"
      table.insert(dashboard.section.buttons.val, 4, button)
    end,
  },

About

"Habitats" for your neovim projects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages