first commit

This commit is contained in:
2025-10-07 09:26:47 +03:00
commit 534141e40a
91 changed files with 3631 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
# AGENTS.md - Конфигурация NVIM
## Общее описание
Отвечать на русском языке.
Работать только с директорией ./lua/antoxa

View File

@@ -0,0 +1 @@
require('antoxa')

View File

@@ -0,0 +1,23 @@
{
"LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" },
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
"cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" },
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
"lazy.nvim": { "branch": "main", "commit": "59334064f8604ca073791c25dcc5c9698865406e" },
"lspkind.nvim": { "branch": "master", "commit": "3ddd1b4edefa425fda5a9f95a4f25578727c0bb3" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "6bdb14f230de0904229ec367b410fb817e59b072" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" },
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
"neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" },
"nightfox.nvim": { "branch": "main", "commit": "ba47d4b4c5ec308718641ba7402c143836f35aa9" },
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
"nvim-lsp-file-operations": { "branch": "master", "commit": "9744b738183a5adca0f916527922078a965515ed" },
"nvim-lspconfig": { "branch": "master", "commit": "e688b486fe9291f151eae7e5c0b5a5c4ef980847" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"opencode.nvim": { "branch": "main", "commit": "8e01fd796da438b03ff502c2105abb458d81d364" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"snacks.nvim": { "branch": "main", "commit": "bfe8c26dbd83f7c4fbc222787552e29b4eccfcc0" },
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }
}

View File

@@ -0,0 +1,2 @@
require('antoxa.core.options')
require('antoxa.core.keymap')

View File

@@ -0,0 +1,18 @@
vim.g.mapleader = ' '
-- Mappings tabs.
vim.keymap.set('n', '<C-h>', ':-tabmove<CR>')
vim.keymap.set('n', '<C-l>', ':+tabmove<CR>')
-- Mappings buffers.
vim.keymap.set('n', '<leader>k', ':bn<CR>')
vim.keymap.set('n', '<leader>j', ':bp<CR>')
-- Move cursour vertical.
vim.keymap.set('n', '<C-d>', '<C-d>zz')
-- Diagnostic keymaps.
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float)
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist)

View File

@@ -0,0 +1,45 @@
-- Encoding.
vim.scriptencoding = 'utf-8'
vim.opt.encoding = 'utf-8'
vim.opt.fileencoding = 'utf-8'
-- Backups.
vim.opt.backup = false
vim.opt.swapfile = false
-- Lines.
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.colorcolumn = '80'
vim.opt.signcolumn = 'yes'
vim.opt.cursorline = true
vim.opt.guicursor = ''
vim.opt.wrap = false
-- Tabs.
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
-- Search
vim.opt.ignorecase = true
vim.opt.smartcase = true
-- View.
vim.opt.termguicolors = true
-- vim.opt.background = "dark"
-- vim.opt.splitright = true
-- vim.opt.splitbelow = true
-- Explorer style tree
-- vim.g.netrw_liststyle = 3
-- Etc.
vim.opt.mouse = ''
vim.opt.clipboard:append('unnamedplus')
vim.opt.list = true
vim.opt.listchars:append 'tab:┊ '
-- vim.opt.listchars:append 'space:·'
-- vim.opt.listchars:append 'eol:↴'
-- vim.opt.backspace = 'indent,eol,start'

View File

@@ -0,0 +1,2 @@
require('antoxa.core')
require('antoxa.lazy')

View File

@@ -0,0 +1,36 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
local out = vim.fn.system({ 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ 'Failed to clone lazy.nvim:\n', 'ErrorMsg' },
{ out, 'WarningMsg' },
{ '\nPress any key to exit...' },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
-- Make sure to setup `mapleader` and `maplocalleader` before
-- loading lazy.nvim so that mappings are correct.
-- This is also a good place to setup other settings (vim.opt)
-- vim.g.mapleader = ' '
-- vim.g.maplocalleader = '\\'
-- Setup lazy.nvim
require('lazy').setup({
spec = {
-- import your plugins
{ import = 'antoxa.plugins' },
{ import = 'antoxa.plugins.lsp' }
},
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { 'habamax' } },
-- automatically check for plugin updates
checker = { enabled = true },
})

View File

