Change syntax conviention fisrt part

This commit is contained in:
CRy386i 2026-05-02 17:24:43 +02:00
parent daa989d24a
commit 433fcafca9
9 changed files with 109 additions and 108 deletions

View file

@ -1,17 +1,17 @@
-- Bootstrap lazy.nvim -- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git" local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({ vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" }, { "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" }, { out, "WarningMsg" },
{ "\nPress any key to exit..." }, { "\nPress any key to exit..." },
}, true, {}) }, true, {})
vim.fn.getchar() vim.fn.getchar()
os.exit(1) os.exit(1)
end end
end end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
@ -23,10 +23,10 @@ vim.g.maplocalleader = "\\"
-- Setup lazy.nvim -- Setup lazy.nvim
require("lazy").setup({ require("lazy").setup({
spec = { spec = {
-- import your plugins -- import your plugins
{ import = "plugins" }, { import = "plugins" },
}, },
-- automatically check for plugin updates -- automatically check for plugin updates
checker = { enabled = false }, checker = { enabled = false },
}) })

View file

@ -1,2 +1,4 @@
All plugins what looks like a pure library (as a plenary.nvim) should be use in "depenedencies" filed and with "lazy = true". All plugins what looks like a pure library (as a plenary.nvim) should be use in "depenedencies" filed and with "lazy = true".
Main theme should be load during startup (lazy = false) and high priority. Main theme should be load during startup (lazy = false) and high priority.
If plugin required a "require("nvim-treesitter.configs").setup(opts)" we can use "main = 'nvim-treesitter.configs'" intead
will use it implicity in "config" and "opts" blocks.

View file

@ -1,9 +1,9 @@
return { return {
'stevearc/aerial.nvim', "stevearc/aerial.nvim",
opts = {}, opts = {},
-- Optional dependencies -- Optional dependencies
dependencies = { dependencies = {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
"nvim-tree/nvim-web-devicons" "nvim-tree/nvim-web-devicons"
}, },
} }

View file

@ -1,11 +1,9 @@
return { return {
{ "ellisonleao/gruvbox.nvim",
'ellisonleao/gruvbox.nvim', lazy = false,
lazy = false, priority = 1000,
priority = 1000, config = function()
config = function() vim.cmd([[colorscheme gruvbox]])
vim.cmd([[colorscheme gruvbox]]) end,
end, opts = { style = "dark" }
opts = { style = 'dark' } }
},
} -- Main theme should be load during startup.

View file

@ -1,13 +1,14 @@
return { 'ej-shafran/compile-mode.nvim', return {
version = '^5.13.0', "ej-shafran/compile-mode.nvim",
version = "^5.13.0",
dependencies = { dependencies = {
'nvim-lua/plenary.nvim', lazy = true, "nvim-lua/plenary.nvim", lazy = true,
'm00qek/baleia.nvim' "m00qek/baleia.nvim"
}, },
config = function() config = function()
---@type CompileModeOpts ---@type CompileModeOpts
vim.g.compile_mode = { vim.g.compile_mode = {
default_command = 'cmake --build build', default_command = "cmake --build build",
input_word_completion = true, input_word_completion = true,
baleia_setup = true, baleia_setup = true,
bang_expansion = true, bang_expansion = true,

View file

@ -1,25 +1,25 @@
return { return {
'hrsh7th/nvim-cmp', "hrsh7th/nvim-cmp",
dependencies = { dependencies = {
'neovim/nvim-lspconfig', "neovim/nvim-lspconfig",
'hrsh7th/cmp-nvim-lsp', "hrsh7th/cmp-nvim-lsp",
'petertriho/cmp-git', "petertriho/cmp-git",
'hrsh7th/cmp-buffer', "hrsh7th/cmp-buffer",
'hrsh7th/cmp-path', "hrsh7th/cmp-path",
'hrsh7th/cmp-cmdline', "hrsh7th/cmp-cmdline",
'hrsh7th/cmp-vsnip', "hrsh7th/cmp-vsnip",
'hrsh7th/vim-vsnip', "hrsh7th/vim-vsnip",
'hrsh7th/cmp-nvim-lsp-signature-help', "hrsh7th/cmp-nvim-lsp-signature-help",
}, },
config = function() config = function()
local cmp = require'cmp' local cmp = require"cmp"
cmp.setup({ cmp.setup({
snippet = { snippet = {
-- REQUIRED - you must specify a snippet engine -- REQUIRED - you must specify a snippet engine
expand = function(args) expand = function(args)
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users. -- require("luasnip").lsp_expand(args.body) -- For `luasnip` users.
-- require('snippy').expand_snippet(args.body) -- For `snippy` users. -- require("snippy").expand_snippet(args.body) -- For `snippy` users.
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
end, end,
}, },
@ -28,56 +28,56 @@ return {
-- documentation = cmp.config.window.bordered(), -- documentation = cmp.config.window.bordered(),
}, },
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4), ["<C-b>"] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4), ["<C-f>"] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(), ["<C-Space>"] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(), ["<C-e>"] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. ["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}), }),
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = 'nvim_lsp' }, { name = "nvim_lsp" },
{ name = 'vsnip' }, -- For vsnip users. { name = "vsnip" }, -- For vsnip users.
-- { name = 'luasnip' }, -- For luasnip users. -- { name = "luasnip" }, -- For luasnip users.
-- { name = 'ultisnips' }, -- For ultisnips users. -- { name = "ultisnips" }, -- For ultisnips users.
-- { name = 'snippy' }, -- For snippy users. -- { name = "snippy" }, -- For snippy users.
}, { }, {
{ name = 'buffer' }, { name = "buffer" },
{ name = 'nvim_lsp_signature_help' }, { name = "nvim_lsp_signature_help" },
}) })
}) })
-- Set configuration for specific filetype. -- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', { cmp.setup.filetype("gitcommit", {
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = 'git' }, { name = "git" },
}, { }, {
{ name = 'buffer' }, { name = "buffer" },
}) })
}) })
cmp.setup.filetype('cmake', { cmp.setup.filetype("cmake", {
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = 'cmake', "CMakeLists.txt" }, { name = "cmake", "CMakeLists.txt" },
}, { }, {
{ name = 'buffer' }, { name = "buffer" },
}) })
}) })
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won"t work anymore).
cmp.setup.cmdline({ '/', '?' }, { cmp.setup.cmdline({ "/", "?" }, {
mapping = cmp.mapping.preset.cmdline(), mapping = cmp.mapping.preset.cmdline(),
sources = { sources = {
{ name = 'buffer' } { name = "buffer" }
} }
}) })
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). -- Use cmdline & path source for ":" (if you enabled `native_menu`, this won"t work anymore).
cmp.setup.cmdline(':', { cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(), mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = 'path' } { name = "path" }
}, { }, {
{ name = 'cmdline' } { name = "cmdline" }
}) })
}) })
end, end,

