1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

Compare commits

..

No commits in common. "e08b17f33551f92e8591075d076729d608523cc1" and "58261611609ec4b3e134aa42edeb31e8cc01a288" have entirely different histories.

4 changed files with 88 additions and 67 deletions

View File

@ -1,7 +1,4 @@
require("fzf-lua").setup {
defaults = {
file_icons = "mini",
},
winopts = {
row = 0.5,
height = 0.7,

View File

@ -0,0 +1,36 @@
local api = vim.api
local exclude_ft = { "help", "git", "markdown", "snippets", "text", "gitconfig", "alpha", "dashboard" }
require("ibl").setup {
indent = {
-- -- U+2502 may also be a good choice, it will be on the middle of cursor.
-- -- U+250A is also a good choice
char = "",
},
scope = {
show_start = false,
show_end = false,
},
exclude = {
filetypes = exclude_ft,
buftypes = { "terminal" },
},
}
local gid = api.nvim_create_augroup("indent_blankline", { clear = true })
api.nvim_create_autocmd("InsertEnter", {
pattern = "*",
group = gid,
command = "IBLDisable",
})
api.nvim_create_autocmd("InsertLeave", {
pattern = "*",
group = gid,
callback = function()
if not vim.tbl_contains(exclude_ft, vim.bo.filetype) then
vim.cmd([[IBLEnable]])
end
end,
})

View File

@ -1,14 +1,6 @@
-- Setup nvim-cmp.
local cmp = require("cmp")
-- The extentions needed by nvim-cmp should be loaded beforehand
require("cmp_nvim_lsp")
require("cmp_path")
require("cmp_buffer")
require("cmp_omni")
require("cmp_nvim_ultisnips")
local MiniIcons = require("mini.icons")
local lspkind = require("lspkind")
cmp.setup {
snippet = {
@ -51,14 +43,21 @@ cmp.setup {
view = {
entries = "custom",
},
-- solution taken from https://github.com/echasnovski/mini.nvim/issues/1007#issuecomment-2258929830
formatting = {
format = function(_, vim_item)
local icon, hl = MiniIcons.get("lsp", vim_item.kind)
vim_item.kind = icon .. " " .. vim_item.kind
vim_item.kind_hl_group = hl
return vim_item
end,
format = lspkind.cmp_format {
mode = "symbol_text",
menu = {
nvim_lsp = "[LSP]",
ultisnips = "[US]",
path = "[Path]",
buffer = "[Buffer]",
emoji = "[Emoji]",
omni = "[Omni]",
},
show_labelDetails = true,
maxwidth = 40,
ellipsis_char = "...",
},
},
}

View File

@ -22,19 +22,24 @@ end
local plugin_specs = {
-- auto-completion engine
{ "hrsh7th/cmp-nvim-lsp", lazy = true },
{ "hrsh7th/cmp-path", lazy = true },
{ "hrsh7th/cmp-buffer", lazy = true },
{ "hrsh7th/cmp-omni", lazy = true },
{ "quangnguyen30192/cmp-nvim-ultisnips", lazy = true },
{
"hrsh7th/nvim-cmp",
name = "nvim-cmp",
event = "InsertEnter",
-- event = 'InsertEnter',
event = "VeryLazy",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"onsails/lspkind-nvim",
"hrsh7th/cmp-path",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-omni",
"quangnguyen30192/cmp-nvim-ultisnips",
},
config = function()
require("config.nvim-cmp")
end,
},
{
"neovim/nvim-lspconfig",
event = { "BufRead", "BufNewFile" },
@ -51,7 +56,7 @@ local plugin_specs = {
},
{
"nvim-treesitter/nvim-treesitter",
lazy = true,
event = "VeryLazy",
build = ":TSUpdate",
config = function()
require("config.treesitter")
@ -83,7 +88,7 @@ local plugin_specs = {
-- Super fast buffer jump
{
"smoka7/hop.nvim",
keys = { "f" },
event = "VeryLazy",
config = function()
require("config.nvim_hop")
end,
@ -107,16 +112,17 @@ local plugin_specs = {
},
{
"ibhagwan/fzf-lua",
-- optional for icon support
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require("config.fzf-lua")
end,
event = "VeryLazy",
},
{
"MeanderingProgrammer/markdown.nvim",
main = "render-markdown",
opts = {},
ft = { "markdown" },
dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" },
},
-- A list of colorscheme plugin you may want to try. Find what suits you.
{ "navarasu/onedark.nvim", lazy = true },
@ -135,22 +141,11 @@ local plugin_specs = {
branch = "v2",
},
{ "rebelot/kanagawa.nvim", lazy = true },
-- plugins to provide nerdfont icons
{
"echasnovski/mini.icons",
version = false,
config = function()
-- this is the compatibility fix for plugins that only support nvim-web-devicons
require("mini.icons").mock_nvim_web_devicons()
require("mini.icons").tweak_lsp_kind()
end,
lazy = true,
},
{ "nvim-tree/nvim-web-devicons", event = "VeryLazy" },
{
"nvim-lualine/lualine.nvim",
event = "BufRead",
event = "VeryLazy",
cond = firenvim_not_active,
config = function()
require("config.lualine")
@ -176,16 +171,11 @@ local plugin_specs = {
},
{
"echasnovski/mini.indentscope",
version = false,
"lukas-reineke/indent-blankline.nvim",
event = "VeryLazy",
main = "ibl",
config = function()
local mini_indent = require("mini.indentscope")
mini_indent.setup {
draw = {
animation = mini_indent.gen_animation.none(),
},
symbol = "",
}
require("config.indent-blankline")
end,
},
{
@ -211,7 +201,7 @@ local plugin_specs = {
end,
},
-- Highlight URLs inside vim
{ "itchyny/vim-highlighturl", event = "BufReadPost" },
{ "itchyny/vim-highlighturl", event = "VeryLazy" },
-- notification plugin
{
@ -222,8 +212,6 @@ local plugin_specs = {
end,
},
{ "nvim-lua/plenary.nvim", lazy = true },
-- For Windows and Mac, we can open an URL in the browser. For Linux, it may
-- not be possible since we maybe in a server which disables GUI.
{
@ -236,6 +224,7 @@ local plugin_specs = {
enabled = function()
return vim.g.is_win or vim.g.is_mac
end,
dependencies = { "nvim-lua/plenary.nvim" },
config = true, -- default settings
submodules = false, -- not needed, submodules are required only for tests
},
@ -263,10 +252,7 @@ local plugin_specs = {
},
-- Comment plugin
{ "tpope/vim-commentary", keys = {
{ "gc", mode = "n" },
{ "gc", mode = "v" },
} },
{ "tpope/vim-commentary", event = "VeryLazy" },
-- Multiple cursor plugin like Sublime Text?
-- 'mg979/vim-visual-multi'
@ -280,7 +266,7 @@ local plugin_specs = {
config = function()
require("config.yanky")
end,
cmd = "YankyRingHistory",
event = "VeryLazy",
},
-- Handy unix command inside Vim (Rename, Move etc.)
@ -336,12 +322,10 @@ local plugin_specs = {
config = function()
require("config.gitsigns")
end,
event = "BufRead",
},
{
"sindrets/diffview.nvim",
cmd = { "DiffviewOpen" },
},
{
@ -376,7 +360,7 @@ local plugin_specs = {
ft = { "markdown" },
},
{ "chrisbra/unicode.vim", keys = { "ga" }, cmd = { "UnicodeSearch" } },
{ "chrisbra/unicode.vim", event = "VeryLazy" },
-- Additional powerful text object for vim, this plugin should be studied
-- carefully to use its full power
@ -385,6 +369,9 @@ local plugin_specs = {
-- Plugin to manipulate character pairs quickly
{ "machakann/vim-sandwich", event = "VeryLazy" },
-- Add indent object for vim (useful for languages like Python)
{ "michaeljsmith/vim-indent-object", event = "VeryLazy" },
-- Only use these plugin on Windows and Mac and when LaTeX is installed
{
"lervag/vimtex",
@ -494,7 +481,8 @@ local plugin_specs = {
-- file explorer
{
"nvim-tree/nvim-tree.lua",
keys = { "<space>s" },
event = "VeryLazy",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require("config.nvim-tree")
end,
@ -502,7 +490,8 @@ local plugin_specs = {
{
"j-hui/fidget.nvim",
event = "BufRead",
event = "VeryLazy",
tag = "legacy",
config = function()
require("config.fidget-nvim")
end,
@ -522,12 +511,13 @@ local plugin_specs = {
"CopilotC-Nvim/CopilotChat.nvim",
dependencies = {
{ "zbirenbaum/copilot.lua" }, -- or github/copilot.vim
{ "nvim-lua/plenary.nvim" }, -- for curl, log wrapper
},
opts = {
debug = true, -- Enable debugging
-- See Configuration section for rest
},
cmd = { "CopilotChat" },
-- See Commands section for default commands if you want to lazy load on them
},
{
"zbirenbaum/copilot.lua",
@ -544,6 +534,7 @@ local plugin_specs = {
config = function()
require("config.live-command")
end,
event = "VeryLazy",
},
{
-- show hint for code actions, the user can also implement code actions themselves,
@ -552,11 +543,9 @@ local plugin_specs = {
config = function()
require("config.lightbulb")
end,
event = "LspAttach",
},
{
"Bekaboo/dropbar.nvim",
event = "VeryLazy",
},
{
"catgoose/nvim-colorizer.lua",