0.0.1
This commit is contained in:
commit
36c66e33e6
17 changed files with 348 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
./lazy-lock.json
|
||||||
25
init.lua
Normal file
25
init.lua
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
vim.g.maplocalleader = " "
|
||||||
|
|
||||||
|
vim.opt.backspace = "2"
|
||||||
|
vim.opt.laststatus = 2
|
||||||
|
vim.opt.autowrite = true
|
||||||
|
vim.opt.cursorline = true
|
||||||
|
vim.opt.autoread = true
|
||||||
|
|
||||||
|
vim.opt.tabstop = 2
|
||||||
|
vim.opt.shiftwidth = 2
|
||||||
|
vim.opt.shiftround = true
|
||||||
|
vim.opt.expandtab = true
|
||||||
|
|
||||||
|
vim.opt.number = true
|
||||||
|
vim.opt.relativenumber = true
|
||||||
|
|
||||||
|
require("config.lazy")
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>h", ":noh<CR>")
|
||||||
|
|
||||||
|
-- terminal
|
||||||
|
vim.keymap.set("t", "<Esc>", [[<C-\><C-n>]], { desc = "Exit terminal mode" })
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>t", ":tabnew<CR>", { desc = "Open tab" })
|
||||||
26
lua/config/lazy.lua
Normal file
26
lua/config/lazy.lua
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
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)
|
||||||
|
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
vim.g.maplocalleader = " "
|
||||||
|
|
||||||
|
require("lazy").setup({
|
||||||
|
spec = {
|
||||||
|
{ import = "plugins" },
|
||||||
|
},
|
||||||
|
checker = { enabled = true },
|
||||||
|
install = { colorscheme = { "github_dark", "habamax" } },
|
||||||
|
})
|
||||||
3
lua/config/lazy.py
Normal file
3
lua/config/lazy.py
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
for i in range(100):
|
||||||
|
print(i)
|
||||||
|
print("hello world")
|
||||||
44
lua/plugins/cmp.lua
Normal file
44
lua/plugins/cmp.lua
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
return {
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
event = "InsertEnter",
|
||||||
|
dependencies = {
|
||||||
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
|
"hrsh7th/cmp-buffer",
|
||||||
|
"hrsh7th/cmp-path",
|
||||||
|
},
|
||||||
|
|
||||||
|
config = function()
|
||||||
|
local cmp = require("cmp")
|
||||||
|
|
||||||
|
cmp.setup({
|
||||||
|
completion = {
|
||||||
|
completeopt = "menu,menuone,noinsert",
|
||||||
|
},
|
||||||
|
|
||||||
|
preselect = cmp.PreselectMode.Item,
|
||||||
|
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||||
|
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||||
|
|
||||||
|
["<C-n>"] = cmp.mapping.select_next_item(),
|
||||||
|
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||||
|
|
||||||
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
|
|
||||||
|
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||||
|
}),
|
||||||
|
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = "nvim_lsp" },
|
||||||
|
{ name = "path" },
|
||||||
|
}, {
|
||||||
|
{ name = "buffer" },
|
||||||
|
}),
|
||||||
|
|
||||||
|
formatting = {
|
||||||
|
fields = { "kind", "abbr", "menu" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
37
lua/plugins/conform.lua
Normal file
37
lua/plugins/conform.lua
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
return {
|
||||||
|
"stevearc/conform.nvim",
|
||||||
|
event = { "BufWritePre" },
|
||||||
|
cmd = { "ConformInfo" },
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>f",
|
||||||
|
function()
|
||||||
|
require("conform").format({ async = true })
|
||||||
|
end,
|
||||||
|
mode = "",
|
||||||
|
desc = "Format buffer",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
formatters_by_ft = {
|
||||||
|
lua = { "stylua" },
|
||||||
|
python = { "ruff", "black" },
|
||||||
|
javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||||
|
},
|
||||||
|
default_format_opts = {
|
||||||
|
lsp_format = "fallback",
|
||||||
|
},
|
||||||
|
format_on_save = {
|
||||||
|
timeout_ms = 500,
|
||||||
|
lsp_fallback = true, -- современный стандарт
|
||||||
|
},
|
||||||
|
formatters = {
|
||||||
|
shfmt = {
|
||||||
|
append_args = { "-i", "2" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
init = function()
|
||||||
|
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
|
||||||
|
end,
|
||||||
|
}
|
||||||
13
lua/plugins/github-theme.lua
Normal file
13
lua/plugins/github-theme.lua
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
return {
|
||||||
|
"projekt0n/github-nvim-theme",
|
||||||
|
name = "github-theme",
|
||||||
|
lazy = false,
|
||||||
|
priority = 1000,
|
||||||
|
config = function()
|
||||||
|
require("github-theme").setup({
|
||||||
|
-- здесь можно добавить свои опции, если нужно
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.cmd("colorscheme github_dark")
|
||||||
|
end,
|
||||||
|
}
|
||||||
58
lua/plugins/mason.lua
Normal file
58
lua/plugins/mason.lua
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
dependencies = {
|
||||||
|
{ "williamboman/mason.nvim" },
|
||||||
|
{ "williamboman/mason-lspconfig.nvim" },
|
||||||
|
{ "hrsh7th/nvim-cmp" },
|
||||||
|
},
|
||||||
|
|
||||||
|
config = function()
|
||||||
|
-- Mason
|
||||||
|
require("mason").setup()
|
||||||
|
|
||||||
|
local lspconfig = require("lspconfig")
|
||||||
|
|
||||||
|
-- Capabilities (для nvim-cmp)
|
||||||
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
|
local ok, cmp_lsp = pcall(require, "cmp_nvim_lsp")
|
||||||
|
if ok then
|
||||||
|
capabilities = cmp_lsp.default_capabilities(capabilities)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Mason-LSP
|
||||||
|
require("mason-lspconfig").setup({
|
||||||
|
ensure_installed = {
|
||||||
|
"lua_ls",
|
||||||
|
"pyright",
|
||||||
|
"clangd",
|
||||||
|
"rust_analyzer",
|
||||||
|
"ts_ls",
|
||||||
|
},
|
||||||
|
|
||||||
|
handlers = {
|
||||||
|
-- дефолт для всех серверов
|
||||||
|
function(server_name)
|
||||||
|
lspconfig[server_name].setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
|
||||||
|
-- кастом для lua
|
||||||
|
["lua_ls"] = function()
|
||||||
|
lspconfig.lua_ls.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
diagnostics = { globals = { "vim" } },
|
||||||
|
workspace = { checkThirdParty = false },
|
||||||
|
telemetry = { enable = false },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
4
lua/plugins/mini.lua
Normal file
4
lua/plugins/mini.lua
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
return {
|
||||||
|
"nvim-mini/mini.nvim",
|
||||||
|
version = "*",
|
||||||
|
}
|
||||||
15
lua/plugins/oil.lua
Normal file
15
lua/plugins/oil.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
return {
|
||||||
|
"stevearc/oil.nvim",
|
||||||
|
---@module 'oil'
|
||||||
|
---@type oil.SetupOpts
|
||||||
|
opts = {},
|
||||||
|
-- Optional dependencies
|
||||||
|
dependencies = { { "nvim-mini/mini.icons", opts = {} } },
|
||||||
|
-- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if you prefer nvim-web-devicons
|
||||||
|
-- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations.
|
||||||
|
keys = {
|
||||||
|
{ "-", "<CMD>Oil<CR>", desc = "Oil: Open parent directory" },
|
||||||
|
{ "<leader>e", "<CMD>Oil<CR>", desc = "Oil: Explorer" },
|
||||||
|
},
|
||||||
|
lazy = false,
|
||||||
|
}
|
||||||
5
lua/plugins/project.lua
Normal file
5
lua/plugins/project.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
return {
|
||||||
|
"DrKJeff16/project.nvim",
|
||||||
|
dependencies = {},
|
||||||
|
opts = {},
|
||||||
|
}
|
||||||
57
lua/plugins/snacks.lua
Normal file
57
lua/plugins/snacks.lua
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
return {
|
||||||
|
"folke/snacks.nvim",
|
||||||
|
priority = 1000,
|
||||||
|
lazy = false,
|
||||||
|
|
||||||
|
opts = {
|
||||||
|
dashboard = {
|
||||||
|
enabled = true,
|
||||||
|
preset = {
|
||||||
|
header = [[
|
||||||
|
░▒▓██████▓▒░░▒▓█▓▒░░▒▓█▓▒░ ░▒▓███████▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░▒▓██████████████▓▒░
|
||||||
|
░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░
|
||||||
|
░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░
|
||||||
|
░▒▓█▓▒▒▓███▓▒░▒▓███████▓▒░ ░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░
|
||||||
|
░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▓█▓▒░ ░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░
|
||||||
|
░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓██▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▓█▓▒░ ░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░
|
||||||
|
░▒▓██████▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓██▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓██▓▒░ ░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░
|
||||||
|
workspace by grechkagk :3 ]],
|
||||||
|
keys = {
|
||||||
|
{ icon = " ", key = "f", desc = "Find File", action = ":lua Snacks.dashboard.pick('files')" },
|
||||||
|
{ icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" },
|
||||||
|
{
|
||||||
|
icon = " ",
|
||||||
|
key = "g",
|
||||||
|
desc = "Find Text",
|
||||||
|
action = ":lua Snacks.dashboard.pick('live_grep')",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon = " ",
|
||||||
|
key = "r",
|
||||||
|
desc = "Recent Files",
|
||||||
|
action = ":lua Snacks.dashboard.pick('oldfiles')",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon = " ",
|
||||||
|
key = "c",
|
||||||
|
desc = "Config",
|
||||||
|
action = ":lua Snacks.dashboard.pick('files', {cwd = vim.fn.stdpath('config')})",
|
||||||
|
},
|
||||||
|
{ icon = " ", key = "s", desc = "Restore Session", section = "session" },
|
||||||
|
{
|
||||||
|
icon = " ",
|
||||||
|
key = "L",
|
||||||
|
desc = "Lazy",
|
||||||
|
action = ":Lazy",
|
||||||
|
enabled = package.loaded.lazy ~= nil,
|
||||||
|
},
|
||||||
|
{ icon = " ", key = "q", desc = "Quit", action = ":qa" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
sections = {
|
||||||
|
{ section = "header" },
|
||||||
|
{ section = "keys", gap = 1, padding = 1 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
9
lua/plugins/telescope.lua
Normal file
9
lua/plugins/telescope.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
return {
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
version = "*",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
-- optional but recommended
|
||||||
|
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
|
||||||
|
},
|
||||||
|
}
|
||||||
5
lua/plugins/test.md
Normal file
5
lua/plugins/test.md
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
# TEST TEXT!
|
||||||
|
|
||||||
|
|
||||||
|
hello world!
|
||||||
|
:3
|
||||||
16
lua/plugins/themery.lua
Normal file
16
lua/plugins/themery.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
return {
|
||||||
|
"zaldih/themery.nvim",
|
||||||
|
lazy = false,
|
||||||
|
config = function()
|
||||||
|
require("themery").setup({
|
||||||
|
themes = {
|
||||||
|
"github_dark",
|
||||||
|
"github_light",
|
||||||
|
},
|
||||||
|
livePreview = true,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
keys = {
|
||||||
|
{ "<leader>c", "<cmd>Themery<CR>", desc = "theme picker" },
|
||||||
|
},
|
||||||
|
}
|
||||||
12
lua/plugins/treesitter.lua
Normal file
12
lua/plugins/treesitter.lua
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
return {
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
build = ":TSUpdate",
|
||||||
|
lazy = false,
|
||||||
|
config = function()
|
||||||
|
require("nvim-treesitter.configs").setup({
|
||||||
|
ensure_installed = { "lua", "vim", "vimdoc", "query" },
|
||||||
|
highlight = { enable = true },
|
||||||
|
indent = { enable = true },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
18
lua/plugins/which-key.lua
Normal file
18
lua/plugins/which-key.lua
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
return {
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = {
|
||||||
|
-- your configuration comes here
|
||||||
|
-- or leave it empty to use the default settings
|
||||||
|
-- refer to the configuration section below
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>?",
|
||||||
|
function()
|
||||||
|
require("which-key").show({ global = false })
|
||||||
|
end,
|
||||||
|
desc = "Buffer Local Keymaps (which-key)",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue