Compare commits

..
17 Commits
8 changed files with 219 additions and 134 deletions
+13 -1
View File
@@ -1,10 +1,22 @@
-- Modules
vim.loader.enable()
vim.opt.runtimepath:remove('/usr/share/nvim/site')
for _, m in ipairs({ 'netrw', 'netrwPlugin', 'gzip', 'tarPlugin', 'zipPlugin', 'tutor_mode_plugin', 'rplugin' }) do
for _, m in ipairs({
'netrw', 'netrwPlugin',
'gzip', 'tarPlugin',
'tutor_mode_plugin',
'remote_plugins',
'nvim_zip_plugin',
'nvim_net_plugin',
'spellfile_plugin',
}) do
vim.g['loaded_' .. m] = 1
end
for _, p in ipairs({ 'node', 'python3', 'perl', 'ruby' }) do
vim.g['loaded_' .. p .. '_provider'] = 0
end
-- Config Global
vim.pack.add({ 'https://github.com/nvim-mini/mini.nvim' })
local misc = require('mini.misc')
+48
View File
@@ -0,0 +1,48 @@
local ns = vim.api.nvim_create_namespace('git_status')
local hls = { M = 'DiagnosticWarn', ['?'] = 'DiagnosticInfo', A = 'DiagnosticOk', D = 'DiagnosticError', R = 'DiagnosticWarn' }
local function show(buf_id, items, query)
MiniPick.default_show(buf_id, items, query)
vim.api.nvim_buf_clear_namespace(buf_id, ns, 0, -1)
for i, item in ipairs(items) do
if item.hl then
vim.api.nvim_buf_set_extmark(buf_id, ns, i - 1, 1, { end_col = 3, hl_group = item.hl, priority = 202, hl_mode = 'combine' })
end
end
end
return {
status = function()
local lines = vim.fn.systemlist('git status -s -u')
if vim.v.shell_error ~= 0 then
return vim.notify('Not a git repository', vim.log.levels.WARN)
end
local items = {}
for _, l in ipairs(lines) do
local s = l:sub(1, 2):match('%S+')
local p = l:sub(4):gsub('.* %-> ', ''):gsub('^"(.*)"$', '%1')
local hl = l:sub(1, 1) ~= ' ' and l:sub(1, 1) ~= '?' and 'DiagnosticOk' or hls[s:sub(1, 1)]
items[#items + 1] = {
text = string.format(' %-2s %s', s == '??' and '?' or s, p),
path = p,
hl = hl,
}
end
if #items == 0 then return vim.notify('No changes', vim.log.levels.INFO) end
MiniPick.start({
source = { items = items, name = 'Git Status', show = show },
mappings = {
quickfix = {
char = '<C-q>',
func = function()
local m = MiniPick.get_picker_matches()
MiniPick.default_choose_marked(#m.marked > 0 and m.marked or m.all)
return true
end,
},
},
})
end,
}
+8 -15
View File
@@ -1,26 +1,19 @@
local M = {}
-- Open a command in a simple centered floating window
function M.open_terminal_app(cmd)
local buf = vim.api.nvim_create_buf(false, true)
vim.bo[buf].bufhidden = "wipe"
local function open(cmd)
local lines = vim.o.lines - vim.o.cmdheight - (vim.o.laststatus > 0 and 1 or 0)
local w = math.floor(vim.o.columns * 0.95)
local h = math.floor(lines * 0.95)
local w, h = math.floor(vim.o.columns * 0.95), math.floor(lines * 0.95)
local buf = vim.api.nvim_create_buf(false, true)
vim.bo[buf].bufhidden = 'wipe'
local win = vim.api.nvim_open_win(buf, true, {
relative = "editor",
relative = 'editor',
width = w,
height = h,
row = math.floor((lines - h) / 2),
col = math.floor((vim.o.columns - w) / 2),
border = "rounded",
border = 'rounded',
})
vim.fn.termopen(cmd, {
on_exit = function() pcall(vim.api.nvim_win_close, win, true) end,
})
vim.fn.termopen(cmd, { on_exit = function() pcall(vim.api.nvim_win_close, win, true) end })
end
return M
return { open = open }
+4 -4
View File
@@ -5,19 +5,19 @@
"src": "https://github.com/stevearc/conform.nvim"
},
"mini.nvim": {
"rev": "455856f765c78220fe547fb0862708942b52c42c",
"rev": "ac5dffcc52b8378fbb15efeb0497a83e57a0b01c",
"src": "https://github.com/nvim-mini/mini.nvim"
},
"nvim-dap": {
"rev": "c9a0738e45f1bd41d792a126941348dce661cf9b",
"rev": "cfa2d58f4537aca6ca83e2de1a0d9f1491121264",
"src": "https://github.com/mfussenegger/nvim-dap"
},
"nvim-lspconfig": {
"rev": "456f8cc94438de35ff2294454019e7b780b73514",
"rev": "ac9d2f7c4757db6320cab6697fe73e5e8adb2457",
"src": "https://github.com/neovim/nvim-lspconfig"
},
"nvim-treesitter": {
"rev": "5cb0114e6242625db56dd6440e945ed1ece10bc7",
"rev": "9a168f6357ed21c3a636e1727bc7d382abc451b8",
"src": "https://github.com/nvim-treesitter/nvim-treesitter"
},
"rose-pine": {
+26 -31
View File
@@ -1,28 +1,29 @@
-- General
vim.g.mapleader = ' ' -- Use `<Space>` as <Leader> key
vim.o.undofile = true -- Enable persistent undo
vim.o.shada = "'100,<50,s10,:1000,/100,@100,h" -- Limit ShaDa file (for startup)
vim.g.mapleader = ' ' -- Use `<Space>` as <Leader> key
vim.o.undofile = true -- Enable persistent undo
vim.o.shada = "'50,<20,s10,:100,/50,@50,h" -- Limit ShaDa file (for startup)
-- UI
vim.o.breakindent = true -- Indent wrapped lines to match line start
vim.o.breakindentopt = 'list:-1' -- Add padding for lists (if 'wrap' is set)
vim.o.cursorline = true -- Enable current line highlighting
vim.o.linebreak = true -- Wrap lines at 'breakat' (if 'wrap' is set)
vim.o.list = true -- Show helpful text indicators
vim.o.number = true -- Show line numbers
vim.o.pumheight = 10 -- Make popup menu smaller
vim.o.pummaxwidth = 80 -- Make popup menu not too wide
vim.o.shortmess = 'CFOSWacou' -- Disable some built-in completion messages
vim.o.signcolumn = 'yes' -- Always show signcolumn (less flicker)
vim.o.splitbelow = true -- Horizontal splits will be below
vim.o.splitkeep = 'screen' -- Reduce scroll during window split
vim.o.splitright = true -- Vertical splits will be to the right
vim.o.wrap = false -- Don't visually wrap lines
vim.o.winborder = 'rounded' -- Use border in floating windows
vim.o.pumborder = 'rounded' -- Use border in popup menu
vim.o.cmdheight = 0 -- Hide the command line when not in use
vim.cmd('syntax off') -- Disable legacy syntax highlighting
require('vim._core.ui2').enable({ -- Enable new ui (requires nightly)
vim.o.breakindent = true -- Indent wrapped lines to match line start
vim.o.breakindentopt = 'list:-1' -- Add padding for lists (if 'wrap' is set)
vim.o.cursorline = true -- Enable current line highlighting
vim.o.linebreak = true -- Wrap lines at 'breakat' (if 'wrap' is set)
vim.o.list = true -- Show helpful text indicators
vim.o.listchars = 'tab:→ ,trail:·,nbsp:␣' -- Characters for list mode
vim.o.number = true -- Show line numbers
vim.o.pumheight = 10 -- Make popup menu smaller
vim.o.pummaxwidth = 80 -- Make popup menu not too wide
vim.o.shortmess = 'CFOSWacou' -- Disable some built-in completion messages
vim.o.signcolumn = 'yes' -- Always show signcolumn (less flicker)
vim.o.splitbelow = true -- Horizontal splits will be below
vim.o.splitkeep = 'screen' -- Reduce scroll during window split
vim.o.splitright = true -- Vertical splits will be to the right
vim.o.wrap = false -- Don't visually wrap lines
vim.o.winborder = 'rounded' -- Use border in floating windows
vim.o.pumborder = 'rounded' -- Use border in popup menu
vim.o.cmdheight = 0 -- Hide the command line when not in use
vim.cmd('syntax off') -- Disable legacy syntax highlighting
require('vim._core.ui2').enable({ -- Enable new ui (requires nightly)
msg = { targets = 'msg' }
})
@@ -48,22 +49,16 @@ Config.autocmd('LspAttach', '*', function(ev) vim.bo[ev.buf].complete = 'o' end,
-- Diagnostics
Config.later(function()
vim.diagnostic.config({
jump = { on_jump = vim.diagnostic.open_float },
signs = {
priority = 9999,
severity = { min = vim.diagnostic.severity.WARN, max = vim.diagnostic.severity.ERROR },
severity = { min = vim.diagnostic.severity.INFO },
text = {
[vim.diagnostic.severity.ERROR] = '',
[vim.diagnostic.severity.WARN] = '',
[vim.diagnostic.severity.INFO] = '',
[vim.diagnostic.severity.HINT] = '',
},
},
underline = { severity = { min = vim.diagnostic.severity.HINT, max = vim.diagnostic.severity.ERROR } },
virtual_lines = false,
virtual_text = {
current_line = true,
severity = { min = vim.diagnostic.severity.ERROR, max = vim.diagnostic.severity.ERROR },
},
update_in_insert = false,
virtual_text = false,
})
end)
+69 -69
View File
@@ -7,8 +7,8 @@ Config.leader_group_clues = {
{ mode = 'n', keys = '<Leader>g', desc = '+Git' },
{ mode = 'n', keys = '<Leader>l', desc = '+Language' },
{ mode = 'n', keys = '<Leader>r', desc = '+Request' },
{ mode = 'n', keys = '<Leader>s', desc = '+Session' },
{ mode = 'n', keys = '<Leader>t', desc = '+Terminal' },
{ mode = 'n', keys = '<Leader><Tab>', desc = '+Tab' },
{ mode = 'x', keys = '<Leader>g', desc = '+Git' },
{ mode = 'x', keys = '<Leader>l', desc = '+Language' },
}
@@ -34,21 +34,19 @@ local close_invisible_buffers = function()
:each(function(buf) pcall(vim.api.nvim_buf_delete, buf, { force = false }) end)
end
nmap_leader('bd', '<Cmd>bdelete<CR>', 'Delete')
nmap_leader('bD', '<Cmd>bdelete!<CR>', 'Delete!')
nmap_leader('bd', vim.cmd.bdelete, 'Delete')
nmap_leader('bs', new_scratch_buffer, 'Scratch')
nmap_leader('bw', '<Cmd>bwipeout<CR>', 'Wipeout')
nmap_leader('bW', '<Cmd>bwipeout!<CR>', 'Wipeout!')
nmap_leader('bw', vim.cmd.bwipeout, 'Wipeout')
nmap_leader('bo', close_invisible_buffers, 'Close invisible buffers')
-- Debug
nmap_leader('db', '<Cmd>lua require("dap").toggle_breakpoint()<CR>', 'Toggle Breakpoint')
nmap_leader('dl', '<Cmd>lua require("dap").set_breakpoint(nil, nil, vim.fn.input("Log point: "))<CR>', 'Log point')
nmap_leader('dc', '<Cmd>lua require("dap").continue()<CR>', 'Run/Continue')
nmap_leader('dC', '<Cmd>lua require("dap").run_to_cursor()<CR>', 'Run to Cursor')
nmap_leader('de', '<Cmd>lua require("dap.ui.widgets").hover()<CR>', 'Inspect')
nmap_leader('dr', '<Cmd>lua require("dap").repl.open()<CR>', 'Open REPL')
nmap_leader('dt', '<Cmd>lua require("dap").terminate()<CR>', 'Terminate')
nmap_leader('db', function() require('dap').toggle_breakpoint() end, 'Toggle Breakpoint')
nmap_leader('dl', function() require('dap').set_breakpoint(nil, nil, vim.fn.input('Log point: ')) end, 'Log point')
nmap_leader('dc', function() require('dap').continue() end, 'Run/Continue')
nmap_leader('dC', function() require('dap').run_to_cursor() end, 'Run to Cursor')
nmap_leader('de', function() require('dap.ui.widgets').hover() end, 'Inspect')
nmap_leader('dr', function() require('dap').repl.open() end, 'Open REPL')
nmap_leader('dt', function() require('dap').terminate() end, 'Terminate')
-- Explore
local explore_at_file = function()
@@ -56,79 +54,81 @@ local explore_at_file = function()
MiniFiles.open(vim.uv.fs_stat(file) and file or nil)
end
nmap_leader('ed', '<Cmd>lua MiniFiles.open()<CR>', 'Directory')
nmap_leader('ed', function() MiniFiles.open() end, 'Directory')
nmap_leader('ef', explore_at_file, 'File directory')
nmap_leader('ey', '<Cmd>lua vim.fn.setreg("+", vim.api.nvim_buf_get_name(0))<CR>', 'Yank absolute path')
nmap_leader('en', '<Cmd>messages<CR>', 'Notifications')
nmap_leader('ey', function() vim.fn.setreg('+', vim.fn.fnamemodify(vim.api.nvim_buf_get_name(0), ':.')) end, 'Yank relative path')
nmap_leader('eY', function() vim.fn.setreg('+', vim.api.nvim_buf_get_name(0)) end, 'Yank absolute path')
nmap_leader('en', vim.cmd.messages, 'Notifications')
-- Find
nmap_leader('fb', '<Cmd>lua MiniPick.builtin.buffers()<CR>', 'Buffers')
nmap_leader('fc', '<Cmd>lua MiniExtra.pickers.git_commits()<CR>', 'Commits (all)')
nmap_leader('fC', '<Cmd>lua MiniExtra.pickers.git_commits({ path = "%" })<CR>', 'Commits (buf)')
nmap_leader('fd', '<Cmd>lua MiniExtra.pickers.diagnostic({ scope = "all" })<CR>', 'Diagnostic workspace')
nmap_leader('fD', '<Cmd>lua MiniExtra.pickers.diagnostic({ scope = "current" })<CR>', 'Diagnostic buffer')
nmap_leader('ff', '<Cmd>lua MiniPick.builtin.files()<CR>', 'Files')
nmap_leader('fg', '<Cmd>lua MiniPick.builtin.grep_live()<CR>', 'Grep live')
nmap_leader('fG', '<Cmd>lua MiniPick.builtin.grep({ pattern = vim.fn.expand("<cword>") })<CR>', 'Grep word')
nmap_leader('fh', '<Cmd>lua MiniPick.builtin.help()<CR>', 'Help tags')
nmap_leader('fl', '<Cmd>lua MiniPick.builtin.buf_lines({ scope = "all" })<CR>', 'Lines (all)')
nmap_leader('fL', '<Cmd>lua MiniPick.builtin.buf_lines({ scope = "current" })<CR>', 'Lines (buf)')
nmap_leader('fr', '<Cmd>lua MiniPick.builtin.resume()<CR>', 'Resume')
nmap_leader('fs', '<Cmd>lua MiniExtra.pickers.lsp({ scope = "workspace_symbol_live" })<CR>', 'Symbols workspace')
nmap_leader('fS', '<Cmd>lua MiniExtra.pickers.lsp({ scope = "document_symbol" })<CR>', 'Symbols document')
nmap_leader('f:', '<Cmd>lua MiniExtra.pickers.history({ scope = ":" })<CR>', 'Command history')
nmap_leader('fb', function() MiniPick.builtin.buffers() end, 'Buffers')
nmap_leader('fc', function() MiniExtra.pickers.git_commits() end, 'Commits (all)')
nmap_leader('fC', function() MiniExtra.pickers.git_commits({ path = vim.fn.expand('%') }) end, 'Commits (buf)')
nmap_leader('fd', function() MiniExtra.pickers.diagnostic({ scope = 'all' }) end, 'Diagnostic workspace')
nmap_leader('fD', function() MiniExtra.pickers.diagnostic({ scope = 'current' }) end, 'Diagnostic buffer')
nmap_leader('ff', function() MiniPick.builtin.files() end, 'Files')
nmap_leader('fg', function() MiniPick.builtin.grep_live() end, 'Grep live')
nmap_leader('fG', function() MiniPick.builtin.grep({ pattern = vim.fn.expand('<cword>') }) end, 'Grep word')
nmap_leader('fh', function() MiniPick.builtin.help() end, 'Help tags')
nmap_leader('fl', function() MiniExtra.pickers.buf_lines({ scope = 'all' }) end, 'Lines (all)')
nmap_leader('fL', function() MiniExtra.pickers.buf_lines({ scope = 'current' }) end, 'Lines (buf)')
nmap_leader('fm', function() require('git').status() end, 'Modified / changed files')
nmap_leader('fo', function() MiniExtra.pickers.oldfiles() end, 'Old / recent files')
nmap_leader('fr', function() MiniPick.builtin.resume() end, 'Resume')
nmap_leader('fs', function() MiniExtra.pickers.lsp({ scope = 'workspace_symbol_live' }) end, 'Symbols workspace')
nmap_leader('fS', function() MiniExtra.pickers.lsp({ scope = 'document_symbol' }) end, 'Symbols document')
nmap_leader('f:', function() MiniExtra.pickers.history({ scope = ':' }) end, 'Command history')
-- Git
local git_log_cmd = [[Git log --pretty=format:\%h\ \%as\ │\ \%s --topo-order]]
local git_log_buf_cmd = git_log_cmd .. ' --follow -- %'
local diff_unstaged = function()
vim.cmd.diffthis()
vim.cmd('vert Git show :./%')
vim.cmd.diffthis()
end
nmap_leader('ga', '<Cmd>Git diff --cached<CR>', 'Added diff')
nmap_leader('gA', '<Cmd>Git diff --cached -- %<CR>', 'Added diff buffer')
nmap_leader('gd', '<Cmd>Git diff<CR>', 'Diff')
nmap_leader('gD', '<Cmd>Git diff -- %<CR>', 'Diff buffer')
nmap_leader('gl', '<Cmd>' .. git_log_cmd .. '<CR>', 'Log')
nmap_leader('gL', '<Cmd>' .. git_log_buf_cmd .. '<CR>', 'Log buffer')
nmap_leader('go', '<Cmd>lua MiniDiff.toggle_overlay()<CR>', 'Toggle overlay')
nmap_leader('gs', '<Cmd>lua MiniGit.show_at_cursor()<CR>', 'Show at cursor')
xmap_leader('gs', '<Cmd>lua MiniGit.show_at_cursor()<CR>', 'Show at selection')
nmap_leader('ga', function() vim.cmd('Git add %') end, 'Add current file')
nmap_leader('gd', diff_unstaged, 'Diff unstaged')
nmap_leader('gs', function() MiniGit.show_at_cursor() end, 'Show at cursor')
xmap_leader('gs', function() MiniGit.show_at_cursor() end, 'Show at selection')
-- Language
nmap_leader('la', '<Cmd>lua vim.lsp.buf.code_action()<CR>', 'Actions')
nmap_leader('ld', '<Cmd>lua vim.diagnostic.open_float()<CR>', 'Diagnostic popup')
nmap_leader('lf', '<Cmd>lua require("conform").format({ async = true })<CR>', 'Format')
xmap_leader('lf', '<Cmd>lua require("conform").format({ async = true })<CR>', 'Format selection')
nmap_leader('li', '<Cmd>lua vim.lsp.buf.implementation()<CR>', 'Implementation')
nmap_leader('lh', '<Cmd>lua vim.lsp.buf.hover()<CR>', 'Hover')
nmap_leader('ll', '<Cmd>lua vim.lsp.codelens.run()<CR>', 'Lens')
nmap_leader('lr', '<Cmd>lua vim.lsp.buf.rename()<CR>', 'Rename')
nmap_leader('lR', '<Cmd>lua vim.lsp.buf.references()<CR>', 'References')
nmap_leader('ls', '<Cmd>lua vim.lsp.buf.definition()<CR>', 'Source definition')
nmap_leader('lt', '<Cmd>lua vim.lsp.buf.type_definition()<CR>', 'Type definition')
nmap_leader('la', function() vim.lsp.buf.code_action() end, 'Actions')
nmap_leader('ld', function() vim.diagnostic.open_float() end, 'Diagnostic popup')
nmap_leader('lf', function() require('conform').format({ async = true }) end, 'Format')
xmap_leader('lf', function() require('conform').format({ async = true }) end, 'Format selection')
nmap_leader('li', function() vim.lsp.buf.implementation() end, 'Implementation')
nmap_leader('lh', function() vim.lsp.buf.hover() end, 'Hover')
nmap_leader('ll', function() vim.lsp.codelens.run() end, 'Lens')
nmap_leader('lr', function() vim.lsp.buf.rename() end, 'Rename')
nmap_leader('lR', function() vim.lsp.buf.references() end, 'References')
nmap_leader('ls', function() vim.lsp.buf.definition() end, 'Source definition')
nmap_leader('lt', function() vim.lsp.buf.type_definition() end, 'Type definition')
-- Request
nmap_leader('rs', '<Cmd>lua require("kulala").run()<CR>', 'Send HTTP request')
-- Session
local session_new = 'vim.ui.input({ prompt = "Session name: " }, MiniSessions.write)'
nmap_leader('sd', '<Cmd>lua MiniSessions.select("delete")<CR>', 'Delete')
nmap_leader('sn', '<Cmd>lua ' .. session_new .. '<CR>', 'New')
nmap_leader('sr', '<Cmd>lua MiniSessions.select("read")<CR>', 'Read')
nmap_leader('sR', '<Cmd>lua MiniSessions.restart()<CR>', 'Restart')
nmap_leader('sw', '<Cmd>lua MiniSessions.write()<CR>', 'Write current')
nmap_leader('rs', function() require('kulala').run() end, 'Send HTTP request')
-- Terminal
nmap_leader('tT', '<Cmd>horizontal term<CR>', 'Terminal (horizontal)')
nmap_leader('tt', '<Cmd>vertical term<CR>', 'Terminal (vertical)')
nmap_leader('tc', '<Cmd>vertical term claude<CR>', 'Claude')
nmap_leader('tf', '<Cmd>lua require("terminal").open_terminal_app(vim.o.shell)<CR>', 'Terminal (popup)')
nmap_leader('tg', '<Cmd>lua require("terminal").open_terminal_app("lazygit")<CR>', 'LazyGit')
nmap_leader('ts', '<Cmd>lua require("terminal").open_terminal_app("lazysql")<CR>', 'LazySQL')
local open_ai = function()
vim.cmd('vertical term ' .. (vim.fn.executable('pi') == 1 and 'pi' or 'claude'))
end
nmap_leader('tT', function() vim.cmd('horizontal term') end, 'Terminal (horizontal)')
nmap_leader('tt', function() vim.cmd('vertical term') end, 'Terminal (vertical)')
nmap_leader('ta', open_ai, 'AI')
nmap_leader('tf', function() require('terminal').open(vim.o.shell) end, 'Terminal (popup)')
nmap_leader('tg', function() require('terminal').open('lazygit') end, 'LazyGit')
nmap_leader('ts', function() require('terminal').open('lazysql') end, 'LazySQL')
-- Tabs
nmap_leader('<Tab><Tab>', vim.cmd.tabnew, 'New tab')
nmap_leader('<Tab>d', vim.cmd.tabclose, 'Close tab')
nmap_leader('<Tab>]', vim.cmd.tabnext, 'Next tab')
nmap_leader('<Tab>[', vim.cmd.tabprevious, 'Previous tab')
-- Brackets
vim.keymap.set('n', ']d', function() vim.diagnostic.jump({ count = 1 }) end, { desc = 'Next diagnostic' })
vim.keymap.set('n', '[d', function() vim.diagnostic.jump({ count = -1 }) end, { desc = 'Previous diagnostic' })
-- Overwrites
vim.keymap.set('n', '<Esc>', '<Cmd>nohlsearch<CR>', { desc = 'Clear highlights', silent = true })
vim.keymap.set('n', '<Esc>', vim.cmd.nohlsearch, { desc = 'Clear highlights', silent = true })
vim.keymap.set('t', '<C-w>', '<C-\\><C-n><C-w>', { desc = 'Terminal window navigation', silent = true })
+26 -6
View File
@@ -3,11 +3,31 @@ Config.now(function()
-- Global icon provider
require('mini.icons').setup()
Config.later(MiniIcons.tweak_lsp_kind)
-- Start screen, statusline, and session management
require('mini.starter').setup()
require('mini.statusline').setup()
require('mini.sessions').setup()
local starter = require('mini.starter')
starter.setup({
items = {
function()
return vim.iter({ vim.fn.glob('~/Code/*', 0, 1), vim.fn.glob('~/Documents/*/*', 0, 1) })
:flatten()
:filter(function(p) return vim.fn.isdirectory(p) == 1 end)
:map(function(p)
return {
name = vim.fn.fnamemodify(p, ':t'),
action = function()
vim.fn.chdir(p)
require('mini.files').open(p)
end,
section = 'Projects',
}
end)
:totable()
end,
starter.sections.builtin_actions(),
},
})
end)
Config.later(function()
@@ -36,7 +56,7 @@ Config.later(function()
{ mode = { 'n', 'x' }, keys = 'g' },
{ mode = { 'n', 'x' }, keys = "'" },
{ mode = { 'n', 'x' }, keys = '`' },
{ mode = { 'n', 'x' }, keys = "'" },
{ mode = { 'n', 'x' }, keys = '"' },
{ mode = { 'i', 'c' }, keys = '<C-r>' },
{ mode = 'n', keys = '<C-w>' },
{ mode = { 'n', 'x' }, keys = 's' },
@@ -51,6 +71,7 @@ Config.later(function()
require('mini.pairs').setup()
require('mini.pick').setup()
require('mini.extra').setup()
MiniPick.registry.git_status = function() require('git').status() end
end)
-- File Explorer
@@ -58,7 +79,6 @@ Config.now_if_args(function()
require('mini.files').setup()
Config.autocmd('User', 'MiniFilesExplorerOpen', function()
MiniFiles.set_bookmark('c', vim.fn.stdpath('config'), { desc = 'Config' })
MiniFiles.set_bookmark('d', vim.fn.expand('~/Documents'), { desc = 'Documents' })
MiniFiles.set_bookmark('w', vim.fn.getcwd, { desc = 'Working directory' })
end, 'Add default marks')
end)
+25 -8
View File
@@ -2,18 +2,27 @@
Config.now(function()
vim.pack.add({ { src = 'https://github.com/rose-pine/neovim', name = 'rose-pine' } })
require('rose-pine').setup({
enable = { terminal = false, legacy_highlights = false, migrations = false },
enable = { terminal = false, legacy_highlights = false, migrations = false, },
styles = { italic = false },
highlight_groups = {
MiniDiffOverAdd = { fg = 'NONE', bg = 'foam', blend = 20 },
MiniDiffOverChangeBuf = { bg = 'rose', blend = 20 },
},
})
vim.cmd('colorscheme rose-pine')
vim.cmd.colorscheme('rose-pine')
end)
-- Treesitter
Config.now_if_args(function()
vim.pack.add({ 'https://github.com/nvim-treesitter/nvim-treesitter' })
vim.treesitter.language.register('bash', 'sh')
vim.treesitter.language.register('tsx', 'typescriptreact')
local filetypes = {
'html', 'css', 'lua', 'go', 'php', 'blade', 'sql', 'javascript',
'typescript', 'typescriptreact', 'svelte', 'dockerfile', 'yaml', 'markdown', 'dart',
'json', 'xml', 'toml', 'sh', 'bash', 'zsh', 'just', 'gitcommit', 'diff', 'regex', 'http'
'json', 'xml', 'toml', 'sh', 'zsh', 'just', 'gitcommit', 'diff', 'regex', 'http'
}
Config.autocmd('FileType', filetypes, function(ev)
@@ -23,17 +32,25 @@ Config.now_if_args(function()
end, 'Start tree-sitter')
Config.later(function()
vim.pack.add({ 'https://github.com/nvim-treesitter/nvim-treesitter' })
require('nvim-treesitter').install(vim.tbl_map(function(ft)
return vim.treesitter.language.get_lang(ft) or ft
end, filetypes))
local missing = {}
for _, ft in ipairs(filetypes) do
local lang = vim.treesitter.language.get_lang(ft) or ft
if #vim.api.nvim_get_runtime_file('parser/' .. lang .. '.so', false) == 0 then
table.insert(missing, lang)
end
end
if #missing > 0 then
require('nvim-treesitter').install(missing)
end
end)
end)
-- LSP
Config.now_if_args(function()
vim.pack.add({ 'https://github.com/neovim/nvim-lspconfig' })
vim.lsp.enable({ 'ansiblels', 'gopls', 'phpantom_lsp', 'svelte', 'tailwindcss', 'tsc' })
vim.lsp.enable({ 'ansiblels', 'gopls', 'phpantom_lsp', 'svelte', 'tailwindcss', 'tsc', 'biome' })
end)
-- Formatting