@@ -0,0 +1,150 @@
return {
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"hrsh7th/cmp-nvim-lsp",
{ "antosha417/nvim-lsp-file-operations", config = true },
{ "folke/neodev.nvim", opts = {} },
},
config = function()
-- import cmp-nvim-lsp plugin
local cmp_nvim_lsp = require("cmp_nvim_lsp")
local keymap = vim.keymap -- for conciseness
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
callback = function(ev)
-- Buffer local mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local opts = { buffer = ev.buf, silent = true }
-- set keybinds
opts.desc = "Show LSP references"
keymap.set("n", "gR", "<cmd>Telescope lsp_references<CR>", opts) -- show definition, references
opts.desc = "Go to declaration"
keymap.set("n", "gD", vim.lsp.buf.declaration, opts) -- go to declaration
opts.desc = "Show LSP definitions"
keymap.set("n", "gd", "<cmd>Telescope lsp_definitions<CR>", opts) -- show lsp definitions
opts.desc = "Show LSP implementations"
keymap.set("n", "gi", "<cmd>Telescope lsp_implementations<CR>", opts) -- show lsp implementations
-- opts.desc = "Show LSP type definitions"
-- keymap.set("n", "gt", "<cmd>Telescope lsp_type_definitions<CR>", opts) -- show lsp type definitions
opts.desc = "See available code actions"
keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts) -- see available code actions, in visual mode will apply to selection
opts.desc = "Smart rename"
keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts) -- smart rename
opts.desc = "Show buffer diagnostics"
keymap.set("n", "<leader>D", "<cmd>Telescope diagnostics bufnr=0<CR>", opts) -- show diagnostics for file
opts.desc = "Show line diagnostics"
keymap.set("n", "<leader>d", vim.diagnostic.open_float, opts) -- show diagnostics for line
-- opts.desc = "Go to previous diagnostic"
-- keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) -- jump to previous diagnostic in buffer
--
-- opts.desc = "Go to next diagnostic"
-- keymap.set("n", "]d", vim.diagnostic.goto_next, opts) -- jump to next diagnostic in buffer
opts.desc = "Show documentation for what is under cursor"
keymap.set("n", "K", vim.lsp.buf.hover, opts) -- show documentation for what is under cursor
-- opts.desc = "Restart LSP"
-- keymap.set("n", "<leader>rs", ":LspRestart<CR>", opts) -- mapping to restart lsp if necessary
end,
})
-- used to enable autocompletion (assign to every lsp server config)
local capabilities = cmp_nvim_lsp.default_capabilities()
-- vim.diagnostic.config({
-- signs = {
-- text = {
-- [vim.diagnostic.severity.ERROR] = " ",
-- [vim.diagnostic.severity.WARN] = " ",
-- [vim.diagnostic.severity.HINT] = "󰠠 ",
-- [vim.diagnostic.severity.INFO] = " ",
-- },
-- },
-- })
vim.lsp.config("*", {
capabilities = capabilities,
})
vim.lsp.config("lua_ls", {
settings = {
Lua = {
-- make the language server recognize "vim" global
diagnostics = {
globals = { "vim" },
},
completion = {
callSnippet = "Replace",
},
},
},
})
vim.lsp.config('ts_ls', {
init_options = {
plugins = {
{
name = '@vue/typescript-plugin',
location = '/home/antoxa/.nvm/versions/node/v22.20.0/lib/node_modules/@vue/typescript-plugin',
languages = { 'vue' }
}
}
},
settings = {
typescript = {
tsserver = {
useSyntaxServer = false,
},
inlayHints = {
includeInlayParameterNameHints = 'all',
includeInlayParameterNameHintsWhenArgumentMatchesName = true,
includeInlayFunctionParameterTypeHints = true,
includeInlayVariableTypeHints = true,
includeInlayVariableTypeHintsWhenTypeMatchesName = true,
includeInlayPropertyDeclarationTypeHints = true,
includeInlayFunctionLikeReturnTypeHints = true,
includeInlayEnumMemberValueHints = true,
},
},
},
filetypes = { 'javascript', 'typescript', 'vue' }
})
-- vim.lsp.config("svelte", {
-- on_attach = function(client, bufnr)
-- vim.api.nvim_create_autocmd("BufWritePost", {
-- pattern = { "*.js", "*.ts" },
-- callback = function(ctx)
-- -- Here use ctx.match instead of ctx.file
-- client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.match })
-- end,
-- })
-- end,
-- })
vim.lsp.config("graphql", {
filetypes = { "graphql", "gql", "svelte", "typescriptreact", "javascriptreact" },
})
vim.lsp.config("emmet_ls", {
filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "svelte" },
})
-- vim.lsp.config("eslint", {
-- filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "svelte" },
-- })
end
}

View File

