小编use*_*980的帖子

不使用插件在 Vim 中使用自动保存?

如何在不使用插件的情况下在 Vim 中自动保存?

我找到了以下帖子:

输入时自动保存在 VIM 中

给出以下答案:

autocmd TextChanged,TextChangedI <buffer> silent write
Run Code Online (Sandbox Code Playgroud)

它工作得很好,除了当我把它放在我的 .vimrc 中时它不起作用,那么我怎样才能将该行放在我的 .vimrc 中,以便每次打开 Vim 时它都可以工作?

编辑:当我不使用会话时,似乎将该行放入 .vimrc 中即可工作!

所以我将重新表述我的问题:

如何将上述工作与 mksession 结合起来,使用 vim -S 在 Vim 中打开预配置的会话?

vim

2
推荐指数
1
解决办法
1628
查看次数

静态结构警告空声明中无用的存储类说明符

  static struct astr {
          int a;
  };

  static const struct astr newastr = {
          .a = 9,
  };
Run Code Online (Sandbox Code Playgroud)

我得到:警告:空声明中无用的存储类说明符

如果我把它改成

  static struct astr {
          int a;
  } something;
Run Code Online (Sandbox Code Playgroud)

那么警告将被修复。

以下也没有给出该警告

  struct astr {
          int a;
  };

  static const struct astr newastr = {
          .a = 9,
  }; 
Run Code Online (Sandbox Code Playgroud)

有人可以解释一下这是怎么回事吗?

c static struct

2
推荐指数
1
解决办法
937
查看次数

标签 统计

c ×1

static ×1

struct ×1

vim ×1