0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

MacでLazyVim+Skimで快適LaTeX

Posted at

使用している環境

  • iTerm
  • LazyVim
  • Skim

Skim

Skimのインストール

brew install skim

でインストール。

Skim の Inverse search 機能

Skimで表示しているpdfファイルからneovimへ飛ぶ機能を設定する。

SkimのSettings->Syncを開く。
Check for file changes のチェックボックスはチェックしなくて良い。
その下の command, argumentsと書いているところのPresetをCustomにして、

command:

nvim

arguments:

--headless -c "VimtexInverseSearch %line '%file'"

を入力する。こうすると、cmd+shift+clickでPDFの該当部分からtexファイルの該当部分へ飛ぶことができる。

たまに効かなくなることがあるが、cmd+qskimを終了してから<leader>lvskimを再起動すると元に戻ることが多い。

Lazyvim側の設定

Lazy Extrasでtexファイルのサポートを有効にする

lazy extrasはスタートアップ画面からxを押せば開くことができる。

lang.texを探してxを押せば有効にできる。
これで自動的にVimTexが有効化される。

VimTexの設定

Vimtexはデフォルトでlatexmkを用いてコンパイルするので.latexmkrcなどを設定していればコンパイル絡みの設定はしなくても動く。

lazyvimの設定はスタートアップ画面からcを入力すれば開くことができる

options.lua

vim.g.vimtex_view_method = "skim"

の行を追加すればvimtexのデフォルトのviewerがskimになる。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?