From d4fbb03b40657c0036652eef571256a173ab00e4 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Fri, 1 Apr 2022 00:28:43 +0200 Subject: refactor: init config --- init.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index bdd6e6c..2c2e9e8 100644 --- a/init.lua +++ b/init.lua @@ -1,5 +1,3 @@ -- Loads plugins for Neovim. -require "settings" -require "install" -require "config" +require "bootstrap" -- cgit v1.2.3-70-g09d2 From ffc1dfc4fd0d6eb50b5a5ac9b598718a1f1070c4 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 3 Apr 2022 21:26:47 +0200 Subject: fix(init): add fnl init to lua init --- init.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 2c2e9e8..4058650 100644 --- a/init.lua +++ b/init.lua @@ -1,3 +1,9 @@ -- Loads plugins for Neovim. -require "bootstrap" +-- Load fennel config +vim.g["aniseed#env"] = { + module = "init", + compile = true +} + +require "init" -- cgit v1.2.3-70-g09d2 From f896d92a19555335d024bcc73e276196aa01db0b Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 5 Apr 2022 22:48:39 +0200 Subject: style: format --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 4058650..7defcbf 100644 --- a/init.lua +++ b/init.lua @@ -3,7 +3,7 @@ -- Load fennel config vim.g["aniseed#env"] = { module = "init", - compile = true + compile = true, } require "init" -- cgit v1.2.3-70-g09d2 From a3c5be89d922a7bd7c2992eda7bd1bef4d8ddf44 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 7 Apr 2022 22:41:58 +0200 Subject: fix: remove init req --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 7defcbf..6dfde98 100644 --- a/init.lua +++ b/init.lua @@ -6,4 +6,4 @@ vim.g["aniseed#env"] = { compile = true, } -require "init" +-- require "init" -- cgit v1.2.3-70-g09d2 From 143d0de99399e9d6b4779ebd91a1cbcee5df5dd5 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 7 Apr 2022 22:46:45 +0200 Subject: feat(bootstrap): convert script to lua --- fnl/bootstrap.fnl | 31 ------------------------------- init.lua | 5 +++-- lua/bootstrap.lua | 29 +++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 33 deletions(-) delete mode 100644 fnl/bootstrap.fnl create mode 100644 lua/bootstrap.lua (limited to 'init.lua') diff --git a/fnl/bootstrap.fnl b/fnl/bootstrap.fnl deleted file mode 100644 index 2665550..0000000 --- a/fnl/bootstrap.fnl +++ /dev/null @@ -1,31 +0,0 @@ -;; Bootstraping for fresh install -(module bootstrap - {autoload {util util}}) - -(defn- fmt [s ...] - (string.format s ...)) - -(def- packer-path - (.. (vim.fn.stdpath :data) :site/pack)) - -(def- git-clone-url "!git clone --depth 1 https://github.com/%s/%s %s") - -(defn- execute [cmd] - (vim.api.nvim_command cmd)) - -(defn- ensure-path [packer-path repository] - (fmt "%s/packer/start/%s" packer-path repository)) - -(defn- ensure [user repository] - (let [path (ensure-path packer-path repository)]) - (if (> (vim.fn.empty (vim.fn.glob path) 0)) - (do - (execute (fmt git-clone-url user repository path)) - (execute (fmt "packadd %s" repository))))) - -(ensure :wbthomason :packer.nvim) -(ensure :Olical :aniseed) -(ensure :lewis6991 :impatient.nvim) - -(require :config.packer) -(require :config.impatient) diff --git a/init.lua b/init.lua index 6dfde98..43946ea 100644 --- a/init.lua +++ b/init.lua @@ -1,9 +1,10 @@ -- Loads plugins for Neovim. +-- Bootstap essential plugins +require "bootstrap" + -- Load fennel config vim.g["aniseed#env"] = { module = "init", compile = true, } - --- require "init" diff --git a/lua/bootstrap.lua b/lua/bootstrap.lua new file mode 100644 index 0000000..ab84c17 --- /dev/null +++ b/lua/bootstrap.lua @@ -0,0 +1,29 @@ +-- Bootstrap nvim with essential plugins. + +local fn = vim.fn +local fmt = string.format +local execute = vim.api.nvim_command + +local function ensure(user, repository) + local packer_path = fn.stdpath "data" .. "/site/pack" + local ensure_path = fmt("%s/packer/start/%s", packer_path, repository) + if fn.empty(fn.glob(ensure_path)) > 0 then + execute( + fmt( + "!git clone --depth 1 https://github.com/%s/%s %s", + user, + repository, + ensure_path + ) + ) + execute(fmt("packadd %s", repository)) + end +end + +-- Bootstrap install essential modules if not present +ensure("wbthomason", "packer.nvim") +ensure("Olical", "aniseed") +ensure("lewis6991", "impatient.nvim") + +-- Enable faster loading with impatient +require "impatient" -- cgit v1.2.3-70-g09d2 From 7dd11b2ceb386814e978b04c61edb29217480326 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 19:57:26 +0200 Subject: refactor(init): remove comments --- init.lua | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 43946ea..78b668f 100644 --- a/init.lua +++ b/init.lua @@ -1,9 +1,4 @@ --- Loads plugins for Neovim. - --- Bootstap essential plugins -require "bootstrap" - --- Load fennel config +-- Loads plugins for Neovim with fennel. vim.g["aniseed#env"] = { module = "init", compile = true, -- cgit v1.2.3-70-g09d2 From 3a6f157ba8974f68de7e436e8ecbce1dacf2a439 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Apr 2022 21:11:15 +0200 Subject: fix(init): add loading of bootstrap lua --- init.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 78b668f..7cc6bc9 100644 --- a/init.lua +++ b/init.lua @@ -1,4 +1,5 @@ -- Loads plugins for Neovim with fennel. +require "bootstrap" vim.g["aniseed#env"] = { module = "init", compile = true, -- cgit v1.2.3-70-g09d2 From 4dcae0c53cbae623083ab0a7e7ff7bec8cca1070 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 12 Apr 2022 00:14:16 +0200 Subject: refactor(bootstrap): mv to init --- bootstrap.lua | 26 -------------------------- init.lua | 31 ++++++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 27 deletions(-) delete mode 100644 bootstrap.lua (limited to 'init.lua') diff --git a/bootstrap.lua b/bootstrap.lua deleted file mode 100644 index 6147c84..0000000 --- a/bootstrap.lua +++ /dev/null @@ -1,26 +0,0 @@ --- Bootstrap nvim with essential plugins. - -local fn = vim.fn -local fmt = string.format -local execute = vim.api.nvim_command - -local function ensure(user, repository) - local packer_path = fn.stdpath "data" .. "/site/pack" - local ensure_path = fmt("%s/packer/start/%s", packer_path, repository) - if fn.empty(fn.glob(ensure_path)) > 0 then - execute( - fmt( - "!git clone --depth 1 https://github.com/%s/%s %s", - user, - repository, - ensure_path - ) - ) - execute(fmt("packadd %s", repository)) - end -end - --- Bootstrap install essential modules if not present -ensure("wbthomason", "packer.nvim") -ensure("Olical", "aniseed") -ensure("lewis6991", "impatient.nvim") diff --git a/init.lua b/init.lua index 7cc6bc9..90db1c4 100644 --- a/init.lua +++ b/init.lua @@ -1,5 +1,34 @@ +-- Bootstrap nvim with essential plugins. +local fn = vim.fn +local fmt = string.format +local execute = vim.api.nvim_command +local packer_path = fn.stdpath "data" .. "/site/pack/packer/start" + +local function ensure(user, repository) + local ensure_path = fmt("%s/%s", packer_path, repository) + if fn.empty(fn.glob(ensure_path)) > 0 then + execute( + fmt( + "!git clone --depth 1 https://github.com/%s/%s %s", + user, + repository, + ensure_path + ) + ) + execute(fmt("packadd %s", repository)) + end +end + +-- Bootstrap install essential modules if not present +ensure("wbthomason", "packer.nvim") +ensure("Olical", "aniseed") +ensure("lewis6991", "impatient.nvim") + +if #vim.fn.readdir(packer_path) == 3 then + require("packer").sync() +end + -- Loads plugins for Neovim with fennel. -require "bootstrap" vim.g["aniseed#env"] = { module = "init", compile = true, -- cgit v1.2.3-70-g09d2 From 40263320fa45f52741c55f5c6e78afbdaa7ee2e7 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 12 Apr 2022 00:25:51 +0200 Subject: fix(bootstrap): mv check of plugins back to install --- fnl/init.fnl | 4 +++- init.lua | 4 ---- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'init.lua') diff --git a/fnl/init.fnl b/fnl/init.fnl index 4862b16..00e8fc0 100644 --- a/fnl/init.fnl +++ b/fnl/init.fnl @@ -3,4 +3,6 @@ (require :settings) (require :install) (if (> util.num-plugins 3) - (require :config)) + (require :config) + (vim.notify "Not loading config before plugins are downloaded" + vim.log.levels.DEBUG)) diff --git a/init.lua b/init.lua index 90db1c4..e166864 100644 --- a/init.lua +++ b/init.lua @@ -24,10 +24,6 @@ ensure("wbthomason", "packer.nvim") ensure("Olical", "aniseed") ensure("lewis6991", "impatient.nvim") -if #vim.fn.readdir(packer_path) == 3 then - require("packer").sync() -end - -- Loads plugins for Neovim with fennel. vim.g["aniseed#env"] = { module = "init", -- cgit v1.2.3-70-g09d2