init: initial commit

This commit is contained in:
ITQ
2026-03-08 16:23:50 +03:00
commit 02476899b4
22 changed files with 2257 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
local augroup = vim.api.nvim_create_augroup
-- highlight on yank
vim.api.nvim_create_autocmd("TextYankPost", {
group = augroup("YankHighlight", { clear = true }),
callback = function()
vim.highlight.on_yank({ timeout = 200 })
end,
})
-- optional: auto format on save (handled by conform too, but this is a safe place for extra logic later)
+21
View File
@@ -0,0 +1,21 @@
local signs = {
Error = "",
Warn = "",
Hint = "",
Info = "",
}
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
end
vim.diagnostic.config({
virtual_text = { spacing = 2, prefix = "" },
signs = true,
underline = true,
update_in_insert = false,
severity_sort = true,
float = { border = "rounded", source = "if_many" },
})
+22
View File
@@ -0,0 +1,22 @@
local map = vim.keymap.set
-- basics
map("n", "<leader>w", "<cmd>w<cr>", { desc = "Save" })
map("n", "<leader>q", "<cmd>q<cr>", { desc = "Quit" })
-- better movement
map({ "n", "v" }, "H", "^", { desc = "Line start" })
map({ "n", "v" }, "L", "$", { desc = "Line end" })
-- diagnostics
map("n", "[d", vim.diagnostic.goto_prev, { desc = "Prev diagnostic" })
map("n", "]d", vim.diagnostic.goto_next, { desc = "Next diagnostic" })
map("n", "<leader>e", vim.diagnostic.open_float, { desc = "Line diagnostic" })
map("n", "<leader>dl", "<cmd>Telescope diagnostics<cr>", { desc = "Diagnostics list" })
-- Telescope
map("n", "<leader>ff", "<cmd>Telescope find_files<cr>", { desc = "Find files" })
map("n", "<leader>fg", "<cmd>Telescope live_grep<cr>", { desc = "Live grep" })
map("n", "<leader>fb", "<cmd>Telescope buffers<cr>", { desc = "Buffers" })
map("n", "<leader>fh", "<cmd>Telescope help_tags<cr>", { desc = "Help" })
+22
View File
@@ -0,0 +1,22 @@
-- lazy.nvim bootstrap
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)
require("lazy").setup({
spec = {
{ import = "plugins" },
},
defaults = { lazy = true },
install = { colorscheme = { "gruvbox" } },
checker = { enabled = true },
ui = { border = "rounded" },
})
+31
View File
@@ -0,0 +1,31 @@
vim.g.mapleader = " "
vim.g.maplocalleader = " "
local opt = vim.opt
opt.number = true
opt.relativenumber = true
opt.signcolumn = "yes"
opt.cursorline = true
opt.wrap = false
opt.scrolloff = 10
opt.sidescrolloff = 8
opt.tabstop = 4
opt.shiftwidth = 4
opt.expandtab = true
opt.smartindent = true
opt.ignorecase = true
opt.smartcase = true
opt.incsearch = true
opt.splitright = true
opt.splitbelow = true
opt.termguicolors = true
opt.updatetime = 250
opt.timeoutlen = 400
opt.clipboard = "unnamedplus"
opt.undofile = true