Open18

Neovimの整備

ピン留めされたアイテム
taemathtaemath

TODO

  • Ctrl + n_ を入力する
  • gitUIを入れる
  • 補完の表示を良い感じにする
  • カーソル下のコードのPRを開きたい
  • terminalからPRやissueを確認したい
  • templateからDaily Noteを開きたい
taemathtaemath

普段はVSCodeでneovimの拡張機能を使って開発をしつつ、コマンドはNeovimのterminalモードを使っている。
キーボードで完結するVimの思想はすごく惹かれているので、VSCodeをのキーバインドをカスタマイズしている。が最近、顕著に動作が遅くなったので、Neovimに移行しようか(また)迷い出した

taemathtaemath

コメントアウトについて確認する

n: gccでコメントの制御ができる
v: gc

taemathtaemath

easymotionどうなっているか確認する

taemathtaemath
  • 補完の効いている時に <C-n>が効かない
  • color themeを変更する
  • floating terminalに枠をつけたい
taemathtaemath

補完の効いている時に <C-n>が効かない

noremapのoptsをつけた。多分、これで良い

local keymap = vim.keymap
local opts = { noremap = true, silent = true }

keymap.set("i", "<C-n>", "_", opts)

Lazy.vimのデフォルトで使われていた。

  • TODO
taemathtaemath

color themeを変更する

  • 基本的にColorscheme | LazyVimに書いてあるようにすれば良い。
  • everforestの場合、neovim用のプラグインと、読み込むプラグイン名が異なったで手間取った。
return {
  {
    "neanias/everforest-nvim",
    config = function()
      require("everforest").setup({
        background = "soft",
      })
    end,
  },
  {
    "LazyVim/LazyVim",
    opts = {
      colorscheme = "everforest",
    },
  },
}
taemathtaemath

Github Copilotを使えるようにする

  1. pluginを入れる
  2. node のバージョンup を要求された

nodeのバージョンを上げる

  • nodeのバージョンを確認
    • node -v
  • nodeのバージョン管理を何でしているか確認
    • anyenv -v でバージョンが表示されたので、これであると確認ができた
  • Anyenv をアップデートするに従って、anyenv自体をversion up
  • nodenv insitall --listでインストールできるversionを確認
  • nodenv install 21.5.0
  • nodeenv global 21.5.0

これでエラーメッセージが出なくなった

taemathtaemath

zshの起動に時間がかかるを解決する

neovim termを起動したら以下のような警告がでた

[WARNING]: Console output during zsh initialization detected.

When using Powerlevel10k with instant prompt, console output during zsh
initialization may indicate issues.

You can:

  - Recommended: Change ~/.zshrc so that it does not perform console I/O
    after the instant prompt preamble. See the link below for details.

    * You will not see this error message again.
    * Zsh will start quickly and prompt will update smoothly.

  - Suppress this warning either by running p10k configure or by manually
    defining the following parameter:

      typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet

    * You will not see this error message again.
    * Zsh will start quickly but prompt will jump down after initialization.

  - Disable instant prompt either by running p10k configure or by manually
    defining the following parameter:

      typeset -g POWERLEVEL9K_INSTANT_PROMPT=off

    * You will not see this error message again.
    * Zsh will start slowly.

  - Do nothing.

    * You will see this error message every time you start zsh.
    * Zsh will start quickly but prompt will jump down after initialization.

For details, see:
https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt

-- console output produced during zsh initialization follows --

nodenv: yarn: command not found

The `yarn' command exists in these Node versions:
  17.0.0
taemathtaemath

yarnが使えないので、設定した

$ which yarn
/Users/hogehoge/.anyenv/envs/nodenv/shims/yarn

# yarnを一旦削除
$ rm -rf /Users/hogehoge/.anyenv/envs/nodenv/shims/yarn

# 確認
$ which yarn
yarn not found

# npmから再インストール
$ npm install --global yarn

# zshを再起動してから確認
$ yarn --version
taemathtaemath

Bracket Lensと同様の機能

return {
  {
    "haringsrob/nvim_context_vt",
  },
}
taemathtaemath

snippetの整備

  • ~/.config/nvim直下に package.jsonを置く
  • 同じ場所 にsnippets/ ディレクトリを作成
    • ~/.config/nvim/snippets

でできた。

taemathtaemath

itermのフォントを変える

  • Hack Nerd Font Mono, italic にした
brew install font-hack-nerd-font