Git Product home page Git Product logo

my-spaces.nvim's Introduction

My spaces

My spaces for easy to change project root.

Installtion

Using packer.nvim

    use {
       'yonchando/my-spaces.nvim',
       requires = {
         'nvim-telescope/telescope.nvim',
         'nvim-lua/plenary.nvim'
       },
       config = function()
         require("my_spaces").setup()
       end
    }

Using lazy.nvim

  use {
      'yonchando/my-spaces.nvim',
      requires = {
        'nvim-telescope/telescope.nvim',
        'nvim-lua/plenary.nvim'
      },
      config = function()
        require("my_spaces").setup()
      end
  }

Configs

Property Type Default Description
width number 120 Width the windows popup
height number 30 Height the windows popup

Usage

Open the window lists buffer by :ListSpace

You can edit the buffer like normal file.

Note: Seperate projects by line

Key Mode Description
q n Close
Esc n Close
C-c i Close

Using with vim cmd

:AddSpace your-space-path
local nvimtree = require('nvim-tree')

nvimtree.setup({
  on_attach = function(bufnr)
        vim.keymap.set("n", "M", function()
            local node = api.tree.get_node_under_cursor()
    
            local ok, my_spaces = pcall(require, "my_spaces")
    
            if ok then
                my_spaces.add_space({ path = node.absolute_path })
            end
        end, opts("Add to my space"))
  end
})

Keymaping

local my_spaces = pcall(require, "my_spaces")

vim.keymap.set("n", "<leader>ml", vim.cmd.ListSpace, { desc = "[M]y workpaces [L]ist" }) -- List all workspace
vim.keymap.set("n", "<leader>m1", function() my_spaces.go_to(1) end,{desc = "Go to project 1"}) -- Go to project by index start with index 1
vim.keyma1.set("n", "<leader>m2", function() my_spaces.go_to(2) end,{desc = "Go to project 2"})
-- so on

my-spaces.nvim's People

Contributors

yonchando avatar

Stargazers

 avatar Yuta Katayama avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.