代码跳转

This commit is contained in:
LingZhaoHui 2024-06-23 01:01:33 +08:00
parent dfa5521368
commit 4287d622b1
Signed by: zeekling
GPG Key ID: D96E4E75267CA2CC
3 changed files with 31 additions and 14 deletions

View File

@ -16,10 +16,10 @@ git clone ssh://git@git.zeekling.cn:222/linux/nvim-config.git ~/.config/nvim
| \<space>bp | 跳转到下一个buffer | Buffer | | \<space>bp | 跳转到下一个buffer | Buffer |
| \<space>dt | 在左边显示或者关闭目录数 | Dir | | \<space>dt | 在左边显示或者关闭目录数 | Dir |
| \<space>mkp | 预览Markdown | Markdown | | \<space>mkp | 预览Markdown | Markdown |
| \<space>ff | 格式化代码 | Format | | \<space>cf | 格式化代码 | Format |
| \<space>fsf | 在当前目录下面查找文件。支持模糊匹配 | Search | | \<space>ff | 在当前目录下面查找文件。支持模糊匹配 | Find |
| \<space>fsg | 在当前目录下的文件查找字符串 | S earch | | \<space>fg | 在当前目录下的文件查找字符串 | Find |
| \<space>fsb | 在打开的buffer中查找字符串 | Search | | \<space>fb | 在打开的buffer中查找字符串 | Find |
| \<space>ls | 显示Lazy概览页面 | Lazy | | \<space>ls | 显示Lazy概览页面 | Lazy |
## 帮助 ## 帮助

View File

@ -8,7 +8,7 @@ return {
"L3MON4D3/LuaSnip", "L3MON4D3/LuaSnip",
"saadparwaiz1/cmp_luasnip", "saadparwaiz1/cmp_luasnip",
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
"hrsh7th/cmp-cmdline" "hrsh7th/cmp-cmdline",
}, },
config = function() config = function()
local cmp = require("cmp") local cmp = require("cmp")
@ -66,4 +66,14 @@ return {
}) })
end, end,
}, },
{
"nvimdev/lspsaga.nvim",
config = function()
require("lspsaga").setup({})
end,
dependencies = {
"nvim-treesitter/nvim-treesitter", -- optional
"nvim-tree/nvim-web-devicons", -- optional
},
},
} }

View File

@ -15,23 +15,30 @@ return {
n = { "<cmd>BufferLineCycleNext<cr>", "Go to next buffer" }, n = { "<cmd>BufferLineCycleNext<cr>", "Go to next buffer" },
d = { "<cmd>bd<cr>", "delete current buffer" }, d = { "<cmd>bd<cr>", "delete current buffer" },
}, },
c = {
name = "Code",
f = { "<cmd>Format<cr>", "Format Code" },
g = {
name = "Go to",
d = { "<cmd>Lspsaga goto_definition<cr>", "Go to definition" },
f = { "<cmd>Lspsaga finder<cr>", "Find usage or implements" },
i = { "<cmd>Lspsaga finder imp<cr>", "Find implements" },
r = { "<cmd>Lspsaga rename<cr>", "rename" },
},
},
d = { d = {
name = "dirTree", name = "dirTree",
t = { "<cmd>NvimTreeToggle<cr>", "show or hidden dir tree on left" }, t = { "<cmd>NvimTreeToggle<cr>", "show or hidden dir tree on left" },
}, },
f = { f = {
name = "Search,Format Code", name = "Find",
s = { f = { "<cmd>Telescope find_files<cr>", "Find files" },
name = "Search",
f = { "<cmd>Telescope find_files<cr>", "Search files" },
g = { "<cmd>Telescope live_grep<cr>", "Find string in files" }, g = { "<cmd>Telescope live_grep<cr>", "Find string in files" },
b = { "<cmd>Telescope buffers<cr>", "Find string in buffer" }, b = { "<cmd>Telescope buffers<cr>", "Find string in buffer" },
}, },
f = { "<cmd>Format<cr>", "Format Code" },
},
g = { g = {
name = "Git", name = "Git",
b = {"<cmd>Gitsigns blame<cr>", "git blame"} b = { "<cmd>Gitsigns blame<cr>", "git blame" },
}, },
l = { l = {
name = "Lazy", name = "Lazy",