View file

@ -1,9 +1,9 @@
return { return {
'neovim/nvim-lspconfig', "neovim/nvim-lspconfig",
config = function() config = function()
-- Setup language servers -- Setup language servers
-- Server-specific settings. See `:help lspconfig-all` -- Server-specific settings. See `:help lspconfig-all`
vim.lsp.config('*', { vim.lsp.config("*", {
capabilities = { capabilities = {
textDocument = { textDocument = {
semanticTokens = { semanticTokens = {
@ -11,47 +11,47 @@ return {
} }
} }
}, },
root_markers = { '.git' }, root_markers = { ".git" },
}) })
vim.lsp.config('clangd', { vim.lsp.config("clangd", {
cmd = { 'clangd', '--background-index', '--clang-tidy', '--log=verbose', '--header-insertion=never' }, cmd = { "clangd", "--background-index", "--clang-tidy", "--log=verbose", "--header-insertion=never" },
filetypes = { 'c', 'cpp' } filetypes = { "c", "cpp" }
}) })
vim.lsp.enable('clangd') vim.lsp.enable("clangd")
-- Global mappings. -- Global mappings.
-- See `:help vim.diagnostic.*` for documentation on any of the below functions -- See `:help vim.diagnostic.*` for documentation on any of the below functions
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float) vim.keymap.set("n", "<space>e", vim.diagnostic.open_float)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev) vim.keymap.set("n", "[d", vim.diagnostic.goto_prev)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next) vim.keymap.set("n", "]d", vim.diagnostic.goto_next)
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist) vim.keymap.set("n", "<space>q", vim.diagnostic.setloclist)
-- Use LspAttach autocommand to only map the following keys -- Use LspAttach autocommand to only map the following keys
-- after the language server attaches to the current buffer -- after the language server attaches to the current buffer
vim.api.nvim_create_autocmd('LspAttach', { vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup('UserLspConfig', {}), group = vim.api.nvim_create_augroup("UserLspConfig", {}),
callback = function(ev) callback = function(ev)
-- Enable completion triggered by <c-x><c-o> -- Enable completion triggered by <c-x><c-o>
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc' vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc"
-- Buffer local mappings. -- Buffer local mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions -- See `:help vim.lsp.*` for documentation on any of the below functions
local opts = { buffer = ev.buf } local opts = { buffer = ev.buf }
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts) vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts) vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts)
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts) vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help, opts)
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts) vim.keymap.set("n", "<space>wa", vim.lsp.buf.add_workspace_folder, opts)
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts) vim.keymap.set("n", "<space>wr", vim.lsp.buf.remove_workspace_folder, opts)
vim.keymap.set('n', '<space>wl', function() vim.keymap.set("n", "<space>wl", function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders())) print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, opts) end, opts)
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts) vim.keymap.set("n", "<space>D", vim.lsp.buf.type_definition, opts)
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts) vim.keymap.set("n", "<space>rn", vim.lsp.buf.rename, opts)
vim.keymap.set({ 'n', 'v' }, '<space>ca', vim.lsp.buf.code_action, opts) vim.keymap.set({ "n", "v" }, "<space>ca", vim.lsp.buf.code_action, opts)
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts) vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
vim.keymap.set('n', '<space>f', function() vim.keymap.set("n", "<space>f", function()
vim.lsp.buf.format { async = true } vim.lsp.buf.format { async = true }
end, opts) end, opts)
end, end,

View file

@ -1,9 +1,9 @@
return { return {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
build = ":TSUpdate", build = ":TSUpdate",
main = 'nvim-treesitter.configs', main = "nvim-treesitter.configs",
opts = { opts = {
ensure_installed = { 'c', 'cpp', 'lua' }, ensure_installed = { "c", "cpp", "lua" },
highlight = { enable = true, } highlight = { enable = true, }
} }
} }

View file

@ -1 +1 @@
return { 'tpope/vim-commentary' } return { "tpope/vim-commentary" }