Zane- / cder.nvim

A telescope.nvim extension to quickly change Neovim's working directory.
53 stars 3 forks source link

help with config #7

Open battlelitany opened 3 months ago

battlelitany commented 3 months ago

Hi, I'm sorry to be a bother, but I'm still a bit of a newbie at configuring Neovim myself. I have the extension working, but I noticed you said that if bash isn't installed, I would need to change the command_executor option in order to get the previews to work.

What would I change it to if I'm on Windows? Here's the current error I get: image

Also, I set cder as its own .lua file in my plugins folder, and I'm not sure if I should instead change it to the way you have it where I call it in telescope instead.

Here's my current configuration:

return {
  "zane-/cder.nvim",
  keys = {
    {
      "<leader>tc",
      ":Telescope cder<cr>",
      desc = "Change Working Directory",
    }
  },
  config = function()
    require("telescope").load_extension("cder")
  end,
}

Again, apologies for the trouble!

thiru commented 2 months ago

Hey there, this works for me in Windows. You may want to install fd if you don't already have it and add it to your path.

dir_command = {'fd', '--type=d', '--follow', '.', vim.uv.os_homedir()},
command_executer = {'cmd', '/c', 'dir'},
previewer_command = '',
pager_command = 'more',

You can see my full Telescope config here for reference: https://github.com/thiru/dotfiles/blob/master/nvim/lua/custom/plugins/telescope.lua

battlelitany commented 2 months ago

Hey there, this works for me in Windows. You may want to install fd if you don't already have it and add it to your path.

dir_command = {'fd', '--type=d', '--follow', '.', vim.uv.os_homedir()},
command_executer = {'cmd', '/c', 'dir'},
previewer_command = '',
pager_command = 'more',

You can see my full Telescope config here for reference: https://github.com/thiru/dotfiles/blob/master/nvim/lua/custom/plugins/telescope.lua

hey! thanks for answering. i modified my setup to get it working. is it normal that the first part of the output says the following?:

"File Not Found"
"Volume in drive C has no label."
thiru commented 2 months ago

No I don't think that's normal. It's not happening for me. What does your config look like?

battlelitany commented 2 months ago

I started with your full config but pared it down to just what I needed. Regardless though, even with the complete setup, it still gives me the same output. I should have fd installed as well!

Here's the config:

return {
  "nvim-telescope/telescope.nvim",
  dependencies = {
    "nvim-lua/plenary.nvim",
    "nvim-telescope/telescope-symbols.nvim",
    "zane-/cder.nvim",
  },
  keys = {
    {
      "<leader>tc",
      ":Telescope cder<cr>",
      desc = "Change Working Directory",
    },
  },
  config = function()
    require("telescope").setup({
      extensions = {
        cder = {
          command_executer = { 'cmd', '/c', 'dir' },
        }
      },
    })
    pcall(require('telescope').load_extension, 'cder')
  end,
}

And here's the printout: image