aboutsummaryrefslogtreecommitdiff
path: root/lua/startup
diff options
context:
space:
mode:
authormax397574 <[email protected]>2021-10-07 12:42:28 +0200
committerGitHub <[email protected]>2021-10-07 12:42:28 +0200
commitf0ca9dc957f7cdc10ef2a0ee2091acb2687e3610 (patch)
tree282cef719391796f9df7969d0748e53ee23469ae /lua/startup
parent8495ac206f25b3d4eccca2419f66e777bd65d4b7 (diff)
parenta92dabd3e97a7bea6e393e6b5733613dcfdcc9c2 (diff)
Merge pull request #3 from max397574/settings_refactor
Settings refactor
Diffstat (limited to 'lua/startup')
-rw-r--r--lua/startup/config.lua42
-rw-r--r--lua/startup/themes/default.lua58
-rw-r--r--lua/startup/utils.lua1
3 files changed, 60 insertions, 41 deletions
diff --git a/lua/startup/config.lua b/lua/startup/config.lua
index 3a38f9c..8508de5 100644
--- a/lua/startup/config.lua
+++ b/lua/startup/config.lua
@@ -1,43 +1,3 @@
-local settings = {
- -- every line should be same width without escaped \
- -- header = {
- -- " /$$ ",
- -- " |__/ ",
- -- " /$$$$$$$ /$$$$$$ /$$$$$$ /$$ /$$ /$$ /$$$$$$/$$$$ ",
- -- "| $$__ $$ /$$__ $$ /$$__ $$| $$ /$$/| $$| $$_ $$_ $$",
- -- "| $$ \\ $$| $$$$$$$$| $$ \\ $$ \\ $$/$$/ | $$| $$ \\ $$ \\ $$",
- -- "| $$ | $$| $$_____/| $$ | $$ \\ $$$/ | $$| $$ | $$ | $$",
- -- "| $$ | $$| $$$$$$$| $$$$$$/ \\ $/ | $$| $$ | $$ | $$",
- -- "|__/ |__/ \\_______/ \\______/ \\_/ |__/|__/ |__/ |__/",
- -- },
- -- header = require("startup.utils").get_oldfiles(10),
- header = require("startup.utils").default_header(),
- -- name which will be displayed and command
- tools = {
- [" 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" },
- [" Config Files"] = {
- 'lua require("telescope.builtin").find_files({cwd="~/.config"})',
- "<leader>cf",
- },
- [" Colorschemes"] = { "Telescope colorscheme", "<leader>cs" },
- [" New File"] = { "lua require'startup'.new_file()", "<leader>nf" },
- ["ﲉ Help Files"] = { "Telescope help_tags", "<leader>fh" },
- },
- options = {
- align = "center", -- center, left or right
- mapping_names = true,
- -- can be an integer (columns)
- -- float < 1 -> percentage of screen width
- padding = 5, -- only used if align left or right
- },
- colors = {
- background = "#1f2227",
- heading_fg = "#009900",
- tools_fg = "#009900",
- },
-}
+local settings = require "startup.themes.default"
return settings
diff --git a/lua/startup/themes/default.lua b/lua/startup/themes/default.lua
new file mode 100644
index 0000000..3c7fc07
--- /dev/null
+++ b/lua/startup/themes/default.lua
@@ -0,0 +1,58 @@
+local settings = {
+ -- every line should be same width without escaped \
+ header = {
+ type = "text",
+ align = "center",
+ padding = 5,
+ content = {
+ " /$$ ",
+ " |__/ ",
+ " /$$$$$$$ /$$$$$$ /$$$$$$ /$$ /$$ /$$ /$$$$$$/$$$$ ",
+ "| $$__ $$ /$$__ $$ /$$__ $$| $$ /$$/| $$| $$_ $$_ $$",
+ "| $$ \\ $$| $$$$$$$$| $$ \\ $$ \\ $$/$$/ | $$| $$ \\ $$ \\ $$",
+ "| $$ | $$| $$_____/| $$ | $$ \\ $$$/ | $$| $$ | $$ | $$",
+ "| $$ | $$| $$$$$$$| $$$$$$/ \\ $/ | $$| $$ | $$ | $$",
+ "|__/ |__/ \\_______/ \\______/ \\_/ |__/|__/ |__/ |__/",
+ },
+ highlight = "markdownH1",
+ default_color = "#FFFFFF",
+ command = "",
+ },
+ -- name which will be displayed and command
+ body = {
+ type = "mapping",
+ align = "center",
+ padding = 5,
+ 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" },
+ },
+ highlight = "TSString",
+ default_color = "#FFFFFF",
+ command = "",
+ },
+ footer = {
+ type = "text",
+ align = "center",
+ padding = 5,
+ content = { "startup.nvim" },
+ highlight = "TSString",
+ default_color = "#FFFFFF",
+ command = "",
+ },
+
+ options = {
+ mapping_keys = true,
+ empty_lines_between_mappings = true,
+ gap1 = 3,
+ gap2 = 4,
+ },
+ colors = {
+ background = "#1f2227",
+ },
+}
+return settings
diff --git a/lua/startup/utils.lua b/lua/startup/utils.lua
index 2bfe149..101e6b3 100644
--- a/lua/startup/utils.lua
+++ b/lua/startup/utils.lua
@@ -57,6 +57,7 @@ function U.set_buf_options()
vim.api.nvim_buf_set_option(0, "bufhidden", "wipe")
vim.api.nvim_buf_set_option(0, "buftype", "nofile")
vim.api.nvim_buf_set_option(0, "filetype", "dashboard")
+ vim.api.nvim_buf_set_option(0, "modifiable", false)
vim.api.nvim_buf_set_option(0, "swapfile", false)
vim.cmd [[setlocal nonu nornu]]
end