feat(neovide): add initial config files

This commit is contained in:
2025-10-15 03:31:23 +02:00
committed by GitHub
parent ca9980533b
commit 19b47322e1
9 changed files with 142 additions and 0 deletions

20
nvim-neovide/init.lua Normal file
View File

@@ -0,0 +1,20 @@
require("config.lazy")
vim.opt.clipboard = 'unnamedplus'
vim.opt.expandtab = false
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.softtabstop = 4
vim.opt.relativenumber = false
vim.opt.number = true
vim.opt.termguicolors = true
--[[
vim.keymap.set("n", "<leader>F", function()
require("conform").format({ async = true })
end, { desc = "Format file" })
]]
vim.keymap.set("n", "<leader>n", ":BufferLineCycleNext<CR>", { desc = "Go to the next buffer" })
vim.keymap.set("n", "<leader>b", ":BufferLineCyclePrev<CR>", { desc = "Go to the previous buffer" })
vim.keymap.set("n", "<leader>q", ":bd<CR>", { desc = "Close current buffer" })

View File

@@ -0,0 +1,11 @@
{
"blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" },
"catppuccin": { "branch": "main", "commit": "af58927c55c9f3272c940ff02b3cee94a1249f26" },
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
"lazy.nvim": { "branch": "main", "commit": "1ea3c4085785f460fb0e46d2fe1ee895f5f9e7c1" },
"nvim-lspconfig": { "branch": "master", "commit": "ac98db2f9f06a56498ec890a96928774eae412c3" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"which-key.nvim": { "branch": "main", "commit": "b4177e3eaf15fe5eb8357ebac2286d488be1ed00" }
}

View File

@@ -0,0 +1,23 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
require("lazy").setup({
spec = {
{ import = "plugins" },
},
install = { colorscheme = { "catppuccin-mocha" } },
checker = { enabled = true },
})

View File

@@ -0,0 +1,22 @@
return {
"saghen/blink.cmp",
dependencies = "rafamadriz/friendly-snippets",
version = "*",
opts = {
keymap = {
preset = "default",
["<C-space>"] = { "show", "show_documentation", "hide_documentation" },
["<C-e>"] = { "hide" },
["<CR>"] = { "accept", "fallback" },
["<Tab>"] = { "select_next", "fallback" },
["<S-Tab>"] = { "select_prev", "fallback" },
},
appearance = {
use_nvim_cmp_as_default = true,
nerd_font_variant = "mono",
},
sources = {
default = { "lsp", "path", "snippets", "buffer" },
},
},
}

View File

@@ -0,0 +1,8 @@
return {
"catppuccin/nvim",
name = "catppuccin",
priority = 1000,
config = function()
vim.cmd("colorscheme catppuccin-mocha")
end,
}

View File

@@ -0,0 +1,26 @@
return {
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
dependencies = { "saghen/blink.cmp" },
config = function()
local capabilities = require("blink.cmp").get_lsp_capabilities()
vim.lsp.config["clangd"] = {
cmd = { "clangd" },
filetypes = { "c", "cpp" },
capabilities = capabilities,
}
vim.lsp.enable("clangd")
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(args)
local opts = { buffer = args.buf }
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
vim.keymap.set("n", "<leader>F", vim.lsp.buf.format, opts)
end,
})
end,
}

View File

@@ -0,0 +1,14 @@
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
local configs = require("nvim-treesitter.configs")
configs.setup({
ensure_installed = { "c", "lua", "vim", "vimdoc", "markdown" },
sync_install = false,
highlight = { enable = true },
indent = { enable = true },
})
end,
}

View File

@@ -0,0 +1,12 @@
return {
"nvim-telescope/telescope.nvim",
tag = "0.1.8",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
local builtin = require("telescope.builtin")
vim.keymap.set("n", "<leader>ff", builtin.find_files, { desc = "Find files" })
vim.keymap.set("n", "<leader>fg", builtin.live_grep, { desc = "Live grep files" })
vim.keymap.set("n", "<leader>fb", builtin.buffers, { desc = "Find buffers" })
vim.keymap.set("n", "<leader>fh", builtin.help_tags, { desc = "Help tags" })
end,
}

View File

@@ -0,0 +1,6 @@
return {
"folke/which-key.nvim",
event = "VeryLazy",
opts = {},
keys = {},
}