big update change from packer to lazy and other
This commit is contained in:
@ -17,11 +17,10 @@ end
|
||||
|
||||
function set_colorscheme()
|
||||
local colorschemes = vim.fn.getcompletion("", "color")
|
||||
local desired_colorscheme = "material"
|
||||
local desired_colorscheme = "material-lighter"
|
||||
|
||||
if vim.tbl_contains(colorschemes, desired_colorscheme) then
|
||||
vim.cmd("colorscheme " .. desired_colorscheme)
|
||||
vim.g.material_style = "lighter"
|
||||
else
|
||||
vim.cmd("colorscheme default")
|
||||
end
|
||||
|
@ -66,7 +66,6 @@ M.load_default_options = function()
|
||||
-- set leaderkey to space
|
||||
mapleader = " ",
|
||||
maplocalleader = "\\",
|
||||
copilot_node_command = "~/.nodenv/versions/16.17.0/bin/node",
|
||||
codeium_filetypes = {
|
||||
tex = false,
|
||||
},
|
||||
|
@ -8,10 +8,18 @@ local wk = require("which-key")
|
||||
|
||||
-- basic operation for write and quit
|
||||
-- 文件写入退出基本操作
|
||||
wk.register({
|
||||
["<Leader>s"] = { ":w!<CR>", "Save File" },
|
||||
["<Leader>q"] = { ":qa<CR>", "Quit All" },
|
||||
["<Leader>S"] = { ":wa<CR>", "Save All" },
|
||||
wk.add({
|
||||
{ "<Leader>s", ":w!<CR>", desc = "Save File" },
|
||||
{ "<Leader>q", ":qa<CR>", desc = "Quit All" },
|
||||
{ "<Leader>S", ":wa<CR>", desc = "Save All" },
|
||||
})
|
||||
|
||||
-- iron related
|
||||
wk.add({
|
||||
{ "<leader>i", group = "Iron" },
|
||||
{ "<leader>il", "<Cmd>lua require('iron.core').send_line()<CR>", desc = "Send line" },
|
||||
{ "<leader>if", "<Cmd>lua require('iron.core').send_file()<CR>", desc = "Send file" },
|
||||
{ "<leader>ic", "<Cmd>lua require('iron.core').send_until_cursor()<CR>", desc = "Send to cursor" },
|
||||
})
|
||||
|
||||
-- lsp 回调快捷键设置
|
||||
@ -34,33 +42,29 @@ end
|
||||
map("n", ",", ":Jaq<CR>", opt)
|
||||
|
||||
-- markdown related
|
||||
-- markdown 相关
|
||||
wk.register({
|
||||
["<Leader>m"] = { ":MarkdownPreview<CR>", "Markdown preview" },
|
||||
wk.add({
|
||||
{ "<Leader>m", ":MarkdownPreview<CR>", desc = "Markdown preview" },
|
||||
})
|
||||
|
||||
-- git related
|
||||
-- git 相关
|
||||
wk.register({
|
||||
["<Leader>g"] = { ":LazyGit<CR>", "Open lazygit" },
|
||||
})
|
||||
-- file related
|
||||
-- 文件相关操作
|
||||
wk.register({
|
||||
["<Leader><Tab>"] = { "<C-^>", "Last file" },
|
||||
wk.add({
|
||||
{ "<Leader>g", ":LazyGit<CR>", desc = "Open lazygit" },
|
||||
})
|
||||
|
||||
wk.register({
|
||||
["<Leader>f"] = {
|
||||
name = "+File",
|
||||
p = { ":Telescope projects<CR>", "Open project" },
|
||||
r = { ":Telescope oldfiles<CR>", "Recent files" },
|
||||
b = { ":Telescope file_browser<CR>", "File browser" },
|
||||
n = { ":AdvancedNewFile<CR>", "New file" },
|
||||
s = { ":Telescope live_grep<CR>", "Search in project" },
|
||||
f = { ":Telescope find_files<CR>", "Search file" },
|
||||
c = { ":source $MYVIMRC<CR>", "Reload config file" },
|
||||
},
|
||||
-- file related
|
||||
wk.add({
|
||||
{ "<Leader><Tab>", "<C-^>", desc = "Last file" },
|
||||
})
|
||||
|
||||
wk.add({
|
||||
{ "<Leader>f", group = "File" },
|
||||
{ "<Leader>fp", ":Telescope projects<CR>", desc = "Open project" },
|
||||
{ "<Leader>fr", ":Telescope oldfiles<CR>", desc = "Recent files" },
|
||||
{ "<Leader>fb", ":Telescope file_browser<CR>", desc = "File browser" },
|
||||
{ "<Leader>fn", ":AdvancedNewFile<CR>", desc = "New file" },
|
||||
{ "<Leader>fs", ":Telescope live_grep<CR>", desc = "Search in project" },
|
||||
{ "<Leader>ff", ":Telescope find_files<CR>", desc = "Search file" },
|
||||
{ "<Leader>fc", ":source $MYVIMRC<CR>", desc = "Reload config file" },
|
||||
})
|
||||
|
||||
-- jk map to esc
|
||||
@ -68,19 +72,16 @@ wk.register({
|
||||
map("i", "jk", "<Esc>", opt)
|
||||
|
||||
-- window operate by which-key
|
||||
-- 窗口操作(使用which-key快捷键设置)
|
||||
wk.register({
|
||||
["<Leader>w"] = {
|
||||
name = "+Window",
|
||||
h = { "<C-w>h", "To left" },
|
||||
j = { "<C-w>j", "To up" },
|
||||
k = { "<C-w>k", "To down" },
|
||||
l = { "<C-w>l", "To right" },
|
||||
s = { ":sp<CR>", "Split window" },
|
||||
v = { ":vsplit<CR>", "Vsplit window" },
|
||||
d = { ":close<CR>", "Close window" },
|
||||
o = { ":only<CR>", "Close others" },
|
||||
},
|
||||
wk.add({
|
||||
{ "<Leader>w", group = "Window" },
|
||||
{ "<Leader>wh", "<C-w>h", desc = "To left" },
|
||||
{ "<Leader>wj", "<C-w>j", desc = "To up" },
|
||||
{ "<Leader>wk", "<C-w>k", desc = "To down" },
|
||||
{ "<Leader>wl", "<C-w>l", desc = "To right" },
|
||||
{ "<Leader>ws", ":sp<CR>", desc = "Split window" },
|
||||
{ "<Leader>wv", ":vsplit<CR>", desc = "Vsplit window" },
|
||||
{ "<Leader>wd", ":close<CR>", desc = "Close window" },
|
||||
{ "<Leader>wo", ":only<CR>", desc = "Close others" },
|
||||
})
|
||||
|
||||
-- base operation for visual mode
|
||||
@ -91,15 +92,6 @@ map("v", ">", ">gv", opt)
|
||||
-- neoTree
|
||||
map("n", "T", ":NeoTreeFocusToggle<CR>", opt)
|
||||
|
||||
-- Packer
|
||||
wk.register({
|
||||
["<Leader>p"] = {
|
||||
name = "+Packer",
|
||||
i = { ":PackerSync<CR>", "PackerSync" },
|
||||
s = { ":PackerStatus<CR>", "PackerStatus" },
|
||||
c = { ":PackerClean<CR>", "PackerClean" },
|
||||
},
|
||||
})
|
||||
|
||||
-- 定义开关quickfix窗口的函数
|
||||
|
||||
@ -121,32 +113,37 @@ local function toggle_quickfix()
|
||||
end
|
||||
|
||||
-- Bufferline and buffer related
|
||||
wk.register({
|
||||
["<Leader>b"] = {
|
||||
name = "+Buffer",
|
||||
k = { ":bd!<CR>", "Kill buffer" },
|
||||
o = { ":BufferLineCloseRight<CR>:BufferLineCloseLeft<CR>", "Close other buffer" },
|
||||
b = { ":Telescope buffers<CR>", "Open buffers" },
|
||||
n = { ":ls<CR>", "Buffer numbers" },
|
||||
c = { ":noh<CR>", "Cancel highlight" },
|
||||
C = { ":call setqflist([], 'r')<CR>", "Clear quickfix" },
|
||||
q = {
|
||||
function()
|
||||
toggle_quickfix()
|
||||
end,
|
||||
"Toggle quickfix",
|
||||
},
|
||||
s = { ":Telescope current_buffer_fuzzy_find<CR>", "Searching in buffer" },
|
||||
},
|
||||
})
|
||||
wk.register({
|
||||
["<Leader>j"] = { ":HopLineStart<CR>", "Quick jump line" },
|
||||
wk.add({
|
||||
{ "<Leader>b", group = "Buffer" },
|
||||
{ "<Leader>bk", ":bd!<CR>", desc = "Kill buffer" },
|
||||
{ "<Leader>bo", ":BufferLineCloseRight<CR>:BufferLineCloseLeft<CR>", desc = "Close other buffer" },
|
||||
{ "<Leader>bb", ":Telescope buffers<CR>", desc = "Open buffers" },
|
||||
{ "<Leader>bn", ":ls<CR>", desc = "Buffer numbers" },
|
||||
{ "<Leader>bc", ":noh<CR>", desc = "Cancel highlight" },
|
||||
{ "<Leader>bC", ":call setqflist([], 'r')<CR>", desc = "Clear quickfix" },
|
||||
{ "<Leader>bq", function() toggle_quickfix() end, desc = "Toggle quickfix" },
|
||||
{ "<Leader>bs", ":Telescope current_buffer_fuzzy_find<CR>", desc = "Searching in buffer" },
|
||||
})
|
||||
|
||||
-- 快速切换主题
|
||||
wk.register({
|
||||
["<Leader>c"] = { ":Telescope colorscheme<CR>", "Quick change colortheme" },
|
||||
wk.add({
|
||||
{ "<Leader>j", ":HopLineStart<CR>", desc = "Quick jump line" },
|
||||
})
|
||||
|
||||
wk.add({
|
||||
{ "<Leader>c", group = "ChatGPT" },
|
||||
{ "<Leader>cb", ":%GpAppend<CR>", desc = "gpt response by buffer" },
|
||||
})
|
||||
|
||||
-- use gp to interact with chatgpt to write code
|
||||
map("v", "<C-g>r", ":<C-u>'<,'>GpRewrite<cr>", opt)
|
||||
map("v", "<C-g>a", ":<C-u>'<,'>GpAppend<cr>", opt)
|
||||
|
||||
|
||||
-- 快速切换主题
|
||||
-- wk.register({
|
||||
-- ["<Leader>c"] = { ":Telescope colorscheme<CR>", "Quick change colortheme" },
|
||||
-- })
|
||||
|
||||
map("n", "<Tab>", "za", opt)
|
||||
-- insert 模式下ctrl a e跳转开头结尾
|
||||
map("i", "<C-a>", "<C-o>I", opt)
|
||||
@ -160,18 +157,25 @@ map("i", "<C-h>", "<C-o>:BufferLineCyclePrev<CR>", opt)
|
||||
map("i", "<C-l>", "<C-o>:BufferLineCycleNext<CR>", opt)
|
||||
|
||||
-- Mason
|
||||
wk.register({
|
||||
["<Leader>l"] = {
|
||||
name = "+Lsp",
|
||||
i = { ":LspInstall<CR>", "Install lsp" },
|
||||
I = { ":MasonInstall ", "Install any" },
|
||||
r = { ":LspRestart<CR>", "Lsp restart" },
|
||||
m = { ":Mason<CR>", "Mason info" },
|
||||
u = { ":MasonUninstall<CR>", "Uninstall lsp" },
|
||||
U = { ":MasonUninstallAll<CR>", "Unistall all" },
|
||||
l = { ":LspInfo<CR>", "Lsp infos" },
|
||||
R = { vim.lsp.buf.rename, "Buffer var rename" },
|
||||
},
|
||||
wk.add({
|
||||
{ "<Leader>l", group = "Lsp" },
|
||||
{ "<Leader>li", ":LspInstall<CR>", desc = "Install lsp" },
|
||||
{ "<Leader>lI", ":MasonInstall ", desc = "Install any" },
|
||||
{ "<Leader>lr", ":LspRestart<CR>", desc = "Lsp restart" },
|
||||
{ "<Leader>lm", ":Mason<CR>", desc = "Mason info" },
|
||||
{ "<Leader>lu", ":MasonUninstall<CR>", desc = "Uninstall lsp" },
|
||||
{ "<Leader>lU", ":MasonUninstallAll<CR>", desc = "Unistall all" },
|
||||
{ "<Leader>ll", ":LspInfo<CR>", desc = "Lsp infos" },
|
||||
{ "<Leader>lR", vim.lsp.buf.rename, desc = "Buffer var rename" },
|
||||
})
|
||||
|
||||
-- dap keymaps
|
||||
wk.add({
|
||||
{ "<Leader>d", group = "Debug" },
|
||||
{ "<Leader>dr", ":lua require('dap').continue()<CR>", desc = "Start debug" },
|
||||
{ "<Leader>db", ":lua require('dap').toggle_breakpoint()<CR>", desc = "Set breakpoint" },
|
||||
{ "<Leader>dc", ":lua require('dap').clear_breakpoints()<CR>", desc = "Clear breakpoint" },
|
||||
{ "<Leader>de", ":lua require'dap'.close()<CR>:lua require'dap'.terminate()<CR>:lua require'dap.repl'.close()<CR>:lua require'dapui'.close()<CR>:DapVirtualTextDisable<CR><C-w>o<CR>", desc = "Stop debug" },
|
||||
})
|
||||
|
||||
-- cmpeletion keys
|
||||
@ -198,24 +202,6 @@ pluginKeys.cmp = function(cmp)
|
||||
}
|
||||
end
|
||||
|
||||
-- dap keymaps
|
||||
wk.register({
|
||||
["<Leader>d"] = {
|
||||
name = "+Debug",
|
||||
r = { ":lua require('dap').continue()<CR>", "Start debug" },
|
||||
b = { ":lua require('dap').toggle_breakpoint()<CR>", "Set breakpoint" },
|
||||
c = { ":lua require('dap').clear_breakpoints()<CR>", "Clear breakpoint" },
|
||||
e = {
|
||||
":lua require'dap'.close()<CR>"
|
||||
.. ":lua require'dap'.terminate()<CR>"
|
||||
.. ":lua require'dap.repl'.close()<CR>"
|
||||
.. ":lua require'dapui'.close()<CR>"
|
||||
.. ":DapVirtualTextDisable<CR>"
|
||||
.. "<C-w>o<CR>",
|
||||
"Stop debug",
|
||||
},
|
||||
},
|
||||
})
|
||||
map("i", "<C-d>", ":lua require'dap'.continue()<CR>", opt)
|
||||
map("n", "<C-n>", ":lua require'dap'.step_into()<CR>", opt)
|
||||
map("n", "<C-o>", ":lua require'dap'.step_over()<CR>", opt)
|
||||
@ -245,6 +231,7 @@ function SetKeybinds()
|
||||
["c"] = { ":FlutterCopyProfilerUrl<CR>", "FlutterCopyProfilerUrl" },
|
||||
["w"] = { ":FlutterDevTools<CR>", "FlutterDevTools" },
|
||||
}, opts)
|
||||
|
||||
-- elseif fileTy == "sh" then
|
||||
-- wk.register({
|
||||
-- ["W"] = { ":w<CR>", "test write" },
|
||||
|
1
lua/lsp/config/astro.lua
Normal file
1
lua/lsp/config/astro.lua
Normal file
@ -0,0 +1 @@
|
||||
return require("lsp.config.basic_config")
|
@ -8,21 +8,22 @@ local servers = {
|
||||
lua_ls = require("lsp.config.lua"), -- lua/lsp/config/lua.lua
|
||||
clangd = require("lsp.config.clangd"),
|
||||
gopls = require("lsp.config.gopls"),
|
||||
astro = require("lsp.config.astro"),
|
||||
-- eslint = require("lsp.config.eslint"),
|
||||
-- r_language_server = require("lsp.config.r"),
|
||||
-- csharp_ls = require("lsp.config.csharp"),
|
||||
omnisharp = require("lsp.config.csharp"),
|
||||
-- bashls = require("lsp.config.bash"),
|
||||
pyright = require("lsp.config.pyright"),
|
||||
-- pyright = require("lsp.config.pyright"),
|
||||
marksman = require("lsp.config.marksman"),
|
||||
pylsp = require("lsp.config.pylsp"),
|
||||
-- texlab = require("lsp.config.texlab"),
|
||||
volar = require("lsp.config.vue"),
|
||||
-- volar = require("lsp.config.vue"),
|
||||
-- html = require("lsp.config.html"),
|
||||
-- cssls = require("lsp.config.css"),
|
||||
-- emmet_ls = require("lsp.config.emmet"),
|
||||
-- jsonls = require("lsp.config.json"),
|
||||
tsserver = require("lsp.config.ts"),
|
||||
ts_ls = require("lsp.config.ts"),
|
||||
-- rust_analyzer = require("lsp.config.rust"),
|
||||
-- yamlls = require("lsp.config.yamlls"),
|
||||
-- remark_ls = require("lsp.config.markdown"),
|
||||
|
@ -1,21 +1,10 @@
|
||||
local db = require("dashboard")
|
||||
local function foot()
|
||||
-- local total_plugins = #vim.tbl_keys(packer_plugins)
|
||||
local function get_table_size(t)
|
||||
local count = 0
|
||||
for _, __ in pairs(t) do
|
||||
count = count + 1
|
||||
end
|
||||
return count
|
||||
end
|
||||
|
||||
local opt, start = require("packer.plugin_utils").list_installed_plugins()
|
||||
local plugin_count = get_table_size(opt) + get_table_size(start)
|
||||
local datetime = os.date(" %d-%m-%Y %H:%M:%S")
|
||||
local version = vim.version()
|
||||
local nvim_version_info = " v" .. version.major .. "." .. version.minor .. "." .. version.patch
|
||||
|
||||
return datetime .. " " .. plugin_count .. " plugins" .. nvim_version_info
|
||||
return datetime .. nvim_version_info
|
||||
end
|
||||
|
||||
db.setup({
|
||||
|
@ -1,8 +1,8 @@
|
||||
local conf = {
|
||||
-- required openai api key
|
||||
openai_api_key = os.getenv("OPENAI_API_KEY"),
|
||||
openai_api_key = "",
|
||||
-- api endpoint (you can change this to azure endpoint)
|
||||
openai_api_endpoint = "https://api.openai.com/v1/chat/completions",
|
||||
openai_api_endpoint = "https://api1.zhtec.xyz/v1/chat/completions",
|
||||
-- openai_api_endpoint = "https://$URL.openai.azure.com/openai/deployments/{{model}}/chat/completions?api-version=2023-03-15-preview",
|
||||
-- prefix for all commands
|
||||
cmd_prefix = "Gp",
|
||||
@ -13,7 +13,7 @@ local conf = {
|
||||
-- directory for storing chat files
|
||||
chat_dir = vim.fn.stdpath("data"):gsub("/$", "") .. "/gp/chats",
|
||||
-- chat model (string with model name or table with model name and parameters)
|
||||
chat_model = { model = "gpt-4", temperature = 1.1, top_p = 1 },
|
||||
chat_model = { model = "gpt-4o", temperature = 1.1, top_p = 1 },
|
||||
-- chat model system prompt (use this to specify the persona/role of the AI)
|
||||
chat_system_prompt = "You are a general AI assistant.",
|
||||
-- chat custom instructions (not visible in the chat but prepended to model prompt)
|
||||
@ -90,32 +90,32 @@ local conf = {
|
||||
whisper_tempo = "1.75",
|
||||
|
||||
-- example hook functions (see Extend functionality section in the README)
|
||||
hooks = {
|
||||
InspectPlugin = function(plugin, params)
|
||||
print(string.format("Plugin structure:\n%s", vim.inspect(plugin)))
|
||||
print(string.format("Command params:\n%s", vim.inspect(params)))
|
||||
end,
|
||||
-- hooks = {
|
||||
-- InspectPlugin = function(plugin, params)
|
||||
-- print(string.format("Plugin structure:\n%s", vim.inspect(plugin)))
|
||||
-- print(string.format("Command params:\n%s", vim.inspect(params)))
|
||||
-- end,
|
||||
|
||||
-- GpImplement rewrites the provided selection/range based on comments in the code
|
||||
Implement = function(gp, params)
|
||||
local template = "Having following from {{filename}}:\n\n"
|
||||
.. "```{{filetype}}\n{{selection}}\n```\n\n"
|
||||
.. "Please rewrite this code according to the comment instructions."
|
||||
.. "\n\nRespond only with the snippet of finalized code:"
|
||||
-- GpImplement rewrites the provided selection/range based on comments in the code
|
||||
-- Implement = function(gp, params)
|
||||
-- local template = "Having following from {{filename}}:\n\n"
|
||||
-- .. "```{{filetype}}\n{{selection}}\n```\n\n"
|
||||
-- .. "Please rewrite this code according to the comment instructions."
|
||||
-- .. "\n\nRespond only with the snippet of finalized code:"
|
||||
|
||||
gp.Prompt(
|
||||
params,
|
||||
gp.Target.rewrite,
|
||||
nil, -- command will run directly without any prompting for user input
|
||||
gp.config.command_model,
|
||||
template,
|
||||
gp.config.command_system_prompt
|
||||
)
|
||||
end,
|
||||
-- gp.Prompt(
|
||||
-- params,
|
||||
-- gp.Target.rewrite,
|
||||
-- nil, -- command will run directly without any prompting for user input
|
||||
-- gp.config.command_model,
|
||||
-- template,
|
||||
-- gp.config.command_system_prompt
|
||||
-- )
|
||||
-- end,
|
||||
|
||||
-- your own functions can go here, see README for more examples like
|
||||
-- :GpExplain, :GpUnitTests.., :GpBetterChatNew, ..
|
||||
},
|
||||
-- your own functions can go here, see README for more examples like
|
||||
-- :GpExplain, :GpUnitTests.., :GpBetterChatNew, ..
|
||||
-- },
|
||||
}
|
||||
|
||||
-- call setup on your config
|
||||
|
40
lua/plugin-config/iron.lua
Normal file
40
lua/plugin-config/iron.lua
Normal file
@ -0,0 +1,40 @@
|
||||
local iron = require("iron.core")
|
||||
|
||||
iron.setup({
|
||||
config = {
|
||||
-- Whether a repl should be discarded or not
|
||||
scratch_repl = true,
|
||||
-- Your repl definitions come here
|
||||
repl_definition = {
|
||||
sh = {
|
||||
-- Can be a table or a function that
|
||||
-- returns a table (see below)
|
||||
command = { "zsh" },
|
||||
},
|
||||
python = {
|
||||
command = { "ipython" },
|
||||
format = require("iron.fts.common").bracketed_paste,
|
||||
},
|
||||
},
|
||||
-- How the repl window will be displayed
|
||||
-- See below for more information
|
||||
repl_open_cmd = require("iron.view").split("30%"),
|
||||
},
|
||||
-- Iron doesn't set keymaps by default anymore.
|
||||
-- You can set them here or manually add keymaps to the functions in iron.core
|
||||
-- If the highlight is on, you can change how it looks
|
||||
-- For the available options, check nvim_set_hl
|
||||
keymaps = {
|
||||
visual_send = "<space>iv",
|
||||
},
|
||||
highlight = {
|
||||
italic = true,
|
||||
},
|
||||
ignore_blank_lines = true, -- ignore blank lines when sending visual select lines
|
||||
})
|
||||
|
||||
-- iron also has a list of commands, see :h iron-commands for all available commands
|
||||
-- vim.keymap.set("n", "<space>rs", "<cmd>IronRepl<cr>")
|
||||
-- vim.keymap.set("n", "<space>rr", "<cmd>IronRestart<cr>")
|
||||
-- vim.keymap.set("n", "<space>rf", "<cmd>IronFocus<cr>")
|
||||
-- vim.keymap.set("n", "<space>ih", "<cmd>IronHide<cr>")
|
@ -18,7 +18,6 @@ end
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
-- theme = "auto",
|
||||
component_separators = { left = "", right = "" },
|
||||
section_separators = { left = "", right = "" },
|
||||
disabled_filetypes = {
|
||||
@ -33,7 +32,7 @@ require("lualine").setup({
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
},
|
||||
theme = "material-nvim",
|
||||
theme = "ayu_light",
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
|
@ -6,8 +6,8 @@ require("toggleterm").setup({
|
||||
return vim.o.columns * 0.4
|
||||
end
|
||||
end,
|
||||
open_mapping = [[<C-\>]],
|
||||
insert_mapping = true,
|
||||
-- open_mapping = [[<C-\>]],
|
||||
-- insert_mapping = true,
|
||||
start_in_insert = true,
|
||||
autochdir = true,
|
||||
auto_scroll = false, -- automatically scroll to the bottom on terminal output
|
||||
|
@ -1,71 +0,0 @@
|
||||
require("which-key").setup{
|
||||
plugins = {
|
||||
marks = true, -- shows a list of your marks on ' and `
|
||||
registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
|
||||
spelling = {
|
||||
enabled = false, -- enabling this will show WhichKey when pressing z= to select spelling suggestions
|
||||
suggestions = 20, -- how many suggestions should be shown in the list?
|
||||
},
|
||||
-- the presets plugin, adds help for a bunch of default keybindings in Neovim
|
||||
-- No actual key bindings are created
|
||||
presets = {
|
||||
operators = true, -- adds help for operators like d, y, ... and registers them for motion / text object completion
|
||||
motions = true, -- adds help for motions
|
||||
text_objects = true, -- help for text objects triggered after entering an operator
|
||||
windows = true, -- default bindings on <c-w>
|
||||
nav = true, -- misc bindings to work with windows
|
||||
z = true, -- bindings for folds, spelling and others prefixed with z
|
||||
g = true, -- bindings for prefixed with g
|
||||
},
|
||||
},
|
||||
-- add operators that will trigger motion and text object completion
|
||||
-- to enable all native operators, set the preset / operators plugin above
|
||||
operators = { gc = "Comments" },
|
||||
key_labels = {
|
||||
-- override the label used to display some keys. It doesn't effect WK in any other way.
|
||||
-- For example:
|
||||
-- ["<space>"] = "SPC",
|
||||
-- ["<cr>"] = "RET",
|
||||
-- ["<tab>"] = "TAB",
|
||||
},
|
||||
icons = {
|
||||
breadcrumb = "»", -- symbol used in the command line area that shows your active key combo
|
||||
separator = "➜", -- symbol used between a key and it's label
|
||||
group = "+", -- symbol prepended to a group
|
||||
},
|
||||
popup_mappings = {
|
||||
scroll_down = '<c-d>', -- binding to scroll down inside the popup
|
||||
scroll_up = '<c-u>', -- binding to scroll up inside the popup
|
||||
},
|
||||
window = {
|
||||
border = "none", -- none, single, double, shadow
|
||||
position = "bottom", -- bottom, top
|
||||
margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]
|
||||
padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left]
|
||||
winblend = 0
|
||||
},
|
||||
layout = {
|
||||
height = { min = 4, max = 25 }, -- min and max height of the columns
|
||||
width = { min = 20, max = 50 }, -- min and max width of the columns
|
||||
spacing = 3, -- spacing between columns
|
||||
align = "left", -- align columns left, center or right
|
||||
},
|
||||
ignore_missing = false, -- enable this to hide mappings for which you didn't specify a label
|
||||
hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "call", "lua", "^:", "^ "}, -- hide mapping boilerplate
|
||||
show_help = true, -- show help message on the command line when the popup is visible
|
||||
triggers = "auto", -- automatically setup triggers
|
||||
-- triggers = {"<leader>"} -- or specify a list manually
|
||||
triggers_blacklist = {
|
||||
-- list of mode / prefixes that should never be hooked by WhichKey
|
||||
-- this is mostly relevant for key maps that start with a native binding
|
||||
-- most people should not need to change this
|
||||
i = { "j", "k" },
|
||||
v = { "j", "k" },
|
||||
},
|
||||
-- disable the WhichKey popup for certain buf types and file types.
|
||||
-- Disabled by deafult for Telescope
|
||||
disable = {
|
||||
buftypes = {},
|
||||
filetypes = { "TelescopePrompt" },
|
||||
},
|
||||
}
|
37
lua/plugin.lua
Normal file
37
lua/plugin.lua
Normal file
@ -0,0 +1,37 @@
|
||||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"--branch=stable",
|
||||
lazyrepo,
|
||||
lazypath,
|
||||
})
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
-- Setup lazy.nvim
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
{ import = "plugins" },
|
||||
-- -- 插件配置放在这里
|
||||
},
|
||||
|
||||
-- Configure any other settings here. See the documentation for more details.
|
||||
-- colorscheme that will be used when installing plugins.
|
||||
install = { colorscheme = { "" } },
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = false, frequency = 604800 },
|
||||
})
|
221
lua/plugins.lua
221
lua/plugins.lua
@ -1,221 +0,0 @@
|
||||
return require("packer").startup(function()
|
||||
-- Packer can manage itself
|
||||
use("wbthomason/packer.nvim")
|
||||
|
||||
-- lua 调试
|
||||
use("rafcamlet/nvim-luapad")
|
||||
------------------ themes --------------------------
|
||||
|
||||
-- use({
|
||||
-- "navarasu/onedark.nvim",
|
||||
-- })
|
||||
|
||||
use("folke/tokyonight.nvim")
|
||||
|
||||
use("sainnhe/everforest")
|
||||
|
||||
use("marko-cerovac/material.nvim")
|
||||
-----------------------------------------------------------------------------------------
|
||||
|
||||
-- a good terminal
|
||||
-- 一个好的nvim内终端
|
||||
use({ "akinsho/toggleterm.nvim", tag = "*" })
|
||||
|
||||
-- make live command
|
||||
-- 实时命令
|
||||
use({ "smjonas/live-command.nvim" })
|
||||
|
||||
-- lazygit support
|
||||
-- 使用lazygit接口
|
||||
use("kdheepak/lazygit.nvim")
|
||||
|
||||
----------------- markdown --------------------
|
||||
-- markdown preview
|
||||
-- markdown自动预览
|
||||
use({
|
||||
"iamcco/markdown-preview.nvim",
|
||||
})
|
||||
|
||||
-- markdown flow and enhance
|
||||
-- markdown 流程和增强
|
||||
use({ "jakewvincent/mkdnflow.nvim" })
|
||||
|
||||
-- orgmode support
|
||||
-- orgmode 支持
|
||||
-- use({ "nvim-orgmode/orgmode" })
|
||||
|
||||
-- nvim-tree for file manage
|
||||
-- use({
|
||||
-- "kyazdani42/nvim-tree.lua",
|
||||
-- requires = "kyazdani42/nvim-web-devicons",
|
||||
-- })
|
||||
|
||||
use({
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v2.x",
|
||||
requires = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
})
|
||||
|
||||
----------------latex------------------
|
||||
use("lervag/vimtex")
|
||||
|
||||
-- vim dashboard
|
||||
-- vim 开始界面
|
||||
use({
|
||||
"glepnir/dashboard-nvim",
|
||||
requires = { "nvim-tree/nvim-web-devicons" },
|
||||
})
|
||||
|
||||
-- smooth neovim scroll
|
||||
-- 顺滑的neovim滚动
|
||||
-- use("karb94/neoscroll.nvim")
|
||||
|
||||
-- bufferline on the top
|
||||
-- 顶部状态栏
|
||||
use({ "akinsho/bufferline.nvim", tag = "v3.*", requires = "nvim-tree/nvim-web-devicons" })
|
||||
|
||||
-- treesitter
|
||||
use({
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
run = function()
|
||||
require("nvim-treesitter.install").update({ with_sync = true })
|
||||
end,
|
||||
})
|
||||
|
||||
--------------------- file related -------------------------------
|
||||
-- telescope
|
||||
use({
|
||||
"nvim-telescope/telescope.nvim",
|
||||
requires = { { "nvim-lua/plenary.nvim" } },
|
||||
})
|
||||
|
||||
-- telescope-file-browser
|
||||
use({ "nvim-telescope/telescope-file-browser.nvim" })
|
||||
|
||||
-- create new file
|
||||
-- 快捷创建新文件
|
||||
use("Mohammed-Taher/AdvancedNewFile.nvim")
|
||||
|
||||
-- project
|
||||
-- 项目管理
|
||||
use({
|
||||
"ahmedkhalf/project.nvim",
|
||||
})
|
||||
|
||||
-- whick-key
|
||||
use({
|
||||
"folke/which-key.nvim",
|
||||
})
|
||||
|
||||
--------------------- buffer related -----------------
|
||||
|
||||
-- indent-blankline
|
||||
-- 竖向加竖线显示对齐
|
||||
use({ "lukas-reineke/indent-blankline.nvim" })
|
||||
-- comment
|
||||
use({
|
||||
"numToStr/Comment.nvim",
|
||||
})
|
||||
|
||||
-- hop plugin
|
||||
-- 快速跳转
|
||||
use({
|
||||
"phaazon/hop.nvim",
|
||||
branch = "v2", -- optional but strongly recommended
|
||||
})
|
||||
|
||||
-- lualine for bottom stausline
|
||||
-- 底部状态栏
|
||||
use({
|
||||
"nvim-lualine/lualine.nvim",
|
||||
requires = { "nvim-tree/nvim-web-devicons", opt = true },
|
||||
})
|
||||
|
||||
-- notify
|
||||
-- 弹窗消息通知
|
||||
use({
|
||||
"rcarriga/nvim-notify",
|
||||
})
|
||||
|
||||
-- autopairs
|
||||
-- 自动补全括号
|
||||
use({
|
||||
"windwp/nvim-autopairs",
|
||||
})
|
||||
|
||||
-- coderunner
|
||||
-- 代码运行
|
||||
use({ "is0n/jaq-nvim" })
|
||||
|
||||
-- cmake support
|
||||
-- cmake 支持
|
||||
-- use("Civitasv/cmake-tools.nvim")
|
||||
|
||||
------------------- lsp --------------------------
|
||||
-- mason for lsp dap linter and others
|
||||
use({
|
||||
"williamboman/mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"neovim/nvim-lspconfig",
|
||||
})
|
||||
|
||||
-- null-ls for formatter and others
|
||||
-- null-ls 用于格式化和其他
|
||||
use({
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
})
|
||||
|
||||
-- flutter support
|
||||
use({
|
||||
"akinsho/flutter-tools.nvim",
|
||||
requires = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"stevearc/dressing.nvim", -- optional for vim.ui.select
|
||||
},
|
||||
})
|
||||
-- -- 补全引擎
|
||||
use("hrsh7th/nvim-cmp")
|
||||
-- Snippet 引擎
|
||||
use({ "L3MON4D3/LuaSnip" })
|
||||
use("hrsh7th/vim-vsnip")
|
||||
-- 补全源
|
||||
use("hrsh7th/cmp-vsnip")
|
||||
use({ "ray-x/lsp_signature.nvim" })
|
||||
use({ "saadparwaiz1/cmp_luasnip" })
|
||||
use("hrsh7th/cmp-nvim-lsp") -- { name = nvim_lsp }
|
||||
use("hrsh7th/cmp-buffer") -- { name = 'buffer' },
|
||||
use("hrsh7th/cmp-path") -- { name = 'path' }
|
||||
use("hrsh7th/cmp-omni") -- { name = 'omni' }
|
||||
use("hrsh7th/cmp-cmdline") -- { name = 'cmdline' }
|
||||
use("hrsh7th/cmp-nvim-lsp-signature-help") -- { name = 'nvim_lsp_signature_help' }
|
||||
-- 常见编程语言代码段
|
||||
use("rafamadriz/friendly-snippets")
|
||||
-- UI 增强
|
||||
use("onsails/lspkind-nvim")
|
||||
-- copilot 增强
|
||||
-- use("github/copilot.vim")
|
||||
-- Remove the `use` here if you're using folke/lazy.nvim.
|
||||
use({
|
||||
"Exafunction/codeium.vim",
|
||||
})
|
||||
------------------- repl ----------------------
|
||||
use({ "hkupty/iron.nvim" })
|
||||
|
||||
------------------- dap -----------------------
|
||||
-- dap for neovim
|
||||
-- dap ui和适配器
|
||||
use({ "rcarriga/nvim-dap-ui", requires = { "mfussenegger/nvim-dap", "theHamsta/nvim-dap-virtual-text" } })
|
||||
|
||||
-- persistent breakpoints
|
||||
-- 持久化断点
|
||||
use({ "Weissle/persistent-breakpoints.nvim" })
|
||||
|
||||
------------------ gpt -----------------------
|
||||
-- gpt for coding
|
||||
-- gpt辅助代码
|
||||
use("robitx/gp.nvim")
|
||||
end)
|
98
lua/plugins/list.lua
Normal file
98
lua/plugins/list.lua
Normal file
@ -0,0 +1,98 @@
|
||||
return {
|
||||
{ "rafcamlet/nvim-luapad" },
|
||||
{ "echasnovski/mini.nvim", version = false },
|
||||
{ "sainnhe/everforest" },
|
||||
{ "marko-cerovac/material.nvim" },
|
||||
{ "akinsho/toggleterm.nvim", version = "*" },
|
||||
{ "smjonas/live-command.nvim" },
|
||||
{ "kdheepak/lazygit.nvim" },
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
build = function()
|
||||
vim.fn["mkdp#util#install"]()
|
||||
end,
|
||||
},
|
||||
{ "jakewvincent/mkdnflow.nvim" },
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v2.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
},
|
||||
{ "lervag/vimtex" },
|
||||
{
|
||||
"glepnir/dashboard-nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
},
|
||||
{
|
||||
"akinsho/bufferline.nvim",
|
||||
version = "v3.*",
|
||||
dependencies = "nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
},
|
||||
{ "nvim-telescope/telescope-file-browser.nvim" },
|
||||
{ "Mohammed-Taher/AdvancedNewFile.nvim" },
|
||||
{ "ahmedkhalf/project.nvim" },
|
||||
{ "folke/which-key.nvim" },
|
||||
{ "lukas-reineke/indent-blankline.nvim" },
|
||||
{ "numToStr/Comment.nvim" },
|
||||
{
|
||||
"phaazon/hop.nvim",
|
||||
branch = "v2",
|
||||
},
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
},
|
||||
{ "rcarriga/nvim-notify" },
|
||||
{ "windwp/nvim-autopairs" },
|
||||
{ "is0n/jaq-nvim" },
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"neovim/nvim-lspconfig",
|
||||
},
|
||||
{ "jose-elias-alvarez/null-ls.nvim" },
|
||||
{
|
||||
"akinsho/flutter-tools.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"stevearc/dressing.nvim",
|
||||
},
|
||||
},
|
||||
{ "hrsh7th/nvim-cmp" },
|
||||
{ "L3MON4D3/LuaSnip" },
|
||||
{ "hrsh7th/vim-vsnip" },
|
||||
{ "hrsh7th/cmp-vsnip" },
|
||||
{ "ray-x/lsp_signature.nvim" },
|
||||
{ "saadparwaiz1/cmp_luasnip" },
|
||||
{ "hrsh7th/cmp-nvim-lsp" },
|
||||
{ "hrsh7th/cmp-buffer" },
|
||||
{ "hrsh7th/cmp-path" },
|
||||
{ "hrsh7th/cmp-omni" },
|
||||
{ "hrsh7th/cmp-cmdline" },
|
||||
{ "hrsh7th/cmp-nvim-lsp-signature-help" },
|
||||
{ "rafamadriz/friendly-snippets" },
|
||||
{ "onsails/lspkind-nvim" },
|
||||
{ "Vigemus/iron.nvim" },
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
dependencies = {
|
||||
"mfussenegger/nvim-dap",
|
||||
"theHamsta/nvim-dap-virtual-text",
|
||||
},
|
||||
},
|
||||
{ "nvim-neotest/nvim-nio" },
|
||||
{ "Weissle/persistent-breakpoints.nvim" },
|
||||
{ "robitx/gp.nvim" },
|
||||
}
|
19
lua/plugins/whichkey.lua
Normal file
19
lua/plugins/whichkey.lua
Normal file
@ -0,0 +1,19 @@
|
||||
return {
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>?",
|
||||
function()
|
||||
require("which-key").show({ global = false })
|
||||
end,
|
||||
desc = "Buffer Local Keymaps (which-key)",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
Reference in New Issue
Block a user