aboutsummaryrefslogtreecommitdiff
path: root/readme.md
blob: 4ed04e9c1dddd63f7d23a35c39c9a4d1631990aa (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
<div align="center">
<img src="https://user-images.githubusercontent.com/81827001/140657509-1199b444-687f-4f6b-b10a-2eeca35040aa.png" width=315>
  
# 🔧startup.nvim

The fully customizable greeter for neovim
  
</div>

✨Features
--------

* Fully customizable
* Themes
* Easy Customization with building blocks

📦Installation
------------
Use your favourite package manager and call setup function.
Plenary.nvim is a dependency and must be installed.
For the default setup telescope.nvim is needed.
```lua
-- lua and packer.nvim

use {
  "max397574/startup.nvim",
  requires = {"nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim"},
  config = function()
    require"startup".setup()
  end
}
```

⚙️Customization
-------------
<!-- NOTE: -->
<!-- ???See wiki -->

Call the setup function with your configurations

It is recommended to use a file in the setup function. This can be done like this:

```lua
-- lua and packer.nvim

use {
  "max397574/startup.nvim",
  requires = {"nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim"},
  config = function()
    require"startup".setup(require"configs.startup") -- recommended to use a file for this
  end
}
```

Here the file would be located at `/lua/configs/startup.lua`.
The file has to return settings.

For one of the default themes this can be done like this: (example with the startify theme)

```lua
local settings = require"startup.themes.startify"

return settings
```
<!-- NOTE: update this -->
These themes are currently available:

* dashbaord
* startify
* evil

The filetype of the startup screen is `startup`.
You can use this to disable plugins like statuslines.

### 🏗️The basic structure of the settings

```lua
-- General structure of the settings
settings = {
    section_1 = <section> -- as much sections as you like
    section_2 = <section>
    options = {
        mapping_keys = true/false, -- display mapping (e.g. <leader>ff)
        -- if < 0 fraction of screen width
        -- if > 0 numbers of column
        cursor_column = <number>
        empty_lines_between_mappings = true/false, -- add an empty line between mapping/commands
        disable_statuslines = true/false -- disable status and bufferlines
        paddings = <paddings>,
    }
    mappings = {
        -- keys in normal vim mapping format e.g. <c-o>
        -- string
        execute_command = <key>,
        open_file = <key>,
        open_file_split = <key>,
        open_section = <key>,
        open_help = <key>,
    },
    colors = {
        background = <color>, -- hex color code
        folded_section = <color>, -- the colors of the folded section titles
        -- this can also be changed with the `StartupFoldedSection` highlight group
    }
    parts = {"section_1", "section_2"} -- all sections in order
}

-- Structure of a section
section = {
    type = <type>,
    oldfiles_directory = true/false,
    align = <alignment>,
    fold_section = true/false, --whether to fold or not
    title = <title>,
    margin = <margin>,
    content = <content>,
    highlight = <highlight>,
    default_color = <color>,
    command = <command>,
    oldfiles_amount = <amount>,
}

-- the padding before each section
-- table with integers
paddings = {
    <padding_before_section_1>, -- for as as many sections as you have
    <padding_before_section_2>,
}

-- a hex color
-- e.g. "#FF000D"
-- string
color = <color>

-- text: just text will be displayed

-- mapping: commands/mapping which will be displayed
-- those can be executed with <CR>
-- the mappings can be used

-- oldfiles: oldfiles will be displayed
-- those can be opened with 'o'
-- you can specify the amount of oldfiles and whether to display only one from the current directory
-- string
type = "text"/"mapping"/"oldfiles"

-- display only oldfiles of current directory
-- only relevant if type = "oldfiles"
-- boolean
oldfiles_directory = true/false

-- how to align the section
-- string
align = "left"/"center"/"right"

-- whether the section should be "folded" with the title <title>
-- title must be set
-- string
fold_section = true/false

-- title of folded section
-- string
title = <title>

-- only relevant if alignment is left or right
-- if < 0 fraction of screen width
-- if > 0 numbers of column
-- integer or float
margin = <margin>

-- when type = "olfiles" -> leave empty
-- when type = "mapping" -> table with the format
{
    [<displayed_command_name>] = {<command>, <mapping>}
}

-- when type = "text" -> table with strings of text
-- those can be returned by a function
content = <content>

-- the highlight group to highlight the section with
-- leave empty to use a color
-- string
highlight = highlight_group

-- color used if no highlight group is specified (highlight = "")
-- hex color
-- string
default_color = <color>,

-- vim command to be executed, when section get set
-- for example to create mappings
-- string
command = <command>,

-- the amount of oldfiles to be displayed
-- integer
oldfiles_amount = <amount>,
```

### Buildingblocks
<!-- TODO: -->

### Examples
<details>
<summary>
Content for type = "text", table
</summary>
<p>

```lua
content = {
    "This is:",
    "Startup.nvim",
    "by max397574"
}
```

</p>
</details>
<details>
<summary>
Content for type = "text", function
</summary>
<p>

```lua
content = function()
    local clock = " " .. os.date "%H:%M"
    local date = " " .. os.date "%d-%m-%y"
    return {clock,date}
end
```

With a separate function:

```lua
local function time()
    local clock = " " .. os.date "%H:%M"
    local date = " " .. os.date "%d-%m-%y"
    return {clock,date}
end

setting = {
    ...
    content = time()
    ...
}
```

</p>
</details>

<details>
<summary>
Content for type = "mapping"
</summary>
<p>

```lua
content = {
  [" Find File"] = { "Telescope find_files", "<leader>ff" },
  [" Find Word"] = { "Telescope live_grep", "<leader>lg" },
  [" Recent Files"] = { "Telescope oldfiles", "<leader>of" },
  [" File Browser"] = { "Telescope file_browser", "<leader>fb" },
  [" Colorschemes"] = { "Telescope colorscheme", "<leader>cs" },
  [" New File"] = { "lua require'startup'.new_file()", "<leader>nf" },
},
```

</p>
</details>

Check out the [themes](https://github.com/max397574/startup.nvim/tree/master/lua/startup/themes) for full examples.

👀Screenshots
---------------

### The themes

#### Dashbaord

#### Startify

#### Evil Startup

Credits
-------

- Thanks to Binx, for making that logo for free!
  - [Github](https://github.com/Binx-Codes/)
  - [Reddit](https://www.reddit.com/u/binxatmachine)


Similar plugins:
* [dashboard-nvim](https://github.com/glepnir/dashboard-nvim)
* [alpha-nvim](https://github.com/goolord/alpha-nvim)
* [vim-startify](https://github.com/mhinz/vim-startify)