3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

nvim-cmpで、タブ補完が必要ない時にEnterを押したらそのまま改行するようにしたい

Posted at

タイトルの通り。最近エディタをnvimに移行して、色々設定をしていたが、補完が必要なくて改行したいのに、Enterを押すと第一候補の補完が効いてしまうから、それを避けたかった。

nvim-cmp-config.luaの中身に次のものを追加すれば良い。

cmp.setup({
    mapping = cmp.mapping.preset.insert({
                  ['<CR>'] = cmp.mapping.confirm({ select = false }),
              }),
})
3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?