diff --git a/plugin/00-colorscheme.lua b/plugin/00-colorscheme.lua index ce5a106..7912c18 100644 --- a/plugin/00-colorscheme.lua +++ b/plugin/00-colorscheme.lua @@ -1,34 +1,36 @@ -add("ellisonleao/gruvbox.nvim") +add('ellisonleao/gruvbox.nvim') -local palette = require("gruvbox").palette -require("gruvbox").setup({ - bold = false, - italic = { - strings = false, - emphasis = false, - comments = false, - folds = false, - }, - contrast = "hard", - transparent_mode = true, - overrides = { - -- builtin - SignColumn = { bg = "None" }, - CursorLineNr = { bg = "None" }, - Whitespace = { fg = palette.dark0 }, - EndOfBuffer = { fg = palette.dark0_hard }, - Visual = { fg = "None", bg = palette.dark1 }, - Label = { link = "GruvboxPurple" }, +local palette = require('gruvbox').palette +require('gruvbox').setup({ + bold = false, + italic = { + strings = false, + emphasis = false, + comments = false, + folds = false, + }, + contrast = 'hard', + transparent_mode = true, + overrides = { + -- builtin + SignColumn = { bg = 'None' }, + CursorLineNr = { bg = 'None' }, + Whitespace = { fg = palette.dark0 }, + EndOfBuffer = { fg = palette.dark0_hard }, + Visual = { fg = 'None', bg = palette.dark1 }, + Label = { link = 'GruvboxPurple' }, - -- blink.cmp - BlinkCmpMenu = { link = "Normal" }, - BlinkCmpMenuBorder = { link = "BlinkCmpMenu" }, - BlinkCmpMenuSelection = { fg = "None", bg = palette.dark1 }, - BlinkCmpLabelMatch = { fg = palette.bright_green }, - BlinkCmpScrollBarGutter = { bg = palette.dark2 }, - BlinkCmpScrollBarThumb = { bg = palette.light1 }, + -- blink.cmp + BlinkCmpMenu = { link = 'Normal' }, + BlinkCmpMenuBorder = { link = 'BlinkCmpMenu' }, + BlinkCmpMenuSelection = { fg = 'None', bg = palette.dark1 }, + BlinkCmpLabelMatch = { fg = palette.bright_green }, + BlinkCmpScrollBarGutter = { bg = palette.dark2 }, + BlinkCmpScrollBarThumb = { bg = palette.light1 }, - -- indent guides - MiniIndentscopeSymbol = { fg = palette.dark1 }, - }, + -- indent guides + MiniIndentscopeSymbol = { fg = palette.dark1 }, + }, }) + +vim.cmd('colorscheme gruvbox') diff --git a/plugin/editor.lua b/plugin/editor.lua index 778283b..6d39fe9 100644 --- a/plugin/editor.lua +++ b/plugin/editor.lua @@ -11,7 +11,8 @@ add({ 'numToStr/Navigator.nvim', -- navigator 'm4xshen/hardtime.nvim', -- workflow 'mg979/vim-visual-multi', -- multiple cursors - 'pmizio/typescript-tools.nvim', + 'pmizio/typescript-tools.nvim', -- typescript tools + { src = 'iamcco/markdown-preview.nvim', build = 'cd app && npm install' }, 'nvim-lua/plenary.nvim', -- dependency for typescript-tools -- 'nvim-flutter/flutter-tools.nvim', -- flutter tools }) diff --git a/plugin/snacks.lua b/plugin/snacks.lua index f26459b..16e2ec5 100644 --- a/plugin/snacks.lua +++ b/plugin/snacks.lua @@ -1,373 +1,372 @@ -add("folke/snacks.nvim") +add('folke/snacks.nvim') local function files_layout(preview_width, height, width) - preview_width = preview_width or 0.6 - height = height or 0.8 - width = width or 0.9 - return { - layout = { - box = "horizontal", - width = width, - min_width = 120, - height = height, - { - box = "vertical", - border = "rounded", - title = "{title} {live} {flags}", - { win = "input", height = 1, border = "bottom" }, - { win = "list", border = "none" }, - }, - { win = "preview", title = "{preview}", border = "rounded", width = preview_width }, - }, - } + preview_width = preview_width or 0.6 + height = height or 0.8 + width = width or 0.9 + return { + layout = { + box = 'horizontal', + width = width, + min_width = 120, + height = height, + { + box = 'vertical', + border = 'rounded', + title = '{title} {live} {flags}', + { win = 'input', height = 1, border = 'bottom' }, + { win = 'list', border = 'none' }, + }, + { win = 'preview', title = '{preview}', border = 'rounded', width = preview_width }, + }, + } end local function palette_layout(height, width) - height = height or 0.4 - width = width or 0.6 - return { - preview = false, - layout = { - backdrop = false, - row = 1, - width = width, - min_width = 80, - height = height, - border = "rounded", - box = "vertical", - { - win = "input", - height = 1, - border = "rounded", - title = "{title} {live} {flags}", - title_pos = "center", - }, - { win = "list", border = "hpad" }, - { win = "preview", title = "{preview}", border = "rounded" }, - }, - } + height = height or 0.4 + width = width or 0.6 + return { + preview = false, + layout = { + backdrop = false, + row = 1, + width = width, + min_width = 80, + height = height, + border = 'rounded', + box = 'vertical', + { + win = 'input', + height = 1, + border = 'rounded', + title = '{title} {live} {flags}', + title_pos = 'center', + }, + { win = 'list', border = 'hpad' }, + { win = 'preview', title = '{preview}', border = 'rounded' }, + }, + } end -local Snacks = require("snacks") +local Snacks = require('snacks') Snacks.setup({ - animate = { - enabled = true, - duration = 20, -- ms per step - easing = "linear", - fps = 60, - }, - bigfile = { - enabled = true, - notify = true, - size = 1000 * 1024, -- 1 MB instead of 100 KB - }, - bufdelete = { enabled = true }, - dashboard = { - preset = { - header = [[ + animate = { + enabled = true, + duration = 20, -- ms per step + easing = 'linear', + fps = 60, + }, + bigfile = { + enabled = true, + notify = true, + size = 1000 * 1024, -- 1 MB instead of 100 KB + }, + bufdelete = { enabled = true }, + dashboard = { + preset = { + header = [[ ░█░█░█▀▀░█░█░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░░█░░█░░░█░█░█░█░█▀▀░▄▀▄ ░▀░▀░▀▀▀░░▀░░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ]], - }, - sections = { - { section = "header" }, - { - icon = " ", - title = "Keymaps", - section = "keys", - indent = 2, - padding = 1, - }, - { - icon = " ", - title = "Recent Files", - section = "recent_files", - indent = 2, - padding = 1, - }, - { - icon = " ", - title = "Projects", - section = "projects", - indent = 2, - padding = 1, - }, + }, + sections = { + { section = 'header' }, + { + icon = ' ', + title = 'Keymaps', + section = 'keys', + indent = 2, + padding = 1, + }, + { + icon = ' ', + title = 'Recent Files', + section = 'recent_files', + indent = 2, + padding = 1, + }, + { + icon = ' ', + title = 'Projects', + section = 'projects', + indent = 2, + padding = 1, + }, + }, + }, + debug = { enabled = true }, + dim = { + enabled = true, + scope = { + min_size = 5, + max_size = 20, + siblings = true, + }, + }, + explorer = { enabled = false }, + projects = { + enabled = true, + dirs = { + '~/Projects', + '~/Projects/other', + '~/.config/Modus', + }, + }, + git = { enabled = true }, + gitbrowse = { enabled = true }, + image = { enabled = true }, + indent = { + enabled = true, + priority = 1, + char = '▍', + only_scope = false, + only_current = false, + hl = { + 'SnacksIndent1', + 'SnacksIndent2', + 'SnacksIndent3', + 'SnacksIndent4', + 'SnacksIndent5', + 'SnacksIndent6', + 'SnacksIndent7', + 'SnacksIndent8', + }, + }, + input = { + enabled = true, + icon = ' ', + icon_hl = 'SnacksInputIcon', + icon_pos = 'left', + prompt_pos = 'title', + win = { style = 'input' }, + expand = true, + }, + layout = { enabled = true }, + lazygit = { enabled = true }, + notifier = { + enabled = true, + timeout = 2000, + width = { min = 40, max = 0.4 }, + height = { min = 1, max = 0.6 }, + margin = { top = 0, right = 1, bottom = 0 }, + padding = true, + sort = { 'level', 'added' }, + level = vim.log.levels.TRACE, + icons = { + debug = ' ', + error = ' ', + info = ' ', + trace = ' ', + warn = ' ', + }, + style = 'compact', + top_down = true, + date_format = '%R', + more_format = ' ↓ %d lines ', + refresh = 50, + }, + notify = { enabled = true }, + picker = { + enabled = true, + icon = ' ', + icon_hl = 'SnacksPickerIcon', + icon_pos = 'left', + prompt_pos = 'title', + win = { style = 'picker' }, + expand = true, + matchers = { + frecency = true, + cwd_bonus = false, + }, + sources = { + -- layout options: dropdown, horizontal, vertical, vscode, ivy, ivy_split, telescope, top, left, right, bottom, sidebar + buffers = { layout = files_layout() }, + commands = { layout = palette_layout() }, + command_history = { layout = palette_layout() }, + files = { + hidden = true, + layout = files_layout(), + }, + icons = { + icon_sources = { 'nerd_fonts', 'emoji' }, + layout = palette_layout(), + }, + git_files = { layout = files_layout() }, + git_branches = { layout = { preset = 'vertical' } }, + git_status = { layout = files_layout() }, + help = { layout = { preset = 'ivy_split' } }, + man = { layout = { preset = 'ivy_split' } }, + notifications = { layout = palette_layout() }, + projects = { + dev = { '~/Projects', '~/Projects/other' }, + layout = files_layout(0.8), + }, + recent = { layout = files_layout() }, + search_history = { layout = palette_layout() }, + smart = { layout = files_layout() }, + undo = { layout = { preset = 'ivy' } }, + zoxide = { layout = files_layout(0.7) }, + }, + layout = 'custom', + layouts = { + custom = { + layout = { + box = 'vertical', + backdrop = false, + row = -1, + width = 0, + height = 0.4, + border = 'top', + title = ' {title} {live} {flags}', + title_pos = 'left', + { + box = 'horizontal', + { win = 'list', border = 'rounded' }, + { win = 'preview', title = '{preview}', width = 0.6, border = 'left' }, + }, + { win = 'input', height = 1, border = 'top' }, + }, + }, + }, + }, + profiler = { enabled = true }, + quickfile = { enabled = true }, + rename = { enabled = true }, + scope = { + enabled = true, + keys = { + textobject = { + ii = { + min_size = 2, -- minimum size of the scope + edge = false, -- inner scope + cursor = false, + treesitter = { blocks = { enabled = false } }, + desc = 'inner scope', + }, + ai = { + cursor = false, + min_size = 2, -- minimum size of the scope + treesitter = { blocks = { enabled = false } }, + desc = 'full scope', + }, + }, + jump = { + ['[a'] = { + min_size = 1, -- allow single line scopes + bottom = false, + cursor = false, + edge = true, + treesitter = { blocks = { enabled = false } }, + desc = 'jump to top edge of scope', + }, + [']a'] = { + min_size = 1, -- allow single line scopes + bottom = true, + cursor = false, + edge = true, + treesitter = { blocks = { enabled = false } }, + desc = 'jump to bottom edge of scope', + }, + }, + }, + }, + scratch = { + enabled = true, + name = 'SCRATCH', + ft = function() + if vim.bo.buftype == '' and vim.bo.filetype ~= '' then + return vim.bo.filetype + end + return 'markdown' + end, + icon = nil, + root = vim.fn.stdpath('data') .. '/scratch', + autowrite = true, + filekey = { + cwd = true, + branch = true, + count = true, + }, + win = { + width = 120, + height = 40, + bo = { buftype = '', buflisted = false, bufhidden = 'hide', swapfile = false }, + minimal = false, + noautocmd = false, + zindex = 20, + wo = { winhighlight = 'NormalFloat:Normal' }, + border = 'rounded', + title_pos = 'center', + footer_pos = 'center', - }, - }, - debug = { enabled = true }, - dim = { - enabled = true, - scope = { - min_size = 5, - max_size = 20, - siblings = true, - }, - }, - explorer = { enabled = true }, - projects = { - enabled = true, - dirs = { - "~/Projects", - "~/Projects/other", - "~/.config/Modus", - } - }, - git = { enabled = true }, - gitbrowse = { enabled = true }, - image = { enabled = true }, - indent = { - enabled = true, - priority = 1, - char = "▍", - only_scope = false, - only_current = false, - hl = { - "SnacksIndent1", - "SnacksIndent2", - "SnacksIndent3", - "SnacksIndent4", - "SnacksIndent5", - "SnacksIndent6", - "SnacksIndent7", - "SnacksIndent8", - }, - }, - input = { - enabled = true, - icon = " ", - icon_hl = "SnacksInputIcon", - icon_pos = "left", - prompt_pos = "title", - win = { style = "input" }, - expand = true, - }, - layout = { enabled = true }, - lazygit = { enabled = true }, - notifier = { - enabled = true, - timeout = 2000, - width = { min = 40, max = 0.4 }, - height = { min = 1, max = 0.6 }, - margin = { top = 0, right = 1, bottom = 0 }, - padding = true, - sort = { "level", "added" }, - level = vim.log.levels.TRACE, - icons = { - debug = " ", - error = " ", - info = " ", - trace = " ", - warn = " ", - }, - style = "compact", - top_down = true, - date_format = "%R", - more_format = " ↓ %d lines ", - refresh = 50, - }, - notify = { enabled = true }, - picker = { - enabled = true, - icon = " ", - icon_hl = "SnacksPickerIcon", - icon_pos = "left", - prompt_pos = "title", - win = { style = "picker" }, - expand = true, - matchers = { - frecency = true, - cwd_bonus = false, - }, - sources = { - -- layout options: dropdown, horizontal, vertical, vscode, ivy, ivy_split, telescope, top, left, right, bottom, sidebar - buffers = { layout = files_layout() }, - commands = { layout = palette_layout() }, - command_history = { layout = palette_layout() }, - files = { - hidden = true, - layout = files_layout(), - }, - icons = { - icon_sources = { "nerd_fonts", "emoji" }, - layout = palette_layout(), - }, - git_files = { layout = files_layout() }, - git_branches = { layout = { preset = "vertical" } }, - git_status = { layout = files_layout() }, - help = { layout = { preset = "ivy_split" } }, - man = { layout = { preset = "ivy_split" } }, - notifications = { layout = palette_layout() }, - projects = { - dev = { "~/Projects", "~/Projects/other" }, - layout = files_layout(0.8), - }, - recent = { layout = files_layout() }, - search_history = { layout = palette_layout() }, - smart = { layout = files_layout() }, - undo = { layout = { preset = "ivy" } }, - zoxide = { layout = files_layout(0.7) }, - }, - layout = "custom", - layouts = { - custom = { - layout = { - box = "vertical", - backdrop = false, - row = -1, - width = 0, - height = 0.4, - border = "top", - title = " {title} {live} {flags}", - title_pos = "left", - { - box = "horizontal", - { win = "list", border = "rounded" }, - { win = "preview", title = "{preview}", width = 0.6, border = "left" }, - }, - { win = "input", height = 1, border = "top" }, - }, - }, - }, - }, - profiler = { enabled = true }, - quickfile = { enabled = true }, - rename = { enabled = true }, - scope = { - enabled = true, - keys = { - textobject = { - ii = { - min_size = 2, -- minimum size of the scope - edge = false, -- inner scope - cursor = false, - treesitter = { blocks = { enabled = false } }, - desc = "inner scope", - }, - ai = { - cursor = false, - min_size = 2, -- minimum size of the scope - treesitter = { blocks = { enabled = false } }, - desc = "full scope", - }, - }, - jump = { - ["[a"] = { - min_size = 1, -- allow single line scopes - bottom = false, - cursor = false, - edge = true, - treesitter = { blocks = { enabled = false } }, - desc = "jump to top edge of scope", - }, - ["]a"] = { - min_size = 1, -- allow single line scopes - bottom = true, - cursor = false, - edge = true, - treesitter = { blocks = { enabled = false } }, - desc = "jump to bottom edge of scope", - }, - }, - }, - }, - scratch = { - enabled = true, - name = "SCRATCH", - ft = function() - if vim.bo.buftype == "" and vim.bo.filetype ~= "" then - return vim.bo.filetype - end - return "markdown" - end, - icon = nil, - root = vim.fn.stdpath("data") .. "/scratch", - autowrite = true, - filekey = { - cwd = true, - branch = true, - count = true, - }, - win = { - width = 120, - height = 40, - bo = { buftype = "", buflisted = false, bufhidden = "hide", swapfile = false }, - minimal = false, - noautocmd = false, - zindex = 20, - wo = { winhighlight = "NormalFloat:Normal" }, - border = "rounded", - title_pos = "center", - footer_pos = "center", - - keys = { - ["execute"] = { - "", - function(_) - vim.cmd("%SnipRun") - end, - desc = "Execute buffer", - mode = { "n", "x" }, - }, - }, - }, - win_by_ft = { - lua = { - keys = { - ["source"] = { - "cr", - function(self) - local name = "scratch." .. vim.fn.fnamemodify(vim.api.nvim_buf_get_name(self.buf), ":e") - Snacks.debug.run({ buf = self.buf, name = name }) - end, - desc = "Source buffer", - mode = { "n", "x" }, - }, - }, - }, - }, - }, - scroll = { enabled = true }, - select = { enabled = true }, - statuscolumn = { - enabled = true, -- Change this to false - left = { "mark", "sign" }, - right = { "fold", "git" }, - folds = { - open = false, - git_hl = false, - }, - git = { - patterns = { "GitSign", "MiniDiffSign" }, - }, - refresh = 50, - }, - terminal = { enabled = true }, - toggle = { enabled = true }, - win = { enabled = true }, - words = { enabled = true }, - zen = { - enabled = true, - toggles = { - dim = true, - git_signs = false, - mini_diff_signs = false, - -- diagnostics = false, - -- inlay_hints = false, - }, - show = { - statusline = false, - tabline = false, - }, - win = { style = "zen" }, - zoom = { - toggles = {}, - show = { statusline = true, tabline = true }, - win = { - backdrop = false, - width = 0, - }, - }, - }, + keys = { + ['execute'] = { + '', + function(_) + vim.cmd('%SnipRun') + end, + desc = 'Execute buffer', + mode = { 'n', 'x' }, + }, + }, + }, + win_by_ft = { + lua = { + keys = { + ['source'] = { + 'cr', + function(self) + local name = 'scratch.' .. vim.fn.fnamemodify(vim.api.nvim_buf_get_name(self.buf), ':e') + Snacks.debug.run({ buf = self.buf, name = name }) + end, + desc = 'Source buffer', + mode = { 'n', 'x' }, + }, + }, + }, + }, + }, + scroll = { enabled = true }, + select = { enabled = true }, + statuscolumn = { + enabled = true, -- Change this to false + left = { 'mark', 'sign' }, + right = { 'fold', 'git' }, + folds = { + open = false, + git_hl = false, + }, + git = { + patterns = { 'GitSign', 'MiniDiffSign' }, + }, + refresh = 50, + }, + terminal = { enabled = true }, + toggle = { enabled = true }, + win = { enabled = true }, + words = { enabled = true }, + zen = { + enabled = true, + toggles = { + dim = true, + git_signs = false, + mini_diff_signs = false, + -- diagnostics = false, + -- inlay_hints = false, + }, + show = { + statusline = false, + tabline = false, + }, + win = { style = 'zen' }, + zoom = { + toggles = {}, + show = { statusline = true, tabline = true }, + win = { + backdrop = false, + width = 0, + }, + }, + }, })