@@ -0,0 +1,57 @@
return {
"williamboman/mason.nvim",
dependencies = {
"williamboman/mason-lspconfig.nvim",
"WhoIsSethDaniel/mason-tool-installer.nvim",
},
config = function()
-- import mason
local mason = require("mason")
-- import mason-lspconfig
local mason_lspconfig = require("mason-lspconfig")
local mason_tool_installer = require("mason-tool-installer")
-- enable mason and configure icons
mason.setup({
-- ui = {
-- icons = {
-- package_installed = "✓",
-- package_pending = "➜",
-- package_uninstalled = "✗",
-- },
-- },
})
mason_lspconfig.setup({
-- list of servers for mason to install
ensure_installed = {
"ts_ls",
"html",
"cssls",
"tailwindcss",
"lua_ls",
"graphql",
"emmet_ls",
"clangd",
-- "svelte",
-- "prismals",
-- "pyright",
-- "eslint",
},
})
mason_tool_installer.setup({
ensure_installed = {
"prettier", -- prettier formatter
"stylua", -- lua formatter
"clang-format", -- c/c++ formatter
-- "isort", -- python formatter
-- "black", -- python formatter
-- "pylint",
-- "eslint_d",
},
})
end,
}

View File

@@ -0,0 +1,7 @@
return {
'EdenEast/nightfox.nvim',
priority = 1000,
config = function()
vim.cmd.colorscheme('nightfox')
end
}

View File

@@ -0,0 +1,63 @@
return {
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-buffer", -- source for text in buffer
"hrsh7th/cmp-path", -- source for file system paths
{
"L3MON4D3/LuaSnip",
-- follow latest release.
version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
-- install jsregexp (optional!).
build = "make install_jsregexp",
},
"saadparwaiz1/cmp_luasnip", -- for autocompletion
"rafamadriz/friendly-snippets", -- useful snippets
"onsails/lspkind.nvim", -- vs-code like pictograms
},
config = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
local lspkind = require("lspkind")
-- loads vscode style snippets from installed plugins (e.g. friendly-snippets)
require("luasnip.loaders.from_vscode").lazy_load()
cmp.setup({
completion = {
completeopt = "menu,menuone,preview,noselect",
},
snippet = { -- configure how nvim-cmp interacts with snippet engine
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
-- ["<C-k>"] = cmp.mapping.select_prev_item(), -- previous suggestion
-- ["<C-j>"] = cmp.mapping.select_next_item(), -- next suggestion
-- ["<C-b>"] = cmp.mapping.scroll_docs(-4),
-- ["<C-f>"] = cmp.mapping.scroll_docs(4),
-- ["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions
-- ["<C-e>"] = cmp.mapping.abort(), -- close completion window
["<CR>"] = cmp.mapping.confirm({ select = false }),
}),
-- sources for autocompletion
sources = cmp.config.sources({
{ name = "nvim_lsp"},
{ name = "luasnip" }, -- snippets
{ name = "buffer" }, -- text within current buffer
{ name = "path" }, -- file system paths
}),
-- configure lspkind for vs-code like pictograms in completion menu
formatting = {
format = lspkind.cmp_format({
maxwidth = 50,
ellipsis_char = "...",
}),
},
})
end
}

View File

@@ -0,0 +1,28 @@
return {
'NickvanDyke/opencode.nvim',
dependencies = {
-- Recommended for better prompt input, and required to use `opencode.nvim`'s embedded terminal — otherwise optional
{ 'folke/snacks.nvim', opts = { input = { enabled = true } } },
},
config = function()
vim.g.opencode_opts = {
-- Your configuration, if any — see `lua/opencode/config.lua`
}
-- Required for `opts.auto_reload`
vim.opt.autoread = true
-- Recommended/example keymaps
vim.keymap.set('n', '<leader>ot', function() require('opencode').toggle() end, { desc = 'Toggle embedded' })
vim.keymap.set('n', '<leader>oA', function() require('opencode').ask() end, { desc = 'Ask' })
vim.keymap.set('n', '<leader>oa', function() require('opencode').ask('@cursor: ') end, { desc = 'Ask about this' })
vim.keymap.set('v', '<leader>oa', function() require('opencode').ask('@selection: ') end, { desc = 'Ask about selection' })
vim.keymap.set('n', '<leader>oe', function() require('opencode').prompt('Explain @cursor and its context') end, { desc = 'Explain this code' })
vim.keymap.set('n', '<leader>o+', function() require('opencode').prompt('@buffer', { append = true }) end, { desc = 'Add buffer to prompt' })
vim.keymap.set('v', '<leader>o+', function() require('opencode').prompt('@selection', { append = true }) end, { desc = 'Add selection to prompt' })
vim.keymap.set('n', '<leader>on', function() require('opencode').command('session_new') end, { desc = 'New session' })
vim.keymap.set('n', '<S-C-u>', function() require('opencode').command('messages_half_page_up') end, { desc = 'Messages half page up' })
vim.keymap.set('n', '<S-C-d>', function() require('opencode').command('messages_half_page_down') end, { desc = 'Messages half page down' })
vim.keymap.set({ 'n', 'v' }, '<leader>os', function() require('opencode').select() end, { desc = 'Select prompt' })
end,
}

