feat(neovide): add initial config files
This commit is contained in:
20
nvim-neovide/init.lua
Normal file
20
nvim-neovide/init.lua
Normal 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" })
|
||||||
11
nvim-neovide/lazy-lock.json
Normal file
11
nvim-neovide/lazy-lock.json
Normal 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" }
|
||||||
|
}
|
||||||
23
nvim-neovide/lua/config/lazy.lua
Normal file
23
nvim-neovide/lua/config/lazy.lua
Normal 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 },
|
||||||
|
})
|
||||||
22
nvim-neovide/lua/plugins/blink.lua
Normal file
22
nvim-neovide/lua/plugins/blink.lua
Normal 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" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
8
nvim-neovide/lua/plugins/catppuccin.lua
Normal file
8
nvim-neovide/lua/plugins/catppuccin.lua
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
return {
|
||||||
|
"catppuccin/nvim",
|
||||||
|
name = "catppuccin",
|
||||||
|
priority = 1000,
|
||||||
|
config = function()
|
||||||
|
vim.cmd("colorscheme catppuccin-mocha")
|
||||||
|
end,
|
||||||
|
}
|
||||||
26
nvim-neovide/lua/plugins/lsp.lua
Normal file
26
nvim-neovide/lua/plugins/lsp.lua
Normal 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,
|
||||||
|
}
|
||||||
14
nvim-neovide/lua/plugins/nvim-treesitter.lua
Normal file
14
nvim-neovide/lua/plugins/nvim-treesitter.lua
Normal 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,
|
||||||
|
}
|
||||||
12
nvim-neovide/lua/plugins/telescope.lua
Normal file
12
nvim-neovide/lua/plugins/telescope.lua
Normal 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,
|
||||||
|
}
|
||||||
6
nvim-neovide/lua/plugins/which-key.lua
Normal file
6
nvim-neovide/lua/plugins/which-key.lua
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
return {
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = {},
|
||||||
|
keys = {},
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user