Compare commits

...

13 Commits

Author SHA1 Message Date
8cf37489be replace the bufferline with the mini variant
added devicons to telescope deps, so the deps are tracked more
accurately.
2025-11-23 02:05:17 +01:00
8f98beb4a7 replace autopairs with a mini version 2025-11-23 01:54:32 +01:00
f0a4230996 replace which-key with a functionality from mini 2025-11-23 01:44:56 +01:00
4580c248d7 remove unused/rarely used render markdown
we'll need to fing a better solution regardless
2025-11-23 01:36:35 +01:00
5275987eb0 replace inconsistent trailing whitespace functionality with one from mini 2025-11-23 01:33:31 +01:00
411bc325c5 replace snacks with some mini functions 2025-11-23 01:30:17 +01:00
c00629e56d replace gitsigns with the mini variant 2025-11-23 01:24:47 +01:00
84a87fb6a6 add some extra mini plugins 2025-11-23 01:15:44 +01:00
7327691016 simplify statusline 2025-11-23 01:14:11 +01:00
7e654d39e2 write some comments for the different mini modules' functionalities 2025-11-23 00:48:23 +01:00
eed65f7ae0 remove mini.move explicit setup, since we're already using defaults 2025-11-23 00:46:14 +01:00
3507dc0ca1 seperate out mini from lazy.nvim 2025-11-23 00:44:03 +01:00
dfadf1c9f2 fix: not using full path for bash aliases 2025-11-23 00:44:03 +01:00
10 changed files with 120 additions and 334 deletions

View File

@@ -75,7 +75,7 @@ HISTIGNORE='exit*:clear*:\:*:echo*'
shopt -s checkwinsize # check the window size after each command (and if necessary, the values of LINES and COLUMNS)
shopt -s globstar # enable globstar (**/*)
[ -f "$HOME/.bash_aliases" ] && . .bash_aliases
[ -f "$HOME/.bash_aliases" ] && . "$HOME/.bash_aliases"
# cute lil hyfetch :3
[ "$TERM" == "xterm-kitty" ] && fastfetch

View File

@@ -1,32 +0,0 @@
---@type LazySpec
return { {
'windwp/nvim-autopairs', -- automatically inserts closing brackets
event = { 'BufReadPre', 'BufNewFile' },
opts = {
enable_moveright = true, -- moves the cursor over existing pairs instead of inserting duplicates
check_ts = true, -- whether to check treesitter for specific nodes
ts_config = {}
},
config = function(_, opts)
local autopairs = require 'nvim-autopairs'
autopairs.setup(opts)
-- customise the rule for [] brackets so it doesn't close when typing ANSI escape codes
local rule = autopairs.get_rule '['
if rule then
rule:with_pair(function(opt)
local ei = math.max(1, opt.col - 1) -- get the end-index
local prev_oct = opt.line:sub(math.max(1, opt.col - 4), ei) -- get the range of an octal escape code
local prev_hex = opt.line:sub(math.max(1, opt.col - 4), ei) -- get the range of a hexadecimal escape code
local prev_cha = opt.line:sub(math.max(1, opt.col - 2), ei) -- get the range of a character escape code
-- check whether we can't match any of the patterns,
-- if so return true, otherwise return false (whether to insert a pair)
return (prev_oct ~= [[\033]] and prev_hex ~= [[\x1b]] and prev_cha ~= [[\e]])
end)
else
vim.notify('could not add a rule for not auto-closing [ when typing an ANSI escape code',
vim.log.levels.WARN)
end
end,
} }

View File

@@ -1,29 +0,0 @@
---@type LazySpec
return { {
'akinsho/bufferline.nvim', -- shows the opened buffers
event = 'VeryLazy',
dependencies = { 'nvim-tree/nvim-web-devicons', },
---@type bufferline.UserConfig
opts = {
options = {
mode = 'buffers',
separator_style = '',
sort_by = 'directory',
diagnostics = 'nvim_lsp',
diagnostics_indicator = function(c, _, _, _)
return '(' .. c .. ')'
end,
},
},
config = function(_, opts)
require('bufferline').setup(opts)
Map('n', '<tab>', '<cmd>BufferLineCycleNext<cr>', { desc = 'switch to the next tab' })
Map('n', '<s-tab>', '<cmd>BufferLineCyclePrev<cr>', { desc = 'switch to the previous tab' })
Map('n', '<leader>wch', '<cmd>BufferLineCloseLeft<cr>', { desc = 'close the tabs on the left' })
Map('n', '<leader>wcl', '<cmd>BufferLineCloseRight<cr>', { desc = 'close the tabs on the right' })
Map('n', '<leader>wcw', '<cmd>BufferLineCloseOthers<cr>',
{ desc = 'close all tabs except the current one' })
end,
} }

