Changes
This commit is contained in:
Vendored
BIN
Binary file not shown.
+17
-17
@@ -8,21 +8,21 @@ require('DarthMooMancer.lsp')
|
||||
require('DarthMooMancer.tools')
|
||||
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = {
|
||||
'c',
|
||||
'cpp',
|
||||
'rust',
|
||||
'lua',
|
||||
'typescript',
|
||||
'javascript',
|
||||
'css',
|
||||
'html',
|
||||
'python',
|
||||
'go',
|
||||
'yaml',
|
||||
},
|
||||
callback = function()
|
||||
vim.treesitter.start()
|
||||
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||
end,
|
||||
pattern = {
|
||||
'c',
|
||||
'cpp',
|
||||
'rust',
|
||||
'lua',
|
||||
'typescript',
|
||||
'javascript',
|
||||
'css',
|
||||
'html',
|
||||
'python',
|
||||
'go',
|
||||
'yaml',
|
||||
},
|
||||
callback = function()
|
||||
vim.treesitter.start()
|
||||
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||
end,
|
||||
})
|
||||
|
||||
@@ -1,25 +1,30 @@
|
||||
-- require('bamboo').load()
|
||||
-- vim.cmd.colorscheme('bamboo')
|
||||
-- vim.cmd.colorscheme('melange')
|
||||
-- vim.cmd.colorscheme('rose-pine')
|
||||
-- vim.cmd.colorscheme('bamboo-multiplex')
|
||||
require('kanagawa').setup({
|
||||
overrides = function(colors)
|
||||
local theme = colors.theme
|
||||
return {
|
||||
Pmenu = { fg = theme.ui.shade0, bg = theme.ui.bg_p1 }, -- add `blend = vim.o.pumblend` to enable transparency
|
||||
PmenuSel = { fg = 'NONE', bg = theme.ui.bg_p2 },
|
||||
PmenuSbar = { bg = theme.ui.bg_m1 },
|
||||
PmenuThumb = { bg = theme.ui.bg_p2 },
|
||||
}
|
||||
end,
|
||||
require('kanso').setup({
|
||||
foreground = {
|
||||
dark = "saturated", -- Use default colors in dark mode
|
||||
},
|
||||
overrides = function(colors)
|
||||
local theme = colors.theme
|
||||
return {
|
||||
NormalFloat = { bg = "none" },
|
||||
FloatBorder = { bg = "none" },
|
||||
FloatTitle = { bg = "none" },
|
||||
TelescopeBorder = { fg = theme.ui.special, bg = "none" },
|
||||
TelescopePromptBorder = { fg = theme.ui.special, bg = "none" },
|
||||
TelescopeResultsBorder = { fg = theme.ui.special, bg = "none" },
|
||||
TelescopePreviewBorder = { fg = theme.ui.special, bg = "none" },
|
||||
NotifyBackground = { bg = "none" },
|
||||
NotifyBorder = { fg = theme.ui.special, bg = "none" },
|
||||
NotifyBody = { fg = theme.ui.fg, bg = "none" },
|
||||
NotifyTitle = { fg = theme.ui.special, bg = "none" },
|
||||
}
|
||||
end,
|
||||
})
|
||||
|
||||
vim.cmd.colorscheme('kanagawa-dragon')
|
||||
-- vim.cmd.colorscheme('rose-pine')
|
||||
--
|
||||
vim.cmd.colorscheme('kanso-zen')
|
||||
|
||||
vim.api.nvim_set_hl(0, 'Normal', { bg = 'none' })
|
||||
vim.api.nvim_set_hl(0, 'NormalFloat', { link = 'Normal' })
|
||||
-- vim.api.nvim_set_hl(0, 'NormalFloat', { link = 'Normal' })
|
||||
-- vim.api.nvim_set_hl(0, "FloatBorder", { bg = "none" })
|
||||
vim.api.nvim_set_hl(0, 'StatusLine', { link = 'Normal' })
|
||||
vim.api.nvim_set_hl(0, 'StatusLineTerm', { link = 'Normal' })
|
||||
vim.api.nvim_set_hl(0, 'StatusLineNC', { link = 'Normal' })
|
||||
@@ -29,7 +34,7 @@ vim.api.nvim_set_hl(0, 'LineNrBelow', { link = 'NonText', bold = true })
|
||||
vim.api.nvim_set_hl(0, 'LineNr', { link = 'Normal' })
|
||||
vim.api.nvim_set_hl(0, 'FoldColumn', { link = 'Normal' })
|
||||
vim.api.nvim_set_hl(
|
||||
0,
|
||||
'CursorLineNr',
|
||||
{ bg = 'none', link = 'MatchParen', bold = true }
|
||||
0,
|
||||
'CursorLineNr',
|
||||
{ bg = 'none', link = 'MatchParen', bold = true }
|
||||
)
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
vim.keymap.set('v', 'J', ":m '>+1<CR>gv=gv")
|
||||
vim.keymap.set('v', 'K', ":m '<-2<CR>gv=gv")
|
||||
-- vim.keymap.set("n", "<leader>ff", vim.lsp.buf.format)
|
||||
vim.keymap.set('n', '<leader>ff', function()
|
||||
require('conform').format({ async = true, lsp_format = 'never' })
|
||||
require('conform').format({ async = true, lsp_format = 'never' })
|
||||
end)
|
||||
vim.keymap.set('n', '<leader>vs', ':vsplit<CR>')
|
||||
vim.keymap.set('n', '<leader>ss', ':split<CR>')
|
||||
@@ -14,42 +13,35 @@ vim.keymap.set('n', 'N', 'Nzzzv')
|
||||
vim.keymap.set('x', '<leader>p', [["_dP]])
|
||||
local builtin = require('telescope.builtin')
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader><leader>',
|
||||
builtin.find_files,
|
||||
{ desc = 'Telescope find files' }
|
||||
'n',
|
||||
'<leader><leader>',
|
||||
builtin.find_files,
|
||||
{ desc = 'Telescope find files' }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>fh',
|
||||
builtin.help_tags,
|
||||
{ desc = 'Telescope help tags' }
|
||||
'n',
|
||||
'<leader>fh',
|
||||
builtin.help_tags,
|
||||
{ desc = 'Telescope help tags' }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>fg',
|
||||
builtin.live_grep,
|
||||
{ desc = 'Telescope live grep' }
|
||||
'n',
|
||||
'<leader>fg',
|
||||
builtin.live_grep,
|
||||
{ desc = 'Telescope live grep' }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>fm',
|
||||
builtin.man_pages,
|
||||
{ desc = 'Telescope man_pages' }
|
||||
'n',
|
||||
'<leader>fm',
|
||||
builtin.man_pages,
|
||||
{ desc = 'Telescope man_pages' }
|
||||
)
|
||||
-- vim.keymap.set(
|
||||
-- 'n',
|
||||
-- '<leader>xx',
|
||||
-- builtin.diagnostics,
|
||||
-- { desc = 'Telescope diagnostics' }
|
||||
-- )
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>xn',
|
||||
':Telescope notify<CR>',
|
||||
{ desc = 'Telescope notify' }
|
||||
'n',
|
||||
'<leader>xn',
|
||||
':Telescope notify<CR>',
|
||||
{ desc = 'Telescope notify' }
|
||||
)
|
||||
-- vim.keymap.set('n', '<leader>xx', ':FzfLua diagnostics_workspace<CR>')
|
||||
|
||||
vim.keymap.set('n', '<leader>fs', vim.lsp.buf.document_symbol)
|
||||
vim.keymap.set('n', '<leader>gd', vim.lsp.buf.definition)
|
||||
@@ -63,12 +55,13 @@ vim.keymap.set('n', '[q', ':cprev<CR>zz', { desc = 'Previous Quickfix Item' })
|
||||
vim.keymap.set('n', ']q', ':cnext<CR>zz', { desc = 'Next Quickfix Item' })
|
||||
vim.keymap.set('n', '<leader>qo', ':copen<CR>', { desc = 'Open Quickfix' })
|
||||
vim.keymap.set('n', '<leader>qc', ':cclose<CR>', { desc = 'Close Quickfix' })
|
||||
vim.keymap.set('n', '<leader>lp', ':LivePreview pick<cr>')
|
||||
vim.keymap.set('n', '<C-h>', ':NvimTmuxNavigateLeft<CR>', { silent = true })
|
||||
vim.keymap.set('n', '<C-j>', ':NvimTmuxNavigateDown<CR>', { silent = true })
|
||||
vim.keymap.set('n', '<C-k>', ':NvimTmuxNavigateUp<CR>', { silent = true })
|
||||
vim.keymap.set('n', '<C-l>', ':NvimTmuxNavigateRight<CR>', { silent = true })
|
||||
-- vim.keymap.set('n', '<leader>fr', ':FlutterRun<CR>')
|
||||
-- vim.keymap.set('n', '<leader>fq', ':FlutterQuit<CR>')
|
||||
-- vim.keymap.set('n', '<leader>fR', ':FlutterReload<CR>')
|
||||
-- vim.keymap.set('n', '<leader>frr', ':FlutterRestart<CR>')
|
||||
vim.keymap.set('n', '<leader>xx', ':Trouble diagnostics toggle<cr>')
|
||||
local dropbar_api = require("dropbar.api")
|
||||
vim.keymap.set("n", "<Leader>;", dropbar_api.pick, { desc = "Pick symbols in winbar" })
|
||||
vim.keymap.set("n", "[;", dropbar_api.goto_context_start, { desc = "Go to start of current context" })
|
||||
vim.keymap.set("n", "];", dropbar_api.select_next_context, { desc = "Select next context" })
|
||||
|
||||
@@ -1,82 +1,90 @@
|
||||
require('mason').setup()
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = {
|
||||
'vtsls',
|
||||
'lua_ls',
|
||||
'pylsp',
|
||||
'gopls',
|
||||
'html',
|
||||
'tailwindcss',
|
||||
'bashls',
|
||||
},
|
||||
automatic_enable = false,
|
||||
ensure_installed = {
|
||||
'vtsls',
|
||||
'lua_ls',
|
||||
'pylsp',
|
||||
'gopls',
|
||||
'html',
|
||||
'cssls',
|
||||
'bashls',
|
||||
},
|
||||
automatic_enable = false,
|
||||
})
|
||||
|
||||
require('nvim-treesitter').install({
|
||||
'rust',
|
||||
'c',
|
||||
'cpp',
|
||||
'lua',
|
||||
'javascript',
|
||||
'go',
|
||||
'typescript',
|
||||
'css',
|
||||
'html',
|
||||
'python',
|
||||
'yaml',
|
||||
'rust',
|
||||
'c',
|
||||
'cpp',
|
||||
'lua',
|
||||
'javascript',
|
||||
'go',
|
||||
'typescript',
|
||||
'css',
|
||||
'html',
|
||||
'python',
|
||||
'yaml',
|
||||
})
|
||||
|
||||
require('conform').setup({
|
||||
formatters_by_ft = {
|
||||
rust = { 'rustfmt', lsp_format = 'fallback' },
|
||||
lua = { 'stylua', lsp_format = 'fallback' },
|
||||
javascript = { 'prettier', stop_after_first = true },
|
||||
typescript = { 'prettier', stop_after_first = true },
|
||||
json = { 'prettier' },
|
||||
html = { 'prettier' },
|
||||
go = { 'goimports' },
|
||||
c = { 'clang-format' },
|
||||
cpp = { 'clang-format' },
|
||||
dart = { 'dart_format', lsp_format = 'fallback' },
|
||||
['_'] = { 'trim_whitespace' },
|
||||
},
|
||||
format_on_save = {
|
||||
timeout_ms = 2000,
|
||||
lsp_format = 'fallback',
|
||||
},
|
||||
formatters_by_ft = {
|
||||
rust = { 'rustfmt', lsp_format = 'fallback' },
|
||||
lua = { 'stylua', lsp_format = 'fallback' },
|
||||
javascript = { 'prettier', stop_after_first = true },
|
||||
typescript = { 'prettier', stop_after_first = true },
|
||||
json = { 'prettier' },
|
||||
html = { 'prettier' },
|
||||
go = { 'goimports' },
|
||||
c = { 'clang-format' },
|
||||
cpp = { 'clang-format' },
|
||||
css = { 'csskit' },
|
||||
dart = { 'dart_format', lsp_format = 'fallback' },
|
||||
python = { 'autopep8' },
|
||||
['_'] = { 'trim_whitespace' },
|
||||
},
|
||||
format_on_save = {
|
||||
timeout_ms = 2000,
|
||||
lsp_format = 'fallback',
|
||||
},
|
||||
})
|
||||
|
||||
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||
vim.lsp.config('lua_ls', {
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = { globals = { 'vim' } },
|
||||
workspace = {
|
||||
library = vim.api.nvim_get_runtime_file('', true),
|
||||
checkThirdParty = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = { globals = { 'vim' } },
|
||||
workspace = {
|
||||
library = vim.api.nvim_get_runtime_file('', true),
|
||||
checkThirdParty = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.lsp.config('vtsls', {
|
||||
settings = {
|
||||
typescript = {
|
||||
updateImportsOnFileMove = { enabled = 'always' },
|
||||
inlayHints = {
|
||||
parameterNames = { enabled = 'all' },
|
||||
variableTypes = { enabled = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
settings = {
|
||||
typescript = {
|
||||
updateImportsOnFileMove = { enabled = 'always' },
|
||||
inlayHints = {
|
||||
parameterNames = { enabled = 'all' },
|
||||
variableTypes = { enabled = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.lsp.config('html', {
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
vim.lsp.enable({
|
||||
'lua_ls',
|
||||
'clangd',
|
||||
'rust-analyzer',
|
||||
'vtsls',
|
||||
'tailwindcss-language-server',
|
||||
'vscode-html-language-server',
|
||||
'gopls',
|
||||
'lua_ls',
|
||||
'clangd',
|
||||
'rust-analyzer',
|
||||
'vtsls',
|
||||
'tailwindcss-language-server',
|
||||
'cssls',
|
||||
'html',
|
||||
'gopls',
|
||||
'pylsp'
|
||||
})
|
||||
|
||||
@@ -2,29 +2,32 @@ vim.opt.termguicolors = true
|
||||
vim.g.mapleader = ' '
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.tabstop = 8 -- Number of spaces a <Tab> counts for
|
||||
vim.opt.shiftwidth = 8 -- Number of spaces for autoindent (>>, <<, etc.)
|
||||
vim.opt.softtabstop = 8 -- Number of spaces for <Tab> in insert mode (backspace deletes 4 spaces)
|
||||
vim.opt.tabstop = 8 -- Number of spaces a <Tab> counts for
|
||||
vim.opt.shiftwidth = 8 -- Number of spaces for autoindent (>>, <<, etc.)
|
||||
vim.opt.softtabstop = 8 -- Number of spaces for <Tab> in insert mode (backspace deletes 4 spaces)
|
||||
vim.opt.expandtab = true -- Use spaces instead of tabs
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
callback = function(ev)
|
||||
local map = {
|
||||
-- c = { ts = 8, sw = 8, sts = 8, et = false },
|
||||
-- cpp = { ts = 8, sw = 8, sts = 8, et = false },
|
||||
-- go = { ts = 8, sw = 8, sts = 8, et = false },
|
||||
rust = { ts = 4, sw = 4, sts = 4 },
|
||||
lua = { ts = 4, sw = 4, sts = 4 },
|
||||
python = { ts = 4, sw = 4, sts = 4 },
|
||||
dart = { ts = 2, sw = 2, sts = 2 },
|
||||
}
|
||||
local ft = map[ev.match]
|
||||
if ft then
|
||||
vim.bo[ev.buf].tabstop = ft.ts
|
||||
vim.bo[ev.buf].shiftwidth = ft.sw
|
||||
vim.bo[ev.buf].softtabstop = ft.sts
|
||||
vim.bo[ev.buf].expandtab = ft.et ~= nil and ft.et or true
|
||||
end
|
||||
end,
|
||||
callback = function(ev)
|
||||
local map = {
|
||||
-- c = { ts = 8, sw = 8, sts = 8, et = false },
|
||||
-- cpp = { ts = 8, sw = 8, sts = 8, et = false },
|
||||
-- go = { ts = 8, sw = 8, sts = 8, et = false },
|
||||
rust = { ts = 4, sw = 4, sts = 4 },
|
||||
lua = { ts = 4, sw = 4, sts = 4 },
|
||||
python = { ts = 4, sw = 4, sts = 4 },
|
||||
dart = { ts = 2, sw = 2, sts = 2 },
|
||||
html = { ts = 2, sw = 2, sts = 2 },
|
||||
javascript = { ts = 2, sw = 2, sts = 2 },
|
||||
typescript = { ts = 2, sw = 2, sts = 2 },
|
||||
}
|
||||
local ft = map[ev.match]
|
||||
if ft then
|
||||
vim.bo[ev.buf].tabstop = ft.ts
|
||||
vim.bo[ev.buf].shiftwidth = ft.sw
|
||||
vim.bo[ev.buf].softtabstop = ft.sts
|
||||
vim.bo[ev.buf].expandtab = ft.et ~= nil and ft.et or true
|
||||
end
|
||||
end,
|
||||
})
|
||||
vim.opt.autoindent = true -- Copy indent from current line when starting a new line
|
||||
vim.opt.wrap = false
|
||||
@@ -39,25 +42,27 @@ vim.g.netrw_browse_split = 0
|
||||
vim.g.netrw_banner = 0
|
||||
vim.g.netrw_liststyle = 3
|
||||
vim.g.netrw_winsize = 25
|
||||
vim.opt.wrapscan = true -- begin search from top of the file when nothng is found
|
||||
vim.opt.cursorline = true -- enable cursorline
|
||||
vim.opt.wrapscan = true -- begin search from top of the file when nothng is found
|
||||
vim.opt.cursorline = true -- enable cursorline
|
||||
vim.opt.cursorlineopt = { 'screenline', 'number' } -- cursorline look
|
||||
vim.opt.foldmethod = 'indent'
|
||||
vim.opt.foldcolumn = '1'
|
||||
vim.opt.foldenable = false
|
||||
vim.opt.shortmess = 'aF' -- abbreviates messages and prevents file name being echoed when opened
|
||||
vim.opt.ignorecase = true -- ignore cases when searching
|
||||
vim.opt.smartcase = true -- However if we use a capital in search string we then consider case-sensitivity, ignorecase is disabled
|
||||
vim.opt.shortmess = 'aF' -- abbreviates messages and prevents file name being echoed when opened
|
||||
vim.opt.ignorecase = true -- ignore cases when searching
|
||||
vim.opt.smartcase = true -- However if we use a capital in search string we then consider case-sensitivity, ignorecase is disabled
|
||||
vim.opt.smartindent = false -- smarter indentation
|
||||
vim.opt.smarttab = true -- make tab behaviour smarter
|
||||
vim.opt.smarttab = true -- make tab behaviour smarter
|
||||
vim.opt.laststatus = 3
|
||||
vim.opt.showmode = false
|
||||
vim.opt.cmdheight = 0
|
||||
vim.opt.smoothscroll = true
|
||||
vim.opt.spell = true
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true, -- This is the magic line
|
||||
signs = true, -- Shows icons in the gutter
|
||||
underline = true,
|
||||
update_in_insert = false, -- Don't clutter the screen while typing
|
||||
severity_sort = true,
|
||||
virtual_text = true, -- This is the magic line
|
||||
signs = true, -- Shows icons in the gutter
|
||||
underline = true,
|
||||
update_in_insert = false, -- Don't clutter the screen while typing
|
||||
severity_sort = true,
|
||||
})
|
||||
vim.o.winborder = "rounded"
|
||||
|
||||
@@ -1,60 +1,41 @@
|
||||
vim.pack.add({
|
||||
-- Themes
|
||||
{
|
||||
src = 'https://github.com/rose-pine/neovim',
|
||||
name = 'rose-pine',
|
||||
},
|
||||
{
|
||||
src = 'https://github.com/ribru17/bamboo.nvim',
|
||||
},
|
||||
{
|
||||
src = 'https://github.com/savq/melange-nvim',
|
||||
},
|
||||
{
|
||||
src = 'https://github.com/mountain-theme/Mountain',
|
||||
},
|
||||
{
|
||||
src = 'https://github.com/sainnhe/everforest',
|
||||
},
|
||||
{
|
||||
src = 'https://github.com/rebelot/kanagawa.nvim',
|
||||
},
|
||||
-- Themes
|
||||
{ src = 'https://github.com/webhooked/kanso.nvim' },
|
||||
|
||||
-- The rest
|
||||
{ src = 'https://github.com/mbbill/undotree' },
|
||||
{
|
||||
src = 'https://github.com/nvim-mini/mini.pairs',
|
||||
version = vim.version.range('*'),
|
||||
},
|
||||
{
|
||||
src = 'https://github.com/nvim-mini/mini.hipatterns',
|
||||
version = vim.version.range('*'),
|
||||
},
|
||||
{ src = 'https://github.com/nvim-tree/nvim-web-devicons' },
|
||||
{ src = 'https://github.com/nvim-telescope/telescope.nvim' },
|
||||
{
|
||||
src = 'https://github.com/saghen/blink.cmp',
|
||||
version = vim.version.range('*'),
|
||||
},
|
||||
{ src = 'git@moo:dmm/polydev.git' },
|
||||
{
|
||||
src = 'https://github.com/nvim-treesitter/nvim-treesitter',
|
||||
build = ':TSUpdate',
|
||||
},
|
||||
{ src = 'https://github.com/alexghergh/nvim-tmux-navigation' },
|
||||
{ src = 'https://github.com/mason-org/mason.nvim' },
|
||||
{ src = 'https://github.com/mason-org/mason-lspconfig.nvim' },
|
||||
{ src = 'https://github.com/neovim/nvim-lspconfig' },
|
||||
{ src = 'https://github.com/stevearc/conform.nvim' },
|
||||
{ src = 'https://github.com/b0o/incline.nvim' },
|
||||
{ src = 'https://github.com/windwp/nvim-ts-autotag' },
|
||||
{ src = 'https://github.com/MunifTanjim/nui.nvim' },
|
||||
-- { src = 'https://github.com/nvim-lualine/lualine.nvim' },
|
||||
{ src = 'https://github.com/nvim-lua/plenary.nvim' },
|
||||
{ src = 'https://github.com/folke/noice.nvim' },
|
||||
-- { src = 'https://github.com/akinsho/flutter-tools.nvim' },
|
||||
-- { src = 'https://github.com/mfussenegger/nvim-dap' },
|
||||
{ src = 'https://github.com/stevearc/dressing.nvim' },
|
||||
{ src = 'https://github.com/rcarriga/nvim-notify' },
|
||||
{ src = 'https://github.com/folke/trouble.nvim' },
|
||||
-- The rest
|
||||
{ src = 'https://github.com/mbbill/undotree' },
|
||||
{
|
||||
src = 'https://github.com/nvim-mini/mini.pairs',
|
||||
version = vim.version.range('*'),
|
||||
},
|
||||
{
|
||||
src = 'https://github.com/nvim-mini/mini.hipatterns',
|
||||
version = vim.version.range('*'),
|
||||
},
|
||||
{ src = 'https://github.com/nvim-tree/nvim-web-devicons' },
|
||||
{ src = 'https://github.com/nvim-telescope/telescope.nvim' },
|
||||
{
|
||||
src = 'https://github.com/saghen/blink.cmp',
|
||||
version = vim.version.range('*'),
|
||||
},
|
||||
{ src = 'https://git.moomancer.xyz/DarthMooMancer/polydev.git' },
|
||||
{
|
||||
src = 'https://github.com/nvim-treesitter/nvim-treesitter',
|
||||
build = ':TSUpdate',
|
||||
},
|
||||
{ src = 'https://github.com/alexghergh/nvim-tmux-navigation' },
|
||||
{ src = 'https://github.com/mason-org/mason.nvim' },
|
||||
{ src = 'https://github.com/mason-org/mason-lspconfig.nvim' },
|
||||
{ src = 'https://github.com/neovim/nvim-lspconfig' },
|
||||
{ src = 'https://github.com/stevearc/conform.nvim' },
|
||||
{ src = 'https://github.com/b0o/incline.nvim' },
|
||||
{ src = 'https://github.com/windwp/nvim-ts-autotag' },
|
||||
{ src = 'https://github.com/MunifTanjim/nui.nvim' },
|
||||
{ src = 'https://github.com/nvim-lua/plenary.nvim' },
|
||||
{ src = 'https://github.com/folke/noice.nvim' },
|
||||
-- { src = 'https://github.com/stevearc/dressing.nvim' },
|
||||
{ src = 'https://github.com/rcarriga/nvim-notify' },
|
||||
{ src = 'https://github.com/folke/trouble.nvim' },
|
||||
{ src = 'https://github.com/brianhuster/live-preview.nvim' },
|
||||
{ src = 'https://github.com/Bekaboo/dropbar.nvim' },
|
||||
})
|
||||
|
||||
@@ -1,53 +1,84 @@
|
||||
local hipatterns = require('mini.hipatterns')
|
||||
hipatterns.setup({
|
||||
highlighters = {
|
||||
-- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE'
|
||||
fixme = {
|
||||
pattern = '%f[%w]()FIXME()%f[%W]',
|
||||
group = 'MiniHipatternsFixme',
|
||||
},
|
||||
hack = {
|
||||
pattern = '%f[%w]()HACK()%f[%W]',
|
||||
group = 'MiniHipatternsHack',
|
||||
},
|
||||
todo = {
|
||||
pattern = '%f[%w]()TODO()%f[%W]',
|
||||
group = 'MiniHipatternsTodo',
|
||||
},
|
||||
note = {
|
||||
pattern = '%f[%w]()NOTE()%f[%W]',
|
||||
group = 'MiniHipatternsNote',
|
||||
},
|
||||
highlighters = {
|
||||
-- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE'
|
||||
fixme = {
|
||||
pattern = '%f[%w]()FIXME()%f[%W]',
|
||||
group = 'MiniHipatternsFixme',
|
||||
},
|
||||
hack = {
|
||||
pattern = '%f[%w]()HACK()%f[%W]',
|
||||
group = 'MiniHipatternsHack',
|
||||
},
|
||||
todo = {
|
||||
pattern = '%f[%w]()TODO()%f[%W]',
|
||||
group = 'MiniHipatternsTodo',
|
||||
},
|
||||
note = {
|
||||
pattern = '%f[%w]()NOTE()%f[%W]',
|
||||
group = 'MiniHipatternsNote',
|
||||
},
|
||||
|
||||
hex_color = hipatterns.gen_highlighter.hex_color(),
|
||||
},
|
||||
hex_color = hipatterns.gen_highlighter.hex_color(),
|
||||
},
|
||||
})
|
||||
|
||||
require('mini.pairs').setup()
|
||||
require('nvim-tmux-navigation').setup({
|
||||
disable_when_zoomed = true, -- defaults to false
|
||||
disable_when_zoomed = true, -- defaults to false
|
||||
})
|
||||
|
||||
require('blink.cmp').setup({
|
||||
completion = {
|
||||
menu = {
|
||||
draw = {
|
||||
columns = {
|
||||
{ 'label', gap = 1 },
|
||||
{ 'kind_icon', gap = 1, 'kind' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
completion = {
|
||||
documentation = {
|
||||
auto_show = true,
|
||||
auto_show_delay_ms = 100,
|
||||
window = {
|
||||
winhighlight = 'Normal:NormalFloat,FloatBorder:TelescopeBorder,CursorLine:Visual,Search:None',
|
||||
},
|
||||
},
|
||||
menu = {
|
||||
draw = {
|
||||
columns = {
|
||||
{ "label", "label_description", gap = 1 },
|
||||
{ "kind_icon", "kind", gap = 1 },
|
||||
{ "source_name", gap = 1 },
|
||||
},
|
||||
},
|
||||
scrollbar = false,
|
||||
winhighlight =
|
||||
'Pmenu:NormalFloat,FloatBorder:TelescopeBorder,PmenuSel:TelescopeSelection,CursorLine:TelescopeSelection,Search:None',
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
require('Polydev').setup()
|
||||
require('nvim-ts-autotag').setup({
|
||||
opts = {
|
||||
enable_close = true, -- Auto close tags
|
||||
enable_rename = true, -- Auto rename pairs of tags
|
||||
enable_close_on_slash = false, -- Auto close on trailing </
|
||||
},
|
||||
opts = {
|
||||
enable_close = true, -- Auto close tags
|
||||
enable_rename = true, -- Auto rename pairs of tags
|
||||
enable_close_on_slash = false, -- Auto close on trailing </
|
||||
},
|
||||
})
|
||||
|
||||
require('trouble').setup({})
|
||||
-- require('dropbar').setup({})
|
||||
require("telescope").setup({
|
||||
defaults = {
|
||||
prompt_prefix = " ", -- Changes the search icon/prompt prefix
|
||||
selection_caret = " ", -- Changes the arrow/caret next to the selected item
|
||||
layout_strategy = "horizontal",
|
||||
layout_config = {
|
||||
horizontal = {
|
||||
prompt_position = 'top',
|
||||
prompt_min_width = 40,
|
||||
prompt_max_width = 80,
|
||||
preview_width = 80,
|
||||
},
|
||||
},
|
||||
sorting_strategy = "ascending",
|
||||
preview = {
|
||||
hide_on_startup = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,382 +1,366 @@
|
||||
--- Derive a highlight from an existing scheme group.
|
||||
local function derive_hl(name, opts)
|
||||
local base = opts.base and vim.api.nvim_get_hl(0, { name = opts.base })
|
||||
or {}
|
||||
local fg = opts.fg and vim.api.nvim_get_hl(0, { name = opts.fg }) or {}
|
||||
local bg = opts.bg and vim.api.nvim_get_hl(0, { name = opts.bg }) or {}
|
||||
vim.api.nvim_set_hl(0, name, {
|
||||
fg = fg.fg or base.fg,
|
||||
bg = bg.bg or base.bg,
|
||||
bold = opts.bold,
|
||||
})
|
||||
local base = opts.base and vim.api.nvim_get_hl(0, { name = opts.base })
|
||||
or {}
|
||||
local fg = opts.fg and vim.api.nvim_get_hl(0, { name = opts.fg }) or {}
|
||||
local bg = opts.bg and vim.api.nvim_get_hl(0, { name = opts.bg }) or {}
|
||||
vim.api.nvim_set_hl(0, name, {
|
||||
fg = fg.fg or base.fg,
|
||||
bg = bg.bg or base.bg,
|
||||
bold = opts.bold,
|
||||
})
|
||||
end
|
||||
--- Derive a mode highlight where bg comes from a syntax group and fg contrasts.
|
||||
local function derive_mode_hl(name, color_group)
|
||||
local color = vim.api.nvim_get_hl(0, { name = color_group })
|
||||
local status_bg = vim.api.nvim_get_hl(0, { name = 'StatusLine' })
|
||||
vim.api.nvim_set_hl(0, name, {
|
||||
bg = color.fg,
|
||||
fg = status_bg.bg or '#191724',
|
||||
bold = true,
|
||||
})
|
||||
local color = vim.api.nvim_get_hl(0, { name = color_group })
|
||||
local status_bg = vim.api.nvim_get_hl(0, { name = 'StatusLine' })
|
||||
vim.api.nvim_set_hl(0, name, {
|
||||
bg = color.fg,
|
||||
fg = status_bg.bg or '#191724',
|
||||
bold = true,
|
||||
})
|
||||
end
|
||||
|
||||
--- (Re)build all statusline highlight groups from current scheme.
|
||||
local function setup_statusline_highlights()
|
||||
derive_mode_hl('StatusModeNormal', 'Type')
|
||||
derive_mode_hl('StatusModeInsert', 'String')
|
||||
derive_mode_hl('StatusModeVisual', 'Statement')
|
||||
derive_mode_hl('StatusModeCommand', 'PreProc')
|
||||
derive_mode_hl('StatusModeReplace', 'WarningMsg')
|
||||
derive_mode_hl('StatusModeTerminal', 'Special')
|
||||
derive_hl('StatusGit', { base = 'CursorLine', fg = 'LineNr' })
|
||||
derive_hl('StatusLsp', { base = 'StatusLine', fg = 'DiagnosticInfo' })
|
||||
derive_hl('StatusLspSpinner', { base = 'StatusLine', fg = 'Constant' })
|
||||
derive_hl(
|
||||
'StatusDiagError',
|
||||
{ base = 'StatusLine', fg = 'DiagnosticError' }
|
||||
)
|
||||
derive_hl('StatusDiagWarn', { base = 'StatusLine', fg = 'DiagnosticWarn' })
|
||||
derive_hl('StatusDiagHint', { base = 'StatusLine', fg = 'DiagnosticHint' })
|
||||
derive_hl('StatusCursor', { base = 'CursorLine', fg = 'Normal' })
|
||||
-- derive_hl('StatusGitAdded', { base = 'StatusLine', fg = 'OkMsg' })
|
||||
derive_hl('StatusGitAdded', { base = 'StatusLine', fg = 'MoreMsg' })
|
||||
derive_hl(
|
||||
'StatusGitRemoved',
|
||||
{ base = 'StatusLine', fg = 'DiagnosticError' }
|
||||
)
|
||||
derive_hl('StatusRecording', { base = 'StatusLine', fg = 'WarningMsg' })
|
||||
derive_mode_hl('StatusModeNormal', 'Type')
|
||||
derive_mode_hl('StatusModeInsert', 'String')
|
||||
derive_mode_hl('StatusModeVisual', 'Statement')
|
||||
derive_mode_hl('StatusModeCommand', 'PreProc')
|
||||
derive_mode_hl('StatusModeReplace', 'WarningMsg')
|
||||
derive_mode_hl('StatusModeTerminal', 'Special')
|
||||
derive_hl('StatusGit', { base = 'CursorLine', fg = 'LineNr' })
|
||||
derive_hl('StatusLsp', { base = 'StatusLine', fg = 'DiagnosticInfo' })
|
||||
derive_hl('StatusLspSpinner', { base = 'StatusLine', fg = 'Constant' })
|
||||
derive_hl(
|
||||
'StatusDiagError',
|
||||
{ base = 'StatusLine', fg = 'DiagnosticError' }
|
||||
)
|
||||
derive_hl('StatusDiagWarn', { base = 'StatusLine', fg = 'DiagnosticWarn' })
|
||||
derive_hl('StatusDiagHint', { base = 'StatusLine', fg = 'DiagnosticHint' })
|
||||
derive_hl('StatusCursor', { base = 'CursorLine', fg = 'Normal' })
|
||||
-- derive_hl('StatusGitAdded', { base = 'StatusLine', fg = 'OkMsg' })
|
||||
derive_hl('StatusGitAdded', { base = 'StatusLine', fg = 'MoreMsg' })
|
||||
derive_hl(
|
||||
'StatusGitRemoved',
|
||||
{ base = 'StatusLine', fg = 'DiagnosticError' }
|
||||
)
|
||||
derive_hl('StatusRecording', { base = 'StatusLine', fg = 'WarningMsg' })
|
||||
end
|
||||
vim.api.nvim_create_autocmd('ColorScheme', {
|
||||
callback = setup_statusline_highlights,
|
||||
callback = setup_statusline_highlights,
|
||||
})
|
||||
setup_statusline_highlights()
|
||||
|
||||
--- Mode text mapping.
|
||||
local mode_map = {
|
||||
['n'] = ' NORM ',
|
||||
['i'] = ' INS ',
|
||||
['v'] = ' VIS ',
|
||||
['V'] = ' V-LINE ',
|
||||
[''] = ' V-BLK ',
|
||||
['R'] = ' REPL ',
|
||||
['c'] = ' CMD ',
|
||||
['t'] = ' TERM ',
|
||||
['n'] = ' NORM ',
|
||||
['i'] = ' INS ',
|
||||
['v'] = ' VIS ',
|
||||
['V'] = ' V-LINE ',
|
||||
[''] = ' V-BLK ',
|
||||
['R'] = ' REPL ',
|
||||
['c'] = ' CMD ',
|
||||
['t'] = ' TERM ',
|
||||
}
|
||||
local mode_hl_map = {
|
||||
['n'] = 'StatusModeNormal',
|
||||
['i'] = 'StatusModeInsert',
|
||||
['v'] = 'StatusModeVisual',
|
||||
['V'] = 'StatusModeVisual',
|
||||
[''] = 'StatusModeVisual',
|
||||
['R'] = 'StatusModeReplace',
|
||||
['c'] = 'StatusModeCommand',
|
||||
['t'] = 'StatusModeTerminal',
|
||||
['n'] = 'StatusModeNormal',
|
||||
['i'] = 'StatusModeInsert',
|
||||
['v'] = 'StatusModeVisual',
|
||||
['V'] = 'StatusModeVisual',
|
||||
[''] = 'StatusModeVisual',
|
||||
['R'] = 'StatusModeReplace',
|
||||
['c'] = 'StatusModeCommand',
|
||||
['t'] = 'StatusModeTerminal',
|
||||
}
|
||||
|
||||
--- Git branch (async, cached per buffer, refreshed every 5s)
|
||||
local function update_git_branch()
|
||||
if vim.bo.buftype ~= '' then
|
||||
return
|
||||
end
|
||||
vim.system(
|
||||
{ 'git', 'branch', '--show-current' },
|
||||
{ text = true },
|
||||
function(out)
|
||||
vim.b.git_branch = (out.code == 0 and out.stdout or ''):gsub(
|
||||
'%s+',
|
||||
''
|
||||
)
|
||||
end
|
||||
)
|
||||
if vim.bo.buftype ~= '' then
|
||||
return
|
||||
end
|
||||
vim.system(
|
||||
{ 'git', 'branch', '--show-current' },
|
||||
{ text = true },
|
||||
function(out)
|
||||
vim.b.git_branch = (out.code == 0 and out.stdout or ''):gsub(
|
||||
'%s+',
|
||||
''
|
||||
)
|
||||
end
|
||||
)
|
||||
end
|
||||
vim.uv.new_timer():start(5000, 5000, vim.schedule_wrap(update_git_branch))
|
||||
vim.api.nvim_create_autocmd({ 'BufEnter', 'FocusGained' }, {
|
||||
callback = function()
|
||||
update_git_branch()
|
||||
end,
|
||||
callback = function()
|
||||
update_git_branch()
|
||||
end,
|
||||
})
|
||||
|
||||
--- LSP progress (Neovim 0.10+ built-in handler)
|
||||
local progress = {}
|
||||
local spinner_frames =
|
||||
{ '⣾', '⣽', '⣻', '⢿', '⡿', '⣟', '⣯', '⣷' }
|
||||
{ '⣾', '⣽', '⣻', '⢿', '⡿', '⣟', '⣯', '⣷' }
|
||||
|
||||
local frame = 0
|
||||
--- Clean stale progress messages periodically
|
||||
local progress_timer = vim.uv.new_timer()
|
||||
local function start_progress_timer()
|
||||
if not progress_timer:is_active() then
|
||||
progress_timer:start(0, 200, function()
|
||||
local now = vim.loop.now()
|
||||
for k, v in pairs(progress) do
|
||||
local ttl = v.done and 2000 or 10000
|
||||
if now - v.t > ttl then
|
||||
progress[k] = nil
|
||||
end
|
||||
end
|
||||
if next(progress) then
|
||||
frame = (frame % #spinner_frames) + 1
|
||||
vim.schedule(function()
|
||||
vim.cmd('redrawstatus')
|
||||
end)
|
||||
else
|
||||
progress_timer:stop()
|
||||
vim.schedule(function()
|
||||
vim.cmd('redrawstatus')
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end
|
||||
if not progress_timer:is_active() then
|
||||
progress_timer:start(0, 200, function()
|
||||
local now = vim.loop.now()
|
||||
for k, v in pairs(progress) do
|
||||
local ttl = v.done and 2000 or 10000
|
||||
if now - v.t > ttl then
|
||||
progress[k] = nil
|
||||
end
|
||||
end
|
||||
if next(progress) then
|
||||
frame = (frame % #spinner_frames) + 1
|
||||
vim.schedule(function()
|
||||
vim.cmd('redrawstatus')
|
||||
end)
|
||||
else
|
||||
progress_timer:stop()
|
||||
vim.schedule(function()
|
||||
vim.cmd('redrawstatus')
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd('LspProgress', {
|
||||
callback = function(ev)
|
||||
local d = ev.data
|
||||
if not d then
|
||||
return
|
||||
end
|
||||
local params = d.params
|
||||
if not params or not params.token then
|
||||
return
|
||||
end
|
||||
local key = d.client_id .. ':' .. tostring(params.token)
|
||||
local value = params.value or {}
|
||||
if value.kind == 'begin' then
|
||||
progress[key] = {
|
||||
msg = (value.message or 'working...'):gsub('%%', '%%%%'),
|
||||
t = vim.loop.now(),
|
||||
}
|
||||
start_progress_timer()
|
||||
elseif value.kind == 'report' then
|
||||
local msg_parts = {}
|
||||
if value.message then
|
||||
msg_parts[#msg_parts + 1] = value.message
|
||||
end
|
||||
if value.percentage ~= nil then
|
||||
msg_parts[#msg_parts + 1] = '(' .. value.percentage .. '%%)'
|
||||
end
|
||||
progress[key] = {
|
||||
msg = table.concat(msg_parts, ' '),
|
||||
t = vim.loop.now(),
|
||||
}
|
||||
elseif value.kind == 'end' then
|
||||
if progress[key] then
|
||||
progress[key].done = true
|
||||
end
|
||||
vim.cmd('redrawstatus')
|
||||
end
|
||||
end,
|
||||
callback = function(ev)
|
||||
local d = ev.data
|
||||
if not d then
|
||||
return
|
||||
end
|
||||
local params = d.params
|
||||
if not params or not params.token then
|
||||
return
|
||||
end
|
||||
local key = d.client_id .. ':' .. tostring(params.token)
|
||||
local value = params.value or {}
|
||||
if value.kind == 'begin' then
|
||||
progress[key] = {
|
||||
msg = (value.message or 'working...'):gsub('%%', '%%%%'),
|
||||
t = vim.loop.now(),
|
||||
}
|
||||
start_progress_timer()
|
||||
elseif value.kind == 'report' then
|
||||
local msg_parts = {}
|
||||
if value.message then
|
||||
msg_parts[#msg_parts + 1] = value.message
|
||||
end
|
||||
if value.percentage ~= nil then
|
||||
msg_parts[#msg_parts + 1] = '(' .. value.percentage .. '%%)'
|
||||
end
|
||||
progress[key] = {
|
||||
msg = table.concat(msg_parts, ' '),
|
||||
t = vim.loop.now(),
|
||||
}
|
||||
elseif value.kind == 'end' then
|
||||
if progress[key] then
|
||||
progress[key].done = true
|
||||
end
|
||||
vim.cmd('redrawstatus')
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ 'LspAttach', 'LspDetach' }, {
|
||||
callback = function(args)
|
||||
local names = {}
|
||||
for _, c in ipairs(vim.lsp.get_clients({ bufnr = args.buf })) do
|
||||
table.insert(names, c.name)
|
||||
end
|
||||
vim.b[args.buf].lsp_names = #names > 0
|
||||
and (' ● ' .. table.concat(names, ', ') .. ' ')
|
||||
or ''
|
||||
end,
|
||||
callback = function(args)
|
||||
local names = {}
|
||||
for _, c in ipairs(vim.lsp.get_clients({ bufnr = args.buf })) do
|
||||
table.insert(names, c.name)
|
||||
end
|
||||
vim.b[args.buf].lsp_names = #names > 0
|
||||
and (' ● ' .. table.concat(names, ', ') .. ' ')
|
||||
or ''
|
||||
end,
|
||||
})
|
||||
|
||||
local function lsp_section()
|
||||
local client_ids = {}
|
||||
for _, c in
|
||||
ipairs(vim.lsp.get_clients({ bufnr = vim.api.nvim_get_current_buf() }))
|
||||
do
|
||||
client_ids[c.id] = true
|
||||
end
|
||||
local latest = nil
|
||||
for key, p in pairs(progress) do
|
||||
local cid = tonumber(key:match('^(%d+):'))
|
||||
if cid and client_ids[cid] then
|
||||
if not latest or p.t > latest.t then
|
||||
latest = p
|
||||
end
|
||||
end
|
||||
end
|
||||
if latest and (not latest.done or (vim.loop.now() - latest.t < 2000)) then
|
||||
return '%#StatusLspSpinner# ○ ' .. latest.msg .. ' %*'
|
||||
end
|
||||
return '%#StatusLsp#' .. (vim.b.lsp_names or '') .. '%*'
|
||||
local client_ids = {}
|
||||
for _, c in
|
||||
ipairs(vim.lsp.get_clients({ bufnr = vim.api.nvim_get_current_buf() }))
|
||||
do
|
||||
client_ids[c.id] = true
|
||||
end
|
||||
local latest = nil
|
||||
for key, p in pairs(progress) do
|
||||
local cid = tonumber(key:match('^(%d+):'))
|
||||
if cid and client_ids[cid] then
|
||||
if not latest or p.t > latest.t then
|
||||
latest = p
|
||||
end
|
||||
end
|
||||
end
|
||||
if latest and (not latest.done or (vim.loop.now() - latest.t < 2000)) then
|
||||
return '%#StatusLspSpinner# ○ ' .. latest.msg .. ' %*'
|
||||
end
|
||||
return '%#StatusLsp#' .. (vim.b.lsp_names or '') .. '%*'
|
||||
end
|
||||
|
||||
local diag_cache = {}
|
||||
local function build_diag_string(counts)
|
||||
local parts = {}
|
||||
if counts[1] and counts[1] > 0 then
|
||||
table.insert(parts, '%#StatusDiagError# E' .. counts[1] .. ' %*')
|
||||
end
|
||||
if counts[2] and counts[2] > 0 then
|
||||
table.insert(parts, '%#StatusDiagWarn# W' .. counts[2] .. ' %*')
|
||||
end
|
||||
if counts[4] and counts[4] > 0 then
|
||||
table.insert(parts, '%#StatusDiagHint# H' .. counts[4] .. ' %*')
|
||||
end
|
||||
return table.concat(parts)
|
||||
local parts = {}
|
||||
if counts[1] and counts[1] > 0 then
|
||||
table.insert(parts, '%#StatusDiagError# E' .. counts[1] .. ' %*')
|
||||
end
|
||||
if counts[2] and counts[2] > 0 then
|
||||
table.insert(parts, '%#StatusDiagWarn# W' .. counts[2] .. ' %*')
|
||||
end
|
||||
if counts[4] and counts[4] > 0 then
|
||||
table.insert(parts, '%#StatusDiagHint# H' .. counts[4] .. ' %*')
|
||||
end
|
||||
return table.concat(parts)
|
||||
end
|
||||
|
||||
local function update_diag_cache(ev)
|
||||
diag_cache[ev.buf] = build_diag_string(vim.diagnostic.count(ev.buf))
|
||||
diag_cache[ev.buf] = build_diag_string(vim.diagnostic.count(ev.buf))
|
||||
end
|
||||
vim.api.nvim_create_autocmd(
|
||||
'DiagnosticChanged',
|
||||
{ callback = update_diag_cache }
|
||||
'DiagnosticChanged',
|
||||
{ callback = update_diag_cache }
|
||||
)
|
||||
|
||||
local function update_git_diff()
|
||||
if vim.bo.buftype ~= '' then
|
||||
return
|
||||
end
|
||||
local file = vim.fn.expand('%:p')
|
||||
if file == '' then
|
||||
return
|
||||
end
|
||||
vim.system(
|
||||
{ 'git', 'diff', '--numstat', 'HEAD', '--', file },
|
||||
{ text = true },
|
||||
function(out)
|
||||
if out.code ~= 0 or out.stdout == '' then
|
||||
vim.b.git_diff = nil
|
||||
return
|
||||
end
|
||||
local added, removed = out.stdout:match('(%d+)%s+(%d+)')
|
||||
vim.b.git_diff = {
|
||||
added = tonumber(added) or 0,
|
||||
removed = tonumber(removed) or 0,
|
||||
}
|
||||
end
|
||||
)
|
||||
if vim.bo.buftype ~= '' then
|
||||
return
|
||||
end
|
||||
local file = vim.fn.expand('%:p')
|
||||
if file == '' then
|
||||
return
|
||||
end
|
||||
vim.system(
|
||||
{ 'git', 'diff', '--numstat', 'HEAD', '--', file },
|
||||
{ text = true },
|
||||
function(out)
|
||||
if out.code ~= 0 or out.stdout == '' then
|
||||
vim.b.git_diff = nil
|
||||
return
|
||||
end
|
||||
local added, removed = out.stdout:match('(%d+)%s+(%d+)')
|
||||
vim.b.git_diff = {
|
||||
added = tonumber(added) or 0,
|
||||
removed = tonumber(removed) or 0,
|
||||
}
|
||||
end
|
||||
)
|
||||
end
|
||||
vim.api.nvim_create_autocmd({ 'BufEnter', 'FocusGained', 'BufWritePost' }, {
|
||||
callback = update_git_diff,
|
||||
callback = update_git_diff,
|
||||
})
|
||||
|
||||
function _G.__statusline()
|
||||
local m = vim.fn.mode()
|
||||
local mode_hl = mode_hl_map[m] or 'StatusModeNormal'
|
||||
local git = vim.b.git_branch or ''
|
||||
local cur_buf = vim.api.nvim_get_current_buf()
|
||||
local parts = {
|
||||
'%#' .. mode_hl .. '#' .. (mode_map[m] or ' ?? ') .. '%*',
|
||||
git ~= '' and ('%#StatusGit# ' .. git .. ' %*') or '',
|
||||
}
|
||||
local diff = vim.b.git_diff
|
||||
if diff and (diff.added > 0 or diff.removed > 0) then
|
||||
if diff.added > 0 then
|
||||
table.insert(parts, '%#StatusGitAdded# +' .. diff.added .. ' %*')
|
||||
end
|
||||
if diff.removed > 0 then
|
||||
table.insert(
|
||||
parts,
|
||||
'%#StatusGitRemoved# -' .. diff.removed .. ' %*'
|
||||
)
|
||||
end
|
||||
end
|
||||
table.insert(parts, lsp_section())
|
||||
table.insert(parts, '%=')
|
||||
local recording = vim.fn.reg_recording()
|
||||
if recording ~= '' then
|
||||
table.insert(
|
||||
parts,
|
||||
'%#StatusRecording# ● Rec @' .. recording .. ' %*'
|
||||
)
|
||||
end
|
||||
table.insert(
|
||||
parts,
|
||||
diag_cache[cur_buf] or build_diag_string(vim.diagnostic.count(cur_buf))
|
||||
)
|
||||
table.insert(parts, '%#StatusCursor# %l:%-2c %*')
|
||||
table.insert(parts, '%#' .. mode_hl .. '# %p%% %*')
|
||||
return table.concat(parts)
|
||||
local m = vim.fn.mode()
|
||||
local mode_hl = mode_hl_map[m] or 'StatusModeNormal'
|
||||
local git = vim.b.git_branch or ''
|
||||
local cur_buf = vim.api.nvim_get_current_buf()
|
||||
local parts = {
|
||||
'%#' .. mode_hl .. '#' .. (mode_map[m] or ' ?? ') .. '%*',
|
||||
git ~= '' and ('%#StatusGit# ' .. git .. ' %*') or '',
|
||||
}
|
||||
local diff = vim.b.git_diff
|
||||
if diff and (diff.added > 0 or diff.removed > 0) then
|
||||
if diff.added > 0 then
|
||||
table.insert(parts, '%#StatusGitAdded# +' .. diff.added .. ' %*')
|
||||
end
|
||||
if diff.removed > 0 then
|
||||
table.insert(
|
||||
parts,
|
||||
'%#StatusGitRemoved# -' .. diff.removed .. ' %*'
|
||||
)
|
||||
end
|
||||
end
|
||||
table.insert(parts, lsp_section())
|
||||
table.insert(parts, '%=')
|
||||
local recording = vim.fn.reg_recording()
|
||||
if recording ~= '' then
|
||||
table.insert(
|
||||
parts,
|
||||
'%#StatusRecording# ● Rec @' .. recording .. ' %*'
|
||||
)
|
||||
end
|
||||
table.insert(
|
||||
parts,
|
||||
diag_cache[cur_buf] or build_diag_string(vim.diagnostic.count(cur_buf))
|
||||
)
|
||||
table.insert(parts, '%#StatusCursor# %l:%-2c %*')
|
||||
table.insert(parts, '%#' .. mode_hl .. '# %p%% %*')
|
||||
return table.concat(parts)
|
||||
end
|
||||
|
||||
vim.o.statusline = '%!v:lua.__statusline()'
|
||||
|
||||
require('incline').setup({
|
||||
window = {
|
||||
padding = 0,
|
||||
margin = { horizontal = 0 },
|
||||
options = {
|
||||
-- Reset winhl so it doesn't force total transparency
|
||||
winhl = 'Normal:InclineNormal',
|
||||
},
|
||||
},
|
||||
render = function(props)
|
||||
local filename =
|
||||
vim.fn.fnamemodify(vim.api.nvim_buf_get_name(props.buf), ':t')
|
||||
if filename == '' then
|
||||
filename = '[No Name]'
|
||||
end
|
||||
local ft_icon, ft_color =
|
||||
require('nvim-web-devicons').get_icon_color(filename)
|
||||
local modified = vim.bo[props.buf].modified
|
||||
window = { margin = { vertical = 0, horizontal = 1 } },
|
||||
hide = { cursorline = true },
|
||||
render = function(props)
|
||||
local filename = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(props.buf), ":t")
|
||||
if vim.bo[props.buf].modified then
|
||||
filename = "[+] " .. filename
|
||||
end
|
||||
|
||||
return {
|
||||
ft_icon and {
|
||||
' ',
|
||||
ft_icon,
|
||||
' ',
|
||||
guibg = ft_color,
|
||||
guifg = require('incline.helpers').contrast_color(ft_color),
|
||||
} or '',
|
||||
-- Wrap the text and padding inside a structural block linked to 'CursorLine'
|
||||
{
|
||||
' ',
|
||||
{ filename, gui = modified and 'bold,italic' or 'bold' },
|
||||
' ',
|
||||
group = 'CursorLine',
|
||||
},
|
||||
}
|
||||
end,
|
||||
local icon, color = require("nvim-web-devicons").get_icon_color(filename)
|
||||
return { { icon, guifg = color }, { " " }, { filename } }
|
||||
end,
|
||||
-- window = {
|
||||
-- padding = 0,
|
||||
-- margin = { horizontal = 0 },
|
||||
-- options = {
|
||||
-- -- Reset winhl so it doesn't force total transparency
|
||||
-- winhl = 'Normal:InclineNormal',
|
||||
-- },
|
||||
-- },
|
||||
-- render = function(props)
|
||||
-- local filename =
|
||||
-- vim.fn.fnamemodify(vim.api.nvim_buf_get_name(props.buf), ':t')
|
||||
-- if filename == '' then
|
||||
-- filename = '[No Name]'
|
||||
-- end
|
||||
-- local ft_icon, ft_color =
|
||||
-- require('nvim-web-devicons').get_icon_color(filename)
|
||||
-- local modified = vim.bo[props.buf].modified
|
||||
--
|
||||
-- return {
|
||||
-- ft_icon and {
|
||||
-- ' ',
|
||||
-- ft_icon,
|
||||
-- ' ',
|
||||
-- guibg = ft_color,
|
||||
-- guifg = require('incline.helpers').contrast_color(ft_color),
|
||||
-- -- guibg = ft_color,
|
||||
-- -- guifg = require('incline.helpers').contrast_color(ft_color),
|
||||
-- } or '',
|
||||
-- -- Wrap the text and padding inside a structural block linked to 'CursorLine'
|
||||
-- {
|
||||
-- ' ',
|
||||
-- { filename, gui = modified and 'bold,italic' or 'bold' },
|
||||
-- ' ',
|
||||
-- group = 'CursorLine',
|
||||
-- },
|
||||
-- }
|
||||
-- end,
|
||||
})
|
||||
-- require('incline').setup({
|
||||
-- window = {
|
||||
-- padding = 0,
|
||||
-- margin = { horizontal = 0 },
|
||||
-- },
|
||||
-- render = function(props)
|
||||
-- local filename =
|
||||
-- vim.fn.fnamemodify(vim.api.nvim_buf_get_name(props.buf), ':t')
|
||||
-- if filename == '' then
|
||||
-- filename = '[No Name]'
|
||||
-- end
|
||||
-- local ft_icon, ft_color =
|
||||
-- require('nvim-web-devicons').get_icon_color(filename)
|
||||
-- local modified = vim.bo[props.buf].modified
|
||||
-- -- Query 'StatusLine' since your custom highlights derive from it
|
||||
-- return {
|
||||
-- ft_icon and {
|
||||
-- ' ',
|
||||
-- ft_icon,
|
||||
-- ' ',
|
||||
-- guibg = ft_color,
|
||||
-- guifg = require('incline.helpers').contrast_color(ft_color),
|
||||
-- } or '',
|
||||
-- ' ',
|
||||
-- { filename, gui = modified and 'bold,italic' or 'bold' },
|
||||
-- ' ',
|
||||
-- guibg = '#363646',
|
||||
-- }
|
||||
-- end,
|
||||
-- })
|
||||
|
||||
require('noice').setup({
|
||||
lsp = {
|
||||
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
|
||||
override = {
|
||||
['vim.lsp.util.convert_input_to_markdown_lines'] = true,
|
||||
['vim.lsp.util.stylize_markdown'] = true,
|
||||
},
|
||||
},
|
||||
presets = {
|
||||
bottom_search = true, -- use a classic bottom cmdline for search
|
||||
command_palette = true, -- position the cmdline and popupmenu together
|
||||
long_message_to_split = true, -- long messages will be sent to a split
|
||||
inc_rename = false, -- enables an input dialog for inc-rename.nvim
|
||||
lsp_doc_border = false, -- add a border to hover docs and signature help
|
||||
},
|
||||
lsp = {
|
||||
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
|
||||
override = {
|
||||
['vim.lsp.util.convert_input_to_markdown_lines'] = true,
|
||||
['vim.lsp.util.stylize_markdown'] = true,
|
||||
},
|
||||
},
|
||||
presets = {
|
||||
bottom_search = true, -- use a classic bottom cmdline for search
|
||||
command_palette = true, -- position the cmdline and popupmenu together
|
||||
long_message_to_split = true, -- long messages will be sent to a split
|
||||
inc_rename = false, -- enables an input dialog for inc-rename.nvim
|
||||
lsp_doc_border = false, -- add a border to hover docs and signature help
|
||||
},
|
||||
})
|
||||
require('notify').setup({
|
||||
background_colour = '#000000',
|
||||
background_colour = '#000000',
|
||||
})
|
||||
|
||||
@@ -1,74 +1,38 @@
|
||||
{
|
||||
"plugins": {
|
||||
"Mountain": {
|
||||
"rev": "27db65fef4654095bf7e46a8930f411b6545fbe5",
|
||||
"src": "https://github.com/mountain-theme/Mountain"
|
||||
},
|
||||
"bamboo.nvim": {
|
||||
"rev": "1309bc88bffcf1bedc3e84e7fa9004de93da774a",
|
||||
"src": "https://github.com/ribru17/bamboo.nvim"
|
||||
},
|
||||
"blink.cmp": {
|
||||
"rev": "78336bc89ee5365633bcf754d93df01678b5c08f",
|
||||
"src": "https://github.com/saghen/blink.cmp",
|
||||
"version": ">=0.0.0"
|
||||
},
|
||||
"catppuccin": {
|
||||
"rev": "05e8787020dcfdb937bf2ff23855ea2415b4e072",
|
||||
"src": "https://github.com/catppuccin/nvim"
|
||||
},
|
||||
"conform.nvim": {
|
||||
"rev": "619363c30309d29ffa631e67c8183f2a72caa373",
|
||||
"rev": "016802de402556da54c36bd7359b441266b01cdd",
|
||||
"src": "https://github.com/stevearc/conform.nvim"
|
||||
},
|
||||
"dart-vim-plugin": {
|
||||
"rev": "13fa42674f1685a1c5a095c1dac74d94e43a9849",
|
||||
"src": "https://github.com/dart-lang/dart-vim-plugin"
|
||||
},
|
||||
"dressing.nvim": {
|
||||
"rev": "2d7c2db2507fa3c4956142ee607431ddb2828639",
|
||||
"src": "https://github.com/stevearc/dressing.nvim"
|
||||
},
|
||||
"everforest": {
|
||||
"rev": "85a86eb62409e3ec88713bff3d1b9d7374e112e4",
|
||||
"src": "https://github.com/sainnhe/everforest"
|
||||
},
|
||||
"flutter-tools.nvim": {
|
||||
"rev": "7d1acfd139215e02d2784733af69a61aaebe06e8",
|
||||
"src": "https://github.com/akinsho/flutter-tools.nvim"
|
||||
},
|
||||
"fzf-lua": {
|
||||
"rev": "532d463f5c83595192fe740572d8fd6902b2217a",
|
||||
"src": "https://github.com/ibhagwan/fzf-lua"
|
||||
"dropbar.nvim": {
|
||||
"rev": "808ba31cde89aec8833e9789f5e04557cd31c9e1",
|
||||
"src": "https://github.com/Bekaboo/dropbar.nvim"
|
||||
},
|
||||
"incline.nvim": {
|
||||
"rev": "debd628e9395f7a9da57bdc31ce75ca6b40a880b",
|
||||
"src": "https://github.com/b0o/incline.nvim"
|
||||
},
|
||||
"kanagawa.nvim": {
|
||||
"rev": "bb85e4bfc8d89b0e62c8fa53ccdd13d12e2f77b3",
|
||||
"src": "https://github.com/rebelot/kanagawa.nvim"
|
||||
"kanso.nvim": {
|
||||
"rev": "1afbbb449aa0254823dbe1932e3cbb51886ff9fe",
|
||||
"src": "https://github.com/webhooked/kanso.nvim"
|
||||
},
|
||||
"lsp-status.nvim": {
|
||||
"rev": "54f48eb5017632d81d0fd40112065f1d062d0629",
|
||||
"src": "https://github.com/nvim-lua/lsp-status.nvim"
|
||||
},
|
||||
"lualine.nvim": {
|
||||
"rev": "221ce6b2d999187044529f49da6554a92f740a96",
|
||||
"src": "https://github.com/nvim-lualine/lualine.nvim"
|
||||
"live-preview.nvim": {
|
||||
"rev": "a6307fa340ed7c0d96f5c567afc8c991aad94ce0",
|
||||
"src": "https://github.com/brianhuster/live-preview.nvim"
|
||||
},
|
||||
"mason-lspconfig.nvim": {
|
||||
"rev": "a4068c3ebd4cb335b25239e5ea35c22ee6007962",
|
||||
"rev": "b5576cd62899a1a478d0e67ef3d378ee55dba82d",
|
||||
"src": "https://github.com/mason-org/mason-lspconfig.nvim"
|
||||
},
|
||||
"mason.nvim": {
|
||||
"rev": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d",
|
||||
"src": "https://github.com/mason-org/mason.nvim"
|
||||
},
|
||||
"melange-nvim": {
|
||||
"rev": "ce42f6b629beeaa00591ba73a77d3eeac4cf28ce",
|
||||
"src": "https://github.com/savq/melange-nvim"
|
||||
},
|
||||
"mini.hipatterns": {
|
||||
"rev": "607d604e650cdf21d71f863d040c496a1d0cb320",
|
||||
"src": "https://github.com/nvim-mini/mini.hipatterns",
|
||||
@@ -79,24 +43,16 @@
|
||||
"src": "https://github.com/nvim-mini/mini.pairs",
|
||||
"version": ">=0.0.0"
|
||||
},
|
||||
"mini.statusline": {
|
||||
"rev": "127997ebef7ef632161203b960c5ef9d158f4810",
|
||||
"src": "https://github.com/nvim-mini/mini.statusline"
|
||||
},
|
||||
"noice.nvim": {
|
||||
"rev": "7bfd942445fb63089b59f97ca487d605e715f155",
|
||||
"src": "https://github.com/folke/noice.nvim"
|
||||
},
|
||||
"nui.nvim": {
|
||||
"rev": "de740991c12411b663994b2860f1a4fd0937c130",
|
||||
"rev": "10fc361835c856ba4233ef5ea135b919bf3dce97",
|
||||
"src": "https://github.com/MunifTanjim/nui.nvim"
|
||||
},
|
||||
"nvim-dap": {
|
||||
"rev": "9e848e09a697ee95302a3ef2dd43fd6eb709e570",
|
||||
"src": "https://github.com/mfussenegger/nvim-dap"
|
||||
},
|
||||
"nvim-lspconfig": {
|
||||
"rev": "d5b6e3db4c17b0146f63a2fc47e2027a754b2cb1",
|
||||
"rev": "84b6b6c3f13cb34a6c8a0354b0da4c67d8ccf867",
|
||||
"src": "https://github.com/neovim/nvim-lspconfig"
|
||||
},
|
||||
"nvim-notify": {
|
||||
@@ -108,7 +64,7 @@
|
||||
"src": "https://github.com/alexghergh/nvim-tmux-navigation"
|
||||
},
|
||||
"nvim-treesitter": {
|
||||
"rev": "4916d6592ede8c07973490d9322f187e07dfefac",
|
||||
"rev": "5cb0114e6242625db56dd6440e945ed1ece10bc7",
|
||||
"src": "https://github.com/nvim-treesitter/nvim-treesitter"
|
||||
},
|
||||
"nvim-ts-autotag": {
|
||||
@@ -116,7 +72,7 @@
|
||||
"src": "https://github.com/windwp/nvim-ts-autotag"
|
||||
},
|
||||
"nvim-web-devicons": {
|
||||
"rev": "0ca28b61a04fe7426cefbdd52c2647ef0e335b5f",
|
||||
"rev": "5f032a85be210cd1c6ac98861eb3b187ff3bd5eb",
|
||||
"src": "https://github.com/nvim-tree/nvim-web-devicons"
|
||||
},
|
||||
"plenary.nvim": {
|
||||
@@ -124,19 +80,11 @@
|
||||
"src": "https://github.com/nvim-lua/plenary.nvim"
|
||||
},
|
||||
"polydev": {
|
||||
"rev": "8d41141e9ab68c271bb8bb2db5528bb0a61c78eb",
|
||||
"src": "git@moo:dmm/polydev.git"
|
||||
},
|
||||
"rose-pine": {
|
||||
"rev": "ff483051a47e27d84bdef47703538df1ed9f4a47",
|
||||
"src": "https://github.com/rose-pine/neovim"
|
||||
},
|
||||
"statusline.lua": {
|
||||
"rev": "4c7083cdd8b902ce06762861124ac4c031b2e581",
|
||||
"src": "https://github.com/beauwilliams/statusline.lua"
|
||||
"rev": "2b30e36fade3272081f7166bc0ec614b0b7da1c9",
|
||||
"src": "https://git.moomancer.xyz/DarthMooMancer/polydev.git"
|
||||
},
|
||||
"telescope.nvim": {
|
||||
"rev": "427b576c16792edad01a92b89721d923c19ad60f",
|
||||
"rev": "40aedd8a68c78a656a10a8d62d80c54af59420fb",
|
||||
"src": "https://github.com/nvim-telescope/telescope.nvim"
|
||||
},
|
||||
"trouble.nvim": {
|
||||
|
||||
Reference in New Issue
Block a user