goolord / alpha-nvim

a lua powered greeter like vim-startify / dashboard-nvim
MIT License
1.84k stars 109 forks source link

`SPC ff`, `SPC fh`, `SPC fr`, `SPC fg`, and `SPC fm` are not woking for `dashboard-nvim theme` #108

Closed tapyu closed 2 years ago

tapyu commented 2 years ago

I've tried to follow the quick start's section but I couldn't understand what commands alpha-nvim suppose I've mapped to SPC ff, SPC fh, SPC fr, SPC fg, and SPC fm when using dashboard-nvim theme. For the out-of-the-box config, none of these keymapping are working...

The README.md file says:

this theme makes some assumptions about your default keybindings to customize the buttons, see :h alpha-example

It turns out that the alpha-example doesn't even set these keymaps. Rather, it sets only the button q and e. The unique keymap that works is e (new file).

How to reproduce

  1. save this code as minimal_init.lua
    require("packer").startup{function ()
      use 'wbthomason/packer.nvim'
      use {
        'goolord/alpha-nvim',
        config = function ()
            require'alpha'.setup(require'alpha.themes.dashboard'.config)
        end
      }
    end
    }
  2. Run nvim -u minimal_init.lua
  3. Test SPC ff, SPC fh, SPC fr, SPC fg, and SPC fm. They won't work

Expected behavior

One of the following options:

As it is written on README.md, it conveys the wrongly impression that these keys work, but they don't.

Thanks in advance.

tapyu commented 2 years ago

I suppose I've finally find out what are some of the commands that I should use:

local is_status_ok, alpha = pcall(require, "alpha")

if not is_status_ok then
  print("alpha plugin not found")
  return
end

local dashboard = require("alpha.themes.dashboard")

dashboard.section.buttons.val = {
  dashboard.button("SPC f f", "  Find file", ":Telescope find_files hidden=true no_ignore=true<CR>"),
  dashboard.button("SPC f h", "  Recently opened files", "<cmd>Telescope oldfiles<CR>"),
  dashboard.button("SPC f r", "  Frecency/MRU"),
  dashboard.button("SPC f g", "  Find word",  "<cmd>Telescope live_grep<cr>"),
  dashboard.button("SPC f m", "  Jump to bookmarks"),
  dashboard.button("SPC s l", "  Open last session", "<cmd>SessionManager load_last_session<CR>"),
}

alpha.setup(dashboard.config)

Anyone can say which command I should use got SPC f m and SPC f r? I really didn't understand a "quick start" which does not provides the basic functionalities.

EKYS12 commented 2 years ago

Just installed this plug in and experienced it myself as well. Out of the box the starting UI shows the hot keys like space ff but they do absolutely nothing. Either hotkeys the user are straight up shown on start up should work out of the box, or not be shown as the default hotkeys. If the point were to make users customize their shortcuts from the start, then the displayed shortcuts shouldn't exist and instead the program should encourage you to make new hotkeys.

goolord commented 2 years ago

yes the dashboard theme makes assumptions about what keybindings you already have by default, but so does the viml dashboard plugin. i don't have any interest in changing that

goolord commented 2 years ago

if you make no assumptions about the user's keybindings, what would you even put on the dashboard theme by default? the header is the only thing that's like that

it's not hard to configure