Skip to content
This repository has been archived by the owner on Mar 5, 2023. It is now read-only.

nyngwang/fzf-lua-projections.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

fzf-lua-projections.nvim

fzf-lua-projections.nvim will help you restoring any project session in a breeze by facilitating my favorite plugin ibhagwan/fzf-lua and the new star project GnikDroy/projections.nvim.

btw, this repo was built with the help of projections.nvim and fzf-lua :)

Demo.

github_demo_fzf-lua-projection.nvim.mov

Requirements.

  • You will need to add this line to your init.lua
    vim.opt.ssop:append({ 'localoptions' })
  • For ibhagwan/fzf-lua: you don't need to add anything for this plugin. :)
  • For GnikDroy/projections.nvim: you just need to read the following note.
    • if you use neovim as the editor for terminal interactive git commands, e.g git commit without any argument, you have to ensure that you did add the guardian check vim.fn.argc() == 0 as indicated in README.md of GnikDroy/projections.nvim:
      -- auto-restore on start.
      vim.api.nvim_create_autocmd({ 'VimEnter' }, {
        -- group = 'YOUR_GROUP', -- it's recommended to use augroup.
        pattern = '*',
        callback = function ()
          if -- neovim is not start by `nvim some_arg` or `git commit`.
            vim.fn.argc() == 0 then
            require('projections.session').restore(vim.loop.cwd())
          end
        end
      })

Dependencies

Compatible with

Config. Example.

note: Actually, it's fzf-lua-projections requires GnikDroy/projections.nvim

use {
  'GnikDroy/projections.nvim',
  requires = {
    -- add these two lines
    'ibhagwan/fzf-lua',                  -- Customize the menu UI yourself from fzf-lua's setup.
    'nyngwang/fzf-lua-projections.nvim', -- actually, it's that fzf-lua-projections requires projections,
                                         -- I just want to make it compact :)
  },
  config = function ()
    require('projections').setup {
      -- ...
      store_hooks = {
        pre = function ()
          -- if you use neo-tree.nvim, add these two lines to the `pre` of `store_hooks`.
          vim.cmd('tabd Neotree close')
          vim.cmd('tabn')
          -- ...
        end,
        -- ...
      },
    }
    -- just setup your `autocmd`s for projections.
    -- ...
  end
}

-- the only keymap
vim.keymap.set('n', '<Leader>cp', function () require('fzf-lua-p').projects() end, NOREF_NOERR_TRUNC)

About

fzf-lua + projections.nvim

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages