about summary refs log tree commit diff
path: root/neovim/lua/plugins/dashboard.lua
blob: 0e719c74ac27ab0512c01b2bb05d13bf862e941f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
local alpha = require('alpha')
local dashboard = require('alpha.themes.dashboard')

local header = {
    type = 'text',
    val = 'Neovim',
    opts = {
        position = 'center',
    }
}

local buttons = {
    type = 'group',
    val = {
        {
            type = 'text',
            val = 'Quick actions',
            opts = { position = 'center' }
        },
        {
            type = 'padding',
            val = 1,
        },
        dashboard.button('<leader>n', '  New File',
                         ':enew | NvimTreeFocus<CR>',
                         { desc = 'New file' }),
        dashboard.button('<leader>o', '  Old Files',
                         ':Telescope oldfiles<CR>',
                         { desc = 'Old files' }),
        dashboard.button('<leader>ff', '  Find File',
                         ':Telescope find_files<CR>'),
        dashboard.button('<leader>fg', '  Find in files')
    }
}

alpha.setup {
    layout = {
        {
            type = 'padding',
            val = 2,
        },
        header,
        {
            type = 'padding',
            val = 2,
        },
        buttons,
        {
            type = 'padding',
            val = 2,
        },
    },
}

--	vim.api.nvim_create_autocmd("User", {
--	    pattern = "AlphaReady",
--	    command = "set showtabline=0 | set laststatus=0",
--	})