Git Product home page Git Product logo

Comments (4)

danielfalk avatar danielfalk commented on August 24, 2024 3

This should work on the 0.2.x branch now.

from smart-open.nvim.

ebkalderon avatar ebkalderon commented on August 24, 2024

I can't seem to reproduce the config provided by the OP in the 0.2.x branch. The pass-through options appear to be ignored.

Below is the lazy.nvim configuration I used to configure telescope.nvim and smart-open.nvim:

Click to reveal full config
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    "--branch=stable",
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)

require('lazy').setup({
  -- spec = "ebk.plugins",
  {
    "nvim-telescope/telescope.nvim",
    event = "VimEnter",
    dependencies = {
      "nvim-lua/plenary.nvim",
      {
        "nvim-telescope/telescope-fzf-native.nvim",
        build = "make",
        cond = function()
          return vim.fn.executable("make") == 1
        end,
      },
      {
        "danielfalk/smart-open.nvim",
        branch = "0.2.x",
        dependencies = { "kkharji/sqlite.lua" },
        config = true,
      },
      { "nvim-telescope/telescope-ui-select.nvim" },
      { "nvim-tree/nvim-web-devicons" },
    },
    config = function()
      require("telescope").setup({
        defaults = {
          file_ignore_patterns = {
            ".git/",
            "node_modules/",
            "target/",
            "%.gif",
            "%.jpeg",
            "%.jpg",
            "%.png",
          },
        },
        extensions = {
          smart_open = {
            preview = { hide_on_startup = true },
            layout_config = {
              width = 0.65,
            },
            mappings = {
              i = {
                ["<esc>"] = require("telescope.actions").close,
              },
            },
          },
          ["ui-select"] = {
            require("telescope.themes").get_dropdown(),
          },
        },
      })

      pcall(require("telescope").load_extension, "fzf")
      pcall(require("telescope").load_extension, "smart_open")
      pcall(require("telescope").load_extension, "ui-select")

      local builtin = require("telescope.builtin")
      vim.keymap.set("n", "<leader>sh", builtin.help_tags, { desc = "[S]earch [h]elp" })
      vim.keymap.set("n", "<leader>sH", builtin.highlights, { desc = "[S]earch [H]ighlight Groups" })
      vim.keymap.set("n", "<leader>sk", builtin.keymaps, { desc = "[S]earch [K]eymaps" })
      vim.keymap.set("n", "<leader>sf", builtin.find_files, { desc = "[S]earch [F]iles" })
      vim.keymap.set("n", "<leader>ss", builtin.builtin, { desc = "[S]earch [S]elect Telescope" })
      vim.keymap.set("n", "<leader>sw", builtin.grep_string, { desc = "[S]earch current [W]ord" })
      vim.keymap.set("n", "<leader>sg", builtin.live_grep, { desc = "[S]earch by [G]rep" })
      vim.keymap.set("n", "<leader>sd", builtin.diagnostics, { desc = "[S]earch [D]iagnostics" })
      vim.keymap.set("n", "<leader>sr", builtin.resume, { desc = "[S]earch [R]esume" })
      vim.keymap.set("n", "<leader>s.", builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
      vim.keymap.set("n", "<leader><leader>", builtin.buffers, { desc = "[ ] Find existing buffers" })
    end,
  },
})

In fact, it seems as if several smart-open.nvim options aren't being respected anymore with the above Neovim configuration applied (e.g. disable_devicons, show_scores, open_buffer_indicators) but others are (ignore_patterns). Would someone kindly provide a sanity-check?

from smart-open.nvim.

dlvhdr avatar dlvhdr commented on August 24, 2024

I'm able to pass in these options which works, so thanks!

from smart-open.nvim.

ebkalderon avatar ebkalderon commented on August 24, 2024

Hmm, it seems that extensions.smart_open.mappings = { ... } is being applied for me, using the full config above, but extensions.smart_open.preview.hide_on_startup = true and extensions.smart_open.layout_config.width = 0.65 appear to not be applied. Not sure why this is, exactly. 🤷‍♂️ Is anyone able to reproduce?

from smart-open.nvim.

Related Issues (20)

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.