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 [2024/04/01 22:45] – [taglist] dblumeneovim [2025/04/15 16:13] (current) – [Copilot Chat] dblume
Line 9: Line 9:
 The regular ''apt-get'' repo is too out-of-date. When 0.9.5 was stable, Ubuntu 20.04 was providing 0.3 or 0.4. The regular ''apt-get'' repo is too out-of-date. When 0.9.5 was stable, Ubuntu 20.04 was providing 0.3 or 0.4.
  
-I could use snap on my work (Ubuntu) and personal frame.work laptop computers to get 0.9.5. (However, [[https://github.com/cli/cli/blob/trunk/docs/install_linux.md#snap-do-not-use|GitHub recommends against snap for gh]], so maybe snap is problematic.) +[[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/.
- +
-  sudo snap install nvim --classic +
-  ln -s /snap/bin/nvim $HOME/.local/bin/nvim +
- +
-But 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/.+
  
   cd ~/.local/bin/   cd ~/.local/bin/
Line 30: Line 25:
     - ''%%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%%''
   - 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]].
-  +  
 +===== Copilot Chat ===== 
 + 
 +See [[https://github.com/CopilotC-Nvim/CopilotChat.nvim?tab=readme-ov-file#manual|Manual installation of CopilotChat]]. 
 + 
 +<code bash> 
 +mkdir -p ~/.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 
 +git clone --filter=blob:none --single-branch https://github.com/nvim-lua/plenary.nvim 
 +git clone --filter=blob:none --single-branch https://github.com/CopilotC-Nvim/CopilotChat.nvim 
 +</code> 
 + 
 +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]]. 
 + 
 +<code bash> 
 +sed -i 's/(#file:%s-context)/(%s)/' ~/.config/nvim/pack/copilotchat/start/CopilotChat.nvim/lua/CopilotChat/client.lua 
 +</code> 
 + 
 +Optional, [[https://github.com/CopilotC-Nvim/CopilotChat.nvim/wiki/Examples-and-Tips#markdown-rendering|MarkDown rendering]]: 
 + 
 + 
 +<code bash> 
 +git clone --filter=blob:none --single-branch https://github.com/nvim-treesitter/nvim-treesitter \ 
 +          ~/.config/nvim/pack/nvim-treesitter/start/ 
 +</code> 
 + 
 +Add ''require'nvim-treesitter.configs'.setup...'' to .config/nvim/init.vim. Test CopilotChat like this, with treesitter, but not render-markdown. 
 + 
 +See what you think of this first. (Rainbow parentheses may be gone. Might have to add something like [[https://github.com/HiPhish/rainbow-delimiters.nvim|rainbow-delimiters.nvim]]). 
 + 
 +<code bash> 
 +git clone --filter=blob:none --single-branch https://github.com/MeanderingProgrammer/render-markdown.nvim \ 
 +          ~/.config/nvim/pack/render-markdown.nvim/start/ 
 +</code>
 ===== taglist ===== ===== taglist =====
  
Line 40: Line 69:
  
   git clone --filter=blob:none -b v4.6 https://github.com/yegappan/taglist ~/.local/share/nvim/site/plugin/   git clone --filter=blob:none -b v4.6 https://github.com/yegappan/taglist ~/.local/share/nvim/site/plugin/
 +
 +===== cscope =====
 +
 +Cscope has been removed from neovim. If you want it back, install [[https://github.com/dhananjaylatkar/cscope_maps.nvim|dhananjaylatkar/cscope_maps.nvim]] into ''.config/nvim/pack/cscope_maps/start/''. (This //may// also work in ''~/.local/share/nvim/site/pack/cscope_maps/start/'', but you have to get the path right.)
 +
 +Your hierarchy would look something like:
 +<code>
 +~/.config/nvim/pack/cscope_maps/
 +└── start
 +    └── cscope_maps.nvim
 +        └── lua
 +            ├── cscope
 +            │   └── pickers
 +            └── utils
 +</code>
 +
 +Run the following commands:
 +
 +  mkdir -p ~/.config/nvim/pack/cscope_maps/start/
 +  cd ~/.config/nvim/pack/cscope_maps/start/
 +  git clone --filter=blob:none https://github.com/dhananjaylatkar/cscope_maps.nvim.git
 +
 +Then in your init.vim, add the following snippet:
 +
 +<file lua init.vim>
 +lua << EOF
 +  require('cscope_maps').setup({
 +    disable_maps = true, -- Mapping C-] to :Cstag <cword> worse than :tag <cword>
 +-- Alternatively, if we liked the mappings, then customise these two:
 +--    skip_input_prompt = true,
 +--    cscope = { skip_picker_for_single_result = true },
 +  })
 +EOF
 +</file>
 +
 +===== Mappings =====
 +
 +The easiest way to find out where a mapping came from is to run this command:
 +
 +    :verbose imap <key sequence>
  
neovim.1712036710.txt.gz · Last modified: 2024/04/01 22:45 by dblume