First commit
This commit is contained in:
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
lazy-lock.json
|
||||
lazyvim.json
|
||||
|
||||
9
init.lua
Normal file
9
init.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
vim.opt.clipboard = "unnamed,unnamedplus"
|
||||
|
||||
vim.opt.tabstop = 4 -- Количество пробелов, которое занимает табуляция
|
||||
vim.opt.shiftwidth = 4 -- Количество пробелов при автоотступах
|
||||
vim.opt.expandtab = true -- Преобразует табуляцию в пробелы
|
||||
vim.wo.relativenumber = true
|
||||
|
||||
require("config.lazy")
|
||||
require("keymaps")
|
||||
25
lua/config/lazy.lua
Normal file
25
lua/config/lazy.lua
Normal file
@@ -0,0 +1,25 @@
|
||||
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" },
|
||||
},
|
||||
})
|
||||
9
lua/config/mason-tools-list.lua
Normal file
9
lua/config/mason-tools-list.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
local to_install = {
|
||||
"stylua",
|
||||
"ruff",
|
||||
"isort",
|
||||
"mypy",
|
||||
"basedpyright",
|
||||
}
|
||||
|
||||
return to_install
|
||||
15
lua/keymaps.lua
Normal file
15
lua/keymaps.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
-- Remap Ctrl + h to move to the left window
|
||||
keymap("n", "<C-h>", "<C-w>h", opts)
|
||||
|
||||
-- Remap Ctrl + j to move to the window below
|
||||
keymap("n", "<C-j>", "<C-w>j", opts)
|
||||
|
||||
-- Remap Ctrl + k to move to the window above
|
||||
keymap("n", "<C-k>", "<C-w>k", opts)
|
||||
|
||||
-- Remap Ctrl + l to move to the right window
|
||||
keymap("n", "<C-l>", "<C-w>l", opts)
|
||||
|
||||
11
lua/plugins/colorscheme.lua
Normal file
11
lua/plugins/colorscheme.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
return {
|
||||
"briones-gabriel/darcula-solid.nvim",
|
||||
dependencies = {
|
||||
"rktjmp/lush.nvim",
|
||||
},
|
||||
lazy = false, -- make sure we load this during startup if it is your main colorscheme
|
||||
priority = 1000, -- make sure to load this before all the other start plugins
|
||||
config = function()
|
||||
vim.cmd([[colorscheme darcula-solid]])
|
||||
end,
|
||||
}
|
||||
43
lua/plugins/lualine.lua
Normal file
43
lua/plugins/lualine.lua
Normal file
@@ -0,0 +1,43 @@
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
opts = {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = "powerline",
|
||||
component_separators = { left = "", right = "" },
|
||||
section_separators = { left = "", right = "" },
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = {},
|
||||
},
|
||||
ignore_focus = {},
|
||||
always_divide_middle = true,
|
||||
globalstatus = false,
|
||||
refresh = {
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
},
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "branch", "diff", "diagnostics" },
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "encoding", "filetype" },
|
||||
lualine_z = { "location" },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "location" },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = {},
|
||||
},
|
||||
}
|
||||
6
lua/plugins/mason-tool-installer.lua
Normal file
6
lua/plugins/mason-tool-installer.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
return {
|
||||
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
||||
opts = {
|
||||
ensure_installed = require("config.mason-tools-list"),
|
||||
},
|
||||
}
|
||||
6
lua/plugins/mason.lua
Normal file
6
lua/plugins/mason.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
return {
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = require("config.mason-tools-list"),
|
||||
},
|
||||
}
|
||||
31
lua/plugins/neo-tree.lua
Normal file
31
lua/plugins/neo-tree.lua
Normal file
@@ -0,0 +1,31 @@
|
||||
local setup = {
|
||||
source_selector = {
|
||||
winbar = true, -- toggle to show selector on winbar
|
||||
statusline = false, -- toggle to show selector on statusline
|
||||
show_scrolled_off_parent_node = false, -- this will replace the tabs with the parent path
|
||||
-- of the top visible node when scrolled down.
|
||||
sources = {
|
||||
{ source = "filesystem" },
|
||||
{ source = "buffers" },
|
||||
{ source = "git_status" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return {
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("neo-tree").setup(setup)
|
||||
-- Define key mappings here to ensure they are set after the plugin is loaded
|
||||
vim.api.nvim_set_keymap("n", "<leader>n", "<Cmd>Neotree toggle<CR>", { noremap = true, silent = true })
|
||||
end,
|
||||
keys = "<leader>n", -- Optionally specify here to load the plugin on this keypress
|
||||
},
|
||||
}
|
||||
19
lua/plugins/nvim-conform.lua
Normal file
19
lua/plugins/nvim-conform.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
return {
|
||||
"stevearc/conform.nvim",
|
||||
opts = {},
|
||||
config = function()
|
||||
require("conform").setup({
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
python = { "isort", "ruff_format" },
|
||||
},
|
||||
})
|
||||
vim.api.nvim_set_keymap(
|
||||
"n",
|
||||
"<Leader>f",
|
||||
":lua require('conform').format()<CR>",
|
||||
{ noremap = true, silent = true }
|
||||
)
|
||||
end,
|
||||
keys = "<leader>f", -- Optionally specify here to load the plugin on this keypress
|
||||
}
|
||||
19
lua/plugins/nvim-lint.lua
Normal file
19
lua/plugins/nvim-lint.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
return {
|
||||
"mfussenegger/nvim-lint",
|
||||
config = function()
|
||||
local lint = require("lint")
|
||||
|
||||
lint.linters_by_ft = {
|
||||
python = { "ruff", "mypy" },
|
||||
}
|
||||
|
||||
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||
group = lint_augroup,
|
||||
callback = function()
|
||||
lint.try_lint()
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
10
lua/plugins/telescope.lua
Normal file
10
lua/plugins/telescope.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
tag = "0.1.8",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
require("telescope").setup({}) -- Define key mappings here to ensure they are set after the plugin is loaded
|
||||
vim.api.nvim_set_keymap("n", "<leader><C-f>", "<Cmd>Telescope live_grep<CR>", { noremap = true, silent = true })
|
||||
end,
|
||||
keys = "<leader><C-f>", -- Optionally specify here to load the plugin on this keypress
|
||||
}
|
||||
4
lua/plugins/treesitter-text-objects.lua
Normal file
4
lua/plugins/treesitter-text-objects.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
||||
}
|
||||
31
lua/plugins/treesitter.lua
Normal file
31
lua/plugins/treesitter.lua
Normal file
@@ -0,0 +1,31 @@
|
||||
local langs = {
|
||||
"lua",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"python",
|
||||
"go",
|
||||
"html",
|
||||
"css",
|
||||
"scss",
|
||||
"json",
|
||||
"php",
|
||||
"tsx",
|
||||
"sql",
|
||||
}
|
||||
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
local configs = require("nvim-treesitter.configs")
|
||||
|
||||
configs.setup({
|
||||
ensure_installed = langs,
|
||||
sync_install = false,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user