Compare commits

...

No commits in common. "main" and "canary" have entirely different histories.
main ... canary

9 changed files with 376 additions and 274 deletions

3
.gitignore vendored
View File

@ -1,3 +0,0 @@
.neoconf.json
.stylua.toml
lazy-lock.json

View File

@ -6,6 +6,8 @@ local vanila_vim_autostart_commands = {
"set tabstop=4",
}
vim.opt.fillchars = { eob = " " }
for _, cmd in pairs(vanila_vim_autostart_commands) do
vim.cmd(cmd)
end
@ -15,7 +17,6 @@ if vim.lsp.inlay_hint then
end
require("config.lazy")
require("config.plugins.nvimufo")
require("config.plugins.acmp")
require("config.plugins.autotag")
require("config.plugins.autocomplete")
@ -24,11 +25,7 @@ require("config.plugins.colorizer")
require("config.plugins.comment")
require("config.plugins.dap")
require("config.plugins.gitsigns")
require("ibl").setup({
exclude = {
filetypes = { "dashboard" },
}
})
require("config.plugins.ibl")
require("config.plugins.hover_actions")
require("config.plugins.lsp_config")
require("config.plugins.lsp_diagnostic")

View File

@ -1,27 +1,89 @@
vim.opt.termguicolors = true
require("bufferline").setup({
highlights = {
background = {
italic = false,
},
buffer_selected = {
bold = true,
},
},
options = {
mode = "buffers",
persist_buffer_sort = true,
enforce_regular_tabs = false,
always_show_bufferline = false,
offsets = {
{
filetype = "NeoTree",
text = "File Explorer",
highlight = "Directory",
separator = true,
}
}
}
})
local utils = require("config.utils.bufferline")
require("bufferline").setup({
highlights = {
background = {
italic = false,
},
buffer_selected = {
bold = true,
},
},
options = {
themable = true,
get_element_icon = nil,
show_duplicate_prefix = true,
duplicates_across_groups = true,
auto_toggle_bufferline = true,
move_wraps_at_ends = false,
groups = { items = {}, options = { toggle_hidden_on_enter = true } },
mode = "buffers",
numbers = "none",
close_command = function(bufnr)
utils.buf_kill("bd", bufnr, false)
end,
right_mouse_command = "vert sbuffer %d",
left_mouse_command = "buffer %d",
middle_mouse_command = nil,
name_formatter = function(buf)
if buf.name:match "%.md" then
return vim.fn.fnamemodify(buf.name, ":t:r")
end
end,
max_name_length = 18,
max_prefix_length = 15,
truncate_names = true,
tab_size = 18,
diagnostics = "nvim_lsp",
diagnostics_update_in_insert = false,
custom_filter = utils.custom_filter,
offsets = {
{
filetype = "undotree",
text = "Undotree",
highlight = "PanelHeading",
padding = 1,
},
{
filetype = "NvimTree",
text = "Explorer",
highlight = "PanelHeading",
padding = 1,
},
{
filetype = "DiffviewFiles",
text = "Diff View",
highlight = "PanelHeading",
padding = 1,
},
{
filetype = "flutterToolsOutline",
text = "Flutter Outline",
highlight = "PanelHeading",
},
{
filetype = "lazy",
text = "Lazy",
highlight = "PanelHeading",
padding = 1,
},
},
color_icons = true,
show_close_icon = false,
show_tab_indicators = true,
persist_buffer_sort = true,
separator_style = "thin",
enforce_regular_tabs = false,
always_show_bufferline = false,
hover = {
enabled = false,
delay = 200,
reveal = { "close" },
},
sort_by = "id",
debug = { logging = false },
},
})

View File

@ -1,23 +1,14 @@
require("hover").setup {
init = function()
-- Require providers
require("hover.providers.lsp")
-- require('hover.providers.gh')
-- require('hover.providers.gh_user')
-- require('hover.providers.jira')
-- require('hover.providers.dap')
-- require('hover.providers.fold_preview')
require('hover.providers.diagnostic')
-- require('hover.providers.man')
-- require('hover.providers.dictionary')
end,
preview_opts = {
border = 'single'
},
preview_window = false,
title = true,
mouse_providers = {
'LSP'
},
mouse_delay = 1000
init = function()
require("hover.providers.lsp")
end,
preview_opts = {
border = 'single'
},
preview_window = false,
title = true,
mouse_providers = {
'LSP'
},
mouse_delay = 1000
}

View File