View File

@@ -0,0 +1,17 @@
return {
'nvim-telescope/telescope.nvim', branch = '0.1.x',
dependencies = { 'nvim-lua/plenary.nvim' },
config = function()
local builtin = require('telescope.builtin')
-- Default keys
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Telescope find files' })
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = 'Telescope live grep' })
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = 'Telescope buffers' })
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = 'Telescope help tags' })
-- Custom keys
vim.keymap.set('n', '<leader>?', builtin.oldfiles, { desc = 'Telescope old files' })
vim.keymap.set('n', '<leader>fc', builtin.grep_string, { desc = 'Telescope grep string' })
end
}

View File

@@ -0,0 +1,39 @@
return {
'nvim-treesitter/nvim-treesitter', brench = 'master',
event = { 'BufReadPre', 'BufNewFile' },
build = ':TSUpdate',
config = function()
local treesitter = require('nvim-treesitter.configs')
treesitter.setup({
highlight = { enable = true },
indent = { enable = true },
ensure_installed = {
'vim',
'lua',
'cmake',
'cpp',
'c',
'bash',
'javascript',
'typescript',
'tsx',
'json',
'html',
'vue',
'css',
'dockerfile',
'markdown',
'yaml'
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = '<C-space>',
node_incremental = '<C-space>',
-- scope_incremental = false,
-- node_decremental = '<bs>'
}
}
})
end
}

View File

@@ -0,0 +1,52 @@
-- Encoding.
vim.scriptencoding = 'utf-8'
vim.o.encoding = 'utf-8'
vim.o.fileencoding = 'utf-8'
-- Backups.
vim.o.backup = false
vim.o.swapfile = false
-- Lines.
vim.o.number = true
vim.o.relativenumber = true
vim.o.colorcolumn = '80'
vim.o.signcolumn = 'yes'
vim.o.cursorline = true
vim.o.guicursor = ''
-- Tabs.
vim.o.tabstop = 2
vim.o.shiftwidth = 2
-- Etc.
vim.o.mouse = ''
vim.o.clipboard = 'unnamedplus'
-- View.
vim.g.mapleader = ' '
-- vim.g.netrw_liststyle = 3
vim.o.termguicolors = true
vim.o.list = true
vim.opt.listchars:append 'space:·'
vim.opt.listchars:append 'tab:┊ '
-- vim.opt.listchars:append 'eol:↴'
-- Mappings tabs.
vim.keymap.set('n', '<C-h>', ':-tabmove<CR>')
vim.keymap.set('n', '<C-l>', ':+tabmove<CR>')
-- Mappings buffers.
vim.keymap.set('n', '<leader>k', ':bn<CR>')
vim.keymap.set('n', '<leader>j', ':bp<CR>')
-- Move cursour vertical.
vim.keymap.set('n', '<C-d>', '<C-d>zz')
vim.keymap.set('n', '<C-u>', '<C-u>zz')
-- Diagnostic keymaps.
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float)
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist)

View File

@@ -0,0 +1,2 @@
require('axp.base')
require('axp.manager.packer')

View File

@@ -0,0 +1,54 @@
-- Download packer.
local ensure_packer = function()
local fn = vim.fn
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
print('Download packer...')
fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
vim.cmd [[packadd packer.nvim]]
return true
end
return false
end
-- Bootstrap packer.
local packer_bootstrap = ensure_packer()
-- Chek packer.
local status, packer = pcall(require, 'packer')
if (not status) then
print('Oops. Packer is not installed!')
return
end
-- Init packer.
packer.init({
display = {
open_fn = function()
return require('packer.util').float({ border = 'single' })
end
}
})
-- Plugins.
local plugins = require('axp.plugins')
-- Startup packer.
packer.startup(function(use)
use 'wbthomason/packer.nvim'
-- Use pludins.
for _, plugin in ipairs(plugins.list) do
use(plugin)
end
-- Automatically set up your configuration after cloning packer.nvim
-- Put this at the end after all plugins
if packer_bootstrap then
print('Packer sync...')
require('packer').sync()
end
end)
-- Init plugins.
plugins.init()

