User Tools

Site Tools


neovim

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
neovim [2025/04/15 16:11] – [Copilot] dblumeneovim [2025/07/26 08:08] (current) – [Installation] dblume
Line 11: Line 11:
 [[https://github.com/cli/cli/blob/trunk/docs/install_linux.md#snap-do-not-use|GitHub recommends against snap for gh]], and in WSL2, although I had ''snap'', it didn't work, so I [[https://github.com/neovim/neovim/blob/master/INSTALL.md#install-from-download|downloaded the tarball]]. (If you click Linux, it'll download the tarball. Otherwise [[https://github.com/neovim/neovim/releases|scroll down and find/expand "Assets"]].) Then I extracted it into $HOME/.local/bin/. [[https://github.com/cli/cli/blob/trunk/docs/install_linux.md#snap-do-not-use|GitHub recommends against snap for gh]], and in WSL2, although I had ''snap'', it didn't work, so I [[https://github.com/neovim/neovim/blob/master/INSTALL.md#install-from-download|downloaded the tarball]]. (If you click Linux, it'll download the tarball. Otherwise [[https://github.com/neovim/neovim/releases|scroll down and find/expand "Assets"]].) Then I extracted it into $HOME/.local/bin/.
  
 +  uname -m  # x86_64
   cd ~/.local/bin/   cd ~/.local/bin/
-  wget https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz +  wget https://github.com/neovim/neovim/releases/download/stable/nvim-linux-x86_64.tar.gz 
-  tar -xvf nvim-linux64.tar.gz+  tar -xvf nvim-linux64.tar.gz.1
   ln -s nvim-linux64/bin/nvim nvim   ln -s nvim-linux64/bin/nvim nvim
  
Line 24: Line 25:
   - [[https://github.com/github/copilot.vim?tab=readme-ov-file|Install plugin]] (used ''--filter=blob:none'')   - [[https://github.com/github/copilot.vim?tab=readme-ov-file|Install plugin]] (used ''--filter=blob:none'')
     - ''%%git clone --filter=blob:none https://github.com/github/copilot.vim.git ~/.config/nvim/pack/github/start/copilot.vim%%''     - ''%%git clone --filter=blob:none https://github.com/github/copilot.vim.git ~/.config/nvim/pack/github/start/copilot.vim%%''
 +  - Assure you're logged in to GitHub with the profile you want to connect. The next step's setup will launch the browser.
 +  - Start nvim and run '':Copilot setup''
   - read [[https://docs.github.com/en/copilot/using-github-copilot/getting-started-with-github-copilot?tool=vimneovim#about-github-copilot-and-vimneovim|docs]].   - read [[https://docs.github.com/en/copilot/using-github-copilot/getting-started-with-github-copilot?tool=vimneovim#about-github-copilot-and-vimneovim|docs]].
    
Line 31: Line 34:
  
 <code bash> <code bash>
-# (Done as part of CoPilot installation) mkdir -p ~/.config/nvim/pack/copilotchat/start+mkdir -p ~/.config/nvim/pack/copilotchat/start
 cd ~/.config/nvim/pack/copilotchat/start cd ~/.config/nvim/pack/copilotchat/start
 # (Done as part of CoPilot installation) git clone --filter=blob:none --single-branch https://github.com/github/copilot.vim # (Done as part of CoPilot installation) git clone --filter=blob:none --single-branch https://github.com/github/copilot.vim
Line 37: Line 40:
 git clone --filter=blob:none --single-branch https://github.com/CopilotC-Nvim/CopilotChat.nvim git clone --filter=blob:none --single-branch https://github.com/CopilotC-Nvim/CopilotChat.nvim
 </code> </code>
 +
 +==== macOS tweak ====
  
 On macOS, I initially had trouble with diffs of the form ''[file:main.cpp](#file:main.cpp-context)'', so I edited [[https://github.com/CopilotC-Nvim/CopilotChat.nvim/blob/main/lua/CopilotChat/client.lua#L25|~/.config/nvim/pack/copilotchat/start/CopilotChat.nvim/lua/CopilotChat/client.lua:25]]. On macOS, I initially had trouble with diffs of the form ''[file:main.cpp](#file:main.cpp-context)'', so I edited [[https://github.com/CopilotC-Nvim/CopilotChat.nvim/blob/main/lua/CopilotChat/client.lua#L25|~/.config/nvim/pack/copilotchat/start/CopilotChat.nvim/lua/CopilotChat/client.lua:25]].
Line 43: Line 48:
 sed -i 's/(#file:%s-context)/(%s)/' ~/.config/nvim/pack/copilotchat/start/CopilotChat.nvim/lua/CopilotChat/client.lua sed -i 's/(#file:%s-context)/(%s)/' ~/.config/nvim/pack/copilotchat/start/CopilotChat.nvim/lua/CopilotChat/client.lua
 </code> </code>
 +
 +==== WSL tweak ====
 +
 +WSL sets ''$XDG_RUNTIME_DIR'' to a path that cannot be written to. So either:
 +
 +  - ''export XDG_RUNTIME_DIR=/tmp''
 +  - or modify plenary's curl.lua to not find it. (Mangle it.) (See ''sed'' below.)
 +  - or ''[[https://github.com/microsoft/WSL/issues/10846#issuecomment-1840548054|sudo chown 1000:1000 /mnt/wslg/run/user/1000]]'' (untested)
 +
 +<code bash>
 +sed -i 's/XDG_RUNTIME_DIR/DXB_HIDDEN_XDG_RUNTIME_DIR/' ~/.config/nvim/pack/copilotchat/start/plenary.nvim/lua/plenary/curl.lua
 +</code>
 +
 +==== Optional Settings ====
  
 Optional, [[https://github.com/CopilotC-Nvim/CopilotChat.nvim/wiki/Examples-and-Tips#markdown-rendering|MarkDown rendering]]: Optional, [[https://github.com/CopilotC-Nvim/CopilotChat.nvim/wiki/Examples-and-Tips#markdown-rendering|MarkDown rendering]]:
neovim.1744758698.txt.gz · Last modified: 2025/04/15 16:11 by dblume