@ -0,0 +1,5 @@
require("ibl").setup({
exclude = {
filetypes = { "dashboard" },
}
})

View File

@ -1,61 +0,0 @@
vim.o.foldcolumn = "auto:9"
vim.o.foldlevel = 99
vim.o.foldlevelstart = 99
vim.o.foldenable = true
vim.o.fillchars = [[eob: ,fold: ,foldopen:󰅀,foldsep:│,foldclose:󰅂]]
vim.keymap.set('n', 'zR', require('ufo').openAllFolds)
vim.keymap.set('n', 'zM', require('ufo').closeAllFolds)
local handler = function(virtText, lnum, endLnum, width, truncate)
local newVirtText = {}
local totalLines = vim.api.nvim_buf_line_count(0)
local foldedLines = endLnum - lnum
local suffix = ("  %d %d%%"):format(foldedLines, foldedLines / totalLines * 100)
local sufWidth = vim.fn.strdisplaywidth(suffix)
local targetWidth = width - sufWidth
local curWidth = 0
for _, chunk in ipairs(virtText) do
local chunkText = chunk[1]
local chunkWidth = vim.fn.strdisplaywidth(chunkText)
if targetWidth > curWidth + chunkWidth then
table.insert(newVirtText, chunk)
else
chunkText = truncate(chunkText, targetWidth - curWidth)
local hlGroup = chunk[2]
table.insert(newVirtText, { chunkText, hlGroup })
chunkWidth = vim.fn.strdisplaywidth(chunkText)
-- str width returned from truncate() may less than 2nd argument, need padding
if curWidth + chunkWidth < targetWidth then
suffix = suffix .. (" "):rep(targetWidth - curWidth - chunkWidth)
end
break
end
curWidth = curWidth + chunkWidth
end
local rAlignAppndx =
math.max(math.min(vim.opt.textwidth["_value"], width - 1) - curWidth - sufWidth, 0)
suffix = (" "):rep(rAlignAppndx) .. suffix
table.insert(newVirtText, { suffix, "MoreMsg" })
return newVirtText
end
require('ufo').setup({
fold_virt_text_handler = handler,
open_fold_hl_timeout = 400,
preview = {
win_config = {
border = { "", "", "", "", "", "", "", "" },
winblend = 0,
},
mappings = {
scrollU = "<C-u>",
scrollD = "<C-d>",
jumpTop = "[",
jumpBot = "]",
},
},
provider_selector = function(bufnr, filetype, buftype)
return { 'treesitter', 'indent' }
end
})

View File

@ -0,0 +1,95 @@
local Utils = {}
function Utils.is_ft(b, ft)
return vim.bo[b].filetype == ft
end
function Utils.custom_filter(buf, buf_nums)
local logs = vim.tbl_filter(function(b)
return Utils.is_ft(b, "log")
end, buf_nums or {})
if vim.tbl_isempty(logs) then
return true
end
local tab_num = vim.fn.tabpagenr()
local last_tab = vim.fn.tabpagenr "$"
local is_log = Utils.is_ft(buf, "log")
if last_tab == 1 then
return true
end
-- only show log buffers in secondary tabs
return (tab_num == last_tab and is_log) or (tab_num ~= last_tab and not is_log)
end
function Utils.buf_kill(kill_command, bufnr, force)
local bo = vim.bo
local api = vim.api
local fmt = string.format
local fn = vim.fn
if bufnr == 0 or bufnr == nil then
bufnr = api.nvim_get_current_buf()
end
local bufname = api.nvim_buf_get_name(bufnr)
if not force then
local choice
if bo[bufnr].modified then
choice = fn.confirm(fmt([[Save changes to "%s"?]], bufname), "&Yes\n&No\n&Cancel")
if choice == 1 then
vim.api.nvim_buf_call(bufnr, function()
vim.cmd("w")
end)
elseif choice == 2 then
force = true
else
return
end
elseif api.nvim_get_option_value("buftype", { buf = 0 }) == "terminal" then
choice = fn.confirm(fmt([[Close "%s"?]], bufname), "&Yes\n&No\n&Cancel")
if choice == 1 then
force = true
else
return
end
end
end
-- Get list of windows IDs with the buffer to close
local windows = vim.tbl_filter(function(win)
return api.nvim_win_get_buf(win) == bufnr
end, api.nvim_list_wins())
if force then
kill_command = kill_command .. "!"
end
-- Get list of active buffers
local buffers = vim.tbl_filter(function(buf)
return api.nvim_buf_is_valid(buf) and bo[buf].buflisted
end, api.nvim_list_bufs())
-- If there is only one buffer (which has to be the current one), vim will
-- create a new buffer on :bd.
-- For more than one buffer, pick the previous buffer (wrapping around if necessary)
if #buffers > 1 and #windows > 0 then
for i, v in ipairs(buffers) do
if v == bufnr then
local prev_buf_idx = i == 1 and #buffers or (i - 1)
local prev_buffer = buffers[prev_buf_idx]
for _, win in ipairs(windows) do
api.nvim_win_set_buf(win, prev_buffer)
end
end
end
end
-- Check if buffer still exists, to ensure the target buffer wasn't killed
-- due to options like bufhidden=wipe.
if api.nvim_buf_is_valid(bufnr) and bo[bufnr].buflisted then
vim.cmd(string.format("%s %d", kill_command, bufnr))
end
end
return Utils

