Skip to content

Commit b64bb6f

Browse files
committed
feat(mini): remove some
1 parent 8fbaeb9 commit b64bb6f

15 files changed

+262
-231
lines changed

colors/catppuccin-test.lua

+168
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
-- Clear hlgroups and set colors_name {{{
2+
vim.cmd.hi('clear')
3+
vim.g.colors_name = 'catppuccin-test'
4+
-- }}}
5+
6+
-- Palette {{{
7+
-- stylua: ignore start
8+
local c_rosewater
9+
local c_flamingo
10+
local c_pink
11+
local c_mauve
12+
local c_red
13+
local c_maroon
14+
local c_peach
15+
local c_yellow
16+
local c_green
17+
local c_teal
18+
local c_sky
19+
local c_sapphire
20+
local c_blue
21+
local c_lavender
22+
local c_text
23+
local c_subtext1
24+
local c_subtext0
25+
local c_overlay2
26+
local c_overlay1
27+
local c_overlay0
28+
local c_surface2
29+
local c_surface1
30+
local c_surface0
31+
local c_base
32+
local c_mantle
33+
local c_crust
34+
35+
if vim.go.bg == 'dark' then
36+
c_crust = '#11111b'
37+
c_mantle = '#181825'
38+
c_base = '#1e1e2e'
39+
c_surface0 = '#313244'
40+
c_surface1 = '#45475a'
41+
c_surface2 = '#585b70'
42+
c_overlay0 = '#6c7086'
43+
c_overlay1 = '#7f849c'
44+
c_overlay2 = '#9399b2'
45+
c_subtext0 = '#a6adc8'
46+
c_subtext1 = '#bac2de'
47+
c_text = '#cdd6f4'
48+
c_lavender = '#b4befe'
49+
c_blue = '#89b4fa'
50+
c_sapphire = '#74c7ec'
51+
c_sky = '#89dceb'
52+
c_teal = '#94e2d5'
53+
c_green = '#a6e3a1'
54+
c_yellow = '#f9e2af'
55+
c_peach = '#fab387'
56+
c_maroon = '#eba0ac'
57+
c_red = '#f38ba8'
58+
c_mauve = '#cba6f7'
59+
c_pink = '#f5c2e7'
60+
c_flamingo = '#f2cdcd'
61+
c_rosewater = '#f5e0dc'
62+
else
63+
c_crust = '#dce0e8'
64+
c_mantle = '#e6e9ef'
65+
c_base = '#eff1f5'
66+
c_surface0 = '#ccd0da'
67+
c_surface1 = '#bcc0cc'
68+
c_surface2 = '#acb0be'
69+
c_overlay0 = '#9ca0b0'
70+
c_overlay1 = '#8c8fa1'
71+
c_overlay2 = '#7c7f93'
72+
c_subtext0 = '#6c6f85'
73+
c_subtext1 = '#5c5f77'
74+
c_text = '#4c4f69'
75+
c_lavender = '#7287fd'
76+
c_blue = '#1e66f5'
77+
c_sapphire = '#209fb5'
78+
c_sky = '#04a5e5'
79+
c_teal = '#179299'
80+
c_green = '#40a02b'
81+
c_yellow = '#df8e1d'
82+
c_peach = '#fe640b'
83+
c_maroon = '#e64553'
84+
c_red = '#d20f39'
85+
c_mauve = '#8839ef'
86+
c_pink = '#ea76cb'
87+
c_flamingo = '#dd7878'
88+
c_rosewater = '#dc8a78'
89+
end
90+
-- }}}
91+
92+
-- Highlight groups {{{1
93+
local hlgroups = {
94+
-- UI {{{2
95+
ColorColumn = { bg = c_surface0 },
96+
Conceal = { bold = true, fg = c_overlay1 },
97+
CurSearch = { link = 'IncSearch' },
98+
Cursor = { bg = c_text, fg = c_base },
99+
CursorColumn = { link = 'CursorLine' },
100+
CursorIM = { link = 'Cursor' },
101+
CursorLine = { bg = c_surface0 },
102+
CursorLineNr = { fg = c_mauve, bold = true },
103+
DebugPC = { bg = c_crust },
104+
DiffAdd = { bg = c_green },
105+
DiffChange = { bg = c_blue },
106+
DiffDelete = { fg = c_red },
107+
DiffText = { bg = c_blue },
108+
Directory = { fg = c_blue },
109+
EndOfBuffer = { fg = c_surface1 },
110+
ErrorMsg = { fg = c_red },
111+
FloatBorder = { bg = c_mantle, fg = c_subtext0 },
112+
FloatFooter = { bg = c_mantle, fg = c_surface2 },
113+
FloatTitle = { bg = c_mantle, fg = c_subtext1, bold = true },
114+
FoldColumn = { fg = c_overlay0 },
115+
Folded = { bg = c_surface1, fg = c_overlay0 },
116+
Ignore = { link = 'NonText' },
117+
IncSearch = { bg = c_yellow, fg = c_base },
118+
LineNr = { fg = c_surface1 },
119+
MatchParen = { bg = c_surface1 },
120+
ModeMsg = { fg = c_red, bold = true },
121+
MoreMsg = { fg = c_blue },
122+
MsgArea = { fg = c_text },
123+
MsgSeparator = { bg = c_surface1 },
124+
NonText = { fg = c_overlay0 },
125+
Normal = { bg = c_base, fg = c_text },
126+
NormalFloat = { bg = c_mantle, fg = c_text },
127+
NormalNC = { link = 'Normal' },
128+
Pmenu = { bg = c_mantle, fg = c_text },
129+
PmenuSbar = { bg = c_crust },
130+
PmenuSel = { bg = c_surface0, fg = 'NONE' },
131+
PmenuThumb = { bg = c_surface0},
132+
Question = { link = 'MoreMsg' },
133+
QuickFixLine = { bg = c_surface1 },
134+
Search = { bg = c_surface2 },
135+
SignColumn = { fg = c_surface1 },
136+
SpellBad = { underdashed = true },
137+
SpellCap = { underdashed = true },
138+
SpellLocal = { underdashed = true },
139+
SpellRare = { underdashed = true },
140+
StatusLine = { bg = c_mantle, fg = c_text },
141+
StatusLineNC = { bg = c_mantle, fg = c_surface1 },
142+
Substitute = { bg = c_surface1, fg = c_pink },
143+
TabLine = { link = 'StatusLineNC' },
144+
TabLineFill = { link = 'Normal' },
145+
TabLineSel = { link = 'StatusLine' },
146+
TermCursor = { fg = c_base, bg = c_red},
147+
TermCursorNC = { fg = c_base, bg = c_rosewater },
148+
Title = { bold = true, fg = c_blue },
149+
Underlined = { fg = c_teal, underline = true },
150+
VertSplit = { link = 'WinSeparator' },
151+
Visual = { bg = c_surface1 },
152+
VisualNOS = { link = 'Visual' },
153+
WarningMsg = { fg = c_yellow },
154+
Whitespace = { fg = c_surface1 },
155+
WildMenu = { link = 'Pmenu' },
156+
WinBar = { bg = 'NONE', fg = c_rosewater },
157+
WinBarNC = { link = 'WinBar' },
158+
WinSeparator = { fg = c_surface2 },
159+
lCursor = { link = 'Cursor' },
160+
-- }}}2
161+
}
162+
-- }}}1
163+
164+
-- Set highlight groups {{{1
165+
for hlgroup_name, hlgroup_attr in pairs(hlgroups) do
166+
vim.api.nvim_set_hl(0, hlgroup_name, hlgroup_attr)
167+
end
168+
-- }}}1

