summaryrefslogtreecommitdiff
path: root/pkgs/custom-neovim
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/custom-neovim')
-rw-r--r--pkgs/custom-neovim/config/init.lua4
-rw-r--r--pkgs/custom-neovim/config/lua/autocommands.lua50
-rw-r--r--pkgs/custom-neovim/config/lua/options.lua2
-rw-r--r--pkgs/custom-neovim/config/lua/plugins/alpha.lua13
-rw-r--r--pkgs/custom-neovim/config/lua/plugins/dashboard.lua14
-rw-r--r--pkgs/custom-neovim/config/lua/plugins/persisted.lua3
-rw-r--r--pkgs/custom-neovim/default.nix2
7 files changed, 47 insertions, 41 deletions
diff --git a/pkgs/custom-neovim/config/init.lua b/pkgs/custom-neovim/config/init.lua
index 65cedab..c1007bb 100644
--- a/pkgs/custom-neovim/config/init.lua
+++ b/pkgs/custom-neovim/config/init.lua
@@ -13,9 +13,7 @@ require("neovide")
require("plugins.lualine")
require("plugins.tabby")
require("plugins.telescope")
-require("plugins.dashboard")
--- require("plugins.mini.starter")
--- require("plugins.alpha")
+require("plugins.alpha")
-- LSP Plugins:
require("plugins.lspconfig")
diff --git a/pkgs/custom-neovim/config/lua/autocommands.lua b/pkgs/custom-neovim/config/lua/autocommands.lua
index 85a58c6..48a976e 100644
--- a/pkgs/custom-neovim/config/lua/autocommands.lua
+++ b/pkgs/custom-neovim/config/lua/autocommands.lua
@@ -1,32 +1,32 @@
-- Autocommands
-- Use relative line number in normal mode and absolute in insert mode
-vim.opt.number = true
-local numbertoggle = vim.api.nvim_create_augroup("numbertoggle", {})
-vim.api.nvim_create_autocmd(
- { "BufEnter", "FocusGained", "InsertLeave", "WinEnter", "CmdlineLeave" },
- {
- group = numbertoggle,
- callback = function()
- if vim.opt.number and vim.api.nvim_get_mode() ~= "i" then
- vim.opt.relativenumber = true
- end
- end,
- }
-)
+-- vim.opt.number = true
+-- local numbertoggle = vim.api.nvim_create_augroup("numbertoggle", {})
+-- vim.api.nvim_create_autocmd(
+-- { "BufEnter", "FocusGained", "InsertLeave", "WinEnter", "CmdlineLeave" },
+-- {
+-- group = numbertoggle,
+-- callback = function()
+-- if vim.opt.number and vim.api.nvim_get_mode() ~= "i" then
+-- vim.opt.relativenumber = true
+-- end
+-- end,
+-- }
+-- )
-vim.api.nvim_create_autocmd(
- { "BufLeave", "FocusLost", "InsertEnter", "WinLeave", "CmdlineEnter" },
- {
- group = numbertoggle,
- callback = function()
- if vim.opt.number then
- vim.opt.relativenumber = false
- vim.cmd("redraw")
- end
- end,
- }
-)
+-- vim.api.nvim_create_autocmd(
+-- { "BufLeave", "FocusLost", "InsertEnter", "WinLeave", "CmdlineEnter" },
+-- {
+-- group = numbertoggle,
+-- callback = function()
+-- if vim.opt.number then
+-- vim.opt.relativenumber = false
+-- vim.cmd("redraw")
+-- end
+-- end,
+-- }
+-- )
-- start terminal in insert mode
vim.api.nvim_create_autocmd("TermOpen", {
diff --git a/pkgs/custom-neovim/config/lua/options.lua b/pkgs/custom-neovim/config/lua/options.lua
index 14ee7d1..8981dad 100644
--- a/pkgs/custom-neovim/config/lua/options.lua
+++ b/pkgs/custom-neovim/config/lua/options.lua
@@ -7,7 +7,7 @@ vim.o.ruler = false -- don't show #,# in the commandline.
vim.o.icm = 'split'
vim.o.cia = 'abbr,kind,menu'
vim.o.mouse = ""
-vim.o.number = true -- set numbered lines
+vim.o.relativenumber = true -- set numbered lines
vim.o.scrolloff = 4 -- minimal number of screen lines to keep above and below the cursor
vim.o.signcolumn = "yes" -- always show the sign column, otherwise it would shift the text each time
vim.o.clipboard = "unnamedplus" -- use system clipboard
diff --git a/pkgs/custom-neovim/config/lua/plugins/alpha.lua b/pkgs/custom-neovim/config/lua/plugins/alpha.lua
index 5ccdc3f..6599bdb 100644
--- a/pkgs/custom-neovim/config/lua/plugins/alpha.lua
+++ b/pkgs/custom-neovim/config/lua/plugins/alpha.lua
@@ -8,7 +8,7 @@ dashboard.section.header.val = art.misc.hydra
dashboard.section.buttons.val = {
dashboard.button( "f", " > Find file", ":cd $HOME | Telescope find_files<CR>"),
dashboard.button( "r", " > Find recent file", ":Telescope oldfiles<CR>"),
- dashboard.button( "s", " > Load session", ""),
+ dashboard.button( "s", " > Load session", ":Telescope persisted<cr>"),
dashboard.button( "q", " > Quit", ":qa<CR>"),
}
@@ -20,14 +20,7 @@ vim.api.nvim_create_autocmd("BufEnter", {
pattern = "alpha",
callback = function()
vim.opt_local.foldenable = false -- disable folding
+ vim.opt_local.relativenumber = false
+ vim.opt_local.number = false
end,
})
-
--- Refresh dashboard when window resized.
-vim.api.nvim_create_autocmd("VimResized", {
- -- pattern = "alpha",
- callback = function()
- print("redrawn")
- vim.cmd.AlphaRedraw()
- end
-})
diff --git a/pkgs/custom-neovim/config/lua/plugins/dashboard.lua b/pkgs/custom-neovim/config/lua/plugins/dashboard.lua
index 4824c04..f8458c9 100644
--- a/pkgs/custom-neovim/config/lua/plugins/dashboard.lua
+++ b/pkgs/custom-neovim/config/lua/plugins/dashboard.lua
@@ -1,3 +1,15 @@
require('dashboard').setup {
-
+ theme = "doom",
+ config = {
+ header = art.misc.hydra,
+ center = {
+ {
+ icon = " ",
+ desc = "Find file",
+ key = "f",
+ action = ":cd $HOME | Telescope find_files<cr>",
+ },
+ },
+ vertical_center = true,
+ },
}
diff --git a/pkgs/custom-neovim/config/lua/plugins/persisted.lua b/pkgs/custom-neovim/config/lua/plugins/persisted.lua
new file mode 100644
index 0000000..d3a5814
--- /dev/null
+++ b/pkgs/custom-neovim/config/lua/plugins/persisted.lua
@@ -0,0 +1,3 @@
+require("persisted").setup()
+
+require("telescope").load_extension("persisted")
diff --git a/pkgs/custom-neovim/default.nix b/pkgs/custom-neovim/default.nix
index 61f69ef..423fdf9 100644
--- a/pkgs/custom-neovim/default.nix
+++ b/pkgs/custom-neovim/default.nix
@@ -20,7 +20,7 @@ inputs.mnw.lib.wrap pkgs {
telescope-nvim # Picker.
plenary-nvim # General Library.
alpha-nvim # Dashboard.
- dashboard-nvim
+ persisted-nvim # Session manager.
# Colorschemes
oxocarbon-nvim # IBM Carbon themes.