Merge branch 'custom'
This commit is contained in:
commit
d628ec08a9
8
init.lua
8
init.lua
|
|
@ -942,12 +942,8 @@ require('lazy').setup({
|
|||
-- This is the easiest way to modularize your config.
|
||||
--
|
||||
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
||||
-- { import = 'custom.plugins' },
|
||||
--
|
||||
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
|
||||
-- Or use telescope!
|
||||
-- In normal mode type `<space>sh` then write `lazy.nvim-plugin`
|
||||
-- you can continue same window with `<space>sr` which resumes last telescope search
|
||||
-- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
|
||||
{ import = 'custom.plugins' },
|
||||
}, {
|
||||
ui = {
|
||||
-- If you are using a Nerd Font: set icons to an empty table which will use the
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
-- tab 页签
|
||||
return { 'akinsho/bufferline.nvim', version = '*', dependencies = 'nvim-tree/nvim-web-devicons', opts = {} }
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
-- 中文格式化,中英文之间添加空格
|
||||
-- NOTE: 使用 `:Pangu` 进行格式化
|
||||
return { 'hotoo/pangu.vim', ft = { 'markdown' } }
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
-- 文件树
|
||||
return {
|
||||
'nvim-neo-tree/neo-tree.nvim',
|
||||
version = '*',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvim-tree/nvim-web-devicons', -- 不严格要求,但推荐
|
||||
'MunifTanjim/nui.nvim',
|
||||
},
|
||||
config = function()
|
||||
require('neo-tree').setup { close_if_last_window = true }
|
||||
vim.keymap.set('n', '<leader>tf', ':Neotree toggle<CR>', { desc = '[T]oggle [F]ileTree' })
|
||||
end,
|
||||
}
|
||||
|
||||
-- vim: ts=2 sts=2 sw=2 et
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
-- You can add your own plugins here or in other files in this directory!
|
||||
-- I promise not to create any merge conflicts in this directory :)
|
||||
--
|
||||
-- See the kickstart.nvim README for more information
|
||||
return {}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
-- 快速跳转
|
||||
return {
|
||||
"folke/flash.nvim",
|
||||
event = "VeryLazy",
|
||||
---@type Flash.Config
|
||||
opts = {},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
|
||||
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
|
||||
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
|
||||
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
|
||||
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
-- 使用 Shift + j/k 代替 Ctrl + d/u
|
||||
|
||||
vim.keymap.set('n', '<S-j>', '<C-d>')
|
||||
vim.keymap.set('n', '<S-k>', '<C-u>')
|
||||
|
||||
return {}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
-- Markdown 预览
|
||||
return {
|
||||
'iamcco/markdown-preview.nvim',
|
||||
build = 'cd app && npm install',
|
||||
ft = 'markdown',
|
||||
config = function()
|
||||
vim.g.mkdp_auto_start = 1
|
||||
end,
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
-- Mini 全家桶
|
||||
return {
|
||||
'echasnovski/mini.nvim',
|
||||
config = function()
|
||||
-- 可视化显示缩进范围
|
||||
require('mini.indentscope').setup()
|
||||
|
||||
-- 自动配对
|
||||
require('mini.pairs').setup()
|
||||
|
||||
-- 启动界面
|
||||
require('mini.starter').setup()
|
||||
|
||||
-- 小地图
|
||||
local map = require 'mini.map'
|
||||
|
||||
map.setup {
|
||||
integrations = {
|
||||
map.gen_integration.builtin_search(),
|
||||
map.gen_integration.gitsigns(),
|
||||
map.gen_integration.diagnostic(),
|
||||
},
|
||||
symbols = {
|
||||
encode = map.gen_encode_symbols.dot '4x2',
|
||||
},
|
||||
}
|
||||
|
||||
vim.keymap.set('n', '<Leader>tm', map.toggle, { desc = '[T]oggle [M]ap' })
|
||||
|
||||
vim.cmd [[autocmd User MiniStarterOpened
|
||||
\ lua vim.keymap.set(
|
||||
\ 'n',
|
||||
\ '<CR>',
|
||||
\ '<Cmd>lua MiniStarter.eval_current_item(); MiniMap.open()<CR>',
|
||||
\ { buffer = true }
|
||||
\ )]]
|
||||
end,
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
-- 取代 messages, cmdline 和 popupmenu
|
||||
return {
|
||||
'folke/noice.nvim',
|
||||
event = 'VeryLazy',
|
||||
opts = {
|
||||
-- add any options here
|
||||
},
|
||||
dependencies = {
|
||||
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
|
||||
'MunifTanjim/nui.nvim',
|
||||
-- OPTIONAL:
|
||||
-- `nvim-notify` is only needed, if you want to use the notification view.
|
||||
-- If not available, we use `mini` as the fallback
|
||||
-- 'rcarriga/nvim-notify',
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
-- 状态栏
|
||||
return {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
opts = {
|
||||
options = {
|
||||
theme = 'palenight',
|
||||
component_separators = '',
|
||||
section_separators = { left = '', right = '' },
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { { 'mode', separator = { left = '' }, right_padding = 2 } },
|
||||
lualine_z = {
|
||||
{ 'location', separator = { right = '' }, left_padding = 2 },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
-- 文本替换
|
||||
return {
|
||||
'nvim-pack/nvim-spectre',
|
||||
event = 'BufRead',
|
||||
opts = {},
|
||||
}
|
||||
|
||||
-- vim: ts=2 sts=2 sw=2 et
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
-- 翻译
|
||||
-- NOTE: 弹出窗中 `g?` 查看操作帮助
|
||||
return {
|
||||
'potamides/pantran.nvim',
|
||||
config = function()
|
||||
local pantran = require 'pantran'
|
||||
pantran.setup {
|
||||
default_engine = 'google',
|
||||
engines = {
|
||||
google = {
|
||||
fallback = {
|
||||
default_source = 'auto',
|
||||
default_target = 'zh',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
vim.keymap.set('x', '<leader>t', pantran.motion_translate, { noremap = true, silent = true, expr = true, desc = '[T]ranslate' })
|
||||
end,
|
||||
}
|
||||
Loading…
Reference in New Issue