View File

@@ -0,0 +1,2 @@
local status, autopairs = pcall(require, 'nvim-autopairs')
if status then autopairs.setup {} end

View File

@@ -0,0 +1,8 @@
local status, ibl = pcall(require, 'ibl')
if (not status) then return end
ibl.setup {
indent = {
char = ''
}
}

View File

@@ -0,0 +1,2 @@
local status, comment = pcall(require, 'Comment')
if (status) then comment.setup {} end

View File

@@ -0,0 +1,53 @@
local M = {}
M.list = {
-- Common.
'nvim-lua/plenary.nvim',
-- Etc.
'nvim-treesitter/nvim-treesitter',
'nvim-telescope/telescope.nvim',
'windwp/nvim-autopairs',
'numToStr/Comment.nvim',
-- View.
'EdenEast/nightfox.nvim',
'lukas-reineke/indent-blankline.nvim',
-- Lsp.
'neovim/nvim-lspconfig',
'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim',
'hrsh7th/cmp-nvim-lsp',
--- Null-ls.
-- 'jose-elias-alvarez/null-ls.nvim',
-- Autocompletion.
'L3MON4D3/LuaSnip',
'hrsh7th/nvim-cmp'
}
M.init = function()
-- Etc.
require('axp.plugins.autopairs')
require('axp.plugins.comment')
require('axp.plugins.telescope')
require('axp.plugins.treesitter')
-- View.
require('axp.plugins.nightfox')
require('axp.plugins.blankline')
-- Lsp.
require('axp.plugins.lsp')
-- Null-ls.
-- require('axp.plugins.null-ls')
-- Autocompletion
require('axp.plugins.luasnip')
require('axp.plugins.nvim-cmp')
end
return M

View File

@@ -0,0 +1,79 @@
-- Check Lspconfig.
-- local status_lspconfig, lspconfig = pcall(require, 'lspconfig')
-- if (not status_lspconfig) then return end
-- Check Mason.
local status_mason, mason = pcall(require, 'mason')
if (not status_mason) then return end
-- Check Mason lsp installer.
local status_mason_lspconfig, mason_lspconfig = pcall(require, 'mason-lspconfig')
if (not status_mason_lspconfig) then return end
-- Config servers.
local servers = {
'ts_ls',
'lua_ls',
'bashls',
'cmake',
'html',
'dockerls',
'jsonls',
'yamlls',
'graphql'
}
vim.lsp.config('lua_ls', {
settings = {
Lua = {
runtime = {
version = 'LuaJIT',
},
diagnostics = {
globals = {
'vim',
'require',
},
},
},
}
})
vim.lsp.config('ts_ls', {
init_options = {
plugins = {
{
name = '@vue/typescript-plugin',
location = '/home/antoxa/.nvm/versions/node/v22.12.0/lib/node_modules/@vue/typescript-plugin',
languages = { 'vue' }
}
}
},
settings = {
typescript = {
tsserver = {
useSyntaxServer = false,
},
inlayHints = {
includeInlayParameterNameHints = 'all',
includeInlayParameterNameHintsWhenArgumentMatchesName = true,
includeInlayFunctionParameterTypeHints = true,
includeInlayVariableTypeHints = true,
includeInlayVariableTypeHintsWhenTypeMatchesName = true,
includeInlayPropertyDeclarationTypeHints = true,
includeInlayFunctionLikeReturnTypeHints = true,
includeInlayEnumMemberValueHints = true,
},
},
},
filetypes = { 'javascript', 'typescript', 'vue' }
})
-- Mason.
mason.setup {}
-- Mason lsp installer.
mason_lspconfig.setup {
ensure_installed = servers,
automatic_enable = true
}

View File

@@ -0,0 +1,18 @@
local status_luasnip, ls = pcall(require, 'luasnip')
if (not status_luasnip) then return end
-- Init.
ls.config.set_config {}
-- Snippets.
local snippets = require 'axp.plugins.luasnip.snippets'
for name, snippet in pairs(snippets.list) do
ls.add_snippets(name, snippet)
end
-- Keymaps.
vim.keymap.set({ 'i', 's' }, '<C-k>', function()
if ls.expand_or_jumpable() then
ls.expand_or_jump()
end
end, { silent = true })

View File

