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.
e08b17f335
...
5826161160
@ -1,7 +1,4 @@
|
|||||||
require("fzf-lua").setup {
|
require("fzf-lua").setup {
|
||||||
defaults = {
|
|
||||||
file_icons = "mini",
|
|
||||||
},
|
|
||||||
winopts = {
|
winopts = {
|
||||||
row = 0.5,
|
row = 0.5,
|
||||||
height = 0.7,
|
height = 0.7,
|
||||||
|
|||||||
36
lua/config/indent-blankline.lua
Normal file
36
lua/config/indent-blankline.lua
Normal 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,
|
||||||
|
})
|
||||||
@ -1,14 +1,6 @@
|
|||||||
-- Setup nvim-cmp.
|
-- Setup nvim-cmp.
|
||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
|
local lspkind = require("lspkind")
|
||||||
-- 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")
|
|
||||||
|
|
||||||
cmp.setup {
|
cmp.setup {
|
||||||
snippet = {
|
snippet = {
|
||||||
@ -51,14 +43,21 @@ cmp.setup {
|
|||||||
view = {
|
view = {
|
||||||
entries = "custom",
|
entries = "custom",
|
||||||
},
|
},
|
||||||
-- solution taken from https://github.com/echasnovski/mini.nvim/issues/1007#issuecomment-2258929830
|
|
||||||
formatting = {
|
formatting = {
|
||||||
format = function(_, vim_item)
|
format = lspkind.cmp_format {
|
||||||
local icon, hl = MiniIcons.get("lsp", vim_item.kind)
|
mode = "symbol_text",
|
||||||
vim_item.kind = icon .. " " .. vim_item.kind
|
menu = {
|
||||||
vim_item.kind_hl_group = hl
|
nvim_lsp = "[LSP]",
|
||||||
return vim_item
|
ultisnips = "[US]",
|
||||||
end,
|
path = "[Path]",
|
||||||
|
buffer = "[Buffer]",
|
||||||
|
emoji = "[Emoji]",
|
||||||
|
omni = "[Omni]",
|
||||||
|
},
|
||||||
|
show_labelDetails = true,
|
||||||
|
maxwidth = 40,
|
||||||
|
ellipsis_char = "...",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -22,19 +22,24 @@ end
|
|||||||
|
|
||||||
local plugin_specs = {
|
local plugin_specs = {
|
||||||
-- auto-completion engine
|
-- 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",
|
"hrsh7th/nvim-cmp",
|
||||||
name = "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()
|
config = function()
|
||||||
require("config.nvim-cmp")
|
require("config.nvim-cmp")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
event = { "BufRead", "BufNewFile" },
|
event = { "BufRead", "BufNewFile" },
|
||||||
@ -51,7 +56,7 @@ local plugin_specs = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
lazy = true,
|
event = "VeryLazy",
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
config = function()
|
config = function()
|
||||||
require("config.treesitter")
|
require("config.treesitter")
|
||||||
@ -83,7 +88,7 @@ local plugin_specs = {
|
|||||||
-- Super fast buffer jump
|
-- Super fast buffer jump
|
||||||
{
|
{
|
||||||
"smoka7/hop.nvim",
|
"smoka7/hop.nvim",
|
||||||
keys = { "f" },
|
event = "VeryLazy",
|
||||||
config = function()
|
config = function()
|
||||||
require("config.nvim_hop")
|
require("config.nvim_hop")
|
||||||
end,
|
end,
|
||||||
@ -107,16 +112,17 @@ local plugin_specs = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ibhagwan/fzf-lua",
|
"ibhagwan/fzf-lua",
|
||||||
|
-- optional for icon support
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
config = function()
|
config = function()
|
||||||
require("config.fzf-lua")
|
require("config.fzf-lua")
|
||||||
end,
|
end,
|
||||||
event = "VeryLazy",
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"MeanderingProgrammer/markdown.nvim",
|
"MeanderingProgrammer/markdown.nvim",
|
||||||
main = "render-markdown",
|
main = "render-markdown",
|
||||||
opts = {},
|
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.
|
-- A list of colorscheme plugin you may want to try. Find what suits you.
|
||||||
{ "navarasu/onedark.nvim", lazy = true },
|
{ "navarasu/onedark.nvim", lazy = true },
|
||||||
@ -135,22 +141,11 @@ local plugin_specs = {
|
|||||||
branch = "v2",
|
branch = "v2",
|
||||||
},
|
},
|
||||||
{ "rebelot/kanagawa.nvim", lazy = true },
|
{ "rebelot/kanagawa.nvim", lazy = true },
|
||||||
|
{ "nvim-tree/nvim-web-devicons", event = "VeryLazy" },
|
||||||
-- 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-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
event = "BufRead",
|
event = "VeryLazy",
|
||||||
cond = firenvim_not_active,
|
cond = firenvim_not_active,
|
||||||
config = function()
|
config = function()
|
||||||
require("config.lualine")
|
require("config.lualine")
|
||||||
@ -176,16 +171,11 @@ local plugin_specs = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"echasnovski/mini.indentscope",
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
version = false,
|
event = "VeryLazy",
|
||||||
|
main = "ibl",
|
||||||
config = function()
|
config = function()
|
||||||
local mini_indent = require("mini.indentscope")
|
require("config.indent-blankline")
|
||||||
mini_indent.setup {
|
|
||||||
draw = {
|
|
||||||
animation = mini_indent.gen_animation.none(),
|
|
||||||
},
|
|
||||||
symbol = "▏",
|
|
||||||
}
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -211,7 +201,7 @@ local plugin_specs = {
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
-- Highlight URLs inside vim
|
-- Highlight URLs inside vim
|
||||||
{ "itchyny/vim-highlighturl", event = "BufReadPost" },
|
{ "itchyny/vim-highlighturl", event = "VeryLazy" },
|
||||||
|
|
||||||
-- notification plugin
|
-- notification plugin
|
||||||
{
|
{
|
||||||
@ -222,8 +212,6 @@ local plugin_specs = {
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "nvim-lua/plenary.nvim", lazy = true },
|
|
||||||
|
|
||||||
-- For Windows and Mac, we can open an URL in the browser. For Linux, it may
|
-- 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.
|
-- not be possible since we maybe in a server which disables GUI.
|
||||||
{
|
{
|
||||||
@ -236,6 +224,7 @@ local plugin_specs = {
|
|||||||
enabled = function()
|
enabled = function()
|
||||||
return vim.g.is_win or vim.g.is_mac
|
return vim.g.is_win or vim.g.is_mac
|
||||||
end,
|
end,
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
config = true, -- default settings
|
config = true, -- default settings
|
||||||
submodules = false, -- not needed, submodules are required only for tests
|
submodules = false, -- not needed, submodules are required only for tests
|
||||||
},
|
},
|
||||||
@ -263,10 +252,7 @@ local plugin_specs = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
-- Comment plugin
|
-- Comment plugin
|
||||||
{ "tpope/vim-commentary", keys = {
|
{ "tpope/vim-commentary", event = "VeryLazy" },
|
||||||
{ "gc", mode = "n" },
|
|
||||||
{ "gc", mode = "v" },
|
|
||||||
} },
|
|
||||||
|
|
||||||
-- Multiple cursor plugin like Sublime Text?
|
-- Multiple cursor plugin like Sublime Text?
|
||||||
-- 'mg979/vim-visual-multi'
|
-- 'mg979/vim-visual-multi'
|
||||||
@ -280,7 +266,7 @@ local plugin_specs = {
|
|||||||
config = function()
|
config = function()
|
||||||
require("config.yanky")
|
require("config.yanky")
|
||||||
end,
|
end,
|
||||||
cmd = "YankyRingHistory",
|
event = "VeryLazy",
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Handy unix command inside Vim (Rename, Move etc.)
|
-- Handy unix command inside Vim (Rename, Move etc.)
|
||||||
@ -336,12 +322,10 @@ local plugin_specs = {
|
|||||||
config = function()
|
config = function()
|
||||||
require("config.gitsigns")
|
require("config.gitsigns")
|
||||||
end,
|
end,
|
||||||
event = "BufRead",
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"sindrets/diffview.nvim",
|
"sindrets/diffview.nvim",
|
||||||
cmd = { "DiffviewOpen" },
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -376,7 +360,7 @@ local plugin_specs = {
|
|||||||
ft = { "markdown" },
|
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
|
-- Additional powerful text object for vim, this plugin should be studied
|
||||||
-- carefully to use its full power
|
-- carefully to use its full power
|
||||||
@ -385,6 +369,9 @@ local plugin_specs = {
|
|||||||
-- Plugin to manipulate character pairs quickly
|
-- Plugin to manipulate character pairs quickly
|
||||||
{ "machakann/vim-sandwich", event = "VeryLazy" },
|
{ "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
|
-- Only use these plugin on Windows and Mac and when LaTeX is installed
|
||||||
{
|
{
|
||||||
"lervag/vimtex",
|
"lervag/vimtex",
|
||||||
@ -494,7 +481,8 @@ local plugin_specs = {
|
|||||||
-- file explorer
|
-- file explorer
|
||||||
{
|
{
|
||||||
"nvim-tree/nvim-tree.lua",
|
"nvim-tree/nvim-tree.lua",
|
||||||
keys = { "<space>s" },
|
event = "VeryLazy",
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
config = function()
|
config = function()
|
||||||
require("config.nvim-tree")
|
require("config.nvim-tree")
|
||||||
end,
|
end,
|
||||||
@ -502,7 +490,8 @@ local plugin_specs = {
|
|||||||
|
|
||||||
{
|
{
|
||||||
"j-hui/fidget.nvim",
|
"j-hui/fidget.nvim",
|
||||||
event = "BufRead",
|
event = "VeryLazy",
|
||||||
|
tag = "legacy",
|
||||||
config = function()
|
config = function()
|
||||||
require("config.fidget-nvim")
|
require("config.fidget-nvim")
|
||||||
end,
|
end,
|
||||||
@ -522,12 +511,13 @@ local plugin_specs = {
|
|||||||
"CopilotC-Nvim/CopilotChat.nvim",
|
"CopilotC-Nvim/CopilotChat.nvim",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{ "zbirenbaum/copilot.lua" }, -- or github/copilot.vim
|
{ "zbirenbaum/copilot.lua" }, -- or github/copilot.vim
|
||||||
|
{ "nvim-lua/plenary.nvim" }, -- for curl, log wrapper
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {
|
||||||
debug = true, -- Enable debugging
|
debug = true, -- Enable debugging
|
||||||
-- See Configuration section for rest
|
-- See Configuration section for rest
|
||||||
},
|
},
|
||||||
cmd = { "CopilotChat" },
|
-- See Commands section for default commands if you want to lazy load on them
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"zbirenbaum/copilot.lua",
|
"zbirenbaum/copilot.lua",
|
||||||
@ -544,6 +534,7 @@ local plugin_specs = {
|
|||||||
config = function()
|
config = function()
|
||||||
require("config.live-command")
|
require("config.live-command")
|
||||||
end,
|
end,
|
||||||
|
event = "VeryLazy",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
-- show hint for code actions, the user can also implement code actions themselves,
|
-- show hint for code actions, the user can also implement code actions themselves,
|
||||||
@ -552,11 +543,9 @@ local plugin_specs = {
|
|||||||
config = function()
|
config = function()
|
||||||
require("config.lightbulb")
|
require("config.lightbulb")
|
||||||
end,
|
end,
|
||||||
event = "LspAttach",
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Bekaboo/dropbar.nvim",
|
"Bekaboo/dropbar.nvim",
|
||||||
event = "VeryLazy",
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"catgoose/nvim-colorizer.lua",
|
"catgoose/nvim-colorizer.lua",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user