Magicode logo
Magicode
3 min read

Neovim 使えそうな9つのTips

https://cdn.apollon.ai/media/notebox/740f4400-cc6b-4294-9268-a27d2c3fbfe7.jpeg
Neovim, Vimの11のTipsを紹介します.
  • Alternative marker for foldmethod
  • コマンドヒストリーを得る
  • Use Normal-mode keymap at Insert-mode
  • CapsLock with lmap
  • Get Info from outside of vim
  • Pass parameters to lua function from VimL
  • Highhlight syntax inside Markdown
  • Operator-Pending Mappings
  • Adding hoooks to your neovim lua plugin using user events (usercmd).

vim

Alternative marker for foldmethod

Referenced from leap.nvim
; vim: foldmethod=marker foldmarker=///,//>

コマンドヒストリーを得る.

histget('cmd', -1)

Use Normal-mode keymap at Insert-mode.

Use (vim.api.nvim_set_keymap :i :<c-p> "<cmd>normal! j <cr>" ...) but i_CTRL-O.

Insert mode only CapsLock

Get Info from outside of vim

On neovim, you can use vim.loop (luv) instead.

Pass parameters to lua function from VimL

call luaeval("print(_A)", [1, 2, 3])
call luaeval('_A[1] + _A[2]', [1, 1])
echo luaeval('string.format("Lua is %s", _A)', 'awesome')

Highhlight syntax inside Markdown

let g:markdown_fenced_languages = ['cofee', 'css', 'json=javascript', 'erb=eruby']

Operator-Pending Mappings

Adding hoooks to your neovim lua plugin using user events (usercmd).

Discussion

コメントにはログインが必要です。