tab 会被自动修改为 space 吗? 不会,执行 retab 或者 retab! 来转换。
就是这个插件让我感到恐惧 "tpope/vim-sleuth"
- https://tedlogan.com/techblog3.html
- https://gist.github.com/LunarLambda/4c444238fb364509b72cfb891979f1dd
- Expandtab : 是否展开 tab 为 space
- Tabstop : 一个 tab 占用多少个格子
- Shiftwidth : 当打开自动缩进的时候,
int main(int argc, char *argv[]) { // <- 光标在此处,如果 enter ,下一行
return 0;
}
https://superuser.com/questions/594583/what-does-shiftwidth-do-in-vim-editor : 4. Softtabstop : Number of spaces that a counts for while performing editing operations, like inserting a or using . https://vi.stackexchange.com/questions/4244/what-is-softtabstop-used-for
实不相瞒,感觉还是没有太搞清楚.
-
Softtabstop : 既然是一个 tab 按下去的时候,产生多少个 space 的,那么只有允许 tab expand 的时候才有用吧
-
让 Softtabstop 和 Shiftwidth 不相等又什么好处吗?
-
https://www.reddit.com/r/neovim/comments/17ak2eq/neovim_is_automatically_removing_trailing/
看后面的转义符,本来是对齐的,现在配置之后,似乎是 tab 装换为 space 了,变的不对齐了
#define __WAITQUEUE_INITIALIZER(name, tsk) { \
.private = tsk, \
.func = default_wake_function, \
.entry = { NULL, NULL } }
#define DECLARE_WAITQUEUE(name, tsk) \
struct wait_queue_entry name = __WAITQUEUE_INITIALIZER(name, tsk)
ctrl i
实际上等同于 tab 的, 重新映射为<Space>
i
, 🤡 用了 5 年 vim 才知道这个。- vim 中
<cr>
和<enter>
有什么区别- 没有区别,除了拼写不同
- 使用 sudo 保存一个文件
w !sudo tee %
- 如何删除每一行的第一个字符
:%norm dw
为了制作一个最小的复现环境,
使用 .dotfiles/nvim/debug/switch.sh 来来回
为 .dotfiles/nvim/debug/init.lua 和本配置
- https://siraben.dev/2022/03/01/tree-sitter.html
- https://siraben.dev/2022/03/22/tree-sitter-linter.html
- https://blog.antoyo.xyz/vim-tips
- https://news.ycombinator.com/item?id=36312027
- https://m4xshen.dev/posts/vim-command-workflow/
-
https://github.com/rafamadriz/friendly-snippets/blob/main/snippets/c/c.json
-
https://www.reddit.com/r/neovim/comments/13yw98e/how_can_i_switch_the_local_input_method_in_vim_on/
- 是 ccls 的问题吗?
https://zignar.net/2023/06/10/debugging-lua-in-neovim/
https://github.com/ibhagwan/smartyank.nvim
当然,是 session 的原因,但是,我非常怀疑和 nvim tree 有关的
https://github.com/abecodes/tabout.nvim https://github.com/YaroSpace/lua-console.nvim
-
极为细节的问题,但是折腾下应该还是可解的
- ,s 的时候,正好匹配的那个总是不是第一个,检查一下 telescope
- https://www.trickster.dev/post/vim-is-touch-typing-on-steroids/ : 从后往前阅读
https://unix.stackexchange.com/questions/65932/how-to-get-the-first-word-of-a-string
{ "SmiteshP/nvim-navic" }, -- 在 winbar 展示当前的路径 { "utilyre/barbecue.nvim" },
https://nvimdev.github.io/lspsaga/outline/
https://github.com/2KAbhishek/termim.nvim
https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-bufremove.md#features
其实可以更新下
https://github.com/nvim-neorocks/nvim-best-practices
https://github.com/danielfalk/smart-open.nvim 依赖于 sqlite ,nixos 上无法解决
https://github.com/chrishrb/gx.nvim
https://github.com/mpv-player/mpv
https://github.com/sindrets/diffview.nvim : 尝试下
https://github.com/cbochs/grapple.nvim
- 和 nvim-telescope/telescope-frecency.nvim 对比下,真的很慢
text obj 的含义
{
"cshuaimin/ssr.nvim",
module = "ssr",
vim.keymap.set({ "n", "x" }, "<leader>r", function()
require("ssr").open()
end),
}, -- 结构化查询和替换
{
"NStefan002/2048.nvim",
cmd = "Play2048",
config = true,
},
'm4xshen/hardtime.nvim'
"azabiong/vim-highlighter", -- 高亮多个搜索内容
"dstein64/vim-startuptime", -- 分析 nvim 启动时间
'wakatime/vim-wakatime' -- 代码时间统计
"tpope/vim-repeat", -- 更加强大的 `.`
"mg979/vim-visual-multi", -- 同时编辑多个位置
"AckslD/nvim-neoclip.lua", -- 保存 macro
这个应该是用点用的: https://github.com/ptdewey/pendulum-nvim
没办法正常使用,如果可以用的话,那么是极好的
导航栏中,对于
WRITE_ONCE(mm_state->seq, mm_state->seq + 1);
会显示出来:
__compiletime_assert_1139
看看主流配置是如何使用导航栏的
https://lsp-zero.netlify.app/docs/language-server-configuration.html
- https://www.reddit.com/r/neovim/comments/1gl5uaz/snacksnvim_a_collection_of_small_qol_plugins_for/
- https://github.com/folke/snacks.nvim/blob/main/docs/terminal.md
- 他这里封装了 terminal,不好用
- https://github.com/folke/snacks.nvim/blob/main/docs/terminal.md
从 before branch ,忽然发现:
- fafa
- enter 之后没有自动补全了,难道 cmp 配置错误了
harper_ls
https://github.com/aitjcize/cppman
快捷键也是不好用的,应该类似 K
而且 c 语言中的 man 可不可以有类似的搞法
https://beorg.app/orgmode/letsgetgoing/
lua require('barbecue.ui').navigate(-1)
似乎都是不准的,难受 ./barbecue.diff
void kvm_vcpu_unmap(struct kvm_vcpu *vcpu, struct kvm_host_map *map, bool dirty)
{
if (!map)
return;
if (!map->hva)
return;
if (map->page != KVM_UNMAPPED_PAGE)
kunmap(map->page);
#ifdef CONFIG_HAS_IOMEM
else
memunmap(map->hva);
#endif
if (dirty)
kvm_vcpu_mark_page_dirty(vcpu, map->gfn);
kvm_release_pfn(map->pfn, dirty);
map->hva = NULL;
map->page = NULL;
}
使用 tree-sitter 的模式,如果从下面 gj,最后会跳到 else 那里。 看来是 tree sitter 的 bug 了。
而且无法跳到结构体的开始位置
shellcheck 的问题吗?
- nvim 无法在其中拷贝
- ui 总是在闪烁啊
例如这里的 remove_file ,而且被高亮为红色了:
impl Drop for Qemu {
fn drop(&mut self) {
let _ = fs::remove_file(self.qga_sock.as_path());
let _ = fs::remove_file(self.qmp_sock.as_path());
let _ = fs::remove_file(self.command_sock.as_path());
}
}
这不对吧
https://github.com/nvzone/menu
https://github.com/t-troebst/perfanno.nvim
cd $HOME/.local/share/nvim/lazy/ && rm -rf hydra.nvim
找到 nvim/lazy-lock.json ,将其中 hydra.nvim 那个删掉
在 vim 中使用中文输入法,如果打字完成,进入 normal 模式,使用 gg 想要移动到文件的第一行,结果发现 gg 被中文输入法截断了。 所以需要一个插件可以在进入 normal 的模式的时候中文输入法切走。
可以使用两套方案,但是原理都是相同的,
- 方案 1:
- 使用 fcitx.nvim,其代码相当简洁优雅。
- 如果是在 MacOS 上,需要在系统中安装 fcitx-remote-for-osx 来切换输入法。
- 方案 2:
- coc-imselect 自动包含了 fcitx-remote-for-osx 的功能,无论是在 MacOS 上还是 Linux 上都是相同的。
当我在切换到 MacOS 的时候,发现输入法的自动切换不能正常工作,最后通过这个 commit 进行了修复。