@@ -0,0 +1,110 @@
local M = {}
M.list = {}
local status_luasnip, ls = pcall(require, 'luasnip')
if (status_luasnip) then
local s = ls.snippet
local t = ls.text_node
local i = ls.insert_node
-- local c = ls.choice_node
local fmt = require('luasnip.extras.fmt').fmt
local javascript = {
s('import', {
t('import '),
i(2, 'lib'),
t(' from \''),
i(1, 'lib'),
t('\'')
}),
s('try', fmt(
[[
try {{
{}
}} catch (e) {{}}
]],
{
i(1)
}
)),
s('/**', fmt(
[[
/**
* {}
*/
]],
{
i(1)
}
)),
s('const fn', {
t('const '),
i(1, 'fn'),
t(' = '),
i(2, 'async'),
t(' ('),
i(3),
t(') => {'),
i(4),
t('}')
})
}
local vue = {
s('<script', {
t('<script '),
i(1, 'setup'),
t(' lang="'),
i(2, 'ts'),
t('">'),
i(3),
t('</script>')
}),
s('<template', {
t('<template'),
i(1),
t('>'),
i(2),
t('</template>')
}),
s('<style', {
t('<style lang="'),
i(1, 'sass'),
t('">'),
i(2),
t('</style>')
}),
s('const props', {
t('const props = defineProps<{'),
i(1),
t('}>()')
}),
s('const emit', {
t('const emit = defineEmits<{ (e: \''),
i(1, 'update:modelValue'),
t('\', v: '),
i(2, 'any'),
t('): void }>()')
}),
s('onMounted', {
t('onMounted(() => '),
i(1, 'loadData()'),
t(')')
})
}
-- Add javascript in vue.
for number, value in ipairs(javascript) do
vue[6 + number] = value
end
M.list = {
javascript = javascript,
typescript = javascript,
typescriptreact = javascript,
vue = vue
}
end
return M

View File

@@ -0,0 +1,10 @@
local status = pcall(require, 'nightfox')
if status then
-- Apply theme.
vim.cmd.colorscheme('nightfox')
-- Transparency.
-- vim.api.nvim_set_hl(0, 'Normal', { bg = 'none' })
-- vim.api.nvim_set_hl_ns(1)
end

View File

@@ -0,0 +1,225 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignArrayOfStructures: None
AlignConsecutiveAssignments:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
PadOperators: true
AlignConsecutiveBitFields:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
PadOperators: false
AlignConsecutiveDeclarations:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
PadOperators: false
AlignConsecutiveMacros:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
PadOperators: false
AlignEscapedNewlines: Right
AlignOperands: Align
AlignTrailingComments:
Kind: Always
OverEmptyLines: 0
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
AttributeMacros:
- __capability
BinPackArguments: true
BinPackParameters: true
BitFieldColonSpacing: Both
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterExternBlock: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakAfterAttributes: Never
BreakAfterJavaFieldAnnotations: false
BreakArrays: true
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: Always
BreakBeforeBraces: Attach
BreakBeforeInlineASMColon: OnlyMultiline
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IfMacros:
- KJ_IF_MAYBE
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
CaseSensitive: false
- Regex: '.*'
Priority: 1
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentAccessModifiers: false
IndentCaseBlocks: false
IndentCaseLabels: false
IndentExternBlock: AfterExternBlock
IndentGotoLabels: true
IndentPPDirectives: None
IndentRequiresClause: true
IndentWidth: 2
IndentWrappedFunctionNames: false
InsertBraces: false
InsertNewlineAtEOF: false
InsertTrailingCommas: None
IntegerLiteralSeparator:
Binary: 0
BinaryMinDigits: 0
Decimal: 0
DecimalMinDigits: 0
Hex: 0
HexMinDigits: 0
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
LambdaBodyIndentation: Signature
LineEnding: DeriveLF
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PackConstructorInitializers: BinPack
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyIndentedWhitespace: 0
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
PPIndentWidth: -1
QualifierAlignment: Leave
ReferenceAlignment: Pointer
ReflowComments: true
RemoveBracesLLVM: false
RemoveSemicolon: false
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: OuterScope
SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 1
SortIncludes: CaseSensitive
SortJavaStaticImport: Before
SortUsingDeclarations: LexicographicNumeric
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: true
AfterFunctionDefinitionName: false
AfterFunctionDeclarationName: false
AfterIfMacros: true
AfterOverloadedOperator: false
AfterRequiresInClause: false
AfterRequiresInExpression: false
BeforeNonEmptyParentheses: false
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Latest
StatementAttributeLikeMacros:
- Q_EMIT
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 2
UseTab: Always
WhitespaceSensitiveMacros:
- BOOST_PP_STRINGIZE
- CF_SWIFT_NAME
- NS_SWIFT_NAME
- PP_STRINGIZE
- STRINGIZE
...

