Compare commits
247 Commits
Author | SHA1 | Date | |
---|---|---|---|
9f04e1e20d | |||
edff9b1a25 | |||
38d2c8aab0 | |||
50a358bc1e | |||
b1d456cda7 | |||
b9f3cada8a | |||
777be2fabd | |||
5c5e7c65c7 | |||
5b51df3f39 | |||
204be37843 | |||
f98c4a26b3 | |||
94de32c598 | |||
118ca3309d | |||
8597c2085f | |||
c38c3bf407 | |||
f535fb6891 | |||
cb6832d8ad | |||
c555e17e48 | |||
20d36ccd84 | |||
13366c6488 | |||
d6bc320f20 | |||
7bbd48caa0 | |||
761171a872 | |||
092b1fd802 | |||
d2d5d9f53c | |||
38b530d33d | |||
739409cd4b | |||
058089d0d6 | |||
03c5aa71f3 | |||
0f0a81c175 | |||
286a6fb8ae | |||
b72a5c2dfa | |||
704e85183b | |||
b5495eb38a | |||
27ceb433a9 | |||
171a843edf | |||
5538ab2d64 | |||
65874d161a | |||
90a8200e7c | |||
1599edd10a | |||
eac18246d4 | |||
aa0e4f52e4 | |||
b304db9236 | |||
ee7a401388 | |||
8e88aa51f4 | |||
28b7a5add2 | |||
e8c26c70e2 | |||
599798a366 | |||
b1c9fd15bd | |||
4719dadfda | |||
88d465c3ef | |||
23a0004a86 | |||
02bc41412a | |||
44984dcbe2 | |||
0955129796 | |||
4e8a88fc1f | |||
9a4b9aa804 | |||
9357ea2881 | |||
fb70170058 | |||
c0ce89fe62 | |||
5d44c976a7 | |||
6b857f1de6 | |||
9670c8a400 | |||
2abb5907ef | |||
2c658a374d | |||
4fe7ccae73 | |||
0a05888d99 | |||
d894556c37 | |||
efbe4e5793 | |||
1779858426 | |||
cc8397ade3 | |||
b05783de8c | |||
22271cdbbc | |||
bff3a99697 | |||
302c1ff66e | |||
eddd3af351 | |||
dd55cbdc99 | |||
838ce85ad6 | |||
5219cad564 | |||
de93848f58 | |||
502d32490b | |||
51e25a94b4 | |||
1eac633c4f | |||
3f67ac3c73 | |||
33c677a55e | |||
e11a3cbe80 | |||
639a6e7545 | |||
80e6696343 | |||
eebdceca17 | |||
c9bbb922e5 | |||
6e3fb589d5 | |||
4e0a05808c | |||
6b837e9165 | |||
21ee35f710 | |||
25f3587f3f | |||
0cdc23a51d | |||
89d0805fb8 | |||
1bc78272da | |||
af9e452854 | |||
9372d78e7e | |||
30d573502a | |||
3c92fa4eb0 | |||
8c20e0b588 | |||
862e140a7a | |||
1935486ff1 | |||
237be9e3a7 | |||
75a26e8509 | |||
0fcdbe20da | |||
fb110e76d8 | |||
8bcc241b72 | |||
d8f4382dd3 | |||
11c9084ec5 | |||
54df3e26ac | |||
e1f5484c82 | |||
6b4c872f2d | |||
6e0e01f5b4 | |||
a1c5886947 | |||
8a1de2b90a | |||
3823f177e9 | |||
f1ea518e29 | |||
cce46cd640 | |||
337cfdbec4 | |||
b2af941290 | |||
f219364656 | |||
6f1cdfe4bd | |||
1eb019274b | |||
d6b56c075e | |||
6f6d587998 | |||
d3e7f7717e | |||
49b91b6b1f | |||
86de423ef0 | |||
0cc80b1b05 | |||
7272b3e4b5 | |||
b58446f7b3 | |||
d989ecc943 | |||
3849e0150b | |||
1abcffbfd9 | |||
c490c61d07 | |||
79010ae671 | |||
f4750859f2 | |||
9f034ab106 | |||
2f16a7b2d9 | |||
3833a7d1ce | |||
bd2ac542a0 | |||
35053290bf | |||
417de0193d | |||
a12d4bd4e4 | |||
afc8e7f8ca | |||
936d74bb61 | |||
f15dd301e5 | |||
d28c69e49e | |||
0e66ef8393 | |||
626ae1338a | |||
5f0713d2b6 | |||
758520dcbb | |||
ccff8683ba | |||
0e16033e9c | |||
6cf6b0a624 | |||
e08813fa11 | |||
e105c9daf6 | |||
1b74d67a0d | |||
b1ad48067e | |||
63467c1f21 | |||
13e9f6e6b5 | |||
6428fc167c | |||
762017dc35 | |||
afbe2043a7 | |||
f1ce07510d | |||
364bcf325d | |||
3f868aa825 | |||
fecc5faca2 | |||
19926d2848 | |||
450e0c6beb | |||
4e277fcb8f | |||
86d3694672 | |||
7c5a458761 | |||
ecac59c982 | |||
4ff51cd678 | |||
fe341e6b97 | |||
0ca732e0ef | |||
766d5e5bf7 | |||
9b16770573 | |||
e36f7d811c | |||
0b04e3908c | |||
e8ab2ff5b6 | |||
3acdac917b | |||
2ffd629cc7 | |||
dd95de5dbe | |||
9d17c43087 | |||
2aea5c7210 | |||
9935dc3944 | |||
b8ffa5261a | |||
bfe04222fe | |||
f7655a83c5 | |||
9bb4e8755f | |||
4a2c89cd1d | |||
964dd6c4b2 | |||
0136bfa4b5 | |||
5eca3dc3bb | |||
7821c0e851 | |||
bd48536335 | |||
1c878b9d06 | |||
6f9adbd4fb | |||
ff5f5886db | |||
300350686f | |||
718c5c6036 | |||
31d913697b | |||
6bb0d1b66f | |||
0e5ff5c0ab | |||
886d49eb89 | |||
0f7a009d1c | |||
05f45bb720 | |||
9762e7e431 | |||
aab365a9f8 | |||
f61a243d1a | |||
6b05ed7dcd | |||
a7f68e5e37 | |||
3c448a1be1 | |||
7cac6f064c | |||
274649e923 | |||
a3011daf40 | |||
fa6cbfc602 | |||
d012a1acb8 | |||
d03f708cd3 | |||
017582c05a | |||
13bf7977a4 | |||
74786c21d7 | |||
7f5051ef72 | |||
b220e54159 | |||
b25559d397 | |||
ee068d8399 | |||
db86635e32 | |||
a1ab7c6e32 | |||
b30ff44af5 | |||
36d6a7fe4f | |||
50401d358b | |||
7c79cfe073 | |||
f1af34e885 | |||
5dc4ce3e4a | |||
ea930e3545 | |||
a7f971f30e | |||
e54d0dde62 | |||
0bff29c07a | |||
afdcec5b4a | |||
f892ba5cff | |||
a180c3097c | |||
b8d3a1c2cd |
1
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
1
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
blank_issues_enabled: false
|
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -59,6 +59,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
release-type: simple
|
release-type: simple
|
||||||
package-name: LazyVim
|
package-name: LazyVim
|
||||||
|
extra-files: |
|
||||||
|
lua/lazyvim/config/init.lua
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: tag stable versions
|
- name: tag stable versions
|
||||||
if: ${{ steps.release.outputs.release_created }}
|
if: ${{ steps.release.outputs.release_created }}
|
||||||
|
428
CHANGELOG.md
428
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
@ -54,7 +54,7 @@ LazyVim 提供了两全其美的方式 - 根据需要调整配置的灵活性,
|
|||||||
|
|
||||||
## ⚡️ 要求
|
## ⚡️ 要求
|
||||||
|
|
||||||
- Neovim >= **0.8.0** (需要用 **LuaJIT** 构建)
|
- Neovim >= **0.9.0** (需要用 **LuaJIT** 构建)
|
||||||
- Git >= **2.19.0** (用于部分克隆支持)
|
- Git >= **2.19.0** (用于部分克隆支持)
|
||||||
- 一个 [Nerd Font](https://www.nerdfonts.com/) 字体 **_(可选)_**
|
- 一个 [Nerd Font](https://www.nerdfonts.com/) 字体 **_(可选)_**
|
||||||
- 一个用于 `nvim-treesitter` 的 **C** 编译器。看 [这里](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
|
- 一个用于 `nvim-treesitter` 的 **C** 编译器。看 [这里](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
|
||||||
|
@ -56,7 +56,7 @@ to tweak your config as needed, along with the convenience of a pre-configured s
|
|||||||
|
|
||||||
## ⚡️ Requirements
|
## ⚡️ Requirements
|
||||||
|
|
||||||
- Neovim >= **0.8.0** (needs to be built with **LuaJIT**)
|
- Neovim >= **0.9.0** (needs to be built with **LuaJIT**)
|
||||||
- Git >= **2.19.0** (for partial clones support)
|
- Git >= **2.19.0** (for partial clones support)
|
||||||
- a [Nerd Font](https://www.nerdfonts.com/) **_(optional)_**
|
- a [Nerd Font](https://www.nerdfonts.com/) **_(optional)_**
|
||||||
- a **C** compiler for `nvim-treesitter`. See [here](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
|
- a **C** compiler for `nvim-treesitter`. See [here](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 September 04
|
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 October 11
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Table of Contents *LazyVim-table-of-contents*
|
Table of Contents *LazyVim-table-of-contents*
|
||||||
@ -52,7 +52,7 @@ FEATURES *LazyVim-features*
|
|||||||
|
|
||||||
REQUIREMENTS *LazyVim-requirements*
|
REQUIREMENTS *LazyVim-requirements*
|
||||||
|
|
||||||
- Neovim >= **0.8.0** (needs to be built with **LuaJIT**)
|
- Neovim >= **0.9.0** (needs to be built with **LuaJIT**)
|
||||||
- Git >= **2.19.0** (for partial clones support)
|
- Git >= **2.19.0** (for partial clones support)
|
||||||
- a Nerd Font <https://www.nerdfonts.com/> **(optional)**
|
- a Nerd Font <https://www.nerdfonts.com/> **(optional)**
|
||||||
- a **C** compiler for `nvim-treesitter`. See here <https://github.com/nvim-treesitter/nvim-treesitter#requirements>
|
- a **C** compiler for `nvim-treesitter`. See here <https://github.com/nvim-treesitter/nvim-treesitter#requirements>
|
||||||
|
@ -31,12 +31,13 @@ vim.api.nvim_create_autocmd({ "VimResized" }, {
|
|||||||
-- go to last loc when opening a buffer
|
-- go to last loc when opening a buffer
|
||||||
vim.api.nvim_create_autocmd("BufReadPost", {
|
vim.api.nvim_create_autocmd("BufReadPost", {
|
||||||
group = augroup("last_loc"),
|
group = augroup("last_loc"),
|
||||||
callback = function()
|
callback = function(event)
|
||||||
local exclude = { "gitcommit" }
|
local exclude = { "gitcommit" }
|
||||||
local buf = vim.api.nvim_get_current_buf()
|
local buf = event.buf
|
||||||
if vim.tbl_contains(exclude, vim.bo[buf].filetype) then
|
if vim.tbl_contains(exclude, vim.bo[buf].filetype) or vim.b[buf].lazyvim_last_loc then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
vim.b[buf].lazyvim_last_loc = true
|
||||||
local mark = vim.api.nvim_buf_get_mark(buf, '"')
|
local mark = vim.api.nvim_buf_get_mark(buf, '"')
|
||||||
local lcount = vim.api.nvim_buf_line_count(buf)
|
local lcount = vim.api.nvim_buf_line_count(buf)
|
||||||
if mark[1] > 0 and mark[1] <= lcount then
|
if mark[1] > 0 and mark[1] <= lcount then
|
||||||
@ -55,6 +56,7 @@ vim.api.nvim_create_autocmd("FileType", {
|
|||||||
"man",
|
"man",
|
||||||
"notify",
|
"notify",
|
||||||
"qf",
|
"qf",
|
||||||
|
"query",
|
||||||
"spectre_panel",
|
"spectre_panel",
|
||||||
"startuptime",
|
"startuptime",
|
||||||
"tsplayground",
|
"tsplayground",
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,19 +1,9 @@
|
|||||||
-- This file is automatically loaded by lazyvim.config.init
|
-- This file is automatically loaded by lazyvim.config.init
|
||||||
local Util = require("lazyvim.util")
|
local Util = require("lazyvim.util")
|
||||||
|
|
||||||
local function map(mode, lhs, rhs, opts)
|
-- DO NOT USE THIS IN YOU OWN CONFIG!!
|
||||||
local keys = require("lazy.core.handler").handlers.keys
|
-- use `vim.keymap.set` instead
|
||||||
---@cast keys LazyKeysHandler
|
local map = Util.safe_keymap_set
|
||||||
-- do not create the keymap if a lazy keys handler exists
|
|
||||||
if not keys.active[keys.parse({ lhs, mode = mode }).id] then
|
|
||||||
opts = opts or {}
|
|
||||||
opts.silent = opts.silent ~= false
|
|
||||||
if opts.remap and not vim.g.vscode then
|
|
||||||
opts.remap = nil
|
|
||||||
end
|
|
||||||
vim.keymap.set(mode, lhs, rhs, opts)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- better up/down
|
-- better up/down
|
||||||
map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||||
@ -103,14 +93,21 @@ if not Util.has("trouble.nvim") then
|
|||||||
map("n", "]q", vim.cmd.cnext, { desc = "Next quickfix" })
|
map("n", "]q", vim.cmd.cnext, { desc = "Next quickfix" })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- formatting
|
||||||
|
map({ "n", "v" }, "<leader>cf", function()
|
||||||
|
Util.format({ force = true })
|
||||||
|
end, { desc = "Format" })
|
||||||
|
|
||||||
-- stylua: ignore start
|
-- stylua: ignore start
|
||||||
|
|
||||||
-- toggle options
|
-- toggle options
|
||||||
map("n", "<leader>uf", require("lazyvim.plugins.lsp.format").toggle, { desc = "Toggle format on Save" })
|
map("n", "<leader>uf", function() Util.format.toggle() end, { desc = "Toggle auto format (global)" })
|
||||||
|
map("n", "<leader>uF", function() Util.format.toggle(true) end, { desc = "Toggle auto format (buffer)" })
|
||||||
map("n", "<leader>us", function() Util.toggle("spell") end, { desc = "Toggle Spelling" })
|
map("n", "<leader>us", function() Util.toggle("spell") end, { desc = "Toggle Spelling" })
|
||||||
map("n", "<leader>uw", function() Util.toggle("wrap") end, { desc = "Toggle Word Wrap" })
|
map("n", "<leader>uw", function() Util.toggle("wrap") end, { desc = "Toggle Word Wrap" })
|
||||||
map("n", "<leader>ul", function() Util.toggle_number() end, { desc = "Toggle Line Numbers" })
|
map("n", "<leader>uL", function() Util.toggle("relativenumber") end, { desc = "Toggle Relative Line Numbers" })
|
||||||
map("n", "<leader>ud", Util.toggle_diagnostics, { desc = "Toggle Diagnostics" })
|
map("n", "<leader>ul", function() Util.toggle.number() end, { desc = "Toggle Line Numbers" })
|
||||||
|
map("n", "<leader>ud", function() Util.toggle.diagnostics() end, { desc = "Toggle Diagnostics" })
|
||||||
local conceallevel = vim.o.conceallevel > 0 and vim.o.conceallevel or 3
|
local conceallevel = vim.o.conceallevel > 0 and vim.o.conceallevel or 3
|
||||||
map("n", "<leader>uc", function() Util.toggle("conceallevel", false, {0, conceallevel}) end, { desc = "Toggle Conceal" })
|
map("n", "<leader>uc", function() Util.toggle("conceallevel", false, {0, conceallevel}) end, { desc = "Toggle Conceal" })
|
||||||
if vim.lsp.inlay_hint then
|
if vim.lsp.inlay_hint then
|
||||||
@ -118,24 +115,22 @@ if vim.lsp.inlay_hint then
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- lazygit
|
-- lazygit
|
||||||
map("n", "<leader>gg", function() Util.float_term({ "lazygit" }, { cwd = Util.get_root(), esc_esc = false, ctrl_hjkl = false }) end, { desc = "Lazygit (root dir)" })
|
map("n", "<leader>gg", function() Util.terminal({ "lazygit" }, { cwd = Util.root(), esc_esc = false, ctrl_hjkl = false }) end, { desc = "Lazygit (root dir)" })
|
||||||
map("n", "<leader>gG", function() Util.float_term({ "lazygit" }, {esc_esc = false, ctrl_hjkl = false}) end, { desc = "Lazygit (cwd)" })
|
map("n", "<leader>gG", function() Util.terminal({ "lazygit" }, {esc_esc = false, ctrl_hjkl = false}) end, { desc = "Lazygit (cwd)" })
|
||||||
|
|
||||||
-- quit
|
-- quit
|
||||||
map("n", "<leader>qq", "<cmd>qa<cr>", { desc = "Quit all" })
|
map("n", "<leader>qq", "<cmd>qa<cr>", { desc = "Quit all" })
|
||||||
|
|
||||||
-- highlights under cursor
|
-- highlights under cursor
|
||||||
if vim.fn.has("nvim-0.9.0") == 1 then
|
map("n", "<leader>ui", vim.show_pos, { desc = "Inspect Pos" })
|
||||||
map("n", "<leader>ui", vim.show_pos, { desc = "Inspect Pos" })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- LazyVim Changelog
|
-- LazyVim Changelog
|
||||||
map("n", "<leader>L", Util.changelog, {desc = "LazyVim Changelog"})
|
map("n", "<leader>L", Util.changelog, {desc = "LazyVim Changelog"})
|
||||||
|
|
||||||
-- floating terminal
|
-- floating terminal
|
||||||
local lazyterm = function() Util.float_term(nil, { cwd = Util.get_root() }) end
|
local lazyterm = function() Util.terminal(nil, { cwd = Util.root() }) end
|
||||||
map("n", "<leader>ft", lazyterm, { desc = "Terminal (root dir)" })
|
map("n", "<leader>ft", lazyterm, { desc = "Terminal (root dir)" })
|
||||||
map("n", "<leader>fT", function() Util.float_term() end, { desc = "Terminal (cwd)" })
|
map("n", "<leader>fT", function() Util.terminal() end, { desc = "Terminal (cwd)" })
|
||||||
map("n", "<c-/>", lazyterm, { desc = "Terminal (root dir)" })
|
map("n", "<c-/>", lazyterm, { desc = "Terminal (root dir)" })
|
||||||
map("n", "<c-_>", lazyterm, { desc = "which_key_ignore" })
|
map("n", "<c-_>", lazyterm, { desc = "which_key_ignore" })
|
||||||
|
|
||||||
|
@ -2,6 +2,16 @@
|
|||||||
vim.g.mapleader = " "
|
vim.g.mapleader = " "
|
||||||
vim.g.maplocalleader = "\\"
|
vim.g.maplocalleader = "\\"
|
||||||
|
|
||||||
|
-- Enable LazyVim auto format
|
||||||
|
vim.g.autoformat = true
|
||||||
|
|
||||||
|
-- LazyVim root dir detection
|
||||||
|
-- Each entry can be:
|
||||||
|
-- * the name of a detector function like `lsp` or `cwd`
|
||||||
|
-- * a pattern or array of patterns like `.git` or `lua`.
|
||||||
|
-- * a function with signature `function(buf) -> string|string[]`
|
||||||
|
vim.g.root_spec = { "lsp", { ".git", "lua" }, "cwd" }
|
||||||
|
|
||||||
local opt = vim.opt
|
local opt = vim.opt
|
||||||
|
|
||||||
opt.autowrite = true -- Enable auto write
|
opt.autowrite = true -- Enable auto write
|
||||||
@ -16,7 +26,7 @@ opt.grepformat = "%f:%l:%c:%m"
|
|||||||
opt.grepprg = "rg --vimgrep"
|
opt.grepprg = "rg --vimgrep"
|
||||||
opt.ignorecase = true -- Ignore case
|
opt.ignorecase = true -- Ignore case
|
||||||
opt.inccommand = "nosplit" -- preview incremental substitute
|
opt.inccommand = "nosplit" -- preview incremental substitute
|
||||||
opt.laststatus = 0
|
opt.laststatus = 3 -- global statusline
|
||||||
opt.list = true -- Show some invisible characters (tabs...
|
opt.list = true -- Show some invisible characters (tabs...
|
||||||
opt.mouse = "a" -- Enable mouse mode
|
opt.mouse = "a" -- Enable mouse mode
|
||||||
opt.number = true -- Print line number
|
opt.number = true -- Print line number
|
||||||
@ -24,10 +34,10 @@ opt.pumblend = 10 -- Popup blend
|
|||||||
opt.pumheight = 10 -- Maximum number of entries in a popup
|
opt.pumheight = 10 -- Maximum number of entries in a popup
|
||||||
opt.relativenumber = true -- Relative line numbers
|
opt.relativenumber = true -- Relative line numbers
|
||||||
opt.scrolloff = 4 -- Lines of context
|
opt.scrolloff = 4 -- Lines of context
|
||||||
opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" }
|
opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize", "help", "globals", "skiprtp" }
|
||||||
opt.shiftround = true -- Round indent
|
opt.shiftround = true -- Round indent
|
||||||
opt.shiftwidth = 2 -- Size of an indent
|
opt.shiftwidth = 2 -- Size of an indent
|
||||||
opt.shortmess:append({ W = true, I = true, c = true })
|
opt.shortmess:append({ W = true, I = true, c = true, C = true })
|
||||||
opt.showmode = false -- Dont show mode since we have a statusline
|
opt.showmode = false -- Dont show mode since we have a statusline
|
||||||
opt.sidescrolloff = 8 -- Columns of context
|
opt.sidescrolloff = 8 -- Columns of context
|
||||||
opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
|
opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
|
||||||
@ -35,6 +45,7 @@ opt.smartcase = true -- Don't ignore case with capitals
|
|||||||
opt.smartindent = true -- Insert indents automatically
|
opt.smartindent = true -- Insert indents automatically
|
||||||
opt.spelllang = { "en" }
|
opt.spelllang = { "en" }
|
||||||
opt.splitbelow = true -- Put new windows below current
|
opt.splitbelow = true -- Put new windows below current
|
||||||
|
opt.splitkeep = "screen"
|
||||||
opt.splitright = true -- Put new windows right of current
|
opt.splitright = true -- Put new windows right of current
|
||||||
opt.tabstop = 2 -- Number of spaces tabs count for
|
opt.tabstop = 2 -- Number of spaces tabs count for
|
||||||
opt.termguicolors = true -- True color support
|
opt.termguicolors = true -- True color support
|
||||||
@ -42,13 +53,38 @@ opt.timeoutlen = 300
|
|||||||
opt.undofile = true
|
opt.undofile = true
|
||||||
opt.undolevels = 10000
|
opt.undolevels = 10000
|
||||||
opt.updatetime = 200 -- Save swap file and trigger CursorHold
|
opt.updatetime = 200 -- Save swap file and trigger CursorHold
|
||||||
|
opt.virtualedit = "block" -- Allow cursor to move where there is no text in visual block mode
|
||||||
opt.wildmode = "longest:full,full" -- Command-line completion mode
|
opt.wildmode = "longest:full,full" -- Command-line completion mode
|
||||||
opt.winminwidth = 5 -- Minimum window width
|
opt.winminwidth = 5 -- Minimum window width
|
||||||
opt.wrap = false -- Disable line wrap
|
opt.wrap = false -- Disable line wrap
|
||||||
|
opt.fillchars = {
|
||||||
|
foldopen = "",
|
||||||
|
foldclose = "",
|
||||||
|
-- fold = "⸱",
|
||||||
|
fold = " ",
|
||||||
|
foldsep = " ",
|
||||||
|
diff = "╱",
|
||||||
|
eob = " ",
|
||||||
|
}
|
||||||
|
|
||||||
|
if vim.fn.has("nvim-0.10") == 1 then
|
||||||
|
opt.smoothscroll = true
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Folding
|
||||||
|
vim.opt.foldlevel = 99
|
||||||
|
vim.opt.foldtext = "v:lua.require'lazyvim.util'.ui.foldtext()"
|
||||||
|
|
||||||
if vim.fn.has("nvim-0.9.0") == 1 then
|
if vim.fn.has("nvim-0.9.0") == 1 then
|
||||||
opt.splitkeep = "screen"
|
vim.opt.statuscolumn = [[%!v:lua.require'lazyvim.util'.ui.statuscolumn()]]
|
||||||
opt.shortmess:append({ C = true })
|
end
|
||||||
|
|
||||||
|
-- HACK: causes freezes on <= 0.9, so only enable on >= 0.10 for now
|
||||||
|
if vim.fn.has("nvim-0.10") == 1 then
|
||||||
|
vim.opt.foldmethod = "expr"
|
||||||
|
vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||||
|
else
|
||||||
|
vim.opt.foldmethod = "indent"
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Fix markdown indentation settings
|
-- Fix markdown indentation settings
|
||||||
|
@ -8,10 +8,10 @@ local error = vim.health.error or vim.health.report_error
|
|||||||
function M.check()
|
function M.check()
|
||||||
start("LazyVim")
|
start("LazyVim")
|
||||||
|
|
||||||
if vim.fn.has("nvim-0.8.0") == 1 then
|
if vim.fn.has("nvim-0.9.0") == 1 then
|
||||||
ok("Using Neovim >= 0.8.0")
|
ok("Using Neovim >= 0.9.0")
|
||||||
else
|
else
|
||||||
error("Neovim >= 0.8.0 is required")
|
error("Neovim >= 0.9.0 is required")
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, cmd in ipairs({ "git", "rg", { "fd", "fdfind" }, "lazygit" }) do
|
for _, cmd in ipairs({ "git", "rg", { "fd", "fdfind" }, "lazygit" }) do
|
||||||
|
@ -66,12 +66,17 @@ return {
|
|||||||
behavior = cmp.ConfirmBehavior.Replace,
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
select = true,
|
select = true,
|
||||||
}), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
}), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||||
|
["<C-CR>"] = function(fallback)
|
||||||
|
cmp.abort()
|
||||||
|
fallback()
|
||||||
|
end,
|
||||||
}),
|
}),
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = "nvim_lsp" },
|
{ name = "nvim_lsp" },
|
||||||
{ name = "luasnip" },
|
{ name = "luasnip" },
|
||||||
{ name = "buffer" },
|
|
||||||
{ name = "path" },
|
{ name = "path" },
|
||||||
|
}, {
|
||||||
|
{ name = "buffer" },
|
||||||
}),
|
}),
|
||||||
formatting = {
|
formatting = {
|
||||||
format = function(_, item)
|
format = function(_, item)
|
||||||
@ -90,6 +95,13 @@ return {
|
|||||||
sorting = defaults.sorting,
|
sorting = defaults.sorting,
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
|
---@param opts cmp.ConfigSchema
|
||||||
|
config = function(_, opts)
|
||||||
|
for _, source in ipairs(opts.sources) do
|
||||||
|
source.group_index = source.group_index or 1
|
||||||
|
end
|
||||||
|
require("cmp").setup(opts)
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- auto pairs
|
-- auto pairs
|
||||||
@ -97,6 +109,21 @@ return {
|
|||||||
"echasnovski/mini.pairs",
|
"echasnovski/mini.pairs",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
opts = {},
|
opts = {},
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>up",
|
||||||
|
function()
|
||||||
|
local Util = require("lazy.core.util")
|
||||||
|
vim.g.minipairs_disable = not vim.g.minipairs_disable
|
||||||
|
if vim.g.minipairs_disable then
|
||||||
|
Util.warn("Disabled auto pairs", { title = "Option" })
|
||||||
|
else
|
||||||
|
Util.info("Enabled auto pairs", { title = "Option" })
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
desc = "Toggle auto pairs",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Fast and feature-rich surround actions. For text that includes
|
-- Fast and feature-rich surround actions. For text that includes
|
||||||
@ -125,19 +152,25 @@ return {
|
|||||||
end,
|
end,
|
||||||
opts = {
|
opts = {
|
||||||
mappings = {
|
mappings = {
|
||||||
add = "gza", -- Add surrounding in Normal and Visual modes
|
add = "gsa", -- Add surrounding in Normal and Visual modes
|
||||||
delete = "gzd", -- Delete surrounding
|
delete = "gsd", -- Delete surrounding
|
||||||
find = "gzf", -- Find surrounding (to the right)
|
find = "gsf", -- Find surrounding (to the right)
|
||||||
find_left = "gzF", -- Find surrounding (to the left)
|
find_left = "gsF", -- Find surrounding (to the left)
|
||||||
highlight = "gzh", -- Highlight surrounding
|
highlight = "gsh", -- Highlight surrounding
|
||||||
replace = "gzr", -- Replace surrounding
|
replace = "gsr", -- Replace surrounding
|
||||||
update_n_lines = "gzn", -- Update `n_lines`
|
update_n_lines = "gsn", -- Update `n_lines`
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- comments
|
-- comments
|
||||||
{ "JoosepAlviste/nvim-ts-context-commentstring", lazy = true },
|
{
|
||||||
|
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||||
|
lazy = true,
|
||||||
|
opts = {
|
||||||
|
enable_autocmd = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"echasnovski/mini.comment",
|
"echasnovski/mini.comment",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
@ -158,7 +191,6 @@ return {
|
|||||||
-- { "i", mode = { "x", "o" } },
|
-- { "i", mode = { "x", "o" } },
|
||||||
-- },
|
-- },
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
dependencies = { "nvim-treesitter-textobjects" },
|
|
||||||
opts = function()
|
opts = function()
|
||||||
local ai = require("mini.ai")
|
local ai = require("mini.ai")
|
||||||
return {
|
return {
|
||||||
@ -170,6 +202,7 @@ return {
|
|||||||
}, {}),
|
}, {}),
|
||||||
f = ai.gen_spec.treesitter({ a = "@function.outer", i = "@function.inner" }, {}),
|
f = ai.gen_spec.treesitter({ a = "@function.outer", i = "@function.inner" }, {}),
|
||||||
c = ai.gen_spec.treesitter({ a = "@class.outer", i = "@class.inner" }, {}),
|
c = ai.gen_spec.treesitter({ a = "@class.outer", i = "@class.inner" }, {}),
|
||||||
|
t = { "<([%p%w]-)%f[^<%w][^<>]->.-</%1>", "^<.->().*()</[^/]->$" },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
require("lazyvim.config").init()
|
|
||||||
|
|
||||||
return {
|
|
||||||
{ "folke/lazy.nvim", version = "*" },
|
|
||||||
{ "LazyVim/LazyVim", priority = 10000, lazy = false, config = true, cond = true, version = "*" },
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
69
lua/lazyvim/plugins/extras/coding/codeium.lua
Normal file
69
lua/lazyvim/plugins/extras/coding/codeium.lua
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
return {
|
||||||
|
|
||||||
|
-- codeium cmp source
|
||||||
|
{
|
||||||
|
"nvim-cmp",
|
||||||
|
dependencies = {
|
||||||
|
-- codeium
|
||||||
|
{
|
||||||
|
"Exafunction/codeium.nvim",
|
||||||
|
cmd = "Codeium",
|
||||||
|
build = ":Codeium Auth",
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
---@param opts cmp.ConfigSchema
|
||||||
|
opts = function(_, opts)
|
||||||
|
table.insert(opts.sources, 1, {
|
||||||
|
name = "codeium",
|
||||||
|
group_index = 1,
|
||||||
|
priority = 100,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
optional = true,
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = function(_, opts)
|
||||||
|
local started = false
|
||||||
|
local function status()
|
||||||
|
if not package.loaded["cmp"] then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
for _, s in ipairs(require("cmp").core.sources) do
|
||||||
|
if s.name == "codeium" then
|
||||||
|
if s.source:is_available() then
|
||||||
|
started = true
|
||||||
|
else
|
||||||
|
return started and "error" or nil
|
||||||
|
end
|
||||||
|
if s.status == s.SourceStatus.FETCHING then
|
||||||
|
return "pending"
|
||||||
|
end
|
||||||
|
return "ok"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local Util = require("lazyvim.util")
|
||||||
|
local colors = {
|
||||||
|
ok = Util.ui.fg("Special"),
|
||||||
|
error = Util.ui.fg("DiagnosticError"),
|
||||||
|
pending = Util.ui.fg("DiagnosticWarn"),
|
||||||
|
}
|
||||||
|
table.insert(opts.sections.lualine_x, 2, {
|
||||||
|
function()
|
||||||
|
return require("lazyvim.config").icons.kinds.Codeium
|
||||||
|
end,
|
||||||
|
cond = function()
|
||||||
|
return status() ~= nil
|
||||||
|
end,
|
||||||
|
color = function()
|
||||||
|
return colors[status()] or colors.ok
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
@ -21,10 +21,10 @@ return {
|
|||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
local Util = require("lazyvim.util")
|
local Util = require("lazyvim.util")
|
||||||
local colors = {
|
local colors = {
|
||||||
[""] = Util.fg("Special"),
|
[""] = Util.ui.fg("Special"),
|
||||||
["Normal"] = Util.fg("Special"),
|
["Normal"] = Util.ui.fg("Special"),
|
||||||
["Warning"] = Util.fg("DiagnosticError"),
|
["Warning"] = Util.ui.fg("DiagnosticError"),
|
||||||
["InProgress"] = Util.fg("DiagnosticWarn"),
|
["InProgress"] = Util.ui.fg("DiagnosticWarn"),
|
||||||
}
|
}
|
||||||
table.insert(opts.sections.lualine_x, 2, {
|
table.insert(opts.sections.lualine_x, 2, {
|
||||||
function()
|
function()
|
||||||
@ -33,7 +33,13 @@ return {
|
|||||||
return icon .. (status.message or "")
|
return icon .. (status.message or "")
|
||||||
end,
|
end,
|
||||||
cond = function()
|
cond = function()
|
||||||
local ok, clients = pcall(vim.lsp.get_active_clients, { name = "copilot", bufnr = 0 })
|
if not package.loaded["copilot"] then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local ok, clients = pcall(require("lazyvim.util").lsp.get_clients, { name = "copilot", bufnr = 0 })
|
||||||
|
if not ok then
|
||||||
|
return false
|
||||||
|
end
|
||||||
return ok and #clients > 0
|
return ok and #clients > 0
|
||||||
end,
|
end,
|
||||||
color = function()
|
color = function()
|
||||||
@ -60,7 +66,7 @@ return {
|
|||||||
copilot_cmp.setup(opts)
|
copilot_cmp.setup(opts)
|
||||||
-- attach cmp source whenever copilot attaches
|
-- attach cmp source whenever copilot attaches
|
||||||
-- fixes lazy-loading issues with the copilot cmp source
|
-- fixes lazy-loading issues with the copilot cmp source
|
||||||
require("lazyvim.util").on_attach(function(client)
|
require("lazyvim.util").lsp.on_attach(function(client)
|
||||||
if client.name == "copilot" then
|
if client.name == "copilot" then
|
||||||
copilot_cmp._on_insert_enter({})
|
copilot_cmp._on_insert_enter({})
|
||||||
end
|
end
|
||||||
@ -70,9 +76,11 @@ return {
|
|||||||
},
|
},
|
||||||
---@param opts cmp.ConfigSchema
|
---@param opts cmp.ConfigSchema
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
table.insert(opts.sources, 1, { name = "copilot", group_index = 2 })
|
table.insert(opts.sources, 1, {
|
||||||
opts.sorting = opts.sorting or require("cmp.config.default")().sorting
|
name = "copilot",
|
||||||
table.insert(opts.sorting.comparators, 1, require("copilot_cmp.comparators").prioritize)
|
group_index = 1,
|
||||||
|
priority = 100,
|
||||||
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -3,21 +3,10 @@ return {
|
|||||||
{
|
{
|
||||||
"gbprod/yanky.nvim",
|
"gbprod/yanky.nvim",
|
||||||
dependencies = { { "kkharji/sqlite.lua", enabled = not jit.os:find("Windows") } },
|
dependencies = { { "kkharji/sqlite.lua", enabled = not jit.os:find("Windows") } },
|
||||||
opts = function()
|
opts = {
|
||||||
local mapping = require("yanky.telescope.mapping")
|
highlight = { timer = 250 },
|
||||||
local mappings = mapping.get_defaults()
|
ring = { storage = jit.os:find("Windows") and "shada" or "sqlite" },
|
||||||
mappings.i["<c-p>"] = nil
|
},
|
||||||
return {
|
|
||||||
highlight = { timer = 200 },
|
|
||||||
ring = { storage = jit.os:find("Windows") and "shada" or "sqlite" },
|
|
||||||
picker = {
|
|
||||||
telescope = {
|
|
||||||
use_default_mappings = false,
|
|
||||||
mappings = mappings,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
keys = {
|
keys = {
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
{ "<leader>p", function() require("telescope").extensions.yank_history.yank_history({ }) end, desc = "Open Yank History" },
|
{ "<leader>p", function() require("telescope").extensions.yank_history.yank_history({ }) end, desc = "Open Yank History" },
|
||||||
|
@ -1,3 +1,15 @@
|
|||||||
|
---@param config {args?:string[]|fun():string[]?}
|
||||||
|
local function get_args(config)
|
||||||
|
local args = type(config.args) == "function" and (config.args() or {}) or config.args or {}
|
||||||
|
config = vim.deepcopy(config)
|
||||||
|
---@cast args string[]
|
||||||
|
config.args = function()
|
||||||
|
local new_args = vim.fn.input("Run with args: ", table.concat(args, " ")) --[[@as string]]
|
||||||
|
return vim.split(vim.fn.expand(new_args) --[[@as string]], " ")
|
||||||
|
end
|
||||||
|
return config
|
||||||
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"mfussenegger/nvim-dap",
|
"mfussenegger/nvim-dap",
|
||||||
|
|
||||||
@ -13,6 +25,8 @@ return {
|
|||||||
},
|
},
|
||||||
opts = {},
|
opts = {},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
|
-- setup dap config by VsCode launch.json file
|
||||||
|
-- require("dap.ext.vscode").load_launchjs()
|
||||||
local dap = require("dap")
|
local dap = require("dap")
|
||||||
local dapui = require("dapui")
|
local dapui = require("dapui")
|
||||||
dapui.setup(opts)
|
dapui.setup(opts)
|
||||||
@ -41,7 +55,6 @@ return {
|
|||||||
opts = {
|
opts = {
|
||||||
defaults = {
|
defaults = {
|
||||||
["<leader>d"] = { name = "+debug" },
|
["<leader>d"] = { name = "+debug" },
|
||||||
["<leader>da"] = { name = "+adapters" },
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -74,6 +87,7 @@ return {
|
|||||||
{ "<leader>dB", function() require("dap").set_breakpoint(vim.fn.input('Breakpoint condition: ')) end, desc = "Breakpoint Condition" },
|
{ "<leader>dB", function() require("dap").set_breakpoint(vim.fn.input('Breakpoint condition: ')) end, desc = "Breakpoint Condition" },
|
||||||
{ "<leader>db", function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint" },
|
{ "<leader>db", function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint" },
|
||||||
{ "<leader>dc", function() require("dap").continue() end, desc = "Continue" },
|
{ "<leader>dc", function() require("dap").continue() end, desc = "Continue" },
|
||||||
|
{ "<leader>da", function() require("dap").continue({ before = get_args }) end, desc = "Run with Args" },
|
||||||
{ "<leader>dC", function() require("dap").run_to_cursor() end, desc = "Run to Cursor" },
|
{ "<leader>dC", function() require("dap").run_to_cursor() end, desc = "Run to Cursor" },
|
||||||
{ "<leader>dg", function() require("dap").goto_() end, desc = "Go to line (no execute)" },
|
{ "<leader>dg", function() require("dap").goto_() end, desc = "Go to line (no execute)" },
|
||||||
{ "<leader>di", function() require("dap").step_into() end, desc = "Step Into" },
|
{ "<leader>di", function() require("dap").step_into() end, desc = "Step Into" },
|
||||||
|
@ -1,24 +1,40 @@
|
|||||||
return {
|
return {
|
||||||
"mfussenegger/nvim-dap",
|
"mfussenegger/nvim-dap",
|
||||||
|
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{
|
{
|
||||||
"jbyuki/one-small-step-for-vimkind",
|
"jbyuki/one-small-step-for-vimkind",
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
keys = {
|
|
||||||
{ "<leader>daL", function() require("osv").launch({ port = 8086 }) end, desc = "Adapter Lua Server" },
|
|
||||||
{ "<leader>dal", function() require("osv").run_this() end, desc = "Adapter Lua" },
|
|
||||||
},
|
|
||||||
config = function()
|
config = function()
|
||||||
local dap = require("dap")
|
local dap = require("dap")
|
||||||
dap.adapters.nlua = function(callback, config)
|
dap.adapters.nlua = function(callback, conf)
|
||||||
callback({ type = "server", host = config.host or "127.0.0.1", port = config.port or 8086 })
|
local adapter = {
|
||||||
|
type = "server",
|
||||||
|
host = conf.host or "127.0.0.1",
|
||||||
|
port = conf.port or 8086,
|
||||||
|
}
|
||||||
|
if conf.start_neovim then
|
||||||
|
local dap_run = dap.run
|
||||||
|
dap.run = function(c)
|
||||||
|
adapter.port = c.port
|
||||||
|
adapter.host = c.host
|
||||||
|
end
|
||||||
|
require("osv").run_this()
|
||||||
|
dap.run = dap_run
|
||||||
|
end
|
||||||
|
callback(adapter)
|
||||||
end
|
end
|
||||||
dap.configurations.lua = {
|
dap.configurations.lua = {
|
||||||
{
|
{
|
||||||
type = "nlua",
|
type = "nlua",
|
||||||
request = "attach",
|
request = "attach",
|
||||||
name = "Attach to running Neovim instance",
|
name = "Run this file",
|
||||||
|
start_neovim = {},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "nlua",
|
||||||
|
request = "attach",
|
||||||
|
name = "Attach to running Neovim instance (port = 8086)",
|
||||||
|
port = 8086,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
|
134
lua/lazyvim/plugins/extras/editor/aerial.lua
Normal file
134
lua/lazyvim/plugins/extras/editor/aerial.lua
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
local Config = require("lazyvim.config")
|
||||||
|
local Util = require("lazyvim.util")
|
||||||
|
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"stevearc/aerial.nvim",
|
||||||
|
event = "LazyFile",
|
||||||
|
opts = function()
|
||||||
|
---@diagnostic disable-next-line: no-unknown
|
||||||
|
local lualine = require("lualine.components.aerial")
|
||||||
|
|
||||||
|
-- Strip trailing spaces from symbols in statusline
|
||||||
|
---@param _ any
|
||||||
|
---@param symbols {icon?:string}[]
|
||||||
|
lualine.format_status = Util.inject.args(lualine.format_status, function(_, symbols)
|
||||||
|
for _, s in ipairs(symbols) do
|
||||||
|
s.icon = s.icon and s.icon:gsub("%s*$", "") or nil
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
local icons = vim.deepcopy(Config.icons.kinds)
|
||||||
|
|
||||||
|
-- HACK: fix lua's weird choice for `Package` for control
|
||||||
|
-- structures like if/else/for/etc.
|
||||||
|
icons.lua = { Package = icons.Control }
|
||||||
|
|
||||||
|
---@type table<string, string[]>|false
|
||||||
|
local filter_kind = false
|
||||||
|
if Config.kind_filter then
|
||||||
|
filter_kind = assert(vim.deepcopy(Config.kind_filter))
|
||||||
|
filter_kind._ = filter_kind.default
|
||||||
|
filter_kind.default = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
local opts = {
|
||||||
|
attach_mode = "global",
|
||||||
|
backends = { "lsp", "treesitter", "markdown", "man" },
|
||||||
|
show_guides = true,
|
||||||
|
layout = {
|
||||||
|
resize_to_content = false,
|
||||||
|
win_opts = {
|
||||||
|
winhl = "Normal:NormalFloat,FloatBorder:NormalFloat,SignColumn:SignColumnSB",
|
||||||
|
signcolumn = "yes",
|
||||||
|
statuscolumn = " ",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
icons = icons,
|
||||||
|
filter_kind = filter_kind,
|
||||||
|
-- stylua: ignore
|
||||||
|
guides = {
|
||||||
|
mid_item = "├╴",
|
||||||
|
last_item = "└╴",
|
||||||
|
nested_top = "│ ",
|
||||||
|
whitespace = " ",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
return opts
|
||||||
|
end,
|
||||||
|
keys = {
|
||||||
|
{ "<leader>cs", "<cmd>AerialToggle<cr>", desc = "Aerial (Symbols)" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Telescope integration
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = function()
|
||||||
|
Util.on_load("telescope.nvim", function()
|
||||||
|
require("telescope").load_extension("aerial")
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>ss",
|
||||||
|
"<cmd>Telescope aerial<cr>",
|
||||||
|
desc = "Goto Symbol (Aerial)",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- edgy integration
|
||||||
|
{
|
||||||
|
"folke/edgy.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = function(_, opts)
|
||||||
|
local edgy_idx = Util.plugin.extra_idx("ui.edgy")
|
||||||
|
local aerial_idx = Util.plugin.extra_idx("editor.aerial")
|
||||||
|
|
||||||
|
if edgy_idx and edgy_idx > aerial_idx then
|
||||||
|
Util.warn("The `edgy.nvim` extra must be **imported** before the `aerial.nvim` extra to work properly.", {
|
||||||
|
title = "LazyVim",
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
opts.right = opts.right or {}
|
||||||
|
table.insert(opts.right, {
|
||||||
|
title = "Aerial",
|
||||||
|
ft = "aerial",
|
||||||
|
pinned = true,
|
||||||
|
open = "AerialOpen",
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- lualine integration
|
||||||
|
{
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = function(_, opts)
|
||||||
|
table.insert(opts.sections.lualine_c, {
|
||||||
|
"aerial",
|
||||||
|
-- The separator to be used to separate symbols in status line.
|
||||||
|
sep = " ",
|
||||||
|
|
||||||
|
-- The number of symbols to render top-down. In order to render only 'N' last
|
||||||
|
-- symbols, negative numbers may be supplied. For instance, 'depth = -1' can
|
||||||
|
-- be used in order to render only current symbol.
|
||||||
|
depth = 5,
|
||||||
|
|
||||||
|
-- When 'dense' mode is on, icons are not rendered near their symbols. Only
|
||||||
|
-- a single icon that represents the kind of current symbol is rendered at
|
||||||
|
-- the beginning of status line.
|
||||||
|
dense = false,
|
||||||
|
|
||||||
|
-- The separator to be used to separate symbols in dense mode.
|
||||||
|
dense_sep = ".",
|
||||||
|
|
||||||
|
-- Color the symbol icons.
|
||||||
|
colored = true,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
@ -1,6 +0,0 @@
|
|||||||
require("lazy.core.util").warn(
|
|
||||||
"`flash.nvim` is now the default jump plugin for **LazyVim**.\nPlease remove the `lazyvim.plugins.extras.editor.flash` import from your **lazy** config.",
|
|
||||||
{ title = "LazyVim" }
|
|
||||||
)
|
|
||||||
|
|
||||||
return {}
|
|
@ -35,6 +35,22 @@ return {
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- rename surround mappings from gs to gz to prevent conflict with leap
|
||||||
|
{
|
||||||
|
"echasnovski/mini.surround",
|
||||||
|
opts = {
|
||||||
|
mappings = {
|
||||||
|
add = "gza", -- Add surrounding in Normal and Visual modes
|
||||||
|
delete = "gzd", -- Delete surrounding
|
||||||
|
find = "gzf", -- Find surrounding (to the right)
|
||||||
|
find_left = "gzF", -- Find surrounding (to the left)
|
||||||
|
highlight = "gzh", -- Highlight surrounding
|
||||||
|
replace = "gzr", -- Replace surrounding
|
||||||
|
update_n_lines = "gzn", -- Update `n_lines`
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
-- makes some plugins dot-repeatable like leap
|
-- makes some plugins dot-repeatable like leap
|
||||||
{ "tpope/vim-repeat", event = "VeryLazy" },
|
{ "tpope/vim-repeat", event = "VeryLazy" },
|
||||||
}
|
}
|
||||||
|
@ -53,5 +53,12 @@ return {
|
|||||||
vim.keymap.set("n", "g.", toggle_dotfiles, { buffer = buf_id })
|
vim.keymap.set("n", "g.", toggle_dotfiles, { buffer = buf_id })
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("User", {
|
||||||
|
pattern = "MiniFilesActionRename",
|
||||||
|
callback = function(event)
|
||||||
|
require("lazyvim.util").lsp.on_rename(event.data.from, event.data.to)
|
||||||
|
end,
|
||||||
|
})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
42
lua/lazyvim/plugins/extras/editor/navic.lua
Normal file
42
lua/lazyvim/plugins/extras/editor/navic.lua
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
return {
|
||||||
|
-- lsp symbol navigation for lualine. This shows where
|
||||||
|
-- in the code structure you are - within functions, classes,
|
||||||
|
-- etc - in the statusline.
|
||||||
|
{
|
||||||
|
"SmiteshP/nvim-navic",
|
||||||
|
lazy = true,
|
||||||
|
init = function()
|
||||||
|
vim.g.navic_silence = true
|
||||||
|
require("lazyvim.util").lsp.on_attach(function(client, buffer)
|
||||||
|
if client.supports_method("textDocument/documentSymbol") then
|
||||||
|
require("nvim-navic").attach(client, buffer)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
opts = function()
|
||||||
|
return {
|
||||||
|
separator = " ",
|
||||||
|
highlight = true,
|
||||||
|
depth_limit = 5,
|
||||||
|
icons = require("lazyvim.config").icons.kinds,
|
||||||
|
lazy_update_context = true,
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- lualine integration
|
||||||
|
{
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = function(_, opts)
|
||||||
|
table.insert(opts.sections.lualine_c, {
|
||||||
|
function()
|
||||||
|
return require("nvim-navic").get_location()
|
||||||
|
end,
|
||||||
|
cond = function()
|
||||||
|
return package.loaded["nvim-navic"] and require("nvim-navic").is_available()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
55
lua/lazyvim/plugins/extras/editor/symbols-outline.lua
Normal file
55
lua/lazyvim/plugins/extras/editor/symbols-outline.lua
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
local Util = require("lazyvim.util")
|
||||||
|
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"simrat39/symbols-outline.nvim",
|
||||||
|
keys = { { "<leader>cs", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },
|
||||||
|
cmd = "SymbolsOutline",
|
||||||
|
opts = function()
|
||||||
|
local Config = require("lazyvim.config")
|
||||||
|
local defaults = require("symbols-outline.config").defaults
|
||||||
|
local opts = {
|
||||||
|
symbols = {},
|
||||||
|
symbol_blacklist = {},
|
||||||
|
}
|
||||||
|
|
||||||
|
for kind, symbol in pairs(defaults.symbols) do
|
||||||
|
opts.symbols[kind] = {
|
||||||
|
icon = Config.icons.kinds[kind] or symbol.icon,
|
||||||
|
hl = symbol.hl,
|
||||||
|
}
|
||||||
|
if not vim.tbl_contains(Config.kind_filter.default, kind) then
|
||||||
|
table.insert(opts.symbol_blacklist, kind)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return opts
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- edgy integration
|
||||||
|
{
|
||||||
|
"folke/edgy.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = function(_, opts)
|
||||||
|
local edgy_idx = Util.plugin.extra_idx("ui.edgy")
|
||||||
|
local symbols_idx = Util.plugin.extra_idx("editor.symbols-outline")
|
||||||
|
|
||||||
|
if edgy_idx and edgy_idx > symbols_idx then
|
||||||
|
Util.warn(
|
||||||
|
"The `edgy.nvim` extra must be **imported** before the `symbols-outline.nvim` extra to work properly.",
|
||||||
|
{
|
||||||
|
title = "LazyVim",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
opts.right = opts.right or {}
|
||||||
|
table.insert(opts.right, {
|
||||||
|
title = "Symbols Outline",
|
||||||
|
ft = "Outline",
|
||||||
|
pinned = true,
|
||||||
|
open = "SymbolsOutline",
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
26
lua/lazyvim/plugins/extras/formatting/black.lua
Normal file
26
lua/lazyvim/plugins/extras/formatting/black.lua
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
opts = function(_, opts)
|
||||||
|
table.insert(opts.ensure_installed, "black")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nvimtools/none-ls.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = function(_, opts)
|
||||||
|
local nls = require("null-ls")
|
||||||
|
opts.sources = opts.sources or {}
|
||||||
|
table.insert(opts.sources, nls.builtins.formatting.black)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"stevearc/conform.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = {
|
||||||
|
formatters_by_ft = {
|
||||||
|
["python"] = { "black" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
@ -6,10 +6,36 @@ return {
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"jose-elias-alvarez/null-ls.nvim",
|
"nvimtools/none-ls.nvim",
|
||||||
|
optional = true,
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
local nls = require("null-ls")
|
local nls = require("null-ls")
|
||||||
|
opts.sources = opts.sources or {}
|
||||||
table.insert(opts.sources, nls.builtins.formatting.prettierd)
|
table.insert(opts.sources, nls.builtins.formatting.prettierd)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"stevearc/conform.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = {
|
||||||
|
formatters_by_ft = {
|
||||||
|
["javascript"] = { { "prettierd", "prettier" } },
|
||||||
|
["javascriptreact"] = { { "prettierd", "prettier" } },
|
||||||
|
["typescript"] = { { "prettierd", "prettier" } },
|
||||||
|
["typescriptreact"] = { { "prettierd", "prettier" } },
|
||||||
|
["vue"] = { { "prettierd", "prettier" } },
|
||||||
|
["css"] = { { "prettierd", "prettier" } },
|
||||||
|
["scss"] = { { "prettierd", "prettier" } },
|
||||||
|
["less"] = { { "prettierd", "prettier" } },
|
||||||
|
["html"] = { { "prettierd", "prettier" } },
|
||||||
|
["json"] = { { "prettierd", "prettier" } },
|
||||||
|
["jsonc"] = { { "prettierd", "prettier" } },
|
||||||
|
["yaml"] = { { "prettierd", "prettier" } },
|
||||||
|
["markdown"] = { { "prettierd", "prettier" } },
|
||||||
|
["markdown.mdx"] = { { "prettierd", "prettier" } },
|
||||||
|
["graphql"] = { { "prettierd", "prettier" } },
|
||||||
|
["handlebars"] = { { "prettierd", "prettier" } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
@ -8,15 +8,24 @@ return {
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"jose-elias-alvarez/null-ls.nvim",
|
"nvimtools/none-ls.nvim",
|
||||||
|
optional = true,
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
local nls = require("null-ls")
|
local nls = require("null-ls")
|
||||||
opts.sources = opts.sources or {}
|
opts.sources = vim.list_extend(opts.sources or {}, {
|
||||||
vim.list_extend(opts.sources, {
|
|
||||||
nls.builtins.diagnostics.cmake_lint,
|
nls.builtins.diagnostics.cmake_lint,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"mfussenegger/nvim-lint",
|
||||||
|
optional = true,
|
||||||
|
opts = {
|
||||||
|
linters_by_ft = {
|
||||||
|
cmake = { "cmakelint" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"mason.nvim",
|
"mason.nvim",
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
@ -35,6 +44,6 @@ return {
|
|||||||
{
|
{
|
||||||
"Civitasv/cmake-tools.nvim",
|
"Civitasv/cmake-tools.nvim",
|
||||||
opts = {},
|
opts = {},
|
||||||
event = "BufRead",
|
event = "LazyFile",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -8,20 +8,29 @@ return {
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"jose-elias-alvarez/null-ls.nvim",
|
"mason.nvim",
|
||||||
|
opts = function(_, opts)
|
||||||
|
opts.ensure_installed = opts.ensure_installed or {}
|
||||||
|
vim.list_extend(opts.ensure_installed, { "hadolint" })
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nvimtools/none-ls.nvim",
|
||||||
|
optional = true,
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
local nls = require("null-ls")
|
local nls = require("null-ls")
|
||||||
opts.sources = opts.sources or {}
|
opts.sources = vim.list_extend(opts.sources or {}, {
|
||||||
vim.list_extend(opts.sources, {
|
|
||||||
nls.builtins.diagnostics.hadolint,
|
nls.builtins.diagnostics.hadolint,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
dependencies = {
|
},
|
||||||
"mason.nvim",
|
{
|
||||||
opts = function(_, opts)
|
"mfussenegger/nvim-lint",
|
||||||
opts.ensure_installed = opts.ensure_installed or {}
|
optional = true,
|
||||||
vim.list_extend(opts.ensure_installed, { "hadolint" })
|
opts = {
|
||||||
end,
|
linters_by_ft = {
|
||||||
|
dockerfile = { "hadolint" },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -29,4 +29,29 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"nvimtools/none-ls.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = function(_, opts)
|
||||||
|
if vim.fn.executable("credo") == 0 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local nls = require("null-ls")
|
||||||
|
opts.sources = vim.list_extend(opts.sources or {}, {
|
||||||
|
nls.builtins.diagnostics.credo,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"mfussenegger/nvim-lint",
|
||||||
|
optional = true,
|
||||||
|
opts = function(_, opts)
|
||||||
|
if vim.fn.executable("credo") == 0 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
opts.linters_by_ft = {
|
||||||
|
elixir = { "credo" },
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user