a. sudo apt install npm lua-luv-dev lua-lpeg \
libunibilium-dev libutf8proc-dev libluajit-5.1-dev -y
b. 其它的,缺什麼補什麼
lua, tree-sitter
fzf, luarocks(不裝,Checkhealth裡會有WARNING),但它不支援lua 5.5
c. 符號亂碼的話,裝Nerd Font字型:
nerdfonts
下載:
JetBrainsMono Nerd Font
安裝:
font
Terminal:
要選有Nerd Font的字型,所有符號就能正常下載
ex: JetBrainsMono Nerd Font
LazyVim
安裝:
How to Install
Commands for LazyVIM
:checkhealth
:checkhealth mason
:Mason //初始化 Mason.nvim,通過 mason 可以自動裝各種LSP
LazyVim Extras, 剛進去nvim時,壓一下x
/home/ubuntu/.config/nvim/lua/config/options.lua
-- Tab
vim.opt.tabstop = 4 -- number of visual spaces per TAB
vim.opt.softtabstop = 4 -- number of spacesin tab when editing
vim.opt.shiftwidth = 4 -- insert 4 spaces on a tab
vim.opt.expandtab = true -- tabs are spaces, mainly because of python
-- avante.nvim, views can only be fully collapsed with the global statusline
vim.opt.laststatus = 3
vim.bo.modifiable = false //Some plugins or custom configurations might set certain buffers as non-modifiable. Look for settings like:
Quick keyboard map, <leader>:space key
Switch buffer: ]b, [b
Searching for Keywords: <leader> + /
- Trace code compile_commands.json, for clangd //A compilation database describes compile commands for a codebase
放在根專案下
a. Makefie:
$ sudo apt install bear
$ bear -- make
b. CMake:
$ cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ..
ex:
.
├── compile_commands.json
├── include
│ └── hello.h
├── Makefile
└── src
├── hello.c
└── main.c
go to implementation(gI),它只會回應:[Fzf-lua] No implementations foundfor kernel
$ make menuconfig
$ make CC=clang
$ python3 ./scripts/clang-tools/gen_compile_commands.py
- avante.nvim Install and Sync
Create or open ~/.config/nvim/lua/plugins/avante.lua and add this:
return {
"yetone/avante.nvim",
event = "VeryLazy",
lazy = false,
version = false, -- Set this to "*" to always pull the latest release version, or set it to false to update to the latest code changes.
opts = {
-- add any opts here
provider = "gemini",
gemini = {
model = "gemini-2.0-flash", --see more modles
timeout = 30000, -- timeout in milliseconds
temperature = 0, -- adjust if needed
max_tokens = 4096,
},
},
-- if you want to build from source then do `make BUILD_FROM_SOURCE=true`
build = "make",
-- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows
dependencies = {
"stevearc/dressing.nvim",
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
--- The below dependencies are optional,
"echasnovski/mini.pick", -- for file_selector provider mini.pick
"nvim-telescope/telescope.nvim", -- for file_selector provider telescope
"hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions
"ibhagwan/fzf-lua", -- for file_selector provider fzf
"nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons
"zbirenbaum/copilot.lua", -- for providers='copilot'
{
-- support for image pasting
"HakonHarnes/img-clip.nvim",
event = "VeryLazy",
opts = {
-- recommended settings
default = {
embed_image_as_base64 = false,
prompt_for_file_name = false,
drag_and_drop = {
insert_mode = true,
},
-- required for Windows users
use_absolute_path = true,
},
},
},
{
-- Make sure to set this up properly if you have lazy=true
"MeanderingProgrammer/render-markdown.nvim",
opts = {
file_types = { "markdown", "Avante" },
},
ft = { "markdown", "Avante" },
},
},
}
Usage:(support AI list:~/.local/share/nvim/lazy/avante.nvim/lua/avante/providers/)
1. The sidebar will be divided into 3 sections: Ask, File Name, and Search Results.
Use the <tab> key to switch.
2. <leader>a //show the list in the menu
3. $ export GEMINI_API_KEY=your_key
CMD:
1. AvanteClear //Clear history and reload nvim manually, if "leader a r" didn't work.
- 內建bookmark
Delete: :delmarks a-z or :delmarks!
ref:1. keymaps
2. 使用LazyVim将Neovim打造成强大IDE(常用快捷键)
3. gemini.nvim
沒有留言:
張貼留言