Published on

懒人的neovim的配置笔记

安装neovim

# ubuntu
sudo apt-get install neovim

# macos
brew install neovim

配置

拉取配置仓库

git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim

首次运行安装

nvim

使用tokyonight黑色主题时的坑

-- 编辑~/.config/nvim/init.lua, 在末尾追加配置
vim.opt.background = "dark"

github copilot

-- 编辑~/.config/nvim/init.lua, 在lazy段中添加配置
{
  "zbirenbaum/copilot.lua",
  cmd = "Copilot",
  build = ":Copilot auth",
  event = "BufReadPost",
  opts = {
    suggestion = {
      enabled = not vim.g.ai_cmp,
      auto_trigger = true,
      hide_during_completion = vim.g.ai_cmp,
      keymap = {
        accept = "<S-TAB>", -- custom keymap to accept suggestion
        next = "<M-]>",
        prev = "<M-[>",
      },
    },
    panel = { enabled = false },
    filetypes = {
      markdown = true,
      help = true,
    },
  },
}

使用

常用快捷键

- space sf # search file
- gd # go to defination

查看keymap

:Telescope keymaps

Mason

:Mason

shortcuts

shortcutmodeUSAGE
%normalnew file name
dnormalnew directory name
:socmdsource load-vim-script
:help key-notationcmdview key mapping

参考