major update for notifications, better color management and way better icons instead of devicons. Also some minor changes + addet PlugIns

This commit is contained in:
pika 2024-07-06 03:32:08 +02:00
parent 2b4dd54444
commit a76e973992
8 changed files with 205 additions and 90 deletions

1
cd-project.nvim.json Normal file
View file

@ -0,0 +1 @@
[{"name": "pika", "path": "/home/pika"}, {"name": ".config", "path": "/home/pika/.config/"}, {"name": "gitea", "path": "/home/pika/gitea/"}]

View file

@ -71,6 +71,7 @@ map(
"<Cmd>CBcabox1<CR>",
{ noremap = true, silent = true, desc = "[c]reate comment [b]ox (centered)" }
)
map(
"v",
"<leader>cB",
@ -91,6 +92,9 @@ map("n", "<leader>R", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
-- ─< LoremIpsum generator >────────────────────────────────────────────────────────────
map("n", "<leader>L", ":LoremIpsum ")
map("n", "cd", ":CdProject<CR>", { noremap = true, silent = true, desc = "[c]d into a predefined project" })
map("n", "<leader>cd", ":CdProjectManualAdd<CR>", { noremap = true, silent = true, desc = "Add new projects to [cd]" })
-- window management
map("n", "<leader>sv", "<C-w>v", { desc = "Split window vertically" }) -- split window vertically
map("n", "<leader>sh", "<C-w>s", { desc = "Split window horizontally" }) -- split window horizontally

View file

@ -1,6 +1,6 @@
return {
"akinsho/bufferline.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
dependencies = { "echasnovski/mini.icons" },
version = "*",
opts = {
options = {

View file

@ -0,0 +1,41 @@
-- using lazy.nvim
return {
"LintaoAmons/cd-project.nvim",
config = function()
require("cd-project").setup({
-- this json file is acting like a database to update and read the projects in real time.
-- So because it's just a json file, you can edit directly to add more paths you want manually
projects_config_filepath = vim.fs.normalize(vim.fn.stdpath("config") .. "/cd-project.nvim.json"),
-- this controls the behaviour of `CdProjectAdd` command about how to get the project directory
project_dir_pattern = { ".git", ".gitignore", "Cargo.toml", "package.json", "go.mod" },
choice_format = "both", -- optional, you can switch to "name" or "path"
projects_picker = "vim-ui", -- optional, you can switch to `telescope`
auto_register_project = false, -- optional, toggle on/off the auto add project behaviour
-- do whatever you like by hooks
hooks = {
{
callback = function(dir)
vim.notify("switched to dir: " .. dir)
end,
},
{
callback = function(_)
vim.cmd("Telescope find_files")
end,
},
{
callback = function(dir)
vim.notify("switched to dir: " .. dir)
end, -- required, action when trigger the hook
name = "cd hint", -- optional
order = 1, -- optional, the exection order if there're multiple hooks to be trigger at one point
pattern = "cd-project.nvim", -- optional, trigger hook if contains pattern
trigger_point = "DISABLE", -- optional, enum of trigger_points, default to `AFTER_CD`
match_rule = function(dir) -- optional, a function return bool. if have this fields, then pattern will be ignored
return true
end,
},
},
})
end,
}

View file

@ -1,17 +1,72 @@
return {
{
'norcalli/nvim-colorizer.lua',
-- {
-- 'norcalli/nvim-colorizer.lua',
-- opts = {
-- 'css',
-- 'html',
-- 'php',
-- 'bash',
-- 'fish',
-- 'lua',
-- 'toml',
-- html = {
-- mode = 'foreground',
-- },
-- },
-- },
"brenoprata10/nvim-highlight-colors",
opts = {
'css',
'html',
'php',
'bash',
'fish',
'lua',
'toml',
html = {
mode = 'foreground',
},
---Render style
---@usage 'background'|'foreground'|'virtual'
render = "background",
---Set virtual symbol (requires render to be set to 'virtual')
virtual_symbol = "",
---Set virtual symbol suffix (defaults to '')
virtual_symbol_prefix = "",
---Set virtual symbol suffix (defaults to ' ')
virtual_symbol_suffix = " ",
---Set virtual symbol position()
---@usage 'inline'|'eol'|'eow'
---inline mimics VS Code style
---eol stands for `end of column` - Recommended to set `virtual_symbol_suffix = ''` when used.
---eow stands for `end of word` - Recommended to set `virtual_symbol_prefix = ' ' and virtual_symbol_suffix = ''` when used.
virtual_symbol_position = "inline",
---Highlight hex colors, e.g. '#FFFFFF'
enable_hex = true,
---Highlight short hex colors e.g. '#fff'
enable_short_hex = true,
---Highlight rgb colors, e.g. 'rgb(0 0 0)'
enable_rgb = true,
---Highlight hsl colors, e.g. 'hsl(150deg 30% 40%)'
enable_hsl = true,
---Highlight CSS variables, e.g. 'var(--testing-color)'
enable_var_usage = true,
---Highlight named colors, e.g. 'green'
enable_named_colors = true,
---Highlight tailwind colors, e.g. 'bg-blue-500'
enable_tailwind = false,
---Set custom colors
---Label must be properly escaped with '%' to adhere to `string.gmatch`
--- :help string.gmatch
custom_colors = {
{ label = "%-%-theme%-primary%-color", color = "#0f1219" },
{ label = "%-%-theme%-secondary%-color", color = "#5a5d64" },
},
-- Exclude filetypes or buftypes from highlighting e.g. 'exclude_buftypes = {'text'}'
exclude_filetypes = {},
exclude_buftypes = {},
},
}

View file

@ -1,4 +1,5 @@
return {
"nvim-lua/plenary.nvim", -- lua functions that many plugins use
"christoomey/vim-tmux-navigator", -- tmux & split window navigation
"dstein64/nvim-scrollview",
}

View file

@ -0,0 +1,13 @@
return {
"rcarriga/nvim-notify",
config = function()
require("notify").setup({
stages = "fade_in_slide_out",
background_colour = "FloatShadow",
timeout = 2750,
render = "compact",
-- opacity = 75,
})
vim.notify = require("notify")
end,
}

View file

@ -1,77 +1,77 @@
return {
'hrsh7th/nvim-cmp',
event = 'InsertEnter',
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
'hrsh7th/cmp-buffer', -- source for text in buffer
'hrsh7th/cmp-path', -- source for file system paths
"hrsh7th/cmp-buffer", -- source for text in buffer
"hrsh7th/cmp-path", -- source for file system paths
{
'L3MON4D3/LuaSnip',
"L3MON4D3/LuaSnip",
-- follow latest release.
version = 'v2.*', -- Replace <CurrentMajor> by the latest released major (first number of latest release)
version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
-- install jsregexp (optional!).
build = 'make install_jsregexp',
build = "make install_jsregexp",
},
'saadparwaiz1/cmp_luasnip', -- for autocompletion
'rafamadriz/friendly-snippets', -- useful snippets
'onsails/lspkind.nvim', -- vs-code like pictograms
"saadparwaiz1/cmp_luasnip", -- for autocompletion
"rafamadriz/friendly-snippets", -- useful snippets
"onsails/lspkind.nvim", -- vs-code like pictograms
},
config = function()
local cmp = require 'cmp'
local luasnip = require 'luasnip'
local lspkind = require 'lspkind'
local cmp = require("cmp")
local luasnip = require("luasnip")
local lspkind = require("lspkind")
-- loads vscode style snippets from installed plugins (e.g. friendly-snippets)
require('luasnip.loaders.from_vscode').lazy_load()
require("luasnip.loaders.from_vscode").lazy_load()
cmp.setup {
cmp.setup({
completion = {
completeopt = 'menu,menuone,preview,noselect',
completeopt = "menu,menuone,preview,noselect",
},
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert {
['<C-k>'] = cmp.mapping.select_prev_item(), -- previous suggestion
['<C-j>'] = cmp.mapping.select_next_item(), -- next suggestion
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(), -- show completion suggestions
['<C-e>'] = cmp.mapping.abort(), -- close completion window
['<CR>'] = cmp.mapping.confirm { select = false },
mapping = cmp.mapping.preset.insert({
["<C-k>"] = cmp.mapping.select_prev_item(), -- previous suggestion
["<C-j>"] = cmp.mapping.select_next_item(), -- next suggestion
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions
["<C-e>"] = cmp.mapping.abort(), -- close completion window
["<CR>"] = cmp.mapping.confirm({ select = false }),
-- Tab to complete
['<Tab>'] = cmp.mapping(function(fallback)
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.confirm { select = true } -- confirm selection
cmp.confirm({ select = true }) -- confirm selection
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { 'i', 's' }),
},
end, { "i", "s" }),
}),
-- sources for autocompletion
sources = cmp.config.sources {
{ name = 'nvim_lsp' },
{ name = 'luasnip' }, -- snippets
{ name = 'buffer' }, -- text within current buffer
{ name = 'path' }, -- file system paths
},
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" }, -- snippets
{ name = "buffer" }, -- text within current buffer
{ name = "path" }, -- file system paths
}),
-- configure lspkind for vs-code like pictograms in completion menu
formatting = {
format = lspkind.cmp_format {
mode = 'symbol_text', -- show symbol text with icons
maxwidth = 50,
ellipsis_char = '...',
},
format = lspkind.cmp_format({
mode = "symbol_text", -- show symbol text with icons
maxwidth = 130,
ellipsis_char = "...",
}),
},
-- Enable rounded borders
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
}
})
end,
}