View File

@@ -0,0 +1,9 @@
{
"useTabs": true,
"tabWidth": 2,
"singleQuote": true,
"semi": false,
"trailingComma": "none",
"arrowParens": "avoid",
"printWidth": 79
}

View File

@@ -0,0 +1,30 @@
-- Null-ls.
local status, null_ls = pcall(require, 'null-ls')
if (not status) then return end
local formatting = null_ls.builtins.formatting
local prettier_config = vim.fn.stdpath('config') .. '/lua/axp/plugins/null-ls/.prettierrc'
-- local clang_format_config = vim.fn.stdpath('config') .. '/lua/axp/plugins/null-ls/.clang-format'
-- Init.
null_ls.setup {
sources = {
-- formatting.clang_format.with({
-- extra_args = {
-- -- '--style=Google'
-- '--assume-filename=' .. clang_format_config
-- }
-- }),
formatting.prettier.with({
extra_args = { '--config', prettier_config }
})
},
on_attach = function (client, bufnr)
if client.supports_method('textDocument/formatting') then
-- Create a command `:Format` local to the LSP buffer
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
vim.lsp.buf.format()
end, { desc = 'Format current buffer with LSP' })
end
end
}

View File

@@ -0,0 +1,27 @@
local status, cmp = pcall(require, 'cmp')
if (not status) then return end
local status_ls, ls = pcall(require, 'luasnip')
cmp.setup {
snippet = {
expand = function(args)
if (status_ls) then
ls.lsp_expand(args.body)
end
end,
},
mapping = cmp.mapping.preset.insert {
['<C-d>'] = cmp.mapping.scroll_docs( -4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete {},
['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = true,
},
},
sources = {
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
}
}

View File

@@ -0,0 +1,34 @@
local status, telescope = pcall(require, 'telescope')
if (not status) then return end
-- Configure.
telescope.setup {
defaults = {
file_ignore_patterns = {
'.git',
'node_modules',
'dist',
'static',
'public'
}
}
}
-- See `:help telescope.builtin`
local builtin = require('telescope.builtin')
-- Search.
vim.keymap.set('n', '<leader>sf', builtin.find_files)
vim.keymap.set('n', '<leader>sw', builtin.grep_string)
vim.keymap.set('n', '<leader>sg', builtin.live_grep)
-- Old files.
vim.keymap.set('n', '<leader>?', builtin.oldfiles)
-- Search current buffer.
-- vim.keymap.set('n', '<leader>/', function()
-- builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
-- winblend = 10,
-- previewer = false,
-- })
-- end)

View File

@@ -0,0 +1,40 @@
local status, ts = pcall(require, 'nvim-treesitter.configs')
if (not status) then return end
ts.setup {
ensure_installed = {
'vim',
'lua',
'cmake',
'cpp',
'bash',
'javascript',
'typescript',
'tsx',
'json',
'html',
'pug',
'vue',
'css',
'scss',
'python',
'dockerfile',
'regex',
'markdown',
'yaml',
'astro',
},
ignore_install = {},
modules = {},
sync_install = false,
auto_install = true,
autotag = { enable = true },
highlight = {
enable = true,
disable = {},
},
indent = {
enable = true,
disable = {}
}
}

View File

