From e966d5328d6f328546db213278d1a1a6cd2f58d5 Mon Sep 17 00:00:00 2001 From: iceyrazor Date: Sat, 24 May 2025 04:08:28 -0500 Subject: install scripts. reorganization. soon to be deployable --- env/.config/nvim/after/plugin/3rd.lua | 41 ++++++++++++ env/.config/nvim/after/plugin/cloak.lua | 31 +++++++++ env/.config/nvim/after/plugin/colorizer.lua | 1 + env/.config/nvim/after/plugin/hardtime.lua | 1 + env/.config/nvim/after/plugin/harpoon.lua | 11 ++++ env/.config/nvim/after/plugin/indent-blankline.lua | 30 +++++++++ env/.config/nvim/after/plugin/lsp.lua | 75 ++++++++++++++++++++++ env/.config/nvim/after/plugin/lualine.lua | 46 +++++++++++++ env/.config/nvim/after/plugin/notify.lua | 4 ++ env/.config/nvim/after/plugin/telescope.lua | 9 +++ env/.config/nvim/after/plugin/undotree.lua | 1 + 11 files changed, 250 insertions(+) create mode 100644 env/.config/nvim/after/plugin/3rd.lua create mode 100644 env/.config/nvim/after/plugin/cloak.lua create mode 100644 env/.config/nvim/after/plugin/colorizer.lua create mode 100644 env/.config/nvim/after/plugin/hardtime.lua create mode 100755 env/.config/nvim/after/plugin/harpoon.lua create mode 100644 env/.config/nvim/after/plugin/indent-blankline.lua create mode 100755 env/.config/nvim/after/plugin/lsp.lua create mode 100644 env/.config/nvim/after/plugin/lualine.lua create mode 100644 env/.config/nvim/after/plugin/notify.lua create mode 100755 env/.config/nvim/after/plugin/telescope.lua create mode 100644 env/.config/nvim/after/plugin/undotree.lua (limited to 'env/.config/nvim/after/plugin') diff --git a/env/.config/nvim/after/plugin/3rd.lua b/env/.config/nvim/after/plugin/3rd.lua new file mode 100644 index 0000000..c5c0f66 --- /dev/null +++ b/env/.config/nvim/after/plugin/3rd.lua @@ -0,0 +1,41 @@ +require("image").setup({ + backend = "kitty", + processor = "magick_cli", -- or "magick_rock" + integrations = { + markdown = { + enabled = true, + clear_in_insert_mode = false, + download_remote_images = false, + only_render_image_at_cursor = true, + only_render_image_at_cursor_mode = "popup", + floating_windows = false, -- if true, images will be rendered in floating markdown windows + filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here + }, + neorg = { + enabled = true, + filetypes = { "norg" }, + }, + typst = { + enabled = true, + filetypes = { "typst" }, + }, + html = { + enabled = false, + }, + css = { + enabled = false, + }, + }, + max_width = nil, + max_height = nil, + max_width_window_percentage = nil, + max_height_window_percentage = 50, + window_overlap_clear_enabled = false, -- toggles images when windows are overlapped + window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "snacks_notif", "scrollview", "scrollview_sign" }, + editor_only_render_when_focused = false, -- auto show/hide images when the editor gains/looses focus + tmux_show_only_in_active_window = false, -- auto show/hide images in the correct Tmux window (needs visual-activity off) + hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp", "*.avif" }, -- render image files as images when opened +}) + +-- require("image").enable() -- enable the plugin +-- print(require("image").is_enabled()) -- bool diff --git a/env/.config/nvim/after/plugin/cloak.lua b/env/.config/nvim/after/plugin/cloak.lua new file mode 100644 index 0000000..ec68fe5 --- /dev/null +++ b/env/.config/nvim/after/plugin/cloak.lua @@ -0,0 +1,31 @@ +require('yourmom/cloak').setup({ + enabled = true, + cloak_character = '*', + -- The applied highlight group (colors) on the cloaking, see `:h highlight`. + highlight_group = 'Comment', + -- Applies the length of the replacement characters for all matched + -- patterns, defaults to the length of the matched pattern. + cloak_length = nil, -- Provide a number if you want to hide the true length of the value. + -- Whether it should try every pattern to find the best fit or stop after the first. + try_all_patterns = true, + -- Set to true to cloak Telescope preview buffers. (Required feature not in 0.1.x) + cloak_telescope = true, + -- Re-enable cloak when a matched buffer leaves the window. + cloak_on_leave = false, + patterns = { + { + -- Match any file starting with '.env'. + -- This can be a table to match multiple file patterns. + file_pattern = '.env*', + -- Match an equals sign and any character after it. + -- This can also be a table of patterns to cloak, + -- example: cloak_pattern = { ':.+', '-.+' } for yaml files. + cloak_pattern = '=.+', + -- A function, table or string to generate the replacement. + -- The actual replacement will contain the 'cloak_character' + -- where it doesn't cover the original text. + -- If left empty the legacy behavior of keeping the first character is retained. + replace = nil, + } + }, +}) diff --git a/env/.config/nvim/after/plugin/colorizer.lua b/env/.config/nvim/after/plugin/colorizer.lua new file mode 100644 index 0000000..4a4590b --- /dev/null +++ b/env/.config/nvim/after/plugin/colorizer.lua @@ -0,0 +1 @@ +require("colorizer").setup() diff --git a/env/.config/nvim/after/plugin/hardtime.lua b/env/.config/nvim/after/plugin/hardtime.lua new file mode 100644 index 0000000..f5ef021 --- /dev/null +++ b/env/.config/nvim/after/plugin/hardtime.lua @@ -0,0 +1 @@ +require("hardtime").setup() diff --git a/env/.config/nvim/after/plugin/harpoon.lua b/env/.config/nvim/after/plugin/harpoon.lua new file mode 100755 index 0000000..d4d3242 --- /dev/null +++ b/env/.config/nvim/after/plugin/harpoon.lua @@ -0,0 +1,11 @@ +local mark = require("harpoon.mark") +local ui = require("harpoon.ui") + +vim.keymap.set("n","a", mark.add_file) +vim.keymap.set("n","", ui.toggle_quick_menu) + + +vim.keymap.set("n","", function() ui.nav_file(1) end) +vim.keymap.set("n","", function() ui.nav_file(2) end) +vim.keymap.set("n","", function() ui.nav_file(3) end) +vim.keymap.set("n","", function() ui.nav_file(4) end) diff --git a/env/.config/nvim/after/plugin/indent-blankline.lua b/env/.config/nvim/after/plugin/indent-blankline.lua new file mode 100644 index 0000000..b0cb322 --- /dev/null +++ b/env/.config/nvim/after/plugin/indent-blankline.lua @@ -0,0 +1,30 @@ +local highlight = { + "RainbowRed", +} + +local hooks = require "ibl.hooks" +-- create the highlight groups in the highlight setup hook, so they are reset +-- every time the colorscheme changes +hooks.register(hooks.type.HIGHLIGHT_SETUP, function() + vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#702ec0" }) +end) + +require('ibl').setup { + indent = { + char = '|', + highlight = highlight, + }, + scope = { + show_start = false, + show_end = false, + show_exact_scope = false, + }, + exclude = { + filetypes = { + 'help', + 'packer', + 'undotree', + 'diff', + }, + }, +} diff --git a/env/.config/nvim/after/plugin/lsp.lua b/env/.config/nvim/after/plugin/lsp.lua new file mode 100755 index 0000000..9187032 --- /dev/null +++ b/env/.config/nvim/after/plugin/lsp.lua @@ -0,0 +1,75 @@ +vim.api.nvim_create_autocmd("FileType", { + pattern = "src", + callback = function() + print("LSP should now be active for src files") + end, +}) + +local lsp = require("lsp-zero") + +lsp.preset("recommended") + + +local cmp = require('cmp') + +local cmp_select = {behavior = cmp.SelectBehavior.Select} +local cmp_mappings = cmp.mapping.preset.insert({ + [''] = cmp.mapping.select_prev_item(cmp_select), + [''] = cmp.mapping.select_next_item(cmp_select), + [''] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping.complete(), +}) + +cmp.setup({ + mapping = cmp_mappings, +}) + +vim.diagnostic.config({ + virtual_text = true, +}) + +lsp.on_attach(function(client, bufnr) + local opts = {buffer = bufnr, remap = false} + + vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) + vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) + vim.keymap.set("n", "vws", function() vim.lsp.buf.workspace_symbol() end, opts) + vim.keymap.set("n", "vd", function() vim.diagnostic.open_float() end, opts) + vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts) + vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts) + vim.keymap.set("n", "vca", function() vim.lsp.buf.code_action() end, opts) + vim.keymap.set("n", "vrr", function() vim.lsp.buf.references() end, opts) + vim.keymap.set("n", "vrn", function() vim.lsp.buf.rename() end, opts) + vim.keymap.set("i", "", function() vim.lsp.buf.signature_help() end, opts) +end) + + +local lsp_configurations = require('lspconfig.configs') + +if not lsp_configurations.greybel then + lsp_configurations.greybel = { + default_config = { + cmd = { "/bin/greybel-languageserver", "--stdio" }, + filetypes = { "greyscript" }, + root_dir = require('lspconfig.util').root_pattern(".git", vim.fn.getcwd()), + settings = {}, + } + } +end + +-- to learn how to use mason.nvim with lsp-zero +-- read this: https://github.com/VonHeikemen/lsp-zero.nvim/blob/v3.x/doc/md/guides/integrate-with-mason-nvim.md +require('mason').setup({ + registries = { + "github:mason-org/mason-registry", + }, +}) +require('mason-lspconfig').setup({ + ensure_installed = { }, + handlers = { + lsp.default_setup, + }, +}) +require('lspconfig').greybel.setup({}) + +lsp.setup() diff --git a/env/.config/nvim/after/plugin/lualine.lua b/env/.config/nvim/after/plugin/lualine.lua new file mode 100644 index 0000000..4abfa26 --- /dev/null +++ b/env/.config/nvim/after/plugin/lualine.lua @@ -0,0 +1,46 @@ +require('lualine').setup() + +local custom_gruvbox = require'lualine.themes.base16' + +-- Change the background of lualine_c section for normal mode +custom_gruvbox.normal.c.bg = '#222222' + +local hide_in_width = function() + return vim.fn.winwidth(0) > 80 +end + +local diagnostics = { + 'diagnostics', + sources = { 'nvim_diagnostic' }, + sections = { 'error' , 'warn' }, + symbols = { error = ' ', warn = ' ', info = ' ', hint = ' ' }, + update_in_insert = false, + allways_visible = false, + cond = hide_in_width, +} + +require('lualine').setup { + options = { + theme = custom_gruvbox, + icons_enabled = true, + disabled_filetypes = {'undotree', 'diff'}, + }, + sections = { + lualine_a = {{ + 'mode', + fmt = function(str) + return ' ' .. str + end, + }}, + lualine_b = {'branch', 'diff', diagnostics}, + lualine_c = {{ + 'filename', + file_status = true, + path = 0, + }}, + --lualine_x = {'encoding', 'fileformat', 'filetype'}, + lualine_x = {{'encoding', cond=hide_in_width}, {'filetype',cond=hide_in_width}}, + lualine_y = {'progress'}, + lualine_z = {'location'} + } +} diff --git a/env/.config/nvim/after/plugin/notify.lua b/env/.config/nvim/after/plugin/notify.lua new file mode 100644 index 0000000..19c7362 --- /dev/null +++ b/env/.config/nvim/after/plugin/notify.lua @@ -0,0 +1,4 @@ +vim.notify = require("notify") +require("notify").setup({ + background_colour="#000000" +}) diff --git a/env/.config/nvim/after/plugin/telescope.lua b/env/.config/nvim/after/plugin/telescope.lua new file mode 100755 index 0000000..a709d9b --- /dev/null +++ b/env/.config/nvim/after/plugin/telescope.lua @@ -0,0 +1,9 @@ +local builtin = require('telescope.builtin') +vim.keymap.set('n', 'pf', builtin.find_files, {}) +vim.keymap.set('n', 'pg', builtin.live_grep, {}) +vim.keymap.set('n', 'pb', builtin.buffers, {}) +vim.keymap.set('n', 'ph', builtin.help_tags, {}) +vim.keymap.set('n', 'ps', function() + builtin.grep_string({ search = vim.fn.input("Grep > ") }); +end) +--vim.keymap.set('n', '', builtin.git_files, {}) diff --git a/env/.config/nvim/after/plugin/undotree.lua b/env/.config/nvim/after/plugin/undotree.lua new file mode 100644 index 0000000..b6b9276 --- /dev/null +++ b/env/.config/nvim/after/plugin/undotree.lua @@ -0,0 +1 @@ +vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) -- cgit v1.3