0
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.

Neovimでsignをminimapのように表示するplugin

Posted at

概要

最近作ったNeovimのplugin、signbarの紹介記事。

こんな感じで右端のfloating window(以下signbar)にbuffer内のsign(行番号の左に表示されるあれ)を一覧表示してくれる。このgifは粗いけれどGitHubにはオリジナルのmp4があるよ。

374df91a2655-20230220.gif

背景

なぜこのpluginを作ったかというと、以下のような悩みがあったから。同じようなことで悩んでいる人には役立つはず!

  • marks.nvimでどのmarkをどの辺りで使ったかわからなくなる
  • 各種language serverがエラーをsignとして表示してくれるけど、編集中の箇所から離れていると気づかない1

設定

packer.nvimを使う。以下を書き足せばOK(コメントは細かく設定する場合の例)。

use {
  'dr666m1/signbar.nvim',
  config = function()
    require("signbar").setup {
      -- refresh_interval = 1000,
      -- ignored_sign_names = { "Marks_a" },
      -- ignored_sign_groups = { "MarkSigns" },
    }
  end
}

以下、設定項目について補足。

refresh_interval (integer)

指定した間隔(ミリ秒)でsignbarを更新する。デフォルト(nil)だとカーソル移動ごとに更新されるが、それだと頻繁過ぎるときに指定する想定。あまりに間隔が短いとE322のエラーが発生するので、指定するなら1000以上とかがよさげ。

ignored_sign_names, ignored_sign_grups (table)

signbarに表示したくないsignをnameやgroup単位で指定する。ちなみに、現在表示されているsignのnameやgroupを確認するには:sign place group=*を実行するとよい。

最後に

よければ試しに使ってくださいませ!

  1. 自分はエラー数をstatuslineに表示しているのになぜか気づけない...

0
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
0
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?