Initial commit

This commit is contained in:
Alexey 2026-02-24 11:55:27 +03:00
commit e7b4be7296
17 changed files with 213 additions and 0 deletions

31
lua/config/lazy.lua Normal file
View file

@ -0,0 +1,31 @@
require 'config.opts'
-- 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)
-- Setup lazy.nvim
require("lazy").setup({
spec = {
-- import your plugins
{ import = "plugins" },
},
-- 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 },
})

13
lua/config/lsp.lua Normal file
View file

@ -0,0 +1,13 @@
-- Load lsp.name with required setup
local requires = {
'rust_analyzer',
'lua_ls',
}
local lsps = {}
for _, lsp_name in ipairs(requires) do
local lsp = require('lsp.' .. lsp_name)
lsps[lsp_name] = lsp
end
return lsps

31
lua/config/mappings.lua Normal file
View file

@ -0,0 +1,31 @@
local opts = { noremap = true, silent = true }
---Make string like ':cmd<CR>'
---@param cmd string
---@return string
local function auto(cmd)
return string.format(':%s<CR>', cmd)
end
---Make string like '<Leader>cmd'
---@param cmd string
---@return string
local function ld(cmd)
return string.format('<Leader>%s', cmd)
end
return {
n = {
{ ld('ev'), auto('vsplit $MYVIMRC'), opts },
{ ld('sv'), auto('source $MYVIMRC'), opts },
{ ld('n'), auto('Telescope find_files'), opts },
{ ld('h'), auto('Telescope help_tags'), opts },
{ ld('/'), auto('Telescope live_grep'), opts },
{ ld('t'), auto('Trouble diagnostics'), opts },
{ ld('ds'), ':GdbStart rust-gdb -q target/debug/', opts },
--{ ld('?'), function() require("which-key").show({ global = false }) end, opts },
},
i = {
{ 'jk', '<Esc>', opts },
},
}

10
lua/config/opts.lua Normal file
View file

@ -0,0 +1,10 @@
vim.o.number = true
vim.o.tabstop = 4
vim.o.shiftwidth = 4
vim.o.expandtab = true
vim.o.smartindent = true
vim.o.cursorline = true
vim.o.keymap = 'russian-jcuken'
vim.o.iminsert = 0
vim.o.imsearch = 0
vim.g.mapleader = ' '