mirror of
https://github.com/pnx/dotfiles
synced 2026-06-16 03:14:55 +02:00
nvim: moved stuff around.
This commit is contained in:
parent
300d300664
commit
0d7a5fab7b
22 changed files with 975 additions and 990 deletions
|
|
@ -25,6 +25,9 @@ vim.keymap.set('n', '<S-d>', [[:m +1<CR>v=]], { silent = true, desc = 'move curr
|
||||||
vim.keymap.set('v', '<S-a>', [[:m '<-2<CR>gv=gv]], { silent = true, desc = 'move current selection one line up' })
|
vim.keymap.set('v', '<S-a>', [[:m '<-2<CR>gv=gv]], { silent = true, desc = 'move current selection one line up' })
|
||||||
vim.keymap.set('v', '<S-d>', [[:m '>+1<CR>gv=gv]], { silent = true, desc = 'move current selection one line down' })
|
vim.keymap.set('v', '<S-d>', [[:m '>+1<CR>gv=gv]], { silent = true, desc = 'move current selection one line down' })
|
||||||
|
|
||||||
|
-- Undo tree
|
||||||
|
vim.keymap.set('n', '<leader>u', [[:UndotreeToggle<CR>:UndotreeFocus<CR>]], { desc = 'Toggle undotree' })
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Editing - formatting
|
-- Editing - formatting
|
||||||
--
|
--
|
||||||
|
|
@ -43,10 +46,6 @@ vim.keymap.set('x', '<leader>fha', [[:s/0x\(\x\{1\}\X\)/0x0\1/g]],
|
||||||
vim.keymap.set('x', '<leader>fhn', [[:s/\(\(0x\x\{1,2\}, \)\{8\}\)/\1\r/g]],
|
vim.keymap.set('x', '<leader>fhn', [[:s/\(\(0x\x\{1,2\}, \)\{8\}\)/\1\r/g]],
|
||||||
{ desc = "Format a comma separated hex list into 8 bytes per line." })
|
{ desc = "Format a comma separated hex list into 8 bytes per line." })
|
||||||
|
|
||||||
-- Case formatting
|
|
||||||
vim.keymap.set('x', '<leader>fc', "noop", { desc = "Case" })
|
|
||||||
vim.keymap.set("x", "<leader>fcsc", [[:s/\%V\([a-z]\+\)_\?/\u\1/g]],
|
|
||||||
{ desc = "Convert text from snake_case to CamelCase" })
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Editing - Copy / Paste
|
-- Editing - Copy / Paste
|
||||||
|
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
||||||
local icons = require('user.icons')
|
|
||||||
|
|
||||||
return {
|
|
||||||
{ import = "user.plugins.core.colorscheme" },
|
|
||||||
{
|
|
||||||
"williamboman/mason.nvim",
|
|
||||||
build = ":MasonUpdate",
|
|
||||||
cmd = "Mason",
|
|
||||||
opts_extend = { "ensure_installed" },
|
|
||||||
opts = {},
|
|
||||||
config = function(_, opts)
|
|
||||||
require("mason").setup(opts)
|
|
||||||
end
|
|
||||||
},
|
|
||||||
-- Dashboard
|
|
||||||
{
|
|
||||||
"goolord/alpha-nvim",
|
|
||||||
config = function()
|
|
||||||
local alpha = require'alpha'
|
|
||||||
local dashboard = require'alpha.themes.dashboard'
|
|
||||||
|
|
||||||
dashboard.section.header.val = {
|
|
||||||
[[ __ ]],
|
|
||||||
[[ ___ ___ ___ __ __ /\_\ ___ ___ ]],
|
|
||||||
[[ / _ `\ / __`\ / __`\/\ \/\ \\/\ \ / __` __`\ ]],
|
|
||||||
[[/\ \/\ \/\ __//\ \_\ \ \ \_/ |\ \ \/\ \/\ \/\ \ ]],
|
|
||||||
[[\ \_\ \_\ \____\ \____/\ \___/ \ \_\ \_\ \_\ \_\]],
|
|
||||||
[[ \/_/\/_/\/____/\/___/ \/__/ \/_/\/_/\/_/\/_/]],
|
|
||||||
}
|
|
||||||
|
|
||||||
dashboard.section.buttons.val = {
|
|
||||||
dashboard.button("e", icons.files.text .. " New file" , ":ene <BAR> startinsert<CR>"),
|
|
||||||
dashboard.button("s", icons.search .. " Search files" , ":Telescope find_files<CR>"),
|
|
||||||
dashboard.button("o", icons.search .. " Old files" , ":Telescope oldfiles<CR>"),
|
|
||||||
dashboard.button("q", icons.close .. " Quit" , ":qa<CR>"),
|
|
||||||
}
|
|
||||||
|
|
||||||
alpha.setup(dashboard.config)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
-- Icons
|
|
||||||
{
|
|
||||||
'nvim-tree/nvim-web-devicons',
|
|
||||||
opts = {
|
|
||||||
override = {
|
|
||||||
php = {
|
|
||||||
icon = icons.filetypes.php,
|
|
||||||
color = "#4F5B93",
|
|
||||||
name = "Php"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
override_by_filename = {
|
|
||||||
["artisan"] = {
|
|
||||||
icon = icons.filetypes.laravel,
|
|
||||||
color = "#f05340",
|
|
||||||
name = "LaravelArtisan"
|
|
||||||
},
|
|
||||||
["phpunit.xml"] = {
|
|
||||||
icon = icons.filetypes.phpunit,
|
|
||||||
color = "#0d6efd",
|
|
||||||
name = "PhpUnit"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,256 +0,0 @@
|
||||||
|
|
||||||
local options = {
|
|
||||||
flavour = "mocha",
|
|
||||||
transparent_background = not vim.g.neovide,
|
|
||||||
color_overrides = {
|
|
||||||
mocha = {
|
|
||||||
base = "#0E1019",
|
|
||||||
mantle = "#0D0F17",
|
|
||||||
crust = "#0C0D14",
|
|
||||||
surface0 = "#1a1c2d",
|
|
||||||
surface1 = "#343959",
|
|
||||||
surface2 = "#41476F",
|
|
||||||
overlay0 = "#3F4256",
|
|
||||||
overlay1 = "#5B5F7C",
|
|
||||||
overlay2 = "#767BA0",
|
|
||||||
|
|
||||||
text = "#eceef4",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
no_italic = true,
|
|
||||||
no_bold = true,
|
|
||||||
custom_highlights = function(colors)
|
|
||||||
return {
|
|
||||||
CursorLine = { bg = colors.surface0 },
|
|
||||||
SignColumnSep = { bg = colors.surface0, fg = colors.lavender },
|
|
||||||
|
|
||||||
Visual = { bg = colors.surface1 },
|
|
||||||
FoldColumn = { fg = colors.surface2 },
|
|
||||||
|
|
||||||
-- Floating windows
|
|
||||||
NormalFloat = { fg = colors.text, bg = colors.crust },
|
|
||||||
FloatTitle = { fg = colors.base, bg = colors.blue },
|
|
||||||
FloatBorder = { fg = colors.surface1, bg = colors.crust },
|
|
||||||
|
|
||||||
-- Window separator
|
|
||||||
WinSeparator = { fg = colors.surface0 },
|
|
||||||
|
|
||||||
-- Menus
|
|
||||||
Pmenu = { link = "NormalFloat" },
|
|
||||||
PmenuSel = { bg = colors.surface2 },
|
|
||||||
PmenuSbar = { link = "Pmenu" },
|
|
||||||
PmenuThumb = { link = "PmenuSel" },
|
|
||||||
|
|
||||||
-- NoiceMini = { link = "NormalFloat" },
|
|
||||||
WhichKeyFloat = { link = "Pmenu" },
|
|
||||||
|
|
||||||
-- indent lines
|
|
||||||
IblScope = { fg = colors.surface0 },
|
|
||||||
|
|
||||||
-- Search matches
|
|
||||||
IncSearch = { bg = colors.yellow },
|
|
||||||
|
|
||||||
-- Autocomplete window
|
|
||||||
CmpItemAbbr = { fg = colors.overlay2 },
|
|
||||||
CmpItemKindText = { fg = colors.text },
|
|
||||||
|
|
||||||
-- CmpKind
|
|
||||||
CmpItemKindBladeNav = { fg = "#f55247" },
|
|
||||||
|
|
||||||
-- telescope
|
|
||||||
TelescopeNormal = { link = "NormalFloat" },
|
|
||||||
TelescopeBorder = { link = "FloatBorder" },
|
|
||||||
TelescopeTitle = { link = "FloatTitle" },
|
|
||||||
TelescopePromptNormal = { bg = colors.mantle },
|
|
||||||
TelescopePromptPrefix = { fg = colors.mauve },
|
|
||||||
TelescopePromptBorder = { fg = colors.mantle, bg = colors.mantle },
|
|
||||||
TelescopePreviewTitle = { fg = colors.crust, bg = colors.mauve },
|
|
||||||
TelescopeResultsNormal = { fg = colors.text, bg = colors.crust },
|
|
||||||
TelescopeResultsClass = { link = "CmpItemKindClass" },
|
|
||||||
TelescopeResultsInterface = { link = "CmpItemKindInterface" },
|
|
||||||
TelescopeResultsField = { link = "CmpItemKindField" },
|
|
||||||
TelescopeResultsFunction = { link = "CmpItemKindFunction" },
|
|
||||||
TelescopeResultsMethod = { link = "CmpItemKindMethod" },
|
|
||||||
TelescopeResultsNumber = { link = "CmpItemKindNumber" },
|
|
||||||
TelescopeResultsStruct = { link = "CmpItemKindStruct" },
|
|
||||||
TelescopeResultsConstant = { link = "CmpItemKindConstant" },
|
|
||||||
TelescopeResultsOperator = { link = "CmpItemKindOperator" },
|
|
||||||
TelescopeResultsVariable = { link = "CmpItemKindVariable" },
|
|
||||||
TelescopeResultsIdentifier = { link = "CmpItemKindIdentifier" },
|
|
||||||
TelescopeMatching = { fg = colors.lavender },
|
|
||||||
TelescopeSelection = { fg = colors.text, bg = colors.surface1 },
|
|
||||||
TelescopeIndicatorModified = { fg = colors.yellow },
|
|
||||||
TelescopeIndicatorReadonly = { fg = colors.red },
|
|
||||||
TelescopeIndicatorHidden = { link = "TelescopeResultsComment" },
|
|
||||||
|
|
||||||
-- Ufo
|
|
||||||
UfoFoldedEllipsis = { link = "Comment" },
|
|
||||||
|
|
||||||
-- Statusline
|
|
||||||
|
|
||||||
-- Something resets StatusLine highlight background, so use another one for now :)
|
|
||||||
-- StatusLine = { fg = colors.text, bg = colors.crust },
|
|
||||||
StatusLineLualine = { fg = colors.text, bg = colors.crust },
|
|
||||||
|
|
||||||
StatusLineNormal = { link = "StatusLineLualine" },
|
|
||||||
StatusLineSeparator = { fg = colors.rosewater, bg = colors.crust },
|
|
||||||
StatusLineInsert = { fg = colors.base, bg = colors.blue },
|
|
||||||
StatusLineVisual = { fg = colors.base, bg = colors.mauve },
|
|
||||||
StatusLineCommand = { fg = colors.base, bg = colors.yellow },
|
|
||||||
StatusLineReplace = { fg = colors.base, bg = colors.maroon },
|
|
||||||
|
|
||||||
-- Neotree
|
|
||||||
NeoTreeTabActive = { bg = colors.surface2, fg = colors.lavender },
|
|
||||||
NeoTreeTabInactive = { bg = colors.crust, fg = colors.surface2 },
|
|
||||||
NeoTreeTabSeparatorActive = { fg = colors.base, bg = colors.surface2 },
|
|
||||||
NeoTreeTabSeparatorInactive = { fg = colors.base, bg = colors.crust },
|
|
||||||
NeoTreeFileIcon = { link = "Normal" },
|
|
||||||
NeoTreeModified = { fg = colors.yellow },
|
|
||||||
NeoTreeWinSeparator = { link = "WinSeparator" },
|
|
||||||
|
|
||||||
-- BlinkCmp
|
|
||||||
BlinkCmpLabel = { link = 'CmpItemAbbr' },
|
|
||||||
BlinkCmpLabelMatch = { link = 'CmpItemAbbrMatch' },
|
|
||||||
BlinkCmpLabelDeprecated = { link = 'CmpItemAbbrDeprecated'},
|
|
||||||
BlinkCmpLabelDetail = { link = 'CmpItemMenu' },
|
|
||||||
BlinkCmpLabelDescription = { link = 'CmpItemMenu' },
|
|
||||||
|
|
||||||
BlinkCmpSource = { link = 'CmpItemMenu' },
|
|
||||||
BlinkCmpKind = { link = 'CmpItemKind' },
|
|
||||||
BlinkCmpKindText = { link = "CmpItemKindText" },
|
|
||||||
BlinkCmpKindMethod = { link = "CmpItemKindMethod" },
|
|
||||||
BlinkCmpKindFunction = { link = "CmpItemKindFunction" },
|
|
||||||
BlinkCmpKindConstructor = { link = "CmpItemKindConstructor" },
|
|
||||||
BlinkCmpKindField = { link = "CmpItemKindField" },
|
|
||||||
BlinkCmpKindVariable = { link = "CmpItemKindVariable" },
|
|
||||||
BlinkCmpKindClass = { link = "CmpItemKindClass" },
|
|
||||||
BlinkCmpKindInterface = { link = "CmpItemKindInterface" },
|
|
||||||
BlinkCmpKindModule = { link = "CmpItemKindModule" },
|
|
||||||
BlinkCmpKindProperty = { link = "CmpItemKindProperty" },
|
|
||||||
BlinkCmpKindUnit = { link = "CmpItemKindUnit" },
|
|
||||||
BlinkCmpKindValue = { link = "CmpItemKindValue" },
|
|
||||||
BlinkCmpKindEnum = { link = "CmpItemKindEnum" },
|
|
||||||
BlinkCmpKindKeyword = { link = "CmpItemKindKeyword" },
|
|
||||||
BlinkCmpKindSnippet = { link = "CmpItemKindSnippet" },
|
|
||||||
BlinkCmpKindColor = { link = "CmpItemKindColor" },
|
|
||||||
BlinkCmpKindFile = { link = "CmpItemKindFile" },
|
|
||||||
BlinkCmpKindReference = { link = "CmpItemKindReference" },
|
|
||||||
BlinkCmpKindFolder = { link = "CmpItemKindFolder" },
|
|
||||||
BlinkCmpKindEnumMember = { link = "CmpItemKindEnumMember" },
|
|
||||||
BlinkCmpKindConstant = { link = "CmpItemKindConstant" },
|
|
||||||
BlinkCmpKindStruct = { link = "CmpItemKindStruct" },
|
|
||||||
BlinkCmpKindEvent = { link = "CmpItemKindEvent" },
|
|
||||||
BlinkCmpKindOperator = { link = "CmpItemKindOperator" },
|
|
||||||
BlinkCmpKindTypeParameter = { link = "CmpItemKindTypeParameter" },
|
|
||||||
|
|
||||||
-- Neotest
|
|
||||||
NeoTestWinSelect = { fg = colors.mauve },
|
|
||||||
NeoTestIndent = { fg = colors.surface1 },
|
|
||||||
NeoTestExpandMarker = { link = "NeoTestIndent" },
|
|
||||||
NeoTestAdapterName = { fg = colors.mauve },
|
|
||||||
NeoTestFile = { fg = colors.lavender },
|
|
||||||
NeoTestDir = { fg = colors.blue },
|
|
||||||
NeoTestTarget = { fg = colors.blue },
|
|
||||||
NeoTestNamespace = { fg = colors.mauve },
|
|
||||||
NeoTestPassed = { fg = colors.green },
|
|
||||||
NeoTestFailed = { fg = colors.red },
|
|
||||||
NeoTestSkipped = { fg = colors.blue },
|
|
||||||
NeoTestRunning = { fg = colors.yellow },
|
|
||||||
NeoTestWatching = { fg = colors.yellow },
|
|
||||||
NeoTestMarked = { fg = colors.orange },
|
|
||||||
|
|
||||||
-- Diagnostics
|
|
||||||
DiagnosticUnderlineInfo = { style = {"undercurl"} },
|
|
||||||
DiagnosticUnderlineHint = { style = {"undercurl"} },
|
|
||||||
DiagnosticUnderlineWarn = { style = {"undercurl"} },
|
|
||||||
DiagnosticUnderlineError = { style = {"undercurl"} },
|
|
||||||
|
|
||||||
-- Markdown rendering
|
|
||||||
RenderMarkdownCode = { bg = colors.crust },
|
|
||||||
RenderMarkdownCodeInline = { fg = colors.rosewater, bg = colors.crust },
|
|
||||||
|
|
||||||
-- Syntax
|
|
||||||
PreProc = { fg = colors.mauve },
|
|
||||||
Operator = { fg = colors.flamingo },
|
|
||||||
Function = { link = "@text" },
|
|
||||||
Delimiter = { link = "Operator" },
|
|
||||||
Keyword = { fg = colors.yellow },
|
|
||||||
Include = { link = "Keyword" },
|
|
||||||
Repeat = { link = "Keyword" },
|
|
||||||
Conditional = { link = "Keyword" },
|
|
||||||
Type = { fg = colors.blue },
|
|
||||||
Label = { link = "String" },
|
|
||||||
String = { fg = colors.lavender },
|
|
||||||
Exception = { link = "Keyword" },
|
|
||||||
|
|
||||||
-- Treesitter tokens
|
|
||||||
["@constructor"] = { link = "Function" },
|
|
||||||
["@variable"] = { fg = colors.green },
|
|
||||||
["@variable.builtin"] = { link = "@variable" },
|
|
||||||
["@variable.parameter"] = { link = "@parameter" },
|
|
||||||
["@variable.member"] = { link = "@variable" },
|
|
||||||
["@parameter"] = { link = "@variable" },
|
|
||||||
["@keyword.function"] = { link = "Keyword" },
|
|
||||||
["@keyword.return"] = { link = "Keyword" },
|
|
||||||
["@keyword.operator"] = { link = "Keyword" },
|
|
||||||
["@property"] = { link = "@variable" },
|
|
||||||
["@tag"] = { link = "Keyword" },
|
|
||||||
["@tag.delimiter"] = { link = "@text" },
|
|
||||||
["@module"] = { link = "@text" },
|
|
||||||
["@namespace"] = { link = "@keyword" },
|
|
||||||
["@punctuation.bracket"] = { link = "@punctuation" },
|
|
||||||
|
|
||||||
-- LSP
|
|
||||||
["@lsp.type.property"] = { link = "@variable" },
|
|
||||||
["@lsp.type.namespace.go"] = { fg = colors.rosewater },
|
|
||||||
|
|
||||||
-- Bash
|
|
||||||
["@variable.parameter.bash"] = { fg = colors.rosewater },
|
|
||||||
|
|
||||||
-- Makefile
|
|
||||||
["@function.make"] = { link = "Keyword" },
|
|
||||||
["@string.special.symbol.make"] = { link = "@variable" },
|
|
||||||
|
|
||||||
-- Markup
|
|
||||||
["@markup.raw"] = { link = "@text" },
|
|
||||||
["@markup.strong"] = { fg = colors.blue },
|
|
||||||
["@markup.italic"] = { fg = colors.green },
|
|
||||||
|
|
||||||
-- PHP
|
|
||||||
["@keyword.import.php"] = { link = "@keyword" },
|
|
||||||
["@function.builtin.php"] = { fg = colors.blue },
|
|
||||||
["@class.name.php"] = { link = "@text" },
|
|
||||||
["@class.inherit.name.php"] = { link = "@text" },
|
|
||||||
["@class.implements.name.php"] = { link = "@text" },
|
|
||||||
["@interface.name.php"] = { link = "@text" },
|
|
||||||
["@namespace.name.php"] = { link = "@text" },
|
|
||||||
["@namespace.alias.name.php"] = { link = "@text" },
|
|
||||||
["@use.trait.name.php"] = { link = "@text" },
|
|
||||||
|
|
||||||
-- Blade
|
|
||||||
["@tag.blade"] = { fg = colors.mauve },
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
integrations = {
|
|
||||||
cmp = true,
|
|
||||||
treesitter = true,
|
|
||||||
neotree = true,
|
|
||||||
-- barbar = true,
|
|
||||||
-- noice = true,
|
|
||||||
telescope = {
|
|
||||||
enabled = true,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
"catppuccin/nvim",
|
|
||||||
name = "catppuccin",
|
|
||||||
lazy = false,
|
|
||||||
priority = 1000,
|
|
||||||
opts = options,
|
|
||||||
config = function(_, opts)
|
|
||||||
require("catppuccin").setup(opts)
|
|
||||||
vim.cmd.colorscheme("catppuccin")
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
@ -1,172 +1,30 @@
|
||||||
local icons = require('user.icons')
|
|
||||||
|
--
|
||||||
|
-- This functions include plugins that adds editing functionality
|
||||||
|
-- to the editor in some way.
|
||||||
|
--
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{ import = "user.plugins.editor.treesitter" },
|
{ import = "user.plugins.editor.treesitter" },
|
||||||
{ 'echasnovski/mini.pairs', version = '*', opts = {}},
|
|
||||||
{ 'echasnovski/mini.ai', version = '*', opts = {}},
|
|
||||||
{ 'echasnovski/mini.surround', version = '*', opts ={}},
|
|
||||||
{
|
|
||||||
"mbbill/undotree",
|
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
|
||||||
},
|
|
||||||
-- color highlight in documents
|
|
||||||
{
|
|
||||||
'brenoprata10/nvim-highlight-colors',
|
|
||||||
opts = {
|
|
||||||
render = 'virtual',
|
|
||||||
virtual_symbol_position = 'eol',
|
|
||||||
virtual_symbol_prefix = '',
|
|
||||||
virtual_symbol_suffix = '',
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"folke/todo-comments.nvim",
|
|
||||||
dependencies = { "nvim-lua/plenary.nvim" },
|
|
||||||
opts = {
|
|
||||||
signs = false,
|
|
||||||
keywords = {
|
|
||||||
TODO = { color = "warning" },
|
|
||||||
},
|
|
||||||
highlight = {
|
|
||||||
keyword = 'fg',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"pnx/mini.bufremove",
|
|
||||||
opts = {
|
|
||||||
empty_buf = "Alpha"
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"lukas-reineke/indent-blankline.nvim",
|
|
||||||
main = "ibl",
|
|
||||||
opts = {
|
|
||||||
debounce = 10,
|
|
||||||
indent = {
|
|
||||||
char = icons.indent,
|
|
||||||
},
|
|
||||||
scope = {
|
|
||||||
enabled = false,
|
|
||||||
},
|
|
||||||
exclude = {
|
|
||||||
filetypes = {
|
|
||||||
"help",
|
|
||||||
"dashboard",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
config = function(_, opts)
|
|
||||||
require("ibl").setup(opts)
|
|
||||||
|
|
||||||
local hooks = require("ibl.hooks")
|
|
||||||
hooks.register(hooks.type.WHITESPACE, hooks.builtin.hide_first_tab_indent_level)
|
|
||||||
hooks.register(hooks.type.WHITESPACE, hooks.builtin.hide_first_space_indent_level)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
-- Better folds
|
-- Better folds
|
||||||
{ import = "user.plugins.editor.ufo" },
|
{ import = "user.plugins.editor.ufo" },
|
||||||
-- Better status column
|
|
||||||
{
|
-- Edit history
|
||||||
"luukvbaal/statuscol.nvim",
|
{ "mbbill/undotree", event = { "BufReadPre", "BufNewFile" } },
|
||||||
event = { "BufReadPre", "BufNewFile", "BufAdd" },
|
|
||||||
opts = function()
|
-- Autopairs
|
||||||
local builtin = require("statuscol.builtin")
|
{ 'echasnovski/mini.pairs', version = '*', opts = {}},
|
||||||
return {
|
|
||||||
-- Align current relative number to the right.
|
-- Better text objects.
|
||||||
relculright = true,
|
{ 'echasnovski/mini.ai', version = '*', opts = {}},
|
||||||
ft_ignore = {
|
|
||||||
'help',
|
-- I use this for crc,crs,crm (etc) binds to change between cases.
|
||||||
'alpha'
|
{ 'tpope/vim-abolish' },
|
||||||
},
|
|
||||||
segments = {
|
|
||||||
{
|
|
||||||
click = "v:lua.ScSa",
|
|
||||||
sign = {
|
|
||||||
namespace = { "gitsigns" },
|
|
||||||
maxwidth = 1,
|
|
||||||
colwidth = 1,
|
|
||||||
foldclosed = true,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
click = "v:lua.ScSa",
|
|
||||||
sign = {
|
|
||||||
name = { ".*" },
|
|
||||||
namespace = { ".*" },
|
|
||||||
maxwidth = 1,
|
|
||||||
foldclosed = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text = { " ", builtin.lnumfunc, " " },
|
|
||||||
click = "v:lua.ScLa",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text = { builtin.foldfunc, " " },
|
|
||||||
condition = { true, function (args) return args.fold.width > 0 end },
|
|
||||||
click = "v:lua.ScFa"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text = {
|
|
||||||
function(args)
|
|
||||||
local pos = vim.api.nvim_win_get_cursor(args.win)
|
|
||||||
return (args.lnum == pos[1] and "%#SignColumnSep#" or "")..icons.signcolum.separator
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{ import = "user.plugins.editor.gitsigns" },
|
|
||||||
-- Formatting
|
|
||||||
{
|
|
||||||
'stevearc/conform.nvim',
|
|
||||||
opts = {
|
|
||||||
default_format_opts = {
|
|
||||||
lsp_format = "fallback"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
init = function()
|
|
||||||
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
|
|
||||||
user.formatter = function(args)
|
|
||||||
local range = nil
|
|
||||||
if args.count ~= -1 then
|
|
||||||
local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
|
|
||||||
range = {
|
|
||||||
start = { args.line1, 0 },
|
|
||||||
["end"] = { args.line2, end_line:len() },
|
|
||||||
}
|
|
||||||
end
|
|
||||||
require("conform").format({ async = true, range = range })
|
|
||||||
end
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{ import = "user.plugins.editor.finder" },
|
|
||||||
{ import = "user.plugins.editor.autocomplete" },
|
|
||||||
-- Snippets
|
|
||||||
{
|
|
||||||
"L3MON4D3/LuaSnip",
|
|
||||||
lazy = true,
|
|
||||||
build = "make install_jsregexp",
|
|
||||||
dependencies = {
|
|
||||||
{
|
|
||||||
"rafamadriz/friendly-snippets",
|
|
||||||
config = function()
|
|
||||||
require("luasnip.loaders.from_vscode").lazy_load()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
opts = {},
|
|
||||||
config = function(_, opts)
|
|
||||||
require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/snippets" })
|
|
||||||
require("luasnip").setup(opts)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
-- {
|
-- {
|
||||||
-- "m4xshen/hardtime.nvim",
|
-- "pnx/mini.bufremove",
|
||||||
-- dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim" },
|
-- opts = {
|
||||||
-- opts = {}
|
-- empty_buf = "Alpha"
|
||||||
|
-- },
|
||||||
-- },
|
-- },
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,107 +0,0 @@
|
||||||
local icons = require('user.icons')
|
|
||||||
|
|
||||||
return {
|
|
||||||
'saghen/blink.cmp',
|
|
||||||
lazy = false,
|
|
||||||
version = "*",
|
|
||||||
build = 'cargo build --release',
|
|
||||||
dependencies = {
|
|
||||||
{ "xzbdmw/colorful-menu.nvim" },
|
|
||||||
{ 'L3MON4D3/LuaSnip', version = 'v2.*' },
|
|
||||||
},
|
|
||||||
opts = {
|
|
||||||
keymap = {
|
|
||||||
['<Up>'] = { 'select_prev', 'fallback' },
|
|
||||||
['<Down>'] = { 'select_next', 'fallback' },
|
|
||||||
['<C-p>'] = { 'select_prev', 'fallback' },
|
|
||||||
['<C-n>'] = { 'select_next', 'fallback' },
|
|
||||||
['<S-Tab>'] = {
|
|
||||||
function(cmp)
|
|
||||||
if cmp.snippet_active() then
|
|
||||||
return cmp.accept()
|
|
||||||
else
|
|
||||||
return cmp.select_prev()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
'snippet_backward',
|
|
||||||
'fallback'
|
|
||||||
},
|
|
||||||
|
|
||||||
['<Tab>'] = {
|
|
||||||
function(cmp)
|
|
||||||
if cmp.snippet_active() then
|
|
||||||
return cmp.accept()
|
|
||||||
else
|
|
||||||
return cmp.select_next()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
'snippet_forward',
|
|
||||||
'fallback'
|
|
||||||
},
|
|
||||||
['<CR>'] = { 'accept', 'fallback' },
|
|
||||||
},
|
|
||||||
appearance = {
|
|
||||||
nerd_font_variant = 'mono',
|
|
||||||
kind_icons = icons.symbols
|
|
||||||
},
|
|
||||||
sources = {
|
|
||||||
default = function(_)
|
|
||||||
local success, node = pcall(vim.treesitter.get_node)
|
|
||||||
if success and node and vim.tbl_contains({ 'comment', 'line_comment', 'block_comment' }, node:type()) then
|
|
||||||
return { 'buffer' }
|
|
||||||
else
|
|
||||||
return { 'lsp', 'path', 'snippets', 'buffer' }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
},
|
|
||||||
snippets = {
|
|
||||||
preset = 'luasnip',
|
|
||||||
expand = function(snippet) require('luasnip').lsp_expand(snippet) end,
|
|
||||||
active = function(filter)
|
|
||||||
if filter and filter.direction then
|
|
||||||
return require('luasnip').jumpable(filter.direction)
|
|
||||||
end
|
|
||||||
return require('luasnip').in_snippet()
|
|
||||||
end,
|
|
||||||
jump = function(direction) require('luasnip').jump(direction) end,
|
|
||||||
},
|
|
||||||
completion = {
|
|
||||||
menu = {
|
|
||||||
min_width = 18,
|
|
||||||
winblend = 10,
|
|
||||||
draw = {
|
|
||||||
columns = {
|
|
||||||
{ "kind_icon" },
|
|
||||||
{ "label", "source_name", gap = 1 },
|
|
||||||
},
|
|
||||||
components = {
|
|
||||||
label = {
|
|
||||||
text = function(ctx)
|
|
||||||
return require("colorful-menu").blink_components_text(ctx)
|
|
||||||
end,
|
|
||||||
highlight = function(ctx)
|
|
||||||
return require("colorful-menu").blink_components_highlight(ctx)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
documentation = {
|
|
||||||
auto_show = true,
|
|
||||||
window = {
|
|
||||||
winblend = 10
|
|
||||||
}
|
|
||||||
},
|
|
||||||
ghost_text = {
|
|
||||||
enabled = true,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
signature = {
|
|
||||||
enabled = true,
|
|
||||||
window = {
|
|
||||||
scrollbar = false,
|
|
||||||
winblend = 10,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
||||||
local icons = require('user.icons').diff_gutter
|
|
||||||
|
|
||||||
return {
|
|
||||||
"lewis6991/gitsigns.nvim",
|
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
|
||||||
dependencies = {
|
|
||||||
{
|
|
||||||
"folke/which-key.nvim",
|
|
||||||
optional = true,
|
|
||||||
opts = {
|
|
||||||
defaults = {
|
|
||||||
["<leader>g"] = { name = "+git" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
opts = {
|
|
||||||
signs = {
|
|
||||||
add = { text = icons.add },
|
|
||||||
delete = { text = icons.delete },
|
|
||||||
change = { text = icons.change },
|
|
||||||
untracked = { text = icons.untracked },
|
|
||||||
topdelete = { text = icons.delete },
|
|
||||||
changedelete = { text = icons.change },
|
|
||||||
},
|
|
||||||
signs_staged = {
|
|
||||||
add = { text = icons.add },
|
|
||||||
delete = { text = icons.delete },
|
|
||||||
change = { text = icons.change },
|
|
||||||
topdelete = { text = icons.delete },
|
|
||||||
changedelete = { text = icons.change },
|
|
||||||
},
|
|
||||||
diff_opts = {
|
|
||||||
internal = true
|
|
||||||
},
|
|
||||||
preview_config = {
|
|
||||||
border = { " " },
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
@ -1,85 +1,75 @@
|
||||||
return {
|
return {
|
||||||
{
|
"nvim-treesitter/nvim-treesitter",
|
||||||
"nvim-treesitter/nvim-treesitter",
|
build = function()
|
||||||
build = function()
|
require("nvim-treesitter.install").update({ with_sync = true })
|
||||||
require("nvim-treesitter.install").update({ with_sync = true })
|
end,
|
||||||
end,
|
opts_extend = { "ensure_installed" },
|
||||||
opts_extend = { "ensure_installed" },
|
opts = {
|
||||||
opts = {
|
-- Default parsers.
|
||||||
-- Default parsers.
|
ensure_installed = {
|
||||||
ensure_installed = {
|
-- VIM stuff
|
||||||
-- VIM stuff
|
"vim",
|
||||||
"vim",
|
"vimdoc",
|
||||||
"vimdoc",
|
"query",
|
||||||
"query",
|
|
||||||
|
|
||||||
-- Common config languages
|
-- Common config languages
|
||||||
"json",
|
"json",
|
||||||
"jsonc",
|
"jsonc",
|
||||||
"yaml",
|
"yaml",
|
||||||
"toml",
|
"toml",
|
||||||
"xml",
|
"xml",
|
||||||
"kdl",
|
"kdl",
|
||||||
|
|
||||||
-- misc
|
-- misc
|
||||||
"comment",
|
"comment",
|
||||||
"regex",
|
"regex",
|
||||||
"re2c",
|
"re2c",
|
||||||
"xresources",
|
"xresources",
|
||||||
"sql",
|
"sql",
|
||||||
"csv",
|
"csv",
|
||||||
"ssh_config",
|
"ssh_config",
|
||||||
"printf",
|
"printf",
|
||||||
"nginx",
|
"nginx",
|
||||||
},
|
|
||||||
|
|
||||||
auto_install = true,
|
|
||||||
|
|
||||||
highlight = {
|
|
||||||
enable = true,
|
|
||||||
additional_vim_regex_highlighting = false,
|
|
||||||
},
|
|
||||||
|
|
||||||
indent = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
|
||||||
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
|
||||||
|
|
||||||
parser_config.blade = {
|
auto_install = true,
|
||||||
install_info = {
|
|
||||||
url = "https://github.com/EmranMR/tree-sitter-blade",
|
|
||||||
branch = "main",
|
|
||||||
files = { "src/parser.c" },
|
|
||||||
},
|
|
||||||
filetype = "blade",
|
|
||||||
}
|
|
||||||
|
|
||||||
parser_config.dotenv = {
|
highlight = {
|
||||||
install_info = {
|
enable = true,
|
||||||
url = "https://github.com/pnx/tree-sitter-dotenv",
|
additional_vim_regex_highlighting = false,
|
||||||
branch = "main",
|
},
|
||||||
files = { "src/parser.c", "src/scanner.c" },
|
|
||||||
},
|
indent = {
|
||||||
filetype = "dotenv",
|
enable = true,
|
||||||
}
|
|
||||||
|
|
||||||
vim.filetype.add({
|
|
||||||
pattern = {
|
|
||||||
['.env.*'] = 'dotenv',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
require("nvim-treesitter.configs").setup(opts)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"windwp/nvim-ts-autotag",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
},
|
},
|
||||||
event = "InsertEnter",
|
|
||||||
opts = {}
|
|
||||||
},
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
||||||
|
|
||||||
|
parser_config.blade = {
|
||||||
|
install_info = {
|
||||||
|
url = "https://github.com/EmranMR/tree-sitter-blade",
|
||||||
|
branch = "main",
|
||||||
|
files = { "src/parser.c" },
|
||||||
|
},
|
||||||
|
filetype = "blade",
|
||||||
|
}
|
||||||
|
|
||||||
|
parser_config.dotenv = {
|
||||||
|
install_info = {
|
||||||
|
url = "https://github.com/pnx/tree-sitter-dotenv",
|
||||||
|
branch = "main",
|
||||||
|
files = { "src/parser.c", "src/scanner.c" },
|
||||||
|
},
|
||||||
|
filetype = "dotenv",
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.filetype.add({
|
||||||
|
pattern = {
|
||||||
|
['.env.*'] = 'dotenv',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
require("nvim-treesitter.configs").setup(opts)
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
local icons = require('user.icons')
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
{ import = "user.plugins.ide.lsp" },
|
||||||
|
{ import = "user.plugins.ide.autocomplete" },
|
||||||
|
{ import = "user.plugins.ide.formatting" },
|
||||||
-- Linting
|
-- Linting
|
||||||
{
|
{
|
||||||
'mfussenegger/nvim-lint',
|
'mfussenegger/nvim-lint',
|
||||||
|
|
@ -17,47 +19,23 @@ return {
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
-- Testing integration
|
-- Snippets
|
||||||
{
|
{
|
||||||
"nvim-neotest/neotest",
|
"L3MON4D3/LuaSnip",
|
||||||
|
lazy = true,
|
||||||
|
build = "make install_jsregexp",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-neotest/nvim-nio",
|
{
|
||||||
"nvim-lua/plenary.nvim",
|
"rafamadriz/friendly-snippets",
|
||||||
"antoinemadec/FixCursorHold.nvim",
|
config = function()
|
||||||
"nvim-treesitter/nvim-treesitter"
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
},
|
end,
|
||||||
opts = {
|
|
||||||
floating = {
|
|
||||||
border = "none",
|
|
||||||
},
|
|
||||||
output = {
|
|
||||||
enabled = true,
|
|
||||||
open_on_run = true,
|
|
||||||
},
|
|
||||||
icons = {
|
|
||||||
child_indent = icons.tree.vertical,
|
|
||||||
child_prefix = icons.tree.node,
|
|
||||||
collapsed = icons.tree.horizontal,
|
|
||||||
non_collapsible = icons.tree.horizontal,
|
|
||||||
expanded = icons.tree.expanded,
|
|
||||||
final_child_indent = " ",
|
|
||||||
final_child_prefix = icons.tree.nodelast,
|
|
||||||
running_animated = { "⠋", "⠙", "⠚", "⠞", "⠖", "⠦", "⠴", "⠲", "⠳", "⠓" },
|
|
||||||
passed = icons.test.ok,
|
|
||||||
failed = icons.test.failed,
|
|
||||||
running = icons.test.running,
|
|
||||||
skipped = icons.test.skipped,
|
|
||||||
unknown = icons.test.unknown,
|
|
||||||
watching = icons.test.watch,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
opts = {},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
local adapters = {}
|
require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/snippets" })
|
||||||
for name, adapter_opts in pairs(opts.adapters or {}) do
|
require("luasnip").setup(opts)
|
||||||
table.insert(adapters, require(name)(adapter_opts))
|
end,
|
||||||
end
|
},
|
||||||
opts.adapters = adapters
|
|
||||||
require('neotest').setup(opts)
|
|
||||||
end
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
66
nvim/lua/user/plugins/ide/autocomplete.lua
Normal file
66
nvim/lua/user/plugins/ide/autocomplete.lua
Normal file
|
|
@ -0,0 +1,66 @@
|
||||||
|
local icons = require('user.icons')
|
||||||
|
|
||||||
|
return {
|
||||||
|
'saghen/blink.cmp',
|
||||||
|
lazy = false,
|
||||||
|
version = "*",
|
||||||
|
build = 'cargo build --release',
|
||||||
|
dependencies = {
|
||||||
|
{ "xzbdmw/colorful-menu.nvim" },
|
||||||
|
{ 'L3MON4D3/LuaSnip', version = 'v2.*' },
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
keymap = {
|
||||||
|
preset = "super-tab"
|
||||||
|
},
|
||||||
|
appearance = {
|
||||||
|
nerd_font_variant = 'mono',
|
||||||
|
kind_icons = icons.symbols
|
||||||
|
},
|
||||||
|
completion = {
|
||||||
|
list = {
|
||||||
|
selection = {
|
||||||
|
preselect = function(ctx) return ctx.mode ~= 'cmdline' end,
|
||||||
|
-- auto_insert = function(ctx) return ctx.mode ~= 'cmdline' end
|
||||||
|
auto_insert = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
menu = {
|
||||||
|
min_width = 18,
|
||||||
|
winblend = 10,
|
||||||
|
draw = {
|
||||||
|
columns = {
|
||||||
|
{ "kind_icon" },
|
||||||
|
{ "label", "source_name", gap = 1 },
|
||||||
|
},
|
||||||
|
components = {
|
||||||
|
label = {
|
||||||
|
text = function(ctx)
|
||||||
|
return require("colorful-menu").blink_components_text(ctx)
|
||||||
|
end,
|
||||||
|
highlight = function(ctx)
|
||||||
|
return require("colorful-menu").blink_components_highlight(ctx)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
documentation = {
|
||||||
|
auto_show = true,
|
||||||
|
window = {
|
||||||
|
winblend = 10
|
||||||
|
}
|
||||||
|
},
|
||||||
|
ghost_text = {
|
||||||
|
enabled = true,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
signature = {
|
||||||
|
enabled = true,
|
||||||
|
window = {
|
||||||
|
scrollbar = false,
|
||||||
|
winblend = 10,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
22
nvim/lua/user/plugins/ide/formatting.lua
Normal file
22
nvim/lua/user/plugins/ide/formatting.lua
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
return {
|
||||||
|
'stevearc/conform.nvim',
|
||||||
|
opts = {
|
||||||
|
default_format_opts = {
|
||||||
|
lsp_format = "fallback"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
init = function()
|
||||||
|
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
|
||||||
|
user.formatter = function(args)
|
||||||
|
local range = nil
|
||||||
|
if args.count ~= -1 then
|
||||||
|
local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
|
||||||
|
range = {
|
||||||
|
start = { args.line1, 0 },
|
||||||
|
["end"] = { args.line2, end_line:len() },
|
||||||
|
}
|
||||||
|
end
|
||||||
|
require("conform").format({ async = true, range = range })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
}
|
||||||
45
nvim/lua/user/plugins/ide/test.lua
Normal file
45
nvim/lua/user/plugins/ide/test.lua
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
local icons = require('user.icons')
|
||||||
|
|
||||||
|
return {
|
||||||
|
"nvim-neotest/neotest",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-neotest/nvim-nio",
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"antoinemadec/FixCursorHold.nvim",
|
||||||
|
"nvim-treesitter/nvim-treesitter"
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
floating = {
|
||||||
|
border = "none",
|
||||||
|
},
|
||||||
|
output = {
|
||||||
|
enabled = true,
|
||||||
|
open_on_run = true,
|
||||||
|
},
|
||||||
|
icons = {
|
||||||
|
child_indent = icons.tree.vertical,
|
||||||
|
child_prefix = icons.tree.node,
|
||||||
|
collapsed = icons.tree.horizontal,
|
||||||
|
non_collapsible = icons.tree.horizontal,
|
||||||
|
expanded = icons.tree.expanded,
|
||||||
|
final_child_indent = " ",
|
||||||
|
final_child_prefix = icons.tree.nodelast,
|
||||||
|
running_animated = { "⠋", "⠙", "⠚", "⠞", "⠖", "⠦", "⠴", "⠲", "⠳", "⠓" },
|
||||||
|
passed = icons.test.ok,
|
||||||
|
failed = icons.test.failed,
|
||||||
|
running = icons.test.running,
|
||||||
|
skipped = icons.test.skipped,
|
||||||
|
unknown = icons.test.unknown,
|
||||||
|
watching = icons.test.watch,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
local adapters = {}
|
||||||
|
for name, adapter_opts in pairs(opts.adapters or {}) do
|
||||||
|
table.insert(adapters, require(name)(adapter_opts))
|
||||||
|
end
|
||||||
|
opts.adapters = adapters
|
||||||
|
require('neotest').setup(opts)
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
13
nvim/lua/user/plugins/tools.lua
Normal file
13
nvim/lua/user/plugins/tools.lua
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
return {
|
||||||
|
{ import = "user.plugins.tools.finder" },
|
||||||
|
{
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
build = ":MasonUpdate",
|
||||||
|
cmd = "Mason",
|
||||||
|
opts_extend = { "ensure_installed" },
|
||||||
|
opts = {},
|
||||||
|
config = function(_, opts)
|
||||||
|
require("mason").setup(opts)
|
||||||
|
end
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,45 @@
|
||||||
local ui = require("user.ui.telescope")
|
local ui = require("user.ui.telescope")
|
||||||
|
local icons = require('user.icons')
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
{ import = "user.plugins.ui.dashboard" },
|
||||||
|
|
||||||
|
{ import = "user.plugins.ui.editor" },
|
||||||
|
|
||||||
|
{ import = "user.plugins.ui.colorscheme" },
|
||||||
|
{ import = "user.plugins.ui.statusline" },
|
||||||
|
{ import = "user.plugins.ui.statuscolumn" },
|
||||||
|
{ import = "user.plugins.ui.gitsigns" },
|
||||||
|
-- File explorer
|
||||||
|
{ import = "user.plugins.ui.neotree" },
|
||||||
|
|
||||||
|
{ "folke/which-key.nvim", event = "VeryLazy" },
|
||||||
|
|
||||||
|
-- Icons
|
||||||
|
{
|
||||||
|
'nvim-tree/nvim-web-devicons',
|
||||||
|
opts = {
|
||||||
|
override = {
|
||||||
|
php = {
|
||||||
|
icon = icons.filetypes.php,
|
||||||
|
color = "#4F5B93",
|
||||||
|
name = "Php"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
override_by_filename = {
|
||||||
|
["artisan"] = {
|
||||||
|
icon = icons.filetypes.laravel,
|
||||||
|
color = "#f05340",
|
||||||
|
name = "LaravelArtisan"
|
||||||
|
},
|
||||||
|
["phpunit.xml"] = {
|
||||||
|
icon = icons.filetypes.phpunit,
|
||||||
|
color = "#0d6efd",
|
||||||
|
name = "PhpUnit"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'stevearc/dressing.nvim',
|
'stevearc/dressing.nvim',
|
||||||
opts = {
|
opts = {
|
||||||
|
|
@ -27,9 +66,6 @@ return {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ import = "user.plugins.ui.statusline" },
|
|
||||||
-- File explorer
|
|
||||||
{ import = "user.plugins.ui.neotree" },
|
|
||||||
-- Nicer notifications
|
-- Nicer notifications
|
||||||
{
|
{
|
||||||
"j-hui/fidget.nvim",
|
"j-hui/fidget.nvim",
|
||||||
|
|
@ -48,8 +84,4 @@ return {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"folke/which-key.nvim",
|
|
||||||
event = "VeryLazy",
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
258
nvim/lua/user/plugins/ui/colorscheme.lua
Normal file
258
nvim/lua/user/plugins/ui/colorscheme.lua
Normal file
|
|
@ -0,0 +1,258 @@
|
||||||
|
|
||||||
|
local custom_highlights = function(colors)
|
||||||
|
return {
|
||||||
|
CursorLine = { bg = colors.surface0 },
|
||||||
|
SignColumnSep = { bg = colors.surface0, fg = colors.lavender },
|
||||||
|
|
||||||
|
Visual = { bg = colors.surface1 },
|
||||||
|
FoldColumn = { fg = colors.surface2 },
|
||||||
|
|
||||||
|
-- Floating windows
|
||||||
|
NormalFloat = { fg = colors.text, bg = colors.crust },
|
||||||
|
FloatTitle = { fg = colors.base, bg = colors.blue },
|
||||||
|
FloatBorder = { fg = colors.surface1, bg = colors.crust },
|
||||||
|
|
||||||
|
-- Window separator
|
||||||
|
WinSeparator = { fg = colors.surface0 },
|
||||||
|
|
||||||
|
-- Menus
|
||||||
|
Pmenu = { link = "NormalFloat" },
|
||||||
|
PmenuSel = { bg = colors.surface2 },
|
||||||
|
PmenuSbar = { link = "Pmenu" },
|
||||||
|
PmenuThumb = { link = "PmenuSel" },
|
||||||
|
|
||||||
|
-- NoiceMini = { link = "NormalFloat" },
|
||||||
|
WhichKeyFloat = { link = "Pmenu" },
|
||||||
|
|
||||||
|
-- indent lines
|
||||||
|
IblScope = { fg = colors.surface0 },
|
||||||
|
|
||||||
|
-- Search matches
|
||||||
|
IncSearch = { bg = colors.yellow },
|
||||||
|
|
||||||
|
-- Autocomplete window
|
||||||
|
CmpItemAbbr = { fg = colors.overlay2 },
|
||||||
|
CmpItemKindText = { fg = colors.text },
|
||||||
|
|
||||||
|
-- CmpKind
|
||||||
|
CmpItemKindBladeNav = { fg = "#f55247" },
|
||||||
|
|
||||||
|
-- telescope
|
||||||
|
TelescopeNormal = { link = "NormalFloat" },
|
||||||
|
TelescopeBorder = { link = "FloatBorder" },
|
||||||
|
TelescopeTitle = { link = "FloatTitle" },
|
||||||
|
TelescopePromptNormal = { bg = colors.mantle },
|
||||||
|
TelescopePromptPrefix = { fg = colors.mauve },
|
||||||
|
TelescopePromptBorder = { fg = colors.mantle, bg = colors.mantle },
|
||||||
|
TelescopePreviewTitle = { fg = colors.crust, bg = colors.mauve },
|
||||||
|
TelescopeResultsNormal = { fg = colors.text, bg = colors.crust },
|
||||||
|
TelescopeResultsClass = { link = "CmpItemKindClass" },
|
||||||
|
TelescopeResultsInterface = { link = "CmpItemKindInterface" },
|
||||||
|
TelescopeResultsField = { link = "CmpItemKindField" },
|
||||||
|
TelescopeResultsFunction = { link = "CmpItemKindFunction" },
|
||||||
|
TelescopeResultsMethod = { link = "CmpItemKindMethod" },
|
||||||
|
TelescopeResultsNumber = { link = "CmpItemKindNumber" },
|
||||||
|
TelescopeResultsStruct = { link = "CmpItemKindStruct" },
|
||||||
|
TelescopeResultsConstant = { link = "CmpItemKindConstant" },
|
||||||
|
TelescopeResultsOperator = { link = "CmpItemKindOperator" },
|
||||||
|
TelescopeResultsVariable = { link = "CmpItemKindVariable" },
|
||||||
|
TelescopeResultsIdentifier = { link = "CmpItemKindIdentifier" },
|
||||||
|
TelescopeMatching = { fg = colors.lavender },
|
||||||
|
TelescopeSelection = { fg = colors.text, bg = colors.surface1 },
|
||||||
|
TelescopeIndicatorModified = { fg = colors.yellow },
|
||||||
|
TelescopeIndicatorReadonly = { fg = colors.red },
|
||||||
|
TelescopeIndicatorHidden = { link = "TelescopeResultsComment" },
|
||||||
|
|
||||||
|
-- Ufo
|
||||||
|
UfoFoldedEllipsis = { link = "Comment" },
|
||||||
|
|
||||||
|
-- Statusline
|
||||||
|
|
||||||
|
-- Something resets StatusLine highlight background, so use another one for now :)
|
||||||
|
-- StatusLine = { fg = colors.text, bg = colors.crust },
|
||||||
|
StatusLineLualine = { fg = colors.text, bg = colors.crust },
|
||||||
|
|
||||||
|
StatusLineNormal = { link = "StatusLineLualine" },
|
||||||
|
StatusLineSeparator = { fg = colors.rosewater, bg = colors.crust },
|
||||||
|
StatusLineInsert = { fg = colors.base, bg = colors.blue },
|
||||||
|
StatusLineVisual = { fg = colors.base, bg = colors.mauve },
|
||||||
|
StatusLineCommand = { fg = colors.base, bg = colors.yellow },
|
||||||
|
StatusLineReplace = { fg = colors.base, bg = colors.maroon },
|
||||||
|
|
||||||
|
-- Neotree
|
||||||
|
NeoTreeTabActive = { bg = colors.surface2, fg = colors.lavender },
|
||||||
|
NeoTreeTabInactive = { bg = colors.crust, fg = colors.surface2 },
|
||||||
|
NeoTreeTabSeparatorActive = { fg = colors.base, bg = colors.surface2 },
|
||||||
|
NeoTreeTabSeparatorInactive = { fg = colors.base, bg = colors.crust },
|
||||||
|
NeoTreeFileIcon = { link = "Normal" },
|
||||||
|
NeoTreeModified = { fg = colors.yellow },
|
||||||
|
NeoTreeWinSeparator = { link = "WinSeparator" },
|
||||||
|
|
||||||
|
-- BlinkCmp
|
||||||
|
BlinkCmpLabel = { link = 'CmpItemAbbr' },
|
||||||
|
BlinkCmpLabelMatch = { link = 'CmpItemAbbrMatch' },
|
||||||
|
BlinkCmpLabelDeprecated = { link = 'CmpItemAbbrDeprecated'},
|
||||||
|
BlinkCmpLabelDetail = { link = 'CmpItemMenu' },
|
||||||
|
BlinkCmpLabelDescription = { link = 'CmpItemMenu' },
|
||||||
|
|
||||||
|
BlinkCmpSource = { link = 'CmpItemMenu' },
|
||||||
|
BlinkCmpKind = { link = 'CmpItemKind' },
|
||||||
|
BlinkCmpKindText = { link = "CmpItemKindText" },
|
||||||
|
BlinkCmpKindMethod = { link = "CmpItemKindMethod" },
|
||||||
|
BlinkCmpKindFunction = { link = "CmpItemKindFunction" },
|
||||||
|
BlinkCmpKindConstructor = { link = "CmpItemKindConstructor" },
|
||||||
|
BlinkCmpKindField = { link = "CmpItemKindField" },
|
||||||
|
BlinkCmpKindVariable = { link = "CmpItemKindVariable" },
|
||||||
|
BlinkCmpKindClass = { link = "CmpItemKindClass" },
|
||||||
|
BlinkCmpKindInterface = { link = "CmpItemKindInterface" },
|
||||||
|
BlinkCmpKindModule = { link = "CmpItemKindModule" },
|
||||||
|
BlinkCmpKindProperty = { link = "CmpItemKindProperty" },
|
||||||
|
BlinkCmpKindUnit = { link = "CmpItemKindUnit" },
|
||||||
|
BlinkCmpKindValue = { link = "CmpItemKindValue" },
|
||||||
|
BlinkCmpKindEnum = { link = "CmpItemKindEnum" },
|
||||||
|
BlinkCmpKindKeyword = { link = "CmpItemKindKeyword" },
|
||||||
|
BlinkCmpKindSnippet = { link = "CmpItemKindSnippet" },
|
||||||
|
BlinkCmpKindColor = { link = "CmpItemKindColor" },
|
||||||
|
BlinkCmpKindFile = { link = "CmpItemKindFile" },
|
||||||
|
BlinkCmpKindReference = { link = "CmpItemKindReference" },
|
||||||
|
BlinkCmpKindFolder = { link = "CmpItemKindFolder" },
|
||||||
|
BlinkCmpKindEnumMember = { link = "CmpItemKindEnumMember" },
|
||||||
|
BlinkCmpKindConstant = { link = "CmpItemKindConstant" },
|
||||||
|
BlinkCmpKindStruct = { link = "CmpItemKindStruct" },
|
||||||
|
BlinkCmpKindEvent = { link = "CmpItemKindEvent" },
|
||||||
|
BlinkCmpKindOperator = { link = "CmpItemKindOperator" },
|
||||||
|
BlinkCmpKindTypeParameter = { link = "CmpItemKindTypeParameter" },
|
||||||
|
|
||||||
|
-- Neotest
|
||||||
|
NeoTestWinSelect = { fg = colors.mauve },
|
||||||
|
NeoTestIndent = { fg = colors.surface1 },
|
||||||
|
NeoTestExpandMarker = { link = "NeoTestIndent" },
|
||||||
|
NeoTestAdapterName = { fg = colors.mauve },
|
||||||
|
NeoTestFile = { fg = colors.lavender },
|
||||||
|
NeoTestDir = { fg = colors.blue },
|
||||||
|
NeoTestTarget = { fg = colors.blue },
|
||||||
|
NeoTestNamespace = { fg = colors.mauve },
|
||||||
|
NeoTestPassed = { fg = colors.green },
|
||||||
|
NeoTestFailed = { fg = colors.red },
|
||||||
|
NeoTestSkipped = { fg = colors.blue },
|
||||||
|
NeoTestRunning = { fg = colors.yellow },
|
||||||
|
NeoTestWatching = { fg = colors.yellow },
|
||||||
|
NeoTestMarked = { fg = colors.orange },
|
||||||
|
|
||||||
|
-- Diagnostics
|
||||||
|
DiagnosticUnderlineInfo = { style = {"undercurl"} },
|
||||||
|
DiagnosticUnderlineHint = { style = {"undercurl"} },
|
||||||
|
DiagnosticUnderlineWarn = { style = {"undercurl"} },
|
||||||
|
DiagnosticUnderlineError = { style = {"undercurl"} },
|
||||||
|
|
||||||
|
-- Markdown rendering
|
||||||
|
RenderMarkdownCode = { bg = colors.crust },
|
||||||
|
RenderMarkdownCodeInline = { fg = colors.rosewater, bg = colors.crust },
|
||||||
|
|
||||||
|
-- Syntax
|
||||||
|
PreProc = { fg = colors.mauve },
|
||||||
|
Operator = { fg = colors.flamingo },
|
||||||
|
Function = { link = "@text" },
|
||||||
|
Delimiter = { link = "Operator" },
|
||||||
|
Keyword = { fg = colors.yellow },
|
||||||
|
Include = { link = "Keyword" },
|
||||||
|
Repeat = { link = "Keyword" },
|
||||||
|
Conditional = { link = "Keyword" },
|
||||||
|
Type = { fg = colors.blue },
|
||||||
|
Label = { link = "String" },
|
||||||
|
String = { fg = colors.lavender },
|
||||||
|
Exception = { link = "Keyword" },
|
||||||
|
|
||||||
|
-- Treesitter tokens
|
||||||
|
["@constructor"] = { link = "Function" },
|
||||||
|
["@variable"] = { fg = colors.green },
|
||||||
|
["@variable.builtin"] = { link = "@variable" },
|
||||||
|
["@variable.parameter"] = { link = "@parameter" },
|
||||||
|
["@variable.member"] = { link = "@variable" },
|
||||||
|
["@parameter"] = { link = "@variable" },
|
||||||
|
["@keyword.function"] = { link = "Keyword" },
|
||||||
|
["@keyword.return"] = { link = "Keyword" },
|
||||||
|
["@keyword.operator"] = { link = "Keyword" },
|
||||||
|
["@property"] = { link = "@variable" },
|
||||||
|
["@tag"] = { link = "Keyword" },
|
||||||
|
["@tag.delimiter"] = { link = "@text" },
|
||||||
|
["@module"] = { link = "@text" },
|
||||||
|
["@namespace"] = { link = "@keyword" },
|
||||||
|
["@punctuation.bracket"] = { link = "@punctuation" },
|
||||||
|
|
||||||
|
-- LSP
|
||||||
|
["@lsp.type.property"] = { link = "@variable" },
|
||||||
|
["@lsp.type.namespace.go"] = { fg = colors.rosewater },
|
||||||
|
|
||||||
|
-- Bash
|
||||||
|
["@variable.parameter.bash"] = { fg = colors.rosewater },
|
||||||
|
|
||||||
|
-- Makefile
|
||||||
|
["@function.make"] = { link = "Keyword" },
|
||||||
|
["@string.special.symbol.make"] = { link = "@variable" },
|
||||||
|
|
||||||
|
-- Markup
|
||||||
|
["@markup.raw"] = { link = "@text" },
|
||||||
|
["@markup.strong"] = { fg = colors.blue },
|
||||||
|
["@markup.italic"] = { fg = colors.green },
|
||||||
|
|
||||||
|
-- PHP
|
||||||
|
["@keyword.import.php"] = { link = "@keyword" },
|
||||||
|
["@function.builtin.php"] = { fg = colors.blue },
|
||||||
|
["@class.name.php"] = { link = "@text" },
|
||||||
|
["@class.inherit.name.php"] = { link = "@text" },
|
||||||
|
["@class.implements.name.php"] = { link = "@text" },
|
||||||
|
["@interface.name.php"] = { link = "@text" },
|
||||||
|
["@namespace.name.php"] = { link = "@text" },
|
||||||
|
["@namespace.alias.name.php"] = { link = "@text" },
|
||||||
|
["@use.trait.name.php"] = { link = "@text" },
|
||||||
|
|
||||||
|
-- Blade
|
||||||
|
["@tag.blade"] = { fg = colors.mauve },
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
local options = {
|
||||||
|
flavour = "mocha",
|
||||||
|
transparent_background = not vim.g.neovide,
|
||||||
|
color_overrides = {
|
||||||
|
mocha = {
|
||||||
|
base = "#0E1019",
|
||||||
|
mantle = "#0D0F17",
|
||||||
|
crust = "#0C0D14",
|
||||||
|
surface0 = "#1a1c2d",
|
||||||
|
surface1 = "#343959",
|
||||||
|
surface2 = "#41476F",
|
||||||
|
overlay0 = "#3F4256",
|
||||||
|
overlay1 = "#5B5F7C",
|
||||||
|
overlay2 = "#767BA0",
|
||||||
|
|
||||||
|
text = "#eceef4",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
no_italic = true,
|
||||||
|
no_bold = true,
|
||||||
|
custom_highlights = custom_highlights,
|
||||||
|
integrations = {
|
||||||
|
cmp = true,
|
||||||
|
treesitter = true,
|
||||||
|
neotree = true,
|
||||||
|
-- barbar = true,
|
||||||
|
-- noice = true,
|
||||||
|
telescope = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
"catppuccin/nvim",
|
||||||
|
name = "catppuccin",
|
||||||
|
lazy = false,
|
||||||
|
priority = 1000,
|
||||||
|
opts = options,
|
||||||
|
config = function(_, opts)
|
||||||
|
require("catppuccin").setup(opts)
|
||||||
|
vim.cmd.colorscheme("catppuccin")
|
||||||
|
end,
|
||||||
|
}
|
||||||
27
nvim/lua/user/plugins/ui/dashboard.lua
Normal file
27
nvim/lua/user/plugins/ui/dashboard.lua
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
local icons = require('user.icons')
|
||||||
|
|
||||||
|
return {
|
||||||
|
"goolord/alpha-nvim",
|
||||||
|
config = function()
|
||||||
|
local alpha = require'alpha'
|
||||||
|
local dashboard = require'alpha.themes.dashboard'
|
||||||
|
|
||||||
|
dashboard.section.header.val = {
|
||||||
|
[[ __ ]],
|
||||||
|
[[ ___ ___ ___ __ __ /\_\ ___ ___ ]],
|
||||||
|
[[ / _ `\ / __`\ / __`\/\ \/\ \\/\ \ / __` __`\ ]],
|
||||||
|
[[/\ \/\ \/\ __//\ \_\ \ \ \_/ |\ \ \/\ \/\ \/\ \ ]],
|
||||||
|
[[\ \_\ \_\ \____\ \____/\ \___/ \ \_\ \_\ \_\ \_\]],
|
||||||
|
[[ \/_/\/_/\/____/\/___/ \/__/ \/_/\/_/\/_/\/_/]],
|
||||||
|
}
|
||||||
|
|
||||||
|
dashboard.section.buttons.val = {
|
||||||
|
dashboard.button("e", icons.files.text .. " New file" , ":ene <BAR> startinsert<CR>"),
|
||||||
|
dashboard.button("s", icons.search .. " Search files" , ":Telescope find_files<CR>"),
|
||||||
|
dashboard.button("o", icons.search .. " Old files" , ":Telescope oldfiles<CR>"),
|
||||||
|
dashboard.button("q", icons.close .. " Quit" , ":qa<CR>"),
|
||||||
|
}
|
||||||
|
|
||||||
|
alpha.setup(dashboard.config)
|
||||||
|
end
|
||||||
|
}
|
||||||
54
nvim/lua/user/plugins/ui/editor.lua
Normal file
54
nvim/lua/user/plugins/ui/editor.lua
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
local icons = require('user.icons')
|
||||||
|
|
||||||
|
return {
|
||||||
|
-- indent lines
|
||||||
|
{
|
||||||
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
|
main = "ibl",
|
||||||
|
opts = {
|
||||||
|
debounce = 10,
|
||||||
|
indent = {
|
||||||
|
char = icons.indent,
|
||||||
|
},
|
||||||
|
scope = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
exclude = {
|
||||||
|
filetypes = {
|
||||||
|
"help",
|
||||||
|
"dashboard",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
require("ibl").setup(opts)
|
||||||
|
|
||||||
|
local hooks = require("ibl.hooks")
|
||||||
|
hooks.register(hooks.type.WHITESPACE, hooks.builtin.hide_first_tab_indent_level)
|
||||||
|
hooks.register(hooks.type.WHITESPACE, hooks.builtin.hide_first_space_indent_level)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"folke/todo-comments.nvim",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
|
opts = {
|
||||||
|
signs = false,
|
||||||
|
keywords = {
|
||||||
|
TODO = { color = "warning" },
|
||||||
|
},
|
||||||
|
highlight = {
|
||||||
|
keyword = 'fg',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
-- color highlight in documents
|
||||||
|
{
|
||||||
|
'brenoprata10/nvim-highlight-colors',
|
||||||
|
opts = {
|
||||||
|
render = 'virtual',
|
||||||
|
virtual_symbol_position = 'eol',
|
||||||
|
virtual_symbol_prefix = '',
|
||||||
|
virtual_symbol_suffix = '',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
42
nvim/lua/user/plugins/ui/gitsigns.lua
Normal file
42
nvim/lua/user/plugins/ui/gitsigns.lua
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
local icons = require('user.icons').diff_gutter
|
||||||
|
|
||||||
|
local options = {
|
||||||
|
signs = {
|
||||||
|
add = { text = icons.add },
|
||||||
|
delete = { text = icons.delete },
|
||||||
|
change = { text = icons.change },
|
||||||
|
untracked = { text = icons.untracked },
|
||||||
|
topdelete = { text = icons.delete },
|
||||||
|
changedelete = { text = icons.change },
|
||||||
|
},
|
||||||
|
signs_staged = {
|
||||||
|
add = { text = icons.add },
|
||||||
|
delete = { text = icons.delete },
|
||||||
|
change = { text = icons.change },
|
||||||
|
topdelete = { text = icons.delete },
|
||||||
|
changedelete = { text = icons.change },
|
||||||
|
},
|
||||||
|
diff_opts = {
|
||||||
|
internal = true
|
||||||
|
},
|
||||||
|
preview_config = {
|
||||||
|
border = { " " },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
"lewis6991/gitsigns.nvim",
|
||||||
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
|
dependencies = {
|
||||||
|
{
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = {
|
||||||
|
defaults = {
|
||||||
|
["<leader>g"] = { name = "+git" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
opts = options,
|
||||||
|
}
|
||||||
|
|
@ -1,5 +1,107 @@
|
||||||
local icons = require("user.icons")
|
local icons = require("user.icons")
|
||||||
|
|
||||||
|
local options = {
|
||||||
|
-- weird bug
|
||||||
|
-- hide_root_node = true,
|
||||||
|
popup_border_style = 'solid',
|
||||||
|
default_component_configs = {
|
||||||
|
indent = {
|
||||||
|
with_markers = true,
|
||||||
|
indent_marker = icons.tree.vertical,
|
||||||
|
last_indent_marker = icons.tree.nodelast,
|
||||||
|
indent_size = 2,
|
||||||
|
},
|
||||||
|
icon = {
|
||||||
|
folder_closed = icons.folder.closed,
|
||||||
|
folder_open = icons.folder.open,
|
||||||
|
folder_empty = icons.folder.empty,
|
||||||
|
folder_empty_open = icons.folder.empty_open,
|
||||||
|
default = icons.files.default,
|
||||||
|
},
|
||||||
|
modified = {
|
||||||
|
symbol = icons.modified,
|
||||||
|
},
|
||||||
|
name = {
|
||||||
|
highlight_opened_files = true,
|
||||||
|
},
|
||||||
|
git_status = {
|
||||||
|
symbols = icons.gitsigns,
|
||||||
|
align = "right",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
sources = {
|
||||||
|
"filesystem",
|
||||||
|
-- "buffers",
|
||||||
|
-- "git_status",
|
||||||
|
-- "document_symbols",
|
||||||
|
},
|
||||||
|
source_selector = {
|
||||||
|
winbar = true, -- toggle to show selector on winbar
|
||||||
|
show_scrolled_off_parent_node = false, -- boolean
|
||||||
|
sources = { -- table
|
||||||
|
{
|
||||||
|
source = "filesystem",
|
||||||
|
display_name = " Files "
|
||||||
|
},
|
||||||
|
{
|
||||||
|
source = "buffers",
|
||||||
|
display_name = " Buffers "
|
||||||
|
},
|
||||||
|
{
|
||||||
|
source = "git_status",
|
||||||
|
display_name = " Git "
|
||||||
|
},
|
||||||
|
{
|
||||||
|
source = "document_symbols",
|
||||||
|
display_name = " Document Symbols "
|
||||||
|
},
|
||||||
|
},
|
||||||
|
content_layout = "center",
|
||||||
|
separator = { left = "", right= "" },
|
||||||
|
},
|
||||||
|
window = {
|
||||||
|
popup = {
|
||||||
|
size = {
|
||||||
|
height = "100%",
|
||||||
|
width = "100%",
|
||||||
|
},
|
||||||
|
position = "50%",
|
||||||
|
relative = "editor",
|
||||||
|
},
|
||||||
|
mappings = {
|
||||||
|
["<space>"] = "noop",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
filesystem = {
|
||||||
|
follow_current_file = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
use_libuv_file_watcher = true,
|
||||||
|
window = {
|
||||||
|
mappings = {
|
||||||
|
["."] = "noop", -- unbind set_root. I never use it but always hit the key :P
|
||||||
|
["~"] = "toggle_hidden",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
buffers = {
|
||||||
|
window = {
|
||||||
|
mappings = {
|
||||||
|
["."] = "noop",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
event_handlers = {
|
||||||
|
{
|
||||||
|
event = "neo_tree_buffer_enter",
|
||||||
|
handler = function ()
|
||||||
|
vim.opt_local.statuscolumn = ''
|
||||||
|
vim.opt_local.foldcolumn = "0"
|
||||||
|
end
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"nvim-neo-tree/neo-tree.nvim",
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
branch = "v3.x",
|
branch = "v3.x",
|
||||||
|
|
@ -9,106 +111,6 @@ return {
|
||||||
"MunifTanjim/nui.nvim",
|
"MunifTanjim/nui.nvim",
|
||||||
},
|
},
|
||||||
cmd = "Neotree",
|
cmd = "Neotree",
|
||||||
opts = {
|
opts = options
|
||||||
-- weird bug
|
|
||||||
-- hide_root_node = true,
|
|
||||||
popup_border_style = 'solid',
|
|
||||||
default_component_configs = {
|
|
||||||
indent = {
|
|
||||||
with_markers = true,
|
|
||||||
indent_marker = icons.tree.vertical,
|
|
||||||
last_indent_marker = icons.tree.nodelast,
|
|
||||||
indent_size = 2,
|
|
||||||
},
|
|
||||||
icon = {
|
|
||||||
folder_closed = icons.folder.closed,
|
|
||||||
folder_open = icons.folder.open,
|
|
||||||
folder_empty = icons.folder.empty,
|
|
||||||
folder_empty_open = icons.folder.empty_open,
|
|
||||||
default = icons.files.default,
|
|
||||||
},
|
|
||||||
modified = {
|
|
||||||
symbol = icons.modified,
|
|
||||||
},
|
|
||||||
name = {
|
|
||||||
highlight_opened_files = true,
|
|
||||||
},
|
|
||||||
git_status = {
|
|
||||||
symbols = icons.gitsigns,
|
|
||||||
align = "right",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
sources = {
|
|
||||||
"filesystem",
|
|
||||||
"buffers",
|
|
||||||
"git_status",
|
|
||||||
"document_symbols",
|
|
||||||
},
|
|
||||||
source_selector = {
|
|
||||||
winbar = true, -- toggle to show selector on winbar
|
|
||||||
show_scrolled_off_parent_node = false, -- boolean
|
|
||||||
sources = { -- table
|
|
||||||
{
|
|
||||||
source = "filesystem",
|
|
||||||
display_name = " Files "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
source = "buffers",
|
|
||||||
display_name = " Buffers "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
source = "git_status",
|
|
||||||
display_name = " Git "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
source = "document_symbols",
|
|
||||||
display_name = " Document Symbols "
|
|
||||||
},
|
|
||||||
},
|
|
||||||
content_layout = "center",
|
|
||||||
separator = { left = "", right= "" },
|
|
||||||
},
|
|
||||||
window = {
|
|
||||||
popup = {
|
|
||||||
size = {
|
|
||||||
height = "100%",
|
|
||||||
width = "100%",
|
|
||||||
},
|
|
||||||
position = "50%",
|
|
||||||
relative = "editor",
|
|
||||||
},
|
|
||||||
mappings = {
|
|
||||||
["<space>"] = "noop",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
filesystem = {
|
|
||||||
follow_current_file = {
|
|
||||||
enabled = true,
|
|
||||||
},
|
|
||||||
use_libuv_file_watcher = true,
|
|
||||||
window = {
|
|
||||||
mappings = {
|
|
||||||
["."] = "noop", -- unbind set_root. I never use it but always hit the key :P
|
|
||||||
["~"] = "toggle_hidden",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
buffers = {
|
|
||||||
window = {
|
|
||||||
mappings = {
|
|
||||||
["."] = "noop",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
event_handlers = {
|
|
||||||
{
|
|
||||||
event = "neo_tree_buffer_enter",
|
|
||||||
handler = function ()
|
|
||||||
vim.opt_local.statuscolumn = ''
|
|
||||||
vim.opt_local.foldcolumn = "0"
|
|
||||||
end
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
58
nvim/lua/user/plugins/ui/statuscolumn.lua
Normal file
58
nvim/lua/user/plugins/ui/statuscolumn.lua
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
local icons = require('user.icons')
|
||||||
|
|
||||||
|
local opts = function()
|
||||||
|
local builtin = require("statuscol.builtin")
|
||||||
|
return {
|
||||||
|
-- Align current relative number to the right.
|
||||||
|
relculright = true,
|
||||||
|
ft_ignore = {
|
||||||
|
'help',
|
||||||
|
'alpha'
|
||||||
|
},
|
||||||
|
segments = {
|
||||||
|
{
|
||||||
|
click = "v:lua.ScSa",
|
||||||
|
sign = {
|
||||||
|
namespace = { "gitsigns" },
|
||||||
|
maxwidth = 1,
|
||||||
|
colwidth = 1,
|
||||||
|
foldclosed = true,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
click = "v:lua.ScSa",
|
||||||
|
sign = {
|
||||||
|
name = { ".*" },
|
||||||
|
namespace = { ".*" },
|
||||||
|
maxwidth = 1,
|
||||||
|
foldclosed = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text = { " ", builtin.lnumfunc, " " },
|
||||||
|
click = "v:lua.ScLa",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text = { builtin.foldfunc, " " },
|
||||||
|
condition = { true, function (args) return args.fold.width > 0 end },
|
||||||
|
click = "v:lua.ScFa"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text = {
|
||||||
|
function(args)
|
||||||
|
local pos = vim.api.nvim_win_get_cursor(args.win)
|
||||||
|
return (args.lnum == pos[1] and "%#SignColumnSep#" or "")..icons.signcolum.separator
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Better status column
|
||||||
|
return {
|
||||||
|
"luukvbaal/statuscol.nvim",
|
||||||
|
event = { "BufReadPre", "BufNewFile", "BufAdd" },
|
||||||
|
opts = opts
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
local icons = require("user.icons")
|
local icons = require("user.icons")
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Helper functions
|
||||||
|
--
|
||||||
|
|
||||||
local function indent_settings()
|
local function indent_settings()
|
||||||
return (vim.bo.expandtab and "SPC" or "TAB")
|
return (vim.bo.expandtab and "SPC" or "TAB")
|
||||||
.. ":"
|
.. ":"
|
||||||
|
|
@ -26,6 +30,141 @@ local function linter()
|
||||||
return "no linter"
|
return "no linter"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Options
|
||||||
|
--
|
||||||
|
|
||||||
|
local options = {
|
||||||
|
options = {
|
||||||
|
globalstatus = true,
|
||||||
|
component_separators = "",
|
||||||
|
section_separators = "",
|
||||||
|
disabled_filetypes = {
|
||||||
|
statusline = {
|
||||||
|
"dashboard",
|
||||||
|
"alpha",
|
||||||
|
},
|
||||||
|
winbar = {
|
||||||
|
"neo-tree",
|
||||||
|
"NvimTree",
|
||||||
|
"alpha"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
theme = {
|
||||||
|
normal = {
|
||||||
|
a = "StatusLineNormal",
|
||||||
|
b = "StatusLineLualine",
|
||||||
|
c = "StatusLineLualine",
|
||||||
|
x = "StatusLineLualine",
|
||||||
|
y = "StatusLineLualine",
|
||||||
|
z = "StatusLineLualine",
|
||||||
|
},
|
||||||
|
command = {
|
||||||
|
a = "StatusLineCommand",
|
||||||
|
},
|
||||||
|
insert = {
|
||||||
|
a = "StatusLineInsert",
|
||||||
|
},
|
||||||
|
visual = {
|
||||||
|
a = "StatusLineVisual",
|
||||||
|
},
|
||||||
|
replace = {
|
||||||
|
a = "StatusLineReplace",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
sections = {
|
||||||
|
lualine_a = {
|
||||||
|
"mode",
|
||||||
|
},
|
||||||
|
lualine_b = {
|
||||||
|
{"branch"},
|
||||||
|
{
|
||||||
|
"diagnostics",
|
||||||
|
symbols = {
|
||||||
|
error = icons.diagnostics.error .. " ",
|
||||||
|
warn = icons.diagnostics.warn .. " ",
|
||||||
|
info = icons.diagnostics.info .. " ",
|
||||||
|
hint = icons.diagnostics.hint .. " ",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"diff",
|
||||||
|
symbols = {
|
||||||
|
added = icons.diff.added .. " ",
|
||||||
|
modified = icons.diff.modified .. " ",
|
||||||
|
removed = icons.diff.removed .. " ",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"lsp-status",
|
||||||
|
disabled_filetypes = {
|
||||||
|
"TelescopePrompt",
|
||||||
|
},
|
||||||
|
on_click = function (_, btn, _)
|
||||||
|
if btn == "l" then
|
||||||
|
vim.cmd(":LspInfo")
|
||||||
|
elseif btn == "r" then
|
||||||
|
vim.cmd(":LspRestart")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
},
|
||||||
|
linter,
|
||||||
|
},
|
||||||
|
lualine_c = {},
|
||||||
|
lualine_x = {
|
||||||
|
{
|
||||||
|
"filetype",
|
||||||
|
cond = is_not_popup
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fileformat",
|
||||||
|
symbols = {
|
||||||
|
unix = "NL",
|
||||||
|
dos = "NLCR",
|
||||||
|
mac = 'NL'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
indent_settings,
|
||||||
|
},
|
||||||
|
lualine_y = {
|
||||||
|
"location",
|
||||||
|
"progress",
|
||||||
|
},
|
||||||
|
lualine_z = {},
|
||||||
|
},
|
||||||
|
winbar = {
|
||||||
|
lualine_c = {
|
||||||
|
{ "filetype", icon_only = true },
|
||||||
|
{
|
||||||
|
"filename",
|
||||||
|
cond = is_not_popup,
|
||||||
|
path = 1,
|
||||||
|
symbols = vim.tbl_deep_extend("force", icons.file_status, {
|
||||||
|
unnamed = "",
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
inactive_winbar = {
|
||||||
|
lualine_c = {
|
||||||
|
{ "filetype", icon_only = true },
|
||||||
|
{
|
||||||
|
"filename",
|
||||||
|
cond = is_not_popup,
|
||||||
|
path = 1,
|
||||||
|
symbols = vim.tbl_deep_extend("force", icons.file_status, {
|
||||||
|
unnamed = "",
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
extensions = {
|
||||||
|
"lazy",
|
||||||
|
"neo-tree",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
|
|
@ -33,136 +172,7 @@ return {
|
||||||
"nvim-tree/nvim-web-devicons",
|
"nvim-tree/nvim-web-devicons",
|
||||||
"pnx/lualine-lsp-status",
|
"pnx/lualine-lsp-status",
|
||||||
},
|
},
|
||||||
opts = {
|
opts = options,
|
||||||
options = {
|
|
||||||
globalstatus = true,
|
|
||||||
component_separators = "",
|
|
||||||
section_separators = "",
|
|
||||||
disabled_filetypes = {
|
|
||||||
statusline = {
|
|
||||||
"dashboard",
|
|
||||||
"alpha",
|
|
||||||
},
|
|
||||||
winbar = {
|
|
||||||
"neo-tree",
|
|
||||||
"NvimTree",
|
|
||||||
"alpha"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
theme = {
|
|
||||||
normal = {
|
|
||||||
a = "StatusLineNormal",
|
|
||||||
b = "StatusLineLualine",
|
|
||||||
c = "StatusLineLualine",
|
|
||||||
x = "StatusLineLualine",
|
|
||||||
y = "StatusLineLualine",
|
|
||||||
z = "StatusLineLualine",
|
|
||||||
},
|
|
||||||
command = {
|
|
||||||
a = "StatusLineCommand",
|
|
||||||
},
|
|
||||||
insert = {
|
|
||||||
a = "StatusLineInsert",
|
|
||||||
},
|
|
||||||
visual = {
|
|
||||||
a = "StatusLineVisual",
|
|
||||||
},
|
|
||||||
replace = {
|
|
||||||
a = "StatusLineReplace",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
sections = {
|
|
||||||
lualine_a = {
|
|
||||||
"mode",
|
|
||||||
},
|
|
||||||
lualine_b = {
|
|
||||||
{"branch"},
|
|
||||||
{
|
|
||||||
"diagnostics",
|
|
||||||
symbols = {
|
|
||||||
error = icons.diagnostics.error .. " ",
|
|
||||||
warn = icons.diagnostics.warn .. " ",
|
|
||||||
info = icons.diagnostics.info .. " ",
|
|
||||||
hint = icons.diagnostics.hint .. " ",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"diff",
|
|
||||||
symbols = {
|
|
||||||
added = icons.diff.added .. " ",
|
|
||||||
modified = icons.diff.modified .. " ",
|
|
||||||
removed = icons.diff.removed .. " ",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"lsp-status",
|
|
||||||
disabled_filetypes = {
|
|
||||||
"TelescopePrompt",
|
|
||||||
},
|
|
||||||
on_click = function (_, btn, _)
|
|
||||||
if btn == "l" then
|
|
||||||
vim.cmd(":LspInfo")
|
|
||||||
elseif btn == "r" then
|
|
||||||
vim.cmd(":LspRestart")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
},
|
|
||||||
linter,
|
|
||||||
},
|
|
||||||
lualine_c = {},
|
|
||||||
lualine_x = {
|
|
||||||
{
|
|
||||||
"filetype",
|
|
||||||
cond = is_not_popup
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fileformat",
|
|
||||||
symbols = {
|
|
||||||
unix = "NL",
|
|
||||||
dos = "NLCR",
|
|
||||||
mac = 'NL'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
indent_settings,
|
|
||||||
},
|
|
||||||
lualine_y = {
|
|
||||||
"location",
|
|
||||||
"progress",
|
|
||||||
},
|
|
||||||
lualine_z = {},
|
|
||||||
},
|
|
||||||
winbar = {
|
|
||||||
lualine_c = {
|
|
||||||
{ "filetype", icon_only = true },
|
|
||||||
{
|
|
||||||
"filename",
|
|
||||||
cond = is_not_popup,
|
|
||||||
path = 1,
|
|
||||||
symbols = vim.tbl_deep_extend("force", icons.file_status, {
|
|
||||||
unnamed = "",
|
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
inactive_winbar = {
|
|
||||||
lualine_c = {
|
|
||||||
{ "filetype", icon_only = true },
|
|
||||||
{
|
|
||||||
"filename",
|
|
||||||
cond = is_not_popup,
|
|
||||||
path = 1,
|
|
||||||
symbols = vim.tbl_deep_extend("force", icons.file_status, {
|
|
||||||
unnamed = "",
|
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
extensions = {
|
|
||||||
"lazy",
|
|
||||||
"neo-tree",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
init = function ()
|
init = function ()
|
||||||
-- disable mode in the command line, as its already shown in lualine
|
-- disable mode in the command line, as its already shown in lualine
|
||||||
vim.o.showmode = false
|
vim.o.showmode = false
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue