Skip to content
Charles Chiu edited this page Jun 25, 2024 · 52 revisions

This page is not frequently updated, so please also check issues opened and closed to find answer.

How to uninstall all plugins?

rm -fr ~/.local/share/nvim/site/lazy/*

ref: https://github.com/ayamir/nvimdots/discussions/1307#discussioncomment-9869904

Telescope colorscheme preview not works

https://github.com/ayamir/nvimdots/pull/1085#issuecomment-1833612011

nvim-qt command not showing

lazy.nvim will reset rtp for better performance. In this case, nvim-qt's rtp got reset, so it's not shown in the command candidate. Add vim.api.nvim_command("set runtimepath+=" .. global.home .. "/path/to/nvim-qt/runtime") after require("core.pack") in core/init.lua to add the nvim-qt rtp back.

Clipboard for WSL2 users

Please refer to the FAQ and add win32yank.exe to your path.

We don't use clip.exe to copy because it can't handle UTF-8 string correctly, details: https://github.com/ayamir/nvimdots/issues/762

LSP servers don't autostart.

Please check this file to make sure your directory can be detected as a working directory.

For example (gopls):

Your root directory need a go.mod and your .go file need to be created first. Then LSP will autostart when you edit .go file next time.

Copilot setup.

Make sure your github account is signed up for copilot.

Then use Copilot auth command to setup.

Add snippets

I just copy friendly-snippets's package.json to snips directory.

So you need add your snippets follow these steps:

  1. Check the language's snippet file place defined in package.json.

go.json place

  1. So create snippets/go.json and fill content like this:

touch snippets/go.json

go.json content

  1. Finally, check the new snippets!

result

LSP server start failed

You need to use the latest LTS version (such as v16.13.2) to make sure LSP installed from npm works normally.

Relevant debug info is located in ~/.cache/nvim/lsp.log.

You can use tail ~/.cache/nvim/lsp.log to check latest error info.

Debug for c/cpp

Make sure first use g++ or clang++ with -g flag to get executable a.out file.

Change Dashboard Startup Image

set dashboard_image in lua/user/settings.lua, i.e.:

settings["dashboard_image"] = {
	-- your ascii image
}

Remove nvimdots

For *nix:

rm -rf ~/.config/nvim
rm -rf ~/.local/share/nvim

For Windows:

Delete these two folders: ~\AppData\Local\nvim and ~\AppData\Local\nvim-data.

Issues while using clangd (C/C++ LSP)

Make sure to have the following tool available in $PATH

  • clang++
  • clang
  • gcc
  • g++

MacOS/Unix

For MacOS users, this can often be achieved by installing LLVM (it comes with the whole suite):

brew install llvm

If you are using nix-darwin, then add pkgs.llvm to environment.systemPackages:

Example darwin-configuration.nix
{ config, pkgs, lib, ... }:

let
  inherit (pkgs) callPackage fetchFromGitHub;
  inherit (builtins) fetchTarball;

  homeDir = builtins.getEnv "HOME";

in
{
  # auto gc
  nix = {
    gc = {
      automatic = true;
      options = "--max-freed $((25 * 1024**3 - 1024 * $(df -P -k /nix/store | tail -n 1 | awk '{ print $4 }')))";
    };
    package = pkgs.nixUnstable;

    # enable flake and experimental command
    extraOptions = ''
      auto-optimise-store = true
      experimental-features = nix-command flakes
      keep-outputs = true
      keep-derivations = true
      trusted-users = root ${username}
    '' + lib.optionalString (pkgs.system == "aarch64-darwin") ''
      extra-platforms = x86_64-darwin aarch64-darwin
    '';
  };

  environment = {
    systemPackages = with pkgs; [
    llvmPackages
    ];

    # add shell installed by nix to /etc/shells
    shells = with pkgs; [
      zsh
    ];

    # Setup environment variables to pass to zshrc
    variables = {
      PATH = "${pkgs.llvmPackages.out}/bin:$PATH";
    };
  };

  services = {
    # Auto upgrade nix package and the daemon service.
    nix-daemon.enable = true;
  };

}
Clone this wiki locally