nvim-telescope / telescope.nvim

Find, Filter, Preview, Pick. All lua, all the time.
MIT License
15.43k stars 824 forks source link

Can't disable devicons #1222

Open brandonpittman opened 3 years ago

brandonpittman commented 3 years ago

Description

I'm trying to disable the devicons, but adding disable_devicons = true to the setup config has no effect.

Neovim version

NVIM v0.6.0-dev+1602-g1a10acb99 Build type: Release LuaJIT 2.1.0-beta3

Operating system and version

macOS 11.4

Steps to reproduce

  1. Add this setup config:
require('telescope').setup {
  defaults = {
    disable_devicons = true,
  }
}
  1. Start nvim

Expected behavior

devicons should not be displayed.

Actual behavior

devicons are displayed.

Minimal config

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvim/site]]
local package_root = '/tmp/nvim/site/pack'
local install_path = package_root .. '/packer/start/packer.nvim'
local function load_plugins()
  require('packer').startup {
    {
      'wbthomason/packer.nvim',
      {
        'nvim-telescope/telescope.nvim',
        requires = {
          'nvim-lua/plenary.nvim',
          { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' },
        },
      },
      -- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. '/plugin/packer_compiled.lua',
      display = { non_interactive = true },
    },
  }
end
_G.load_config = function()
  require('telescope').setup()
  require('telescope').load_extension('fzf')
  -- ADD INIT.LUA SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
end
if vim.fn.isdirectory(install_path) == 0 then
  print("Installing Telescope and dependencies.")
  vim.fn.system { 'git', 'clone', '--depth=1', 'https://github.com/wbthomason/packer.nvim', install_path }
end
load_plugins()
require('packer').sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua load_config()]]
bangedorrunt commented 3 years ago

Got the same issue, had to pass that key as function argument in every commands I need to disable the icon

brandonpittman commented 3 years ago

@babygau Could you please share an example of how you passed it as a function and were able to change it?

bangedorrunt commented 3 years ago

@brandonpittman I'm on mobile so not easy to write it down. Pls see some of my mappings here for reference. It's written in Fennel but all you care is everything in between <Cmd><CR>.

https://github.com/babygau/nix/blob/tdt/dotfiles/nvim/fnl/plugins/telescope.fnl

brandonpittman commented 3 years ago

@babygau Thank you very much!

Conni2461 commented 3 years ago

Because its not a think yet. Its only a opts. We talked about here that we should make it a thing though we havent decided how yet.

fdschmidt93 commented 3 years ago

Up until then, one way to have picker user defaults for any picker is something like this pattern (though many ways lead to Rome):

local builtins = require "telescope.builtin"

-- common opts users would like to have a default for
local defaults = { previewer = false, disable_devicons = true }

local pickers = setmetatable({}, {
  __index = function(_, key)
    if builtins[key] == nil then
      error "Invalid key, please check :h telescope.builtin"
      return
    end
    return function(opts)
      opts = vim.tbl_extend("keep", opts or {}, defaults)
      builtins[key](opts)
    end
  end,
})

-- later..
pickers.find_files()

Nevertheless, a PR to introduce this option would be very welcome.

toastal commented 2 weeks ago

Did something change in a recent release? I never had to Unicode tofu in the past since I passed the check of devicons not installed. I tried adding the disable_devicons = true line as well & it doesn’t do anything (but color_devicons does work).

jamestrew commented 5 days ago

@toastal I don't think so but I don't know what release you're on. Please open a new bug report with full details if you want support.

toastal commented 2 days ago

This was an upstream issue in Nixpkgs. False alarm.