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:
parent
2b4dd54444
commit
a76e973992
8 changed files with 205 additions and 90 deletions
1
cd-project.nvim.json
Normal file
1
cd-project.nvim.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
[{"name": "pika", "path": "/home/pika"}, {"name": ".config", "path": "/home/pika/.config/"}, {"name": "gitea", "path": "/home/pika/gitea/"}]
|
|
@ -71,6 +71,7 @@ map(
|
||||||
"<Cmd>CBcabox1<CR>",
|
"<Cmd>CBcabox1<CR>",
|
||||||
{ noremap = true, silent = true, desc = "[c]reate comment [b]ox (centered)" }
|
{ noremap = true, silent = true, desc = "[c]reate comment [b]ox (centered)" }
|
||||||
)
|
)
|
||||||
|
|
||||||
map(
|
map(
|
||||||
"v",
|
"v",
|
||||||
"<leader>cB",
|
"<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 >────────────────────────────────────────────────────────────
|
-- ─< LoremIpsum generator >────────────────────────────────────────────────────────────
|
||||||
map("n", "<leader>L", ":LoremIpsum ")
|
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
|
-- window management
|
||||||
map("n", "<leader>sv", "<C-w>v", { desc = "Split window vertically" }) -- split window vertically
|
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
|
map("n", "<leader>sh", "<C-w>s", { desc = "Split window horizontally" }) -- split window horizontally
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
return {
|
return {
|
||||||
"akinsho/bufferline.nvim",
|
"akinsho/bufferline.nvim",
|
||||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
dependencies = { "echasnovski/mini.icons" },
|
||||||
version = "*",
|
version = "*",
|
||||||
opts = {
|
opts = {
|
||||||
options = {
|
options = {
|
||||||
|
|
41
lua/pika/plugins/cd-project.lua
Normal file
41
lua/pika/plugins/cd-project.lua
Normal 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,
|
||||||
|
}
|
|
@ -1,17 +1,72 @@
|
||||||
return {
|
return {
|
||||||
{
|
-- {
|
||||||
'norcalli/nvim-colorizer.lua',
|
-- 'norcalli/nvim-colorizer.lua',
|
||||||
opts = {
|
-- opts = {
|
||||||
'css',
|
-- 'css',
|
||||||
'html',
|
-- 'html',
|
||||||
'php',
|
-- 'php',
|
||||||
'bash',
|
-- 'bash',
|
||||||
'fish',
|
-- 'fish',
|
||||||
'lua',
|
-- 'lua',
|
||||||
'toml',
|
-- 'toml',
|
||||||
html = {
|
-- html = {
|
||||||
mode = 'foreground',
|
-- mode = 'foreground',
|
||||||
},
|
-- },
|
||||||
},
|
-- },
|
||||||
},
|
-- },
|
||||||
|
"brenoprata10/nvim-highlight-colors",
|
||||||
|
opts = {
|
||||||
|
---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 = {},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
return {
|
return {
|
||||||
"nvim-lua/plenary.nvim", -- lua functions that many plugins use
|
"nvim-lua/plenary.nvim", -- lua functions that many plugins use
|
||||||
"christoomey/vim-tmux-navigator", -- tmux & split window navigation
|
"christoomey/vim-tmux-navigator", -- tmux & split window navigation
|
||||||
|
"dstein64/nvim-scrollview",
|
||||||
}
|
}
|
||||||
|
|
13
lua/pika/plugins/notify.lua
Normal file
13
lua/pika/plugins/notify.lua
Normal 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,
|
||||||
|
}
|
|
@ -1,77 +1,77 @@
|
||||||
return {
|
return {
|
||||||
'hrsh7th/nvim-cmp',
|
"hrsh7th/nvim-cmp",
|
||||||
event = 'InsertEnter',
|
event = "InsertEnter",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
'hrsh7th/cmp-buffer', -- source for text in buffer
|
"hrsh7th/cmp-buffer", -- source for text in buffer
|
||||||
'hrsh7th/cmp-path', -- source for file system paths
|
"hrsh7th/cmp-path", -- source for file system paths
|
||||||
{
|
{
|
||||||
'L3MON4D3/LuaSnip',
|
"L3MON4D3/LuaSnip",
|
||||||
-- follow latest release.
|
-- 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!).
|
-- install jsregexp (optional!).
|
||||||
build = 'make install_jsregexp',
|
build = "make install_jsregexp",
|
||||||
},
|
},
|
||||||
'saadparwaiz1/cmp_luasnip', -- for autocompletion
|
"saadparwaiz1/cmp_luasnip", -- for autocompletion
|
||||||
'rafamadriz/friendly-snippets', -- useful snippets
|
"rafamadriz/friendly-snippets", -- useful snippets
|
||||||
'onsails/lspkind.nvim', -- vs-code like pictograms
|
"onsails/lspkind.nvim", -- vs-code like pictograms
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local cmp = require 'cmp'
|
local cmp = require("cmp")
|
||||||
local luasnip = require 'luasnip'
|
local luasnip = require("luasnip")
|
||||||
local lspkind = require 'lspkind'
|
local lspkind = require("lspkind")
|
||||||
|
|
||||||
-- loads vscode style snippets from installed plugins (e.g. friendly-snippets)
|
-- 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 = {
|
completion = {
|
||||||
completeopt = 'menu,menuone,preview,noselect',
|
completeopt = "menu,menuone,preview,noselect",
|
||||||
},
|
},
|
||||||
snippet = {
|
snippet = {
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
luasnip.lsp_expand(args.body)
|
luasnip.lsp_expand(args.body)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
mapping = cmp.mapping.preset.insert {
|
mapping = cmp.mapping.preset.insert({
|
||||||
['<C-k>'] = cmp.mapping.select_prev_item(), -- previous suggestion
|
["<C-k>"] = cmp.mapping.select_prev_item(), -- previous suggestion
|
||||||
['<C-j>'] = cmp.mapping.select_next_item(), -- next suggestion
|
["<C-j>"] = cmp.mapping.select_next_item(), -- next suggestion
|
||||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||||
['<C-Space>'] = cmp.mapping.complete(), -- show completion suggestions
|
["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions
|
||||||
['<C-e>'] = cmp.mapping.abort(), -- close completion window
|
["<C-e>"] = cmp.mapping.abort(), -- close completion window
|
||||||
['<CR>'] = cmp.mapping.confirm { select = false },
|
["<CR>"] = cmp.mapping.confirm({ select = false }),
|
||||||
|
|
||||||
-- Tab to complete
|
-- Tab to complete
|
||||||
['<Tab>'] = cmp.mapping(function(fallback)
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.confirm { select = true } -- confirm selection
|
cmp.confirm({ select = true }) -- confirm selection
|
||||||
elseif luasnip.expand_or_jumpable() then
|
elseif luasnip.expand_or_jumpable() then
|
||||||
luasnip.expand_or_jump()
|
luasnip.expand_or_jump()
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end, { 'i', 's' }),
|
end, { "i", "s" }),
|
||||||
},
|
}),
|
||||||
-- sources for autocompletion
|
-- sources for autocompletion
|
||||||
sources = cmp.config.sources {
|
sources = cmp.config.sources({
|
||||||
{ name = 'nvim_lsp' },
|
{ name = "nvim_lsp" },
|
||||||
{ name = 'luasnip' }, -- snippets
|
{ name = "luasnip" }, -- snippets
|
||||||
{ name = 'buffer' }, -- text within current buffer
|
{ name = "buffer" }, -- text within current buffer
|
||||||
{ name = 'path' }, -- file system paths
|
{ name = "path" }, -- file system paths
|
||||||
},
|
}),
|
||||||
-- configure lspkind for vs-code like pictograms in completion menu
|
-- configure lspkind for vs-code like pictograms in completion menu
|
||||||
formatting = {
|
formatting = {
|
||||||
format = lspkind.cmp_format {
|
format = lspkind.cmp_format({
|
||||||
mode = 'symbol_text', -- show symbol text with icons
|
mode = "symbol_text", -- show symbol text with icons
|
||||||
maxwidth = 50,
|
maxwidth = 130,
|
||||||
ellipsis_char = '...',
|
ellipsis_char = "...",
|
||||||
},
|
}),
|
||||||
},
|
},
|
||||||
-- Enable rounded borders
|
-- Enable rounded borders
|
||||||
window = {
|
window = {
|
||||||
completion = cmp.config.window.bordered(),
|
completion = cmp.config.window.bordered(),
|
||||||
documentation = cmp.config.window.bordered(),
|
documentation = cmp.config.window.bordered(),
|
||||||
},
|
},
|
||||||
}
|
})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue