Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
adoyle-h committed May 14, 2024
1 parent 84c2ac6 commit 028a0c8
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,7 @@ Read the [NOTICE](./NOTICE) file distributed with this work for additional infor
## Vim

- [<C-I> 在 nvim 里等同于 <Tab>](vim/ctrl-i-in-neovim.md)
- [用于调试的最小 neovim 配置](vim/minimal-nvim-config-for-reproduce.md)
- [学习 Neovim](vim/neovim-learning.md)
- [在 vim 中执行 shell 命令,同时将结果输出到 buffer](vim/pipe-shell-output-to-buffer.md)
- [vim 插件教程](vim/plugins-tutorial.md)
Expand Down
4 changes: 4 additions & 0 deletions shell/bash-tricks.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,3 +349,7 @@ https://superuser.com/a/1348950/1776434
`cmd2 < <(cmd)``cmd` 也不能修改当前进程的变量。但是 `cmd2` 是运行在当前进程的,可以修改。

[subshell]: ./subshell-and-child-process.md

## [ ][[ ]] 的区别

https://stackoverflow.com/a/3427931/4622308
34 changes: 34 additions & 0 deletions vim/minimal-nvim-config-for-reproduce.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 用于调试的最小 neovim 配置

1. 创建 repro.lua 文件,内容如下

```lua
-- **DO NOT change the paths and don't remove the colorscheme**
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

vim.cmd.color "elflord"
--------------------------------------------------------------------------------
local plugins = {
}

require("lazy").setup(plugins, {
root = root .. "/plugins",
})
```

它自动下载 lazy.nvim,并且会自动下载插件到 ./repro/plugins

2. `nvim -u ./repro.lua`。它会在当前目录创建 .repro 目录,该目录独立存储所有 nvim 数据。
3. 调试完后删除 .repro 目录。

0 comments on commit 028a0c8

Please sign in to comment.