lua/configs/catppuccin.lua

-5
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,11 @@ require('catppuccin').setup({
9999
highlight_overrides = {
100100
all = function(colors)
101101
return {
102-
["@character.special.gitignore"] = { fg = colors.mauve }, -- catppuccin/nvim#736
103102
FzfLuaBorder = { link = 'WinSeparator' },
104103

105104
NormalFloat = { bg = colors.mantle },
106105
FloatBorder = { bg = colors.mantle, fg = colors.mantle },
107106
CursorLineNr = { fg = colors.mauve, style = { 'bold' } },
108-
PmenuSel = { bg = colors.surface0, fg = '' },
109-
Pmenu = { bg = colors.mantle },
110-
PmenuSbar = { bg = colors.crust },
111-
PmenuThumb = { bg = colors.surface0 },
112107
WinSeparator = { fg = colors.surface1 },
113108
CmpGhostText = { link = 'Comment' },
114109
Folded = { link = 'Comment' },

lua/configs/cmp.lua

+4-2
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,11 @@ cmp.setup({
113113
},
114114
},
115115
formatting = {
116-
fields = { 'kind', 'abbr', 'menu' },
116+
fields = { 'abbr', 'kind', 'menu' },
117117
format = function(entry, cmp_item)
118-
cmp_item.kind = entry.source.name == 'calc' and icons.ui.Calculator or icons.kinds[cmp_item.kind] or ' '
118+
cmp_item.kind = ' ' .. (entry.source.name == 'calc' and icons.ui.Calculator .. 'Calculator'
119+
or entry.source.name == 'cmdline' and icons.ui.Cmd .. 'Command'
120+
or icons.kinds[cmp_item.kind] .. cmp_item.kind or '')
119121
return cmp_item
120122
end,
121123
},

lua/configs/mini-align.lua

-6
This file was deleted.

lua/configs/mini-bracketed.lua

-1
This file was deleted.

lua/configs/mini-clue.lua

-45
This file was deleted.

lua/configs/mini-surround.lua

-1
This file was deleted.

lua/core/autocmds.lua

-18
Original file line numberDiff line numberDiff line change
@@ -170,21 +170,3 @@ augroup('AutoCreateDir', {
170170
end,
171171
},
172172
})
173-
174-
augroup('AutoToggleCmdline', {
175-
'CmdlineEnter',
176-
{
177-
desc = 'Auto show cmdline when focused',
178-
callback = function()
179-
vim.opt.cmdheight = 1
180-
end
181-
}
182-
}, {
183-
'CmdlineLeave',
184-
{
185-
desc = 'Auto hide cmdline when not focused',
186-
callback = function()
187-
vim.opt.cmdheight = 0
188-
end
189-
}
190-
})

lua/core/keymaps.lua

+77-27
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,85 @@
1-
local map = vim.keymap.set
1+
-- More consistent behavior when &wrap is set
2+
-- stylua: ignore start
3+
vim.keymap.set({ 'n', 'x' }, 'j', 'v:count ? "j" : "gj"', { expr = true })
4+
vim.keymap.set({ 'n', 'x' }, 'k', 'v:count ? "k" : "gk"', { expr = true })
5+
vim.keymap.set({ 'n', 'x' }, '<Down>', 'v:count ? "<Down>" : "g<Down>"', { expr = true, replace_keycodes = false })
6+
vim.keymap.set({ 'n', 'x' }, '<Up>', 'v:count ? "<Up>" : "g<Up>"', { expr = true, replace_keycodes = false })
7+
vim.keymap.set({ 'i' }, '<Down>', '<Cmd>norm! g<Down><CR>')
8+
vim.keymap.set({ 'i' }, '<Up>', '<Cmd>norm! g<Up><CR>')
9+
-- stylua: ignore end
210

11+
-- Multi-window operations
312
-- stylua: ignore start
4-
map({ 'n', 'x' }, 'j', 'v:count ? "j" : "gj"', { expr = true })
5-
map({ 'n', 'x' }, 'k', 'v:count ? "k" : "gk"', { expr = true })
6-
map({ 'n', 'x' }, '<Down>', 'v:count ? "<Down>" : "g<Down>"', { expr = true, replace_keycodes = false })
7-
map({ 'n', 'x' }, '<Up>', 'v:count ? "<Up>" : "g<Up>"', { expr = true, replace_keycodes = false })
8-
map({ 'i' }, '<Down>', '<Cmd>norm! g<Down><CR>')
9-
map({ 'i' }, '<Up>', '<Cmd>norm! g<Up><CR>')
13+
vim.keymap.set({ 'n', 'x' }, '<M-h>', '<C-w>h')
14+
vim.keymap.set({ 'n', 'x' }, '<M-j>', '<C-w>j')
15+
vim.keymap.set({ 'n', 'x' }, '<M-k>', '<C-w>k')
16+
vim.keymap.set({ 'n', 'x' }, '<M-l>', '<C-w>l')
17+
vim.keymap.set({ 'n', 'x' }, '<M-n>', '<C-w>n')
18+
vim.keymap.set({ 'n', 'x' }, '<M-q>', '<C-w>q')
19+
vim.keymap.set({ 'n', 'x' }, '<M-s>', '<C-w>s')
20+
vim.keymap.set({ 'n', 'x' }, '<M-v>', '<C-w>v')
21+
vim.keymap.set({ 'n', 'x' }, '<M-x>', '<C-w>x')
22+
23+
vim.keymap.set('t', '<C-^>', '<Cmd>b#<CR>', { replace_keycodes = false })
24+
vim.keymap.set('t', '<C-6>', '<Cmd>b#<CR>', { replace_keycodes = false })
25+
vim.keymap.set('t', '<Esc>', '<Cmd>stopi<CR>', { replace_keycodes = false })
26+
vim.keymap.set('t', '<M-h>', '<Cmd>wincmd h<CR>', { replace_keycodes = false })
27+
vim.keymap.set('t', '<M-j>', '<Cmd>wincmd j<CR>', { replace_keycodes = false })
28+
vim.keymap.set('t', '<M-k>', '<Cmd>wincmd k<CR>', { replace_keycodes = false })
29+
vim.keymap.set('t', '<M-l>', '<Cmd>wincmd l<CR>', { replace_keycodes = false })
1030
-- stylua: ignore end
1131

12-
map({ 'i', 'c' }, '<M-Backspace>', '<C-w>')
32+
-- Buffer navigation
33+
vim.keymap.set('n', ']b', '<Cmd>exec v:count1 . "bn"<CR>')
34+
vim.keymap.set('n', '[b', '<Cmd>exec v:count1 . "bp"<CR>')
35+
36+
-- Tabpages
37+
---@param tab_action function
38+
---@param default_count number?
39+
---@return function
40+
local function tabswitch(tab_action, default_count)
41+
return function()
42+
local count = default_count or vim.v.count
43+
local num_tabs = vim.fn.tabpagenr('$')
44+
if num_tabs >= count then
45+
tab_action(count ~= 0 and count or nil)
46+
return
47+
end
48+
vim.cmd.tablast()
49+
for _ = 1, count - num_tabs do
50+
vim.cmd.tabnew()
51+
end
52+
end
53+
end
54+
vim.keymap.set({ 'n', 'x' }, 'gt', tabswitch(vim.cmd.tabnext))
55+
vim.keymap.set({ 'n', 'x' }, 'gT', tabswitch(vim.cmd.tabprev))
56+
vim.keymap.set({ 'n', 'x' }, 'gy', tabswitch(vim.cmd.tabprev)) -- gT is too hard to press
57+
58+
vim.keymap.set({ 'n', 'x' }, '<Leader>0', '<Cmd>0tabnew<CR>')
59+
vim.keymap.set({ 'n', 'x' }, '<Leader>1', tabswitch(vim.cmd.tabnext, 1))
60+
vim.keymap.set({ 'n', 'x' }, '<Leader>2', tabswitch(vim.cmd.tabnext, 2))
61+
vim.keymap.set({ 'n', 'x' }, '<Leader>3', tabswitch(vim.cmd.tabnext, 3))
62+
vim.keymap.set({ 'n', 'x' }, '<Leader>4', tabswitch(vim.cmd.tabnext, 4))
63+
vim.keymap.set({ 'n', 'x' }, '<Leader>5', tabswitch(vim.cmd.tabnext, 5))
64+
vim.keymap.set({ 'n', 'x' }, '<Leader>6', tabswitch(vim.cmd.tabnext, 6))
65+
vim.keymap.set({ 'n', 'x' }, '<Leader>7', tabswitch(vim.cmd.tabnext, 7))
66+
vim.keymap.set({ 'n', 'x' }, '<Leader>8', tabswitch(vim.cmd.tabnext, 8))
67+
vim.keymap.set({ 'n', 'x' }, '<Leader>9', tabswitch(vim.cmd.tabnext, 9))
68+
69+
-- Correct misspelled word / mark as correct
70+
vim.keymap.set('i', '<C-g>+', '<Esc>[szg`]a')
71+
vim.keymap.set('i', '<C-g>=', '<C-g>u<Esc>[s1z=`]a<C-G>u')
72+
73+
-- Close all floating windows
74+
vim.keymap.set('n', 'q', '<Cmd>fclose<CR>')
1375

14-
map('n', '<Esc>', '<Cmd>noh<CR>')
15-
map('n', 'q', '<Cmd>fclose<CR>')
76+
-- Edit current file's directory
77+
vim.keymap.set({ 'n', 'x' }, '-', '<Cmd>e%:p:h<CR>')
1678

79+
-- Use 'g{' and 'g}' to move to the first/last line of a paragraph
1780
-- stylua: ignore start
18-
map({ 'n', 'x' }, '<M-h>', '<C-w>h')
19-
map({ 'n', 'x' }, '<M-j>', '<C-w>j')
20-
map({ 'n', 'x' }, '<M-k>', '<C-w>k')
21-
map({ 'n', 'x' }, '<M-l>', '<C-w>l')
22-
map({ 'n', 'x' }, '<M-n>', '<C-w>n')
23-
map({ 'n', 'x' }, '<M-q>', '<C-w>q')
24-
map({ 'n', 'x' }, '<M-s>', '<C-w>s')
25-
map({ 'n', 'x' }, '<M-v>', '<C-w>v')
26-
map({ 'n', 'x' }, '<M-x>', '<C-w>x')
27-
28-
map('t', '<C-^>', '<Cmd>b#<CR>', { replace_keycodes = false })
29-
map('t', '<C-6>', '<Cmd>b#<CR>', { replace_keycodes = false })
30-
map('t', '<Esc>', '<Cmd>stopi<CR>', { replace_keycodes = false })
31-
map('t', '<M-h>', '<Cmd>wincmd h<CR>', { replace_keycodes = false })
32-
map('t', '<M-j>', '<Cmd>wincmd j<CR>', { replace_keycodes = false })
33-
map('t', '<M-k>', '<Cmd>wincmd k<CR>', { replace_keycodes = false })
34-
map('t', '<M-l>', '<Cmd>wincmd l<CR>', { replace_keycodes = false })
81+
vim.keymap.set({ 'o' }, 'g{', '<Cmd>silent! normal Vg{<CR>', { noremap = false })
82+
vim.keymap.set({ 'o' }, 'g}', '<Cmd>silent! normal Vg}<CR>', { noremap = false })
83+
vim.keymap.set({ 'n', 'x' }, 'g{', function() require('utils.misc').goto_paragraph_firstline() end, { noremap = false })
84+
vim.keymap.set({ 'n', 'x' }, 'g}', function() require('utils.misc').goto_paragraph_lastline() end, { noremap = false })
3585
-- stylua: ignore end

0 commit comments

Comments
 (0)