@@ -0,0 +1,164 @@
-- Automatically generated packer.nvim plugin loader code
if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then
vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"')
return
end
vim.api.nvim_command('packadd packer.nvim')
local no_errors, error_msg = pcall(function()
_G._packer = _G._packer or {}
_G._packer.inside_compile = true
local time
local profile_info
local should_profile = false
if should_profile then
local hrtime = vim.loop.hrtime
profile_info = {}
time = function(chunk, start)
if start then
profile_info[chunk] = hrtime()
else
profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6
end
end
else
time = function(chunk, start) end
end
local function save_profiles(threshold)
local sorted_times = {}
for chunk_name, time_taken in pairs(profile_info) do
sorted_times[#sorted_times + 1] = {chunk_name, time_taken}
end
table.sort(sorted_times, function(a, b) return a[2] > b[2] end)
local results = {}
for i, elem in ipairs(sorted_times) do
if not threshold or threshold and elem[2] > threshold then
results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms'
end
end
if threshold then
table.insert(results, '(Only showing plugins that took longer than ' .. threshold .. ' ms ' .. 'to load)')
end
_G._packer.profile_output = results
end
time([[Luarocks path setup]], true)
local package_path_str = "/home/antoxa/.cache/nvim/packer_hererocks/2.1.1753364724/share/lua/5.1/?.lua;/home/antoxa/.cache/nvim/packer_hererocks/2.1.1753364724/share/lua/5.1/?/init.lua;/home/antoxa/.cache/nvim/packer_hererocks/2.1.1753364724/lib/luarocks/rocks-5.1/?.lua;/home/antoxa/.cache/nvim/packer_hererocks/2.1.1753364724/lib/luarocks/rocks-5.1/?/init.lua"
local install_cpath_pattern = "/home/antoxa/.cache/nvim/packer_hererocks/2.1.1753364724/lib/lua/5.1/?.so"
if not string.find(package.path, package_path_str, 1, true) then
package.path = package.path .. ';' .. package_path_str
end
if not string.find(package.cpath, install_cpath_pattern, 1, true) then
package.cpath = package.cpath .. ';' .. install_cpath_pattern
end
time([[Luarocks path setup]], false)
time([[try_loadstring definition]], true)
local function try_loadstring(s, component, name)
local success, result = pcall(loadstring(s), name, _G.packer_plugins[name])
if not success then
vim.schedule(function()
vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {})
end)
end
return result
end
time([[try_loadstring definition]], false)
time([[Defining packer_plugins]], true)
_G.packer_plugins = {
["Comment.nvim"] = {
loaded = true,
path = "/home/antoxa/.local/share/nvim/site/pack/packer/start/Comment.nvim",
url = "https://github.com/numToStr/Comment.nvim"
},
LuaSnip = {
loaded = true,
path = "/home/antoxa/.local/share/nvim/site/pack/packer/start/LuaSnip",
url = "https://github.com/L3MON4D3/LuaSnip"
},
["cmp-nvim-lsp"] = {
loaded = true,
path = "/home/antoxa/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp",
url = "https://github.com/hrsh7th/cmp-nvim-lsp"
},
["indent-blankline.nvim"] = {
loaded = true,
path = "/home/antoxa/.local/share/nvim/site/pack/packer/start/indent-blankline.nvim",
url = "https://github.com/lukas-reineke/indent-blankline.nvim"
},
["mason-lspconfig.nvim"] = {
loaded = true,
path = "/home/antoxa/.local/share/nvim/site/pack/packer/start/mason-lspconfig.nvim",
url = "https://github.com/williamboman/mason-lspconfig.nvim"
},
["mason.nvim"] = {
loaded = true,
path = "/home/antoxa/.local/share/nvim/site/pack/packer/start/mason.nvim",
url = "https://github.com/williamboman/mason.nvim"
},
["nightfox.nvim"] = {
loaded = true,
path = "/home/antoxa/.local/share/nvim/site/pack/packer/start/nightfox.nvim",
url = "https://github.com/EdenEast/nightfox.nvim"
},
["nvim-autopairs"] = {
loaded = true,
path = "/home/antoxa/.local/share/nvim/site/pack/packer/start/nvim-autopairs",
url = "https://github.com/windwp/nvim-autopairs"
},
["nvim-cmp"] = {
loaded = true,
path = "/home/antoxa/.local/share/nvim/site/pack/packer/start/nvim-cmp",
url = "https://github.com/hrsh7th/nvim-cmp"
},
["nvim-lspconfig"] = {
loaded = true,
path = "/home/antoxa/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
url = "https://github.com/neovim/nvim-lspconfig"
},
["nvim-treesitter"] = {
loaded = true,
path = "/home/antoxa/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
url = "https://github.com/nvim-treesitter/nvim-treesitter"
},
["packer.nvim"] = {
loaded = true,
path = "/home/antoxa/.local/share/nvim/site/pack/packer/start/packer.nvim",
url = "https://github.com/wbthomason/packer.nvim"
},
["plenary.nvim"] = {
loaded = true,
path = "/home/antoxa/.local/share/nvim/site/pack/packer/start/plenary.nvim",
url = "https://github.com/nvim-lua/plenary.nvim"
},
["telescope.nvim"] = {
loaded = true,
path = "/home/antoxa/.local/share/nvim/site/pack/packer/start/telescope.nvim",
url = "https://github.com/nvim-telescope/telescope.nvim"
}
}
time([[Defining packer_plugins]], false)
_G._packer.inside_compile = false
if _G._packer.needs_bufread == true then
vim.cmd("doautocmd BufRead")
end
_G._packer.needs_bufread = false
if should_profile then save_profiles() end
end)
if not no_errors then
error_msg = error_msg:gsub('"', '\\"')
vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None')
end