added packer script. made plugin configs not error out when no plugin

This commit is contained in:
iceyrazor 2025-05-26 16:00:35 -05:00
parent 571effe737
commit e6577b4106
12 changed files with 270 additions and 229 deletions

View File

@ -1,41 +1,44 @@
require("image").setup({ local ok, image = pcall(require, 'image')
backend = "kitty", if ok then
processor = "magick_cli", -- or "magick_rock" image.setup({
integrations = { backend = "kitty",
markdown = { processor = "magick_cli", -- or "magick_rock"
enabled = true, integrations = {
clear_in_insert_mode = false, markdown = {
download_remote_images = false, enabled = true,
only_render_image_at_cursor = true, clear_in_insert_mode = false,
only_render_image_at_cursor_mode = "popup", download_remote_images = false,
floating_windows = false, -- if true, images will be rendered in floating markdown windows only_render_image_at_cursor = true,
filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here 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,
},
}, },
neorg = { max_width = nil,
enabled = true, max_height = nil,
filetypes = { "norg" }, max_width_window_percentage = nil,
}, max_height_window_percentage = 50,
typst = { window_overlap_clear_enabled = false, -- toggles images when windows are overlapped
enabled = true, window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "snacks_notif", "scrollview", "scrollview_sign" },
filetypes = { "typst" }, 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)
html = { hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp", "*.avif" }, -- render image files as images when opened
enabled = false, })
}, end
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 -- require("image").enable() -- enable the plugin
-- print(require("image").is_enabled()) -- bool -- print(require("image").is_enabled()) -- bool

View File

@ -1,31 +1,34 @@
require('yourmom/cloak').setup({ local ok, cloak = pcall(require, 'yourmom/cloak')
enabled = true, if ok then
cloak_character = '*', cloak.setup({
-- The applied highlight group (colors) on the cloaking, see `:h highlight`. enabled = true,
highlight_group = 'Comment', cloak_character = '*',
-- Applies the length of the replacement characters for all matched -- The applied highlight group (colors) on the cloaking, see `:h highlight`.
-- patterns, defaults to the length of the matched pattern. highlight_group = 'Comment',
cloak_length = nil, -- Provide a number if you want to hide the true length of the value. -- Applies the length of the replacement characters for all matched
-- Whether it should try every pattern to find the best fit or stop after the first. -- patterns, defaults to the length of the matched pattern.
try_all_patterns = true, cloak_length = nil, -- Provide a number if you want to hide the true length of the value.
-- Set to true to cloak Telescope preview buffers. (Required feature not in 0.1.x) -- Whether it should try every pattern to find the best fit or stop after the first.
cloak_telescope = true, try_all_patterns = true,
-- Re-enable cloak when a matched buffer leaves the window. -- Set to true to cloak Telescope preview buffers. (Required feature not in 0.1.x)
cloak_on_leave = false, cloak_telescope = true,
patterns = { -- Re-enable cloak when a matched buffer leaves the window.
{ cloak_on_leave = false,
-- Match any file starting with '.env'. patterns = {
-- This can be a table to match multiple file patterns. {
file_pattern = '.env*', -- Match any file starting with '.env'.
-- Match an equals sign and any character after it. -- This can be a table to match multiple file patterns.
-- This can also be a table of patterns to cloak, file_pattern = '.env*',
-- example: cloak_pattern = { ':.+', '-.+' } for yaml files. -- Match an equals sign and any character after it.
cloak_pattern = '=.+', -- This can also be a table of patterns to cloak,
-- A function, table or string to generate the replacement. -- example: cloak_pattern = { ':.+', '-.+' } for yaml files.
-- The actual replacement will contain the 'cloak_character' cloak_pattern = '=.+',
-- where it doesn't cover the original text. -- A function, table or string to generate the replacement.
-- If left empty the legacy behavior of keeping the first character is retained. -- The actual replacement will contain the 'cloak_character'
replace = nil, -- where it doesn't cover the original text.
} -- If left empty the legacy behavior of keeping the first character is retained.
}, replace = nil,
}) }
},
})
end

View File

@ -1 +1,4 @@
require("colorizer").setup() local ok, colorizer = pcall(require, 'colorizer')
if ok then
colorizer.setup()
end

View File

@ -1 +1,4 @@
require("hardtime").setup() local ok, hardtime = pcall(require, 'hardtime')
if ok then
hardtime.setup()
end

View File

@ -1,11 +1,14 @@
local mark = require("harpoon.mark") local ok, _ = pcall(require, 'harpoon.mark')
local ui = require("harpoon.ui") if ok then
local mark = require("harpoon.mark")
local ui = require("harpoon.ui")
vim.keymap.set("n","<leader>a", mark.add_file) vim.keymap.set("n","<leader>a", mark.add_file)
vim.keymap.set("n","<C-e>", ui.toggle_quick_menu) vim.keymap.set("n","<C-e>", ui.toggle_quick_menu)
vim.keymap.set("n","<C-y>", function() ui.nav_file(1) end) vim.keymap.set("n","<C-y>", function() ui.nav_file(1) end)
vim.keymap.set("n","<C-t>", function() ui.nav_file(2) end) vim.keymap.set("n","<C-t>", function() ui.nav_file(2) end)
vim.keymap.set("n","<C-n>", function() ui.nav_file(3) end) vim.keymap.set("n","<C-n>", function() ui.nav_file(3) end)
vim.keymap.set("n","<C-s>", function() ui.nav_file(4) end) vim.keymap.set("n","<C-s>", function() ui.nav_file(4) end)
end

View File

@ -1,30 +1,33 @@
local highlight = { local ok, _ = pcall(require, 'ibl')
"RainbowRed", if ok then
} local highlight = {
"RainbowRed",
}
local hooks = require "ibl.hooks" local hooks = require "ibl.hooks"
-- create the highlight groups in the highlight setup hook, so they are reset -- create the highlight groups in the highlight setup hook, so they are reset
-- every time the colorscheme changes -- every time the colorscheme changes
hooks.register(hooks.type.HIGHLIGHT_SETUP, function() hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#702ec0" }) vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#702ec0" })
end) end)
require('ibl').setup { require('ibl').setup {
indent = { indent = {
char = '|', char = '|',
highlight = highlight, highlight = highlight,
},
scope = {
show_start = false,
show_end = false,
show_exact_scope = false,
},
exclude = {
filetypes = {
'help',
'packer',
'undotree',
'diff',
}, },
}, scope = {
} show_start = false,
show_end = false,
show_exact_scope = false,
},
exclude = {
filetypes = {
'help',
'packer',
'undotree',
'diff',
},
},
}
end

View File

@ -1,75 +1,78 @@
vim.api.nvim_create_autocmd("FileType", { local ok, _ = pcall(require, 'lsp-zero')
pattern = "src", if ok then
callback = function() vim.api.nvim_create_autocmd("FileType", {
print("LSP should now be active for src files") pattern = "src",
end, callback = function()
}) print("LSP should now be active for src files")
end,
})
local lsp = require("lsp-zero") local lsp = require("lsp-zero")
lsp.preset("recommended") lsp.preset("recommended")
local cmp = require('cmp') local cmp = require('cmp')
local cmp_select = {behavior = cmp.SelectBehavior.Select} local cmp_select = {behavior = cmp.SelectBehavior.Select}
local cmp_mappings = cmp.mapping.preset.insert({ local cmp_mappings = cmp.mapping.preset.insert({
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select), ['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
['<C-n>'] = cmp.mapping.select_next_item(cmp_select), ['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
['<C-y>'] = cmp.mapping.confirm({ select = true }), ['<C-y>'] = cmp.mapping.confirm({ select = true }),
["<C-Space>"] = cmp.mapping.complete(), ["<C-Space>"] = cmp.mapping.complete(),
}) })
cmp.setup({ cmp.setup({
mapping = cmp_mappings, mapping = cmp_mappings,
}) })
vim.diagnostic.config({ vim.diagnostic.config({
virtual_text = true, virtual_text = true,
}) })
lsp.on_attach(function(client, bufnr) lsp.on_attach(function(client, bufnr)
local opts = {buffer = bufnr, remap = false} local opts = {buffer = bufnr, remap = false}
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) 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", "K", function() vim.lsp.buf.hover() end, opts)
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts) vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts) vim.keymap.set("n", "<leader>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_next() end, opts)
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts) vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts) vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts)
vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts) vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts)
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts) vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts) vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
end) end)
local lsp_configurations = require('lspconfig.configs') local lsp_configurations = require('lspconfig.configs')
if not lsp_configurations.greybel then if not lsp_configurations.greybel then
lsp_configurations.greybel = { lsp_configurations.greybel = {
default_config = { default_config = {
cmd = { "/bin/greybel-languageserver", "--stdio" }, cmd = { "/bin/greybel-languageserver", "--stdio" },
filetypes = { "greyscript" }, filetypes = { "greyscript" },
root_dir = require('lspconfig.util').root_pattern(".git", vim.fn.getcwd()), root_dir = require('lspconfig.util').root_pattern(".git", vim.fn.getcwd()),
settings = {}, 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()
end 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()

View File

@ -1,46 +1,49 @@
require('lualine').setup() local ok, lualine = pcall(require, 'lualine')
if ok then
-- require('lualine').setup()
local custom_gruvbox = require'lualine.themes.base16' local custom_gruvbox = require'lualine.themes.base16'
-- Change the background of lualine_c section for normal mode -- Change the background of lualine_c section for normal mode
custom_gruvbox.normal.c.bg = '#222222' custom_gruvbox.normal.c.bg = '#222222'
local hide_in_width = function() local hide_in_width = function()
return vim.fn.winwidth(0) > 80 return vim.fn.winwidth(0) > 80
end end
local diagnostics = { local diagnostics = {
'diagnostics', 'diagnostics',
sources = { 'nvim_diagnostic' }, sources = { 'nvim_diagnostic' },
sections = { 'error' , 'warn' }, sections = { 'error' , 'warn' },
symbols = { error = '', warn = '', info = '', hint = '' }, symbols = { error = '', warn = '', info = '', hint = '' },
update_in_insert = false, update_in_insert = false,
allways_visible = false, allways_visible = false,
cond = hide_in_width, 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'}
} }
}
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'}
}
}
end

View File

@ -1,4 +1,7 @@
vim.notify = require("notify") local ok, notify = pcall(require, 'notify')
require("notify").setup({ if ok then
background_colour="#000000" vim.notify = notify
}) notify.setup({
background_colour="#000000"
})
end

View File

@ -1,19 +1,22 @@
local telescope = require('telescope') local ok, _ = pcall(require, 'telescope')
local builtin = require('telescope.builtin') if ok then
if string.find(vim.loop.cwd(),"iceys%-linux%-stuffs") then local telescope = require('telescope')
telescope.setup{ local builtin = require('telescope.builtin')
pickers = { if string.find(vim.loop.cwd(),"iceys%-linux%-stuffs") then
find_files = { telescope.setup{
hidden=true pickers = {
find_files = {
hidden=true
}
} }
} }
} end
vim.keymap.set('n', '<leader>pf', builtin.find_files, {})
vim.keymap.set('n', '<leader>pg', builtin.live_grep, {})
vim.keymap.set('n', '<leader>pb', builtin.buffers, {})
vim.keymap.set('n', '<leader>ph', builtin.help_tags, {})
vim.keymap.set('n', '<leader>ps', function()
builtin.grep_string({ search = vim.fn.input("Grep > ") });
end)
--vim.keymap.set('n', '<C-p>', builtin.git_files, {})
end end
vim.keymap.set('n', '<leader>pf', builtin.find_files, {})
vim.keymap.set('n', '<leader>pg', builtin.live_grep, {})
vim.keymap.set('n', '<leader>pb', builtin.buffers, {})
vim.keymap.set('n', '<leader>ph', builtin.help_tags, {})
vim.keymap.set('n', '<leader>ps', function()
builtin.grep_string({ search = vim.fn.input("Grep > ") });
end)
--vim.keymap.set('n', '<C-p>', builtin.git_files, {})

View File

@ -1 +1,4 @@
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle) local ok, _ = pcall(require, 'undotree')
if ok then
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
end

8
runs/packer.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
echo DOWNLOADING PACKER FOR NVIM
git clone --depth 1 https://github.com/wbthomason/packer.nvim \
~/.local/share/nvim/site/pack/packer/start/packer.nvim
echo ----------