View File

@@ -1,54 +0,0 @@
---@type LazySpec
return { {
'lewis6991/gitsigns.nvim', -- adds git signs to the signcolumn
event = 'VeryLazy',
opts = {
signs_staged_enable = true, -- whether staged statuses are enabled
signcolumn = true, -- the signs enable/disable based on the signcolumn state
current_line_blame = true, -- show the blame of the current line
current_line_blame_opts = {
delay = 50, -- delay in MS before blame is shown
ignore_whitespace = true, -- whether to ignore whitespace
use_focus = true, -- whether to only enable when the buffer is in focus
},
signs = { -- signs when working
add = { text = '+' },
change = { text = '~' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
untracked = { text = '' },
},
signs_staged = { -- signs when staged
add = { text = 'A' },
change = { text = 'M' },
delete = { text = 'D' },
topdelete = { text = 'D' },
changedelete = { text = 'M' },
untracked = { text = 'U' },
},
attach_to_untracked = true, -- shows untracked files' signcolumn
},
config = function(_, opts)
require('gitsigns').setup(opts)
local palette = _G.userdat.palette
local bg = vim.api.nvim_get_hl(0, { name = 'SignColumn' }).bg
for n, fg in pairs {
GitSignsAdd = palette.bright_green,
GitSignsChange = palette.bright_orange,
GitSignsDelete = palette.bright_red,
GitSignsTopdelete = palette.bright_red,
GitSignsChangedelete = palette.bright_orange,
GitSignsUntracked = palette.bright_aqua,
GitSignsStagedAdd = palette.neutral_green,
GitSignsStagedChange = palette.neutral_orange,
GitSignsStagedDelete = palette.neutral_red,
GitSignsStagedTopDelete = palette.neutral_red,
GitSignsStagedChangedelete = palette.neutral_orange,
GitSignsStagedUntracked = palette.neutral_aqua,
} do
vim.api.nvim_set_hl(0, n, { fg = fg, bg = bg })
end
end,
} }

View File

@@ -3,7 +3,6 @@
return { {
'ellisonleao/gruvbox.nvim',
lazy = false,
dependencies = { 'johnfrankmorgan/whitespace.nvim' },
priority = 1000,
---@module 'gruvbox'
---@type GruvboxConfig

View File

@@ -1,72 +1,120 @@
-- Clone 'mini.nvim' manually in a way that it gets managed by 'mini.deps'
local path_package = vim.fn.stdpath('data') .. '/site/'
local mini_path = path_package .. 'pack/deps/start/mini.nvim'
if not (vim.uv or vim.loop).fs_stat(mini_path) then
vim.cmd('echo "Installing [`mini.nvim`](../doc/mini-nvim.qmd#mini.nvim)" | redraw')
local clone_cmd = {
'git', 'clone', '--filter=blob:none',
'https://github.com/nvim-mini/mini.nvim', mini_path
}
vim.fn.system(clone_cmd)
vim.cmd('packadd mini.nvim | helptags ALL')
vim.cmd('echo "Installed [`mini.nvim`](../doc/mini-nvim.qmd#mini.nvim)" | redraw')
end
require('mini.deps').setup({ path = { package = path_package } })
require('mini.ai').setup() -- enhances the use of a/i textobjects
require('mini.align').setup() -- utility to align text in various ways
require('mini.comment').setup() -- for toggling comments inline
require('mini.move').setup() -- moving lines
require('mini.operators').setup() -- duplicating lines and evaluating equations inline
require('mini.pairs').setup() -- automatic closing pairs
require('mini.surround').setup() -- surround stuff
require('mini.clue').setup({ -- shows available keybinds when performing keybind actions
window = { delay = 50 },
triggers = {
-- Leader triggers
{ mode = 'n', keys = '<Leader>' },
{ mode = 'x', keys = '<Leader>' },
-- Built-in completion
{ mode = 'i', keys = '<C-x>' },
-- `g` key
{ mode = 'n', keys = 'g' },
{ mode = 'x', keys = 'g' },
-- Marks
{ mode = 'n', keys = "'" },
{ mode = 'n', keys = '`' },
{ mode = 'x', keys = "'" },
{ mode = 'x', keys = '`' },
-- Registers
{ mode = 'n', keys = '"' },
{ mode = 'x', keys = '"' },
{ mode = 'i', keys = '<C-r>' },
{ mode = 'c', keys = '<C-r>' },
-- Window commands
{ mode = 'n', keys = '<C-w>' },
-- `z` key
{ mode = 'n', keys = 'z' },
{ mode = 'x', keys = 'z' },
},
clues = {
-- Enhance this by adding descriptions for <Leader> mapping groups
require('mini.clue').gen_clues.builtin_completion(),
require('mini.clue').gen_clues.g(),
require('mini.clue').gen_clues.marks(),
require('mini.clue').gen_clues.registers(),
require('mini.clue').gen_clues.windows(),
require('mini.clue').gen_clues.z(),
},
})
require('mini.diff').setup({ -- shows git diffs in the file
view = {
style = 'sign',
}
})
require('mini.jump').setup() -- extends f,F,t,T to work across multiple lines
require('mini.cursorword').setup() -- highlight words beneath the cursor
require('mini.icons').setup()
require('mini.indentscope').setup({
draw = {
delay = 50, -- delay in MS before writing the indicator
animation = require('mini.indentscope').gen_animation.none(),
},
})
MiniDeps.later(function()
vim.api.nvim_set_hl(0, 'MiniIndentscopeSymbol', { link = 'Whitespace' })
end)
require('mini.notify').setup() -- has more noticeable / utilitarian / aesthetically pleasing notifications
require('mini.statusline').setup({
content = {
active = function()
local mode, mode_hl = MiniStatusline.section_mode({ trunc_width = 120 })
local git = MiniStatusline.section_git({ trunc_width = 40 })
local diff = MiniStatusline.section_diff({ trunc_width = 75 })
local diagnostics = MiniStatusline.section_diagnostics({ trunc_width = 75 })
local lsp = MiniStatusline.section_lsp({ trunc_width = 75 })
local filename = MiniStatusline.section_filename({ trunc_width = 140 })
local fileinfo = MiniStatusline.section_fileinfo({ trunc_width = 120 })
return MiniStatusline.combine_groups({
{ hl = mode_hl, strings = { mode } },
{ hl = 'MiniStatuslineDevinfo', strings = { git, diff, diagnostics, lsp } },
'%<', -- general truncation point
{ hl = 'MiniStatuslineFilename', strings = { filename } },
'%=', -- align right
{ hl = 'MiniStatuslineFileInfo', strings = { fileinfo } },
{ hl = mode_hl, strings = { '%3l:%-3c' } }
})
end,
inactive = function()
return MiniStatusline.combine_groups({
{},
})
end
},
use_icons = true,
set_vim_settings = true,
})
require('mini.tabline').setup() -- TODO: port keybindings from the older configuration
require('mini.trailspace').setup() -- trailing space indication and removal.
---@module 'lazy'
---@type LazySpec
return { {
'nvim-mini/mini.nvim',
config = function()
require('mini.ai').setup()
require('mini.surround').setup()
require('mini.operators').setup()
require('mini.indentscope').setup({
symbol = '¦',
draw = {
delay = 50, -- delay in MS before writing the indicator
animation = require('mini.indentscope').gen_animation.none(),
},
options = {
try_as_border = false,
},
})
vim.api.nvim_set_hl(0, 'MiniIndentscopeSymbol', { fg = _G.userdat.palette.dark2, bg = nil })
require('mini.move').setup({
mappings = {
-- move visual selection in visual mode
left = '<m-h>',
down = '<m-j>',
up = '<m-k>',
right = '<m-l>',
-- move current line in normal mode
line_left = '<m-h>',
line_down = '<m-j>',
line_up = '<m-k>',
line_right = '<m-l>',
},
options = {
reindent_linewise = true, -- automatically re-indent selection during line vertical move
},
})
require('mini.statusline').setup({
content = {
active = function()
local mode, mode_hl = MiniStatusline.section_mode({ trunc_width = 120 })
local git = MiniStatusline.section_git({ trunc_width = 40 })
local diff = MiniStatusline.section_diff({ trunc_width = 75 })
local diagnostics = MiniStatusline.section_diagnostics({ trunc_width = 75 })
local lsp = MiniStatusline.section_lsp({ trunc_width = 75 })
local filename = MiniStatusline.section_filename({ trunc_width = 140 })
local fileinfo = MiniStatusline.section_fileinfo({ trunc_width = 120 })
return MiniStatusline.combine_groups({
{ hl = mode_hl, strings = { mode } },
{ hl = 'MiniStatuslineDevinfo', strings = { git, diff, diagnostics, lsp } },
'%<', -- general truncation point
{ hl = 'MiniStatuslineFilename', strings = { filename } },
'%=', -- align right
{ hl = 'MiniStatuslineFileInfo', strings = { fileinfo } },
{ hl = mode_hl, strings = { '%3l:%-3c' } }
})
end,
inactive = function()
return MiniStatusline.combine_groups({
{},
})
end
},
use_icons = true,
set_vim_settings = true,
})
end
} }
return {}

View File

@@ -1,13 +0,0 @@
---@module 'lazy'
---@type LazySpec
return { {
'MeanderingProgrammer/render-markdown.nvim',
dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' },
---@module 'render-markdown'
---@type render.md.UserConfig
opts = {
completions = {
blink = { enabled = true }
}
}
} }

View File

@@ -1,83 +0,0 @@
---@module 'snacks'
---@module 'lazy'
---@type LazySpec
return { { -- provides quality of life features for neovim
'folke/snacks.nvim',
priority = 1000,
lazy = false,
---@type snacks.Config
opts = {
animate = { enabled = false }, -- efficient animations including over 45 easing functions (library)
bigfile = { enabled = false }, -- deal with big files
bufdelete = { enabled = false }, -- delete buffers without disrupting window layout
dashboard = { enabled = false }, -- beautiful declarative dashboards
debug = { enabled = false }, -- pretty inspect & backtraces for debugging
dim = { enabled = false }, -- focus on the active scope by dimming the rest
explorer = { enabled = false }, -- a file explorer (picker in disguise)
git = { enabled = false }, -- git utilities
gitbrowse = { enabled = false }, -- open the current file, branch, commit, or repo in a browser (e.g. github, gitlab, etc.)
image = { enabled = true }, -- image viewer using kitty graphics protocol
indent = { enabled = false }, -- indent guides and scopes
input = { enabled = false }, -- better vim.ui.input
layout = { enabled = false }, -- window layouts
lazygit = { enabled = false }, -- open lazygit in a float, auto-configure colour scheme and integration with neovim
notifier = { enabled = true }, -- pretty vim.notify
notify = { enabled = true }, -- utility functions to work with neovim's vim.notify
picker = { enabled = false }, -- picker for selecting items
profiler = { enabled = false }, -- neovim lua profiler
quickfile = { enabled = true }, -- when doing nvim somefile.txt, it will render the file as quickly as possible, before loading your plugins.
rename = { enabled = true }, -- LSP-integrated file renaming with support for plugins like and.
scope = { enabled = false }, -- scope detection, text objects and jumping based on treesitter or indent
scratch = { enabled = false }, -- scratch buffers with a persistent file
scroll = { enabled = false }, -- smooth scrolling
statuscolumn = { enabled = false }, -- pretty status column
terminal = { enabled = false }, -- create and toggle floating/split terminals
toggle = { enabled = false }, -- toggle keymaps integrated with which-key icons / colours
util = { enabled = false }, -- utility functions for Snacks (library)
win = { enabled = false }, -- create and manage floating windows or splits
words = { enabled = true }, -- auto-show LSP references and quickly navigate between them
zen = { enabled = false }, -- zen mode; distraction-free coding
},
keys = {
{ '*', function() Snacks.words.jump(-vim.v.count1) end, desc = 'next reference', nowait = true },
{ '#', function() Snacks.words.jump(vim.v.count1) end, desc = 'prev reference', nowait = true },
{ '<c-w>', function() Snacks.bufdelete() end, desc = 'delete buffer', nowait = true },
{ '<leader>N', function() Snacks.notifier.show_history() end, desc = 'show notification history' },
{ '<leader>U', function() Snacks.picker.undo() end, desc = 'undo tree' },
{ '<leader>gB', function() Snacks.git.blame_line() end, desc = 'git blame line' },
{ '<leader>gb', function() Snacks.picker.git_branches() end, desc = 'git branches' },
{ '<leader>@', function() Snacks.picker.lsp_symbols() end, desc = 'workspace symbols' },
{ '<leader>ld', function() Snacks.picker.lsp_definitions() end, desc = 'definition' },
{ '<leader>lr', function() Snacks.picker.lsp_references() end, desc = 'references' },
{ '<leader>li', function() Snacks.picker.lsp_implementations() end, desc = 'implementation' },
{ '<leader>lt', function() Snacks.picker.lsp_type_definitions() end, desc = 'type definition' },
{ '<leader>?', function() Snacks.picker.keymaps() end, desc = 'keymaps' },
{ 'gd', function() Snacks.picker.lsp_definitions() end, desc = 'definition' },
{ 'gr', function() Snacks.picker.lsp_references() end, desc = 'references' },
},
init = function()
Autocmd("User", {
pattern = 'VeryLazy',
callback = function()
local virt_lines = false;
Snacks.toggle.new({
id = "virtual_lines",
name = "diagnostics virtual lines",
get = function() return virt_lines end,
set = function(v)
virt_lines = v
vim.diagnostic.config({ virtual_lines = v })
end,
}):map('<leader>tl')
Snacks.toggle.option('wrap', { name = 'word wrap' }):map('<leader>tw')
Snacks.toggle.option('spell', { name = 'spelling' }):map('<leader>ts')
Snacks.toggle.inlay_hints():map('<leader>th')
end,
})
end,
---@param opts snacks.Config
config = function(_, opts)
require('snacks').setup(opts)
end
} }

View File

@@ -7,6 +7,7 @@ return { {
dependencies = {
{ 'nvim-lua/plenary.nvim' }, -- contains lua functions for neovim, apparently
{ 'nvim-telescope/telescope-ui-select.nvim' }, -- allows neovim core stuff to enter the telescope picker
{ 'nvim-tree/nvim-web-devicons' },
{
'nvim-telescope/telescope-fzf-native.nvim',
build = 'make', -- used for when the plugin is installed/updated

View File

@@ -1,51 +0,0 @@
---@type LazySpec
return { { -- displays pending keybinds, helps with remembering keybinds
'folke/which-key.nvim',
event = 'VeryLazy',
---@module 'which-key'
---@type wk.Opts
opts = {
delay = 0, -- delay in MS between pressing a key and opening which-key
icons = {
mappings = true,
keys = {
Up = '',
Down = '',
Left = '',
Right = '',
C = '󰘴',
M = '󰘵',
D = '󰘳',
S = '󰘶',
CR = '󰌑',
Esc = '󱊷',
ScrollWheelUp = '󱕑',
ScrollWheelDown = '󱕐',
NL = '󰌑',
BS = '󰁮',
Space = '󱁐',
Tab = '󰌒',
F1 = '<F1>',
F2 = '<F2>',
F3 = '<F3>',
F4 = '<F4>',
F5 = '<F5>',
F6 = '<F6>',
F7 = '<F7>',
F8 = '<F8>',
F9 = '<F9>',
F10 = '<F10>',
F11 = '<F11>',
F12 = '<F12>',
},
},
spec = { -- document the key chains we know about
{ '<leader>g', group = 'git' },
{ '<leader>s', group = 'search' },
{ '<leader>t', group = 'toggle' },
{ '<leader>w', group = 'windows' },
{ '<leader>l', group = 'lsp' },
{ '<leader>wc', group = 'close' },
},
},
} }