From c41bb813fdef85bbb80f7b6df5827636be232118 Mon Sep 17 00:00:00 2001 From: Taken Date: Fri, 15 Sep 2023 16:58:38 +0200 Subject: [PATCH] Updated prefs file Signed-off-by: Taken --- lua/taken/core/bootstrap.lua | 7 +++++++ lua/taken/core/init.lua | 1 + lua/taken/core/opts.lua | 11 +++++++++++ lua/taken/custom/init.lua | 3 +++ lua/taken/init.lua | 2 +- lua/taken/prefs.lua.example | 8 ++++---- 6 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 lua/taken/core/bootstrap.lua create mode 100644 lua/taken/custom/init.lua diff --git a/lua/taken/core/bootstrap.lua b/lua/taken/core/bootstrap.lua new file mode 100644 index 0000000..099c493 --- /dev/null +++ b/lua/taken/core/bootstrap.lua @@ -0,0 +1,7 @@ +local configDir = vim.fn.stdpath("config") +local prefs = configDir .. "/lua/taken/prefs.lua" +local example = configDir .. "/lua/taken/prefs.lua.example" + +if vim.fn.filereadable(prefs) == 0 then + vim.cmd("silent! !cp " .. example .. " " .. prefs) +end diff --git a/lua/taken/core/init.lua b/lua/taken/core/init.lua index 5b850c1..61dfa89 100644 --- a/lua/taken/core/init.lua +++ b/lua/taken/core/init.lua @@ -2,3 +2,4 @@ require("taken.core.autocmd") require("taken.core.opts") require("taken.core.gui") require("taken.core.remaps") +require("taken.core.bootstrap") diff --git a/lua/taken/core/opts.lua b/lua/taken/core/opts.lua index 7a93a14..ab2cd7c 100644 --- a/lua/taken/core/opts.lua +++ b/lua/taken/core/opts.lua @@ -44,3 +44,14 @@ vim.o.timeoutlen = 300 -- Options for nvim-tree g.loaded_netrw = 1 g.loaded_netrwPlugin = 1 + +-- windows +if vim.fn.has("win32") == 1 then + vim.o.shell = "pwsh" + vim.o.shellcmdflag = + "-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;" + vim.o.shellredir = "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode" + vim.o.shellpipe = "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode" + vim.o.shellquote = "" + vim.o.shellxquote = "" +end diff --git a/lua/taken/custom/init.lua b/lua/taken/custom/init.lua new file mode 100644 index 0000000..c2af86f --- /dev/null +++ b/lua/taken/custom/init.lua @@ -0,0 +1,3 @@ +local prefs = require("taken.prefs") + +vim.cmd("colorscheme " .. prefs.colorscheme) diff --git a/lua/taken/init.lua b/lua/taken/init.lua index 7c9a9ba..3b6b1b3 100644 --- a/lua/taken/init.lua +++ b/lua/taken/init.lua @@ -1,3 +1,3 @@ require("taken.core") require("taken.lazy") -require("taken.prefs") +require("taken.custom") diff --git a/lua/taken/prefs.lua.example b/lua/taken/prefs.lua.example index bdddf32..bc18888 100644 --- a/lua/taken/prefs.lua.example +++ b/lua/taken/prefs.lua.example @@ -1,5 +1,5 @@ -local M = { - colorscheme = "catppuccin-mocha" -} +local M = {} -vim.cmd("colorscheme " .. M.colorscheme) +M.colorscheme = "catppuccin-mocha" + +return M