commit 6bf4ac86a8eaedd0b9326595af06df7f6b9c9e80
parent 042c8a6df3b219a0d8977f01705ddaeb96814c98
Author: bdmfegys@duck.com <bdmfegys@duck.com>
Date: Tue, 30 Apr 2024 15:41:56 -0400
root: initial commit
Diffstat:
5 files changed, 121 insertions(+), 0 deletions(-)
diff --git a/init.lua b/init.lua
@@ -0,0 +1,15 @@
+local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
+if not (vim.uv or vim.loop).fs_stat(lazypath) then
+ vim.fn.system({
+ "git",
+ "clone",
+ "--filter=blob:none",
+ "https://github.com/folke/lazy.nvim.git",
+ "--branch=stable", -- latest stable release
+ lazypath,
+ })
+end
+vim.opt.rtp:prepend(lazypath)
+require("plugins")
+require("options")
+require("autostart")
diff --git a/lua/autostart.lua b/lua/autostart.lua
@@ -0,0 +1,3 @@
+-- colorscheme
+local pywal = require('pywal')
+pywal.setup()
diff --git a/lua/options.lua b/lua/options.lua
@@ -0,0 +1,35 @@
+-- leaders
+vim.g.mapleader = " "
+vim.g.maplocalleader = "\\"
+local opt = vim.opt
+vim.g.autoformat = false
+opt.number = true
+opt.relativenumber = false
+opt.wrap = true
+opt.termguicolors = true
+
+local wk = require("which-key")
+wk.register({
+ t = {
+ "<cmd>ToggleTerm<cr>",
+ "Open Terminal",
+ },
+ e = {
+ "<cmd>NnnExplorer<cr>",
+ "Open NNN (embedded)",
+ },
+}, { prefix = "<leader>" })
+local has_words_before = function()
+ unpack = unpack or table.unpack
+ local line, col = unpack(vim.api.nvim_win_get_cursor(0))
+ return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
+end
+
+--- move to window
+--map("n", "<C-h>", "<C-w>h", { desc = "Go to Left Window", remap = true })
+--map("n", "<C-j>", "<C-w>j", { desc = "Go to Lower Window", remap = true })
+--map("n", "<C-k>", "<C-w>k", { desc = "Go to Upper Window", remap = true })
+--map("n", "<C-l>", "<C-w>l", { desc = "Go to Right Window", remap = true })
+
+--- clear search with escape
+--map({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", { desc = "Escape and Clear hlsearch" })
diff --git a/lua/plugins.lua b/lua/plugins.lua
@@ -0,0 +1,58 @@
+require("lazy").setup({
+ { 'luukvbaal/nnn.nvim', config = true },
+ { 'nvim-treesitter/nvim-treesitter', build = ":TSUpdate", event = "VeryLazy" },
+ { 'folke/which-key.nvim',
+ event = "VeryLazy",
+ init = function()
+ vim.o.timeout = true
+ vim.o.timeoutlen = 300
+ end,
+ },
+ { 'akinsho/toggleterm.nvim', version = "*", config = true },
+ { 'AlphaTechnolog/pywal.nvim' },
+ { "echasnovski/mini.pairs", event = "VeryLazy",
+ opts = {
+ mappings = {
+ ["`"] = { action = "closeopen", pair = "``", neigh_pattern = "[^\\`].", register = { cr = false } },
+ },
+ },
+ },
+
+ { "williamboman/mason.nvim", cmd = "Mason", keys = { { "<leader>cm", "<cmd>Mason<cr>", desc = "Mason" } }, build = ":MasonUpdate",
+ opts = {
+ ensure_installed = {
+ "stylua",
+ "shfmt",
+ },
+ },
+ ---@param opts MasonSettings | {ensure_installed: string[]}
+ config = function(_, opts)
+ require("mason").setup(opts)
+ local mr = require("mason-registry")
+ mr:on("package:install:success", function()
+ vim.defer_fn(function()
+ -- trigger FileType event to possibly load this newly installed LSP server
+ require("lazy.core.handler.event").trigger({
+ event = "FileType",
+ buf = vim.api.nvim_get_current_buf(),
+ })
+ end, 100)
+ end)
+ local function ensure_installed()
+ for _, tool in ipairs(opts.ensure_installed) do
+ local p = mr.get_package(tool)
+ if not p:is_installed() then
+ p:install()
+ end
+ end
+ end
+ if mr.refresh then
+ mr.refresh(ensure_installed)
+ else
+ ensure_installed()
+ end
+ end,
+},
+
+
+})
diff --git a/lua/pywal.txt b/lua/pywal.txt
@@ -0,0 +1,10 @@
+to lualine config
+'''lua
+local lualine = require('lualine')
+
+lualine.setup {
+ options = {
+ theme = 'pywal-nvim',
+ },
+}
+'''