View File

@ -1,4 +1,6 @@
local map = vim.keymap.set
local bl_utils = require("config.utils.bufferline")
local hover = require "hover"
map("n", ";", ":", { desc = "CMD enter command mode" })
@ -32,26 +34,40 @@ map("i", "<C-s>", "<cmd>w!<cr>")
map("n", "<", "<cmd><gv<cr>")
map("n", ">", "<cmd>>gv<cr>")
map("n", "<leader>dr", "<cmd> DapContinue <cr>", { desc = "Continue debug" } )
map("n", "<leader>c", function(bufnr)
bl_utils.buf_kill("bd", bufnr, true)
end)
map("n", "<leader>dr", "<cmd> DapContinue <cr>", { desc = "Continue debug" })
map("n", "do", function()
require("dapui").open()
require("dapui").open()
end, { desc = "Open DAP ui" })
map("n", "dc", function()
require("dapui").close()
require("dapui").close()
end, { desc = "Start or continue debug" })
map("n", "dt", function()
require("dapui").toggle()
require("dapui").toggle()
end, { desc = "Toggle DAP ui" })
map("n", "<leader>rn", "<cmd>set relativenumber<cr>")
map("n", "<A-j>", "<cmd>m .+1<CR>==")
map("n", "<A-k>", "<cmd>m .-2<CR>==")
map("i", "<A-j>", "<Esc><cmd>m .+1<CR>==gi")
map("i", "<A-k>", "<Esc><cmd>m .-2<CR>==gi")
map("n", "<C-Up>", "<cmd>resize -2<CR>")
map("n", "<C-Down>", "<cmd>resize +2<CR>")
map("n", "<C-Right>", "<cmd>vertical resize -2<CR>")
map("n", "<C-Left>", "<cmd>vertical resize +2<CR>")
map("n", "<leader>an", "<cmd>set norelativenumber<cr>")
map("n", "<leader>rn", "<cmd>set relativenumber<cr>")
map("n", "tt", "<cmd>ToggleTerm<cr>")
map("n", "<C-{>", "<cmd>foldopen<cr>")
map("n", "<C-}>", "<cmd>foldclose<cr>")
map("n", "hh", require("hover").hover, {desc = "hover.nvim"})
map("n", "hs", require("hover").hover_select, {desc = "hover.nvim (select)"})
map("n", "<C-Tab>", function() require("hover").hover_switch("previous") end, {desc = "hover.nvim (previous source)"})
map("n", "<C-S-Tab>", function() require("hover").hover_switch("next") end, {desc = "hover.nvim (next source)"})
map("n", "hh", hover.hover)
map("n", "hs", hover.hover_select)
map("n", "vs", "<cmd> vsplit <cr>")
map("n", "ss", "<cmd> split <cr>")

View File

