added packer script. made plugin configs not error out when no plugin
This commit is contained in:
parent
571effe737
commit
e6577b4106
|
@ -1,4 +1,6 @@
|
|||
require("image").setup({
|
||||
local ok, image = pcall(require, 'image')
|
||||
if ok then
|
||||
image.setup({
|
||||
backend = "kitty",
|
||||
processor = "magick_cli", -- or "magick_rock"
|
||||
integrations = {
|
||||
|
@ -35,7 +37,8 @@ require("image").setup({
|
|||
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
|
||||
})
|
||||
})
|
||||
end
|
||||
|
||||
-- require("image").enable() -- enable the plugin
|
||||
-- print(require("image").is_enabled()) -- bool
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
require('yourmom/cloak').setup({
|
||||
local ok, cloak = pcall(require, 'yourmom/cloak')
|
||||
if ok then
|
||||
cloak.setup({
|
||||
enabled = true,
|
||||
cloak_character = '*',
|
||||
-- The applied highlight group (colors) on the cloaking, see `:h highlight`.
|
||||
|
@ -28,4 +30,5 @@ require('yourmom/cloak').setup({
|
|||
replace = nil,
|
||||
}
|
||||
},
|
||||
})
|
||||
})
|
||||
end
|
||||
|
|
|
@ -1 +1,4 @@
|
|||
require("colorizer").setup()
|
||||
local ok, colorizer = pcall(require, 'colorizer')
|
||||
if ok then
|
||||
colorizer.setup()
|
||||
end
|
||||
|
|
|
@ -1 +1,4 @@
|
|||
require("hardtime").setup()
|
||||
local ok, hardtime = pcall(require, 'hardtime')
|
||||
if ok then
|
||||
hardtime.setup()
|
||||
end
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
local mark = require("harpoon.mark")
|
||||
local ui = require("harpoon.ui")
|
||||
local ok, _ = pcall(require, 'harpoon.mark')
|
||||
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","<C-e>", ui.toggle_quick_menu)
|
||||
vim.keymap.set("n","<leader>a", mark.add_file)
|
||||
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-t>", function() ui.nav_file(2) 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-y>", function() ui.nav_file(1) 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-s>", function() ui.nav_file(4) end)
|
||||
end
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
local highlight = {
|
||||
local ok, _ = pcall(require, 'ibl')
|
||||
if ok then
|
||||
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()
|
||||
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)
|
||||
end)
|
||||
|
||||
require('ibl').setup {
|
||||
require('ibl').setup {
|
||||
indent = {
|
||||
char = '|',
|
||||
highlight = highlight,
|
||||
|
@ -27,4 +29,5 @@ require('ibl').setup {
|
|||
'diff',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
end
|
||||
|
|
|
@ -1,34 +1,36 @@
|
|||
vim.api.nvim_create_autocmd("FileType", {
|
||||
local ok, _ = pcall(require, 'lsp-zero')
|
||||
if ok then
|
||||
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")
|
||||
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_mappings = cmp.mapping.preset.insert({
|
||||
local cmp_select = {behavior = cmp.SelectBehavior.Select}
|
||||
local cmp_mappings = cmp.mapping.preset.insert({
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
|
||||
['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
|
||||
['<C-y>'] = cmp.mapping.confirm({ select = true }),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
})
|
||||
})
|
||||
|
||||
cmp.setup({
|
||||
cmp.setup({
|
||||
mapping = cmp_mappings,
|
||||
})
|
||||
})
|
||||
|
||||
vim.diagnostic.config({
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true,
|
||||
})
|
||||
})
|
||||
|
||||
lsp.on_attach(function(client, bufnr)
|
||||
lsp.on_attach(function(client, bufnr)
|
||||
local opts = {buffer = bufnr, remap = false}
|
||||
|
||||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
|
||||
|
@ -41,12 +43,12 @@ lsp.on_attach(function(client, bufnr)
|
|||
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("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 = {
|
||||
default_config = {
|
||||
cmd = { "/bin/greybel-languageserver", "--stdio" },
|
||||
|
@ -55,21 +57,22 @@ if not lsp_configurations.greybel then
|
|||
settings = {},
|
||||
}
|
||||
}
|
||||
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({
|
||||
-- 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({
|
||||
})
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = { },
|
||||
handlers = {
|
||||
lsp.default_setup,
|
||||
},
|
||||
})
|
||||
require('lspconfig').greybel.setup({})
|
||||
})
|
||||
require('lspconfig').greybel.setup({})
|
||||
|
||||
lsp.setup()
|
||||
lsp.setup()
|
||||
end
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
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
|
||||
custom_gruvbox.normal.c.bg = '#222222'
|
||||
-- Change the background of lualine_c section for normal mode
|
||||
custom_gruvbox.normal.c.bg = '#222222'
|
||||
|
||||
local hide_in_width = function()
|
||||
local hide_in_width = function()
|
||||
return vim.fn.winwidth(0) > 80
|
||||
end
|
||||
end
|
||||
|
||||
local diagnostics = {
|
||||
local diagnostics = {
|
||||
'diagnostics',
|
||||
sources = { 'nvim_diagnostic' },
|
||||
sections = { 'error' , 'warn' },
|
||||
|
@ -17,9 +19,9 @@ local diagnostics = {
|
|||
update_in_insert = false,
|
||||
allways_visible = false,
|
||||
cond = hide_in_width,
|
||||
}
|
||||
}
|
||||
|
||||
require('lualine').setup {
|
||||
lualine.setup {
|
||||
options = {
|
||||
theme = custom_gruvbox,
|
||||
icons_enabled = true,
|
||||
|
@ -43,4 +45,5 @@ require('lualine').setup {
|
|||
lualine_y = {'progress'},
|
||||
lualine_z = {'location'}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
vim.notify = require("notify")
|
||||
require("notify").setup({
|
||||
local ok, notify = pcall(require, 'notify')
|
||||
if ok then
|
||||
vim.notify = notify
|
||||
notify.setup({
|
||||
background_colour="#000000"
|
||||
})
|
||||
})
|
||||
end
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
local telescope = require('telescope')
|
||||
local builtin = require('telescope.builtin')
|
||||
if string.find(vim.loop.cwd(),"iceys%-linux%-stuffs") then
|
||||
local ok, _ = pcall(require, 'telescope')
|
||||
if ok then
|
||||
local telescope = require('telescope')
|
||||
local builtin = require('telescope.builtin')
|
||||
if string.find(vim.loop.cwd(),"iceys%-linux%-stuffs") then
|
||||
telescope.setup{
|
||||
pickers = {
|
||||
find_files = {
|
||||
|
@ -8,12 +10,13 @@ if string.find(vim.loop.cwd(),"iceys%-linux%-stuffs") then
|
|||
}
|
||||
}
|
||||
}
|
||||
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()
|
||||
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)
|
||||
--vim.keymap.set('n', '<C-p>', builtin.git_files, {})
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 ----------
|
Loading…
Reference in New Issue