@ -1,152 +1,152 @@
return {
{
'simrat39/inlay-hints.nvim',
},
{
"LunarVim/breadcrumbs.nvim",
},
{
"akinsho/bufferline.nvim",
},
{
"lewis6991/gitsigns.nvim"
},
{
"lewis6991/hover.nvim",
},
{
"nvim-lualine/lualine.nvim",
},
{
"akinsho/toggleterm.nvim",
},
{
"windwp/nvim-autopairs",
},
{
'kevinhwang91/promise-async',
},
{
'theHamsta/nvim-dap-virtual-text',
},
{
"hrsh7th/cmp-nvim-lsp",
},
{
"SmiteshP/nvim-navic",
},
{
"kyazdani42/nvim-web-devicons"
},
{
'NvChad/nvim-colorizer.lua',
},
{
'numToStr/Comment.nvim'
},
{
"nvim-treesitter/nvim-treesitter",
},
{
"vague2k/huez.nvim",
},
{
"nvim-telescope/telescope.nvim",
},
{
"williamboman/mason-lspconfig.nvim",
},
{
"neovim/nvim-lspconfig",
},
{
"mfussenegger/nvim-dap",
event = "VeryLazy",
},
{
"L3MON4D3/LuaSnip",
lazy = true,
},
{
'folke/lazydev.nvim',
ft = "lua",
},
{
'Bekaboo/dropbar.nvim',
dependencies = {
'nvim-telescope/telescope-fzf-native.nvim',
build = 'make'
},
config = function()
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' })
end
},
{
"folke/noice.nvim",
event = "VeryLazy",
dependencies = {
"MunifTanjim/nui.nvim",
"rcarriga/nvim-notify",
},
},
{
"nvim-neo-tree/neo-tree.nvim",
branch = "v2.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
},
},
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"eslint-lsp",
"js-debug-adapter",
"prettier",
"tinymist",
"typescript-language-server",
}
}
},
{
"rcarriga/nvim-dap-ui",
dependencies = {
"nvim-neotest/nvim-nio",
"mfussenegger/nvim-dap",
},
event = "VeryLazy",
config = function()
require("dapui").setup()
end
},
{
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
{
"L3MON4D3/LuaSnip",
dependencies = "rafamadriz/friendly-snippets",
opts = { history = true, updateevents = "TextChanged,TextChangedI" },
config = function(_, opts)
require("luasnip").config.set_config(opts)
require "config.plugins.luasnip"
end,
},
{
"saadparwaiz1/cmp_luasnip",
"hrsh7th/cmp-nvim-lua",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
},
},
},
{
'kevinhwang91/nvim-ufo',
},
{
'simrat39/inlay-hints.nvim',
},
{
"LunarVim/breadcrumbs.nvim",
},
{
"akinsho/bufferline.nvim",
},
{
"lewis6991/gitsigns.nvim"
},
{
"lewis6991/hover.nvim",
},
{
"nvim-lualine/lualine.nvim",
},
{
"akinsho/toggleterm.nvim",
},
{
"windwp/nvim-autopairs",
},
{
'kevinhwang91/promise-async',
},
{
'theHamsta/nvim-dap-virtual-text',
},
{
"hrsh7th/cmp-nvim-lsp",
},
{
"SmiteshP/nvim-navic",
},
{
"kyazdani42/nvim-web-devicons"
},
{
'NvChad/nvim-colorizer.lua',
},
{
'numToStr/Comment.nvim'
},
{
"nvim-treesitter/nvim-treesitter",
},
{
"catppuccin/nvim"
},
{
"vague2k/huez.nvim",
},
{
"nvim-telescope/telescope.nvim",
},
{
"williamboman/mason-lspconfig.nvim",
},
{
"neovim/nvim-lspconfig",
},
{
"mfussenegger/nvim-dap",
event = "VeryLazy",
},
{
"L3MON4D3/LuaSnip",
lazy = true,
},
{
'folke/lazydev.nvim',
ft = "lua",
},
{
'Bekaboo/dropbar.nvim',
dependencies = {
'nvim-telescope/telescope-fzf-native.nvim',
build = 'make'
},
config = function()
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' })
end
},
{
"folke/noice.nvim",
event = "VeryLazy",
dependencies = {
"MunifTanjim/nui.nvim",
"rcarriga/nvim-notify",
},
},
{
"nvim-neo-tree/neo-tree.nvim",
branch = "v2.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
},
},
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"eslint-lsp",
"js-debug-adapter",
"prettier",
"tinymist",
"typescript-language-server",
}
}
},
{
"rcarriga/nvim-dap-ui",
dependencies = {
"nvim-neotest/nvim-nio",
"mfussenegger/nvim-dap",
},
event = "VeryLazy",
config = function()
require("dapui").setup()
end
},
{
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
{
"L3MON4D3/LuaSnip",
dependencies = "rafamadriz/friendly-snippets",
opts = { history = true, updateevents = "TextChanged,TextChangedI" },
config = function(_, opts)
require("luasnip").config.set_config(opts)
require "config.plugins.luasnip"
end,
},
{
"saadparwaiz1/cmp_luasnip",
"hrsh7th/cmp-nvim-lua",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
},
},
},
}