Refresh neovim config

This commit is contained in:
Vaclav Uruba 2025-05-13 20:19:56 +02:00
parent 9e05f9cba8
commit ec75c94867
Signed by: uruba
GPG Key ID: 9D8E987C4B2E1E9C
40 changed files with 883 additions and 874 deletions

View File

@ -1,7 +1,7 @@
require('core/keymap') require("core/keymap")
require('lazy-init') require("lazy-init")
require('core/basic-vars') require("core/basic-vars")
require('core/options') require("core/options")
require('core/theme') require("core/theme")

View File

@ -1,48 +1,50 @@
{ {
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" },
"alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" }, "alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" },
"auto-session": { "branch": "main", "commit": "82630e2f70be140f8dcc75a12e2ee2839e8488c2" }, "auto-session": { "branch": "main", "commit": "00334ee24b9a05001ad50221c8daffbeedaa0842" },
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"conform.nvim": { "branch": "master", "commit": "363243c03102a531a8203311d4f2ae704c620d9b" }, "conform.nvim": { "branch": "master", "commit": "374aaf384e2e841607b8e2fe63fa3ad01d111c91" },
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
"dressing.nvim": { "branch": "master", "commit": "56ef6a969a4990d938c5fed40c370f65e125fc97" }, "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
"gitsigns.nvim": { "branch": "main", "commit": "9b36d497495436c135659902054ee637e0ba6021" }, "gitsigns.nvim": { "branch": "main", "commit": "43b0c856ae5f32a195d83f4a27fe21d63e6c966c" },
"hererocks": { "branch": "master", "commit": "c9c5444dea1e07e005484014a8231aa667be30b6" }, "hererocks": { "branch": "master", "commit": "c9c5444dea1e07e005484014a8231aa667be30b6" },
"indent-blankline.nvim": { "branch": "master", "commit": "e10626f7fcd51ccd56d7ffc00883ba7e0aa28f78" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"lazy.nvim": { "branch": "main", "commit": "7527af40ddd4a93a02911be570b32609b9d4ea53" }, "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
"lazygit.nvim": { "branch": "main", "commit": "adc37c5a6d7d6e8d0a039f08f3c7837971a1c77a" }, "lazygit.nvim": { "branch": "main", "commit": "b9eae3badab982e71abab96d3ee1d258f0c07961" },
"lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" }, "lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" },
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, "lualine.nvim": { "branch": "master", "commit": "15884cee63a8c205334ab13ab1c891cd4d27101a" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "f75e877f5266e87523eb5a18fcde2081820d087b" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "d39a75bbce4b8aad5d627191ea915179c77c100f" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "374c78d3ebb5c53f43ea6bd906b6587b5e899b9e" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "mason.nvim": { "branch": "main", "commit": "7c7318e8bae7e3536ef6b9e86b9e38e74f2e125e" },
"mini.nvim": { "branch": "main", "commit": "87fc38a8a2b8d498cecb021d057a38ea2e9f5a79" }, "mini.nvim": { "branch": "main", "commit": "009435c6c3653d54bc62997ca6b2e8513bc52cf4" },
"neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, "nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" },
"nvim-autopairs": { "branch": "master", "commit": "3d02855468f94bf435db41b661b58ec4f48a06b7" }, "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
"nvim-cmp": { "branch": "main", "commit": "12509903a5723a876abd65953109f926f4634c30" }, "nvim-dap": { "branch": "master", "commit": "8df427aeba0a06c6577dc3ab82de3076964e3b8d" },
"nvim-lint": { "branch": "master", "commit": "789b7ada1b4f00e08d026dffde410dcfa6a0ba87" }, "nvim-dap-ui": { "branch": "master", "commit": "73a26abf4941aa27da59820fd6b028ebcdbcf932" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "df66808cd78b5a97576bbaeee95ed5ca385a9750" },
"nvim-lint": { "branch": "master", "commit": "c4043f48eb7e16bcfe96de1d9b718b695ff95ed6" },
"nvim-lsp-file-operations": { "branch": "master", "commit": "9744b738183a5adca0f916527922078a965515ed" }, "nvim-lsp-file-operations": { "branch": "master", "commit": "9744b738183a5adca0f916527922078a965515ed" },
"nvim-lspconfig": { "branch": "master", "commit": "66bc018936c6ff76beb75f89d986af6442db4001" }, "nvim-lspconfig": { "branch": "master", "commit": "61e5109c8cf24807e4ae29813a3a82b31821dd45" },
"nvim-surround": { "branch": "main", "commit": "ae298105122c87bbe0a36b1ad20b06d417c0433e" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
"nvim-tree.lua": { "branch": "master", "commit": "70825f23db61ecd900c4cfea169bffe931926a9d" }, "nvim-surround": { "branch": "main", "commit": "0e62500b98f4513feaaf7425c135472457ea5b7d" },
"nvim-treesitter": { "branch": "master", "commit": "53a6b3993f5803378d4d031bf114c0b125a52ba8" }, "nvim-tree.lua": { "branch": "master", "commit": "e7d1b7dadc62fe2eccc17d814354b0a5688621ce" },
"nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, "nvim-treesitter": { "branch": "master", "commit": "066fd6505377e3fd4aa219e61ce94c2b8bdb0b79" },
"nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" },
"nvim-web-devicons": { "branch": "master", "commit": "402377242b04be3f4f0f3720bd952df86e946c30" }, "nvim-web-devicons": { "branch": "master", "commit": "f1420728f59843eb2ef084406b3d0201a0a0932d" },
"onedark.nvim": { "branch": "master", "commit": "67a74c275d1116d575ab25485d1bfa6b2a9c38a6" }, "onedark.nvim": { "branch": "master", "commit": "11de4da47f3e69cb70c3ae9816bd8af166cbe121" },
"plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"rest.nvim": { "branch": "main", "commit": "62606c3599bd304227457d6e20580965939b191e" }, "rest.nvim": { "branch": "main", "commit": "2ded89dbda1fd3c1430685ffadf2df8beb28336d" },
"substitute.nvim": { "branch": "main", "commit": "97f49d16f8eea7967d41db4f657dd63af53eeba1" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" }, "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
"telescope.nvim": { "branch": "master", "commit": "415af52339215926d705cccc08145f3782c4d132" },
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
"trouble.nvim": { "branch": "main", "commit": "6f380b8826fb819c752c8fd7daaee9ef96d4c689" }, "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" },
"vim-css-color": { "branch": "master", "commit": "14fd934cdd9ca1ac0e53511094e612eb9bace373" }, "vim-css-color": { "branch": "master", "commit": "14fd934cdd9ca1ac0e53511094e612eb9bace373" },
"which-key.nvim": { "branch": "main", "commit": "0e76a87ac51772569aec678dc74baa8e2a86100c" } "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
} }

View File

@ -3,7 +3,7 @@ vim.o.cursorline = true
vim.o.expandtab = true vim.o.expandtab = true
-- Mouse -- Mouse
vim.o.mouse = 'a' vim.o.mouse = "a"
-- Line numbers -- Line numbers
vim.o.number = true vim.o.number = true
@ -21,7 +21,7 @@ vim.o.wrap = false
vim.o.showmode = false vim.o.showmode = false
-- Undo -- Undo
vim.o.undodir = vim.fn.expand('~/.vim/undo') vim.o.undodir = vim.fn.expand("~/.vim/undo")
vim.o.undofile = true vim.o.undofile = true
vim.o.undolevels = 1024 vim.o.undolevels = 1024

View File

@ -1,15 +1,17 @@
vim.g.mapleader = ' ' vim.g.mapleader = " "
vim.g.maplocalleader = ' ' vim.g.maplocalleader = " "
-- Insert mode tweaks -- Insert mode tweaks
vim.keymap.set('i', 'jk', '<ESC>', { desc = 'Exit insert mode' }) vim.keymap.set("i", "jk", "<ESC>", { desc = "Exit insert mode" })
-- Window management -- Window management
vim.keymap.set('n', '<leader>sv', '<C-w>v', { desc = 'Split window vertically' }) vim.keymap.set("n", "<leader>sv", "<C-w>v", { desc = "Split window vertically" })
vim.keymap.set('n', '<leader>sh', '<C-w>h', { desc = 'Split window horizonatally' }) vim.keymap.set("n", "<leader>sh", "<C-w>h", { desc = "Split window horizonatally" })
vim.keymap.set('n', '<leader>se', '<C-w>=', { desc = 'Make splits equal size' }) vim.keymap.set("n", "<leader>se", "<C-w>=", { desc = "Make splits equal size" })
vim.keymap.set('n', '<leader>sx', '<cmd>close<cr>', { desc = 'Close current split' }) vim.keymap.set("n", "<leader>sx", "<cmd>close<cr>", { desc = "Close current split" })
-- Buffer management -- Buffer management
vim.keymap.set('n', '<leader>bn', '<cmd>bn<cr>', { desc = 'Next buffer' }) vim.keymap.set("n", "<leader>bn", "<cmd>bn<cr>", { desc = "Next buffer" })
vim.keymap.set('n', '<leader>bp', '<cmd>bp<cr>', { desc = 'Prev buffer' }) vim.keymap.set("n", "<leader>bp", "<cmd>bp<cr>", { desc = "Prev buffer" })
vim.keymap.set("n", "<leader>bd", "<cmd>bd<cr>", { desc = "Close buffer" })
vim.keymap.set("n", "<leader>ba", "<cmd>1,.-bd|.+,$bd<cr>", { desc = "Close other buffers" })

View File

@ -1 +1 @@
vim.cmd('let g:netrw_liststyle = 3') vim.cmd("let g:netrw_liststyle = 3")

View File

@ -6,14 +6,14 @@
-- Load nvim color scheme: -- Load nvim color scheme:
-- Change the 'require' values with your color scheme -- Change the 'require' values with your color scheme
local status_ok, color_scheme = pcall(require, 'onedark') local status_ok, color_scheme = pcall(require, "onedark")
if not status_ok then if not status_ok then
return return
end end
-- OneDark styles: dark, darker, cool, deep, warm, warmer, light -- OneDark styles: dark, darker, cool, deep, warm, warmer, light
require('onedark').setup { require("onedark").setup({
style = 'deep', style = "deep",
colors = { fg = '#b2bbcc' }, --default: #a0a8b7 colors = { fg = "#b2bbcc" }, --default: #a0a8b7
} })
require('onedark').load() require("onedark").load()

View File

@ -5,15 +5,15 @@
-- Plugin manager: lazy.nvim -- Plugin manager: lazy.nvim
-- url: https://github.com/folke/lazy.nvim -- url: https://github.com/folke/lazy.nvim
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim' local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = 'https://github.com/folke/lazy.nvim.git' local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }) local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({ vim.api.nvim_echo({
{ 'Failed to clone lazy.nvim:\n', 'ErrorMsg' }, { "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, 'WarningMsg' }, { out, "WarningMsg" },
{ '\nPress any key to exit...' }, { "\nPress any key to exit..." },
}, true, {}) }, true, {})
vim.fn.getchar() vim.fn.getchar()
os.exit(1) os.exit(1)
@ -21,7 +21,7 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
end end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
require('lazy').setup('lazy-plugins', { require("lazy").setup("lazy-plugins", {
checker = { checker = {
enabled = true, enabled = true,
notify = false, notify = false,
@ -30,4 +30,3 @@ require('lazy').setup('lazy-plugins', {
notify = false, notify = false,
}, },
}) })

View File

@ -0,0 +1,207 @@
---@param config {type?:string, args?:string[]|fun():string[]?}
local function get_args(config)
local args = type(config.args) == "function" and (config.args() or {}) or config.args or {} --[[@as string[] | string ]]
local args_str = type(args) == "table" and table.concat(args, " ") or args --[[@as string]]
config = vim.deepcopy(config)
---@cast args string[]
config.args = function()
local new_args = vim.fn.expand(vim.fn.input("Run with args: ", args_str)) --[[@as string]]
if config.type and config.type == "java" then
---@diagnostic disable-next-line: return-type-mismatch
return new_args
end
return require("dap.utils").splitstr(new_args)
end
return config
end
return {
{
"mfussenegger/nvim-dap",
dependencies = {
"rcarriga/nvim-dap-ui",
-- virtual text for the debugger
{
"theHamsta/nvim-dap-virtual-text",
opts = {},
},
},
keys = {
{
"<leader>dB",
function()
require("dap").set_breakpoint(vim.fn.input("Breakpoint condition: "))
end,
desc = "Breakpoint Condition",
},
{
"<leader>db",
function()
require("dap").toggle_breakpoint()
end,
desc = "Toggle Breakpoint",
},
{
"<leader>dc",
function()
require("dap").continue()
end,
desc = "Run/Continue",
},
{
"<leader>da",
function()
require("dap").continue({ before = get_args })
end,
desc = "Run with Args",
},
{
"<leader>dC",
function()
require("dap").run_to_cursor()
end,
desc = "Run to Cursor",
},
{
"<leader>dg",
function()
require("dap").goto_()
end,
desc = "Go to Line (No Execute)",
},
{
"<leader>di",
function()
require("dap").step_into()
end,
desc = "Step Into",
},
{
"<leader>dj",
function()
require("dap").down()
end,
desc = "Down",
},
{
"<leader>dk",
function()
require("dap").up()
end,
desc = "Up",
},
{
"<leader>dl",
function()
require("dap").run_last()
end,
desc = "Run Last",
},
{
"<leader>do",
function()
require("dap").step_out()
end,
desc = "Step Out",
},
{
"<leader>dO",
function()
require("dap").step_over()
end,
desc = "Step Over",
},
{
"<leader>dP",
function()
require("dap").pause()
end,
desc = "Pause",
},
{
"<leader>dr",
function()
require("dap").repl.toggle()
end,
desc = "Toggle REPL",
},
{
"<leader>ds",
function()
require("dap").session()
end,
desc = "Session",
},
{
"<leader>dt",
function()
require("dap").terminate()
end,
desc = "Terminate",
},
{
"<leader>dw",
function()
require("dap.ui.widgets").hover()
end,
desc = "Widgets",
},
},
},
-- fancy UI for the debugger
{
"rcarriga/nvim-dap-ui",
dependencies = { "nvim-neotest/nvim-nio" },
keys = {
{
"<leader>du",
function()
require("dapui").toggle({})
end,
desc = "Dap UI",
},
{
"<leader>de",
function()
require("dapui").eval()
end,
desc = "Eval",
mode = { "n", "v" },
},
},
opts = {},
config = function(_, opts)
local dap = require("dap")
local dapui = require("dapui")
dapui.setup(opts)
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open({})
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close({})
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close({})
end
end,
},
-- mason.nvim integration
{
"jay-babu/mason-nvim-dap.nvim",
dependencies = "mason.nvim",
cmd = { "DapInstall", "DapUninstall" },
opts = {
-- Makes a best effort to setup the various debuggers with
-- reasonable debug configurations
automatic_installation = true,
automatic_config = true,
-- You can provide additional configuration to the handlers,
-- see mason-nvim-dap README for more information
handlers = {},
},
},
}

View File

@ -1,8 +1,8 @@
return { return {
'rmagatti/auto-session', "rmagatti/auto-session",
event = 'VeryLazy', event = "VeryLazy",
config = function() config = function()
local auto_session = require('auto-session') local auto_session = require("auto-session")
auto_session.setup({ auto_session.setup({
auto_restore_enabled = false, auto_restore_enabled = false,
@ -10,14 +10,14 @@ return {
end, end,
keys = { keys = {
{ {
'<leader>wr', "<leader>wr",
'<cmd>SessionRestore<cr>', "<cmd>SessionRestore<cr>",
desc = 'Session restore', desc = "Session restore",
}, },
{ {
'<leader>ws', "<leader>ws",
'<cmd>SessionSave<cr>', "<cmd>SessionSave<cr>",
desc = 'Session save', desc = "Session save",
} },
}, },
} }

View File

@ -1,31 +1,30 @@
-- Autopairs -- Autopairs
return { return {
'windwp/nvim-autopairs', "windwp/nvim-autopairs",
event = 'InsertEnter', event = "InsertEnter",
dependencies = { dependencies = {
'hrsh7th/nvim-cmp', "hrsh7th/nvim-cmp",
}, },
config = function() config = function()
-- import nvim-autopairs -- import nvim-autopairs
local autopairs = require('nvim-autopairs') local autopairs = require("nvim-autopairs")
-- configure autopairs -- configure autopairs
autopairs.setup({ autopairs.setup({
check_ts = true, -- enable treesitter check_ts = true, -- enable treesitter
ts_config = { ts_config = {
lua = { 'string' }, -- don't add pairs in lua string treesitter nodes lua = { "string" }, -- don't add pairs in lua string treesitter nodes
javascript = { 'template_string' }, -- don't add pairs in javscript template_string treesitter nodes javascript = { "template_string" }, -- don't add pairs in javscript template_string treesitter nodes
java = false, -- don't check treesitter on java
}, },
}) })
-- import nvim-autopairs completion functionality -- import nvim-autopairs completion functionality
local cmp_autopairs = require('nvim-autopairs.completion.cmp') local cmp_autopairs = require("nvim-autopairs.completion.cmp")
-- import nvim-cmp plugin (completions plugin) -- import nvim-cmp plugin (completions plugin)
local cmp = require('cmp') local cmp = require("cmp")
-- make autopairs and completion work together -- make autopairs and completion work together
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done()) cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
end, end,
} }

View File

@ -1,20 +1,20 @@
return { return {
'folke/todo-comments.nvim', "folke/todo-comments.nvim",
event = { 'BufReadPre', 'BufNewFile' }, event = { "BufReadPre", "BufNewFile" },
dependencies = { 'nvim-lua/plenary.nvim' }, dependencies = { "nvim-lua/plenary.nvim" },
config = function() config = function()
local todo_comments = require('todo-comments') local todo_comments = require("todo-comments")
-- set keymaps -- set keymaps
local keymap = vim.keymap -- for conciseness local keymap = vim.keymap -- for conciseness
keymap.set('n', ']t', function() keymap.set("n", "]t", function()
todo_comments.jump_next() todo_comments.jump_next()
end, { desc = 'Next todo comment' }) end, { desc = "Next todo comment" })
keymap.set('n', '[t', function() keymap.set("n", "[t", function()
todo_comments.jump_prev() todo_comments.jump_prev()
end, { desc = 'Previous todo comment' }) end, { desc = "Previous todo comment" })
todo_comments.setup() todo_comments.setup()
end, end,

View File

@ -1,13 +1,13 @@
return { return {
'numToStr/Comment.nvim', "numToStr/Comment.nvim",
event = { 'BufReadPre', 'BufNewFile' }, event = { "BufReadPre", "BufNewFile" },
dependencies = { dependencies = {
'JoosepAlviste/nvim-ts-context-commentstring', "JoosepAlviste/nvim-ts-context-commentstring",
}, },
config = function() config = function()
-- import comment plugin safely -- import comment plugin safely
local comment = require('Comment') local comment = require("Comment")
local ts_context_commentstring = require('ts_context_commentstring.integrations.comment_nvim') local ts_context_commentstring = require("ts_context_commentstring.integrations.comment_nvim")
-- enable comment -- enable comment
comment.setup({ comment.setup({

View File

@ -1,6 +1,5 @@
-- CSS color -- CSS color
return { return {
'ap/vim-css-color', "ap/vim-css-color",
ft = { "css" },
} }

View File

@ -1,4 +1,4 @@
-- Diffview -- Diffview
return { return {
'sindrets/diffview.nvim', "sindrets/diffview.nvim",
} }

View File

@ -1,19 +1,19 @@
return { return {
'kdheepak/lazygit.nvim', "kdheepak/lazygit.nvim",
cmd = { cmd = {
'LazyGit', "LazyGit",
'LazyGitConfig', "LazyGitConfig",
'LazyGitCurrentFile', "LazyGitCurrentFile",
'LazyGitFilter', "LazyGitFilter",
'LazyGitFilterCurrentFile', "LazyGitFilterCurrentFile",
}, },
-- optional for floating window border decoration -- optional for floating window border decoration
dependencies = { dependencies = {
'nvim-lua/plenary.nvim', "nvim-lua/plenary.nvim",
}, },
-- setting the keybinding for LazyGit with 'keys' is recommended in -- setting the keybinding for LazyGit with 'keys' is recommended in
-- order to load the plugin when the command is run for the first time -- order to load the plugin when the command is run for the first time
keys = { keys = {
{ '<leader>lg', '<cmd>LazyGit<cr>', desc = 'Open lazy git' }, { "<leader>hg", "<cmd>LazyGit<cr>", desc = "Open lazy git" },
}, },
} }

View File

@ -1,7 +1,7 @@
-- Git signs -- Git signs
return { return {
'lewis6991/gitsigns.nvim', "lewis6991/gitsigns.nvim",
event = { 'BufReadPre', 'BufNewFile' }, event = { "BufReadPre", "BufNewFile" },
opts = { opts = {
on_attach = function(bufnr) on_attach = function(bufnr)
local gs = package.loaded.gitsigns local gs = package.loaded.gitsigns
@ -11,38 +11,38 @@ return {
end end
-- Navigation -- Navigation
map('n', ']h', gs.next_hunk, 'Next Hunk') map("n", "]h", gs.next_hunk, "Next Hunk")
map('n', '[h', gs.prev_hunk, 'Prev Hunk') map("n", "[h", gs.prev_hunk, "Prev Hunk")
-- Actions -- Actions
map('n', '<leader>hs', gs.stage_hunk, 'Stage hunk') map("n", "<leader>hs", gs.stage_hunk, "Stage hunk")
map('n', '<leader>hr', gs.reset_hunk, 'Reset hunk') map("n", "<leader>hr", gs.reset_hunk, "Reset hunk")
map('v', '<leader>hs', function() map("v", "<leader>hs", function()
gs.stage_hunk({ vim.fn.line('.'), vim.fn.line('v') }) gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") })
end, 'Stage hunk') end, "Stage hunk")
map('v', '<leader>hr', function() map("v", "<leader>hr", function()
gs.reset_hunk({ vim.fn.line('.'), vim.fn.line('v') }) gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") })
end, 'Reset hunk') end, "Reset hunk")
map('n', '<leader>hS', gs.stage_buffer, 'Stage buffer') map("n", "<leader>hS", gs.stage_buffer, "Stage buffer")
map('n', '<leader>hR', gs.reset_buffer, 'Reset buffer') map("n", "<leader>hR", gs.reset_buffer, "Reset buffer")
map('n', '<leader>hu', gs.undo_stage_hunk, 'Undo stage hunk') map("n", "<leader>hu", gs.undo_stage_hunk, "Undo stage hunk")
map('n', '<leader>hp', gs.preview_hunk, 'Preview hunk') map("n", "<leader>hp", gs.preview_hunk, "Preview hunk")
map('n', '<leader>hb', function() map("n", "<leader>hb", function()
gs.blame_line({ full = true }) gs.blame_line({ full = true })
end, 'Blame line') end, "Blame line")
map('n', '<leader>hB', gs.toggle_current_line_blame, 'Toggle line blame') map("n", "<leader>hB", gs.toggle_current_line_blame, "Toggle line blame")
map('n', '<leader>hd', gs.diffthis, 'Diff this') map("n", "<leader>hd", gs.diffthis, "Diff this")
map('n', '<leader>hD', function() map("n", "<leader>hD", function()
gs.diffthis('~') gs.diffthis("~")
end, 'Diff this ~') end, "Diff this ~")
-- Text object -- Text object
map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>', 'Gitsigns select hunk') map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", "Gitsigns select hunk")
end, end,
}, },
} }

View File

@ -1,12 +0,0 @@
-- Indent blankline
return {
'lukas-reineke/indent-blankline.nvim',
event = {
'BufReadPre',
'BufNewFile',
},
main = 'ibl',
opts = {
indent = { char = '' },
},
}

View File

@ -1,17 +0,0 @@
return {
'gbprod/substitute.nvim',
event = { 'BufReadPre', 'BufNewFile' },
config = function()
local substitute = require('substitute')
substitute.setup()
-- set keymaps
local keymap = vim.keymap -- for conciseness
keymap.set('n', 's', substitute.operator, { desc = 'Substitute with motion' })
keymap.set('n', 'ss', substitute.line, { desc = 'Substitute line' })
keymap.set('n', 'S', substitute.eol, { desc = 'Substitute to end of line' })
keymap.set('x', 's', substitute.visual, { desc = 'Substitute in visual mode' })
end,
}

View File

@ -1,7 +1,7 @@
-- Surround -- Surround
return { return {
'kylechui/nvim-surround', "kylechui/nvim-surround",
event = { 'BufReadPre', 'BufNewFile' }, event = { "BufReadPre", "BufNewFile" },
version = '*', -- Use for stability; omit to use `main` branch for the latest features version = "*", -- Use for stability; omit to use `main` branch for the latest features
config = true, config = true,
} }

View File

@ -1,9 +1,9 @@
return { return {
'rest-nvim/rest.nvim', "rest-nvim/rest.nvim",
dependencies = { { 'nvim-lua/plenary.nvim' } }, dependencies = { { "nvim-lua/plenary.nvim" } },
event = 'BufEnter *.http', event = "BufEnter *.http",
config = function() config = function()
require('rest-nvim').setup({ require("rest-nvim").setup({
-- Open request results in a horizontal split -- Open request results in a horizontal split
result_split_horizontal = false, result_split_horizontal = false,
-- Keep the http file buffer above|left when split horizontal|vertical -- Keep the http file buffer above|left when split horizontal|vertical
@ -33,21 +33,21 @@ return {
-- executables or functions for formatting response body [optional] -- executables or functions for formatting response body [optional]
-- set them to false if you want to disable them -- set them to false if you want to disable them
formatters = { formatters = {
json = 'jq', json = "jq",
html = function(body) html = function(body)
return vim.fn.system({'tidy', '-i', '-q', '-'}, body) return vim.fn.system({ "tidy", "-i", "-q", "-" }, body)
end end,
}, },
}, },
-- Jump to request line on run -- Jump to request line on run
jump_to_request = false, jump_to_request = false,
env_file = '.env', env_file = ".env",
-- for telescope select -- for telescope select
env_pattern = '\\.env$', env_pattern = "\\.env$",
env_edit_command = 'tabedit', env_edit_command = "tabedit",
custom_dynamic_variables = {}, custom_dynamic_variables = {},
yank_dry_run = true, yank_dry_run = true,
search_back = true, search_back = true,
}) })
end end,
} }

View File

@ -0,0 +1,38 @@
return {
"stevearc/conform.nvim",
event = { "BufReadPre", "BufNewFile" },
config = function()
local conform = require("conform")
conform.setup({
formatters_by_ft = {
javascript = { "prettier" },
typescript = { "prettier" },
svelte = { "prettier" },
css = { "prettier" },
html = { "prettier" },
json = { "prettier" },
yaml = { "prettier" },
markdown = { "prettier" },
graphql = { "prettier" },
liquid = { "prettier" },
lua = { "stylua" },
python = { "isort", "black" },
sql = { "sqruff" },
},
format_on_save = {
lsp_fallback = true,
async = false,
timeout_ms = 1000,
},
})
vim.keymap.set({ "n", "v" }, "<leader>mp", function()
conform.format({
lsp_fallback = true,
async = false,
timeout_ms = 1000,
})
end, { desc = "Format file or range (in visual mode)" })
end,
}

View File

@ -1,37 +0,0 @@
return {
'stevearc/conform.nvim',
event = { 'BufReadPre', 'BufNewFile' },
config = function()
local conform = require('conform')
conform.setup({
formatters_by_ft = {
javascript = { 'prettier' },
typescript = { 'prettier' },
svelte = { 'prettier' },
css = { 'prettier' },
html = { 'prettier' },
json = { 'prettier' },
yaml = { 'prettier' },
markdown = { 'prettier' },
graphql = { 'prettier' },
liquid = { 'prettier' },
lua = { 'stylua' },
python = { 'isort', 'black' },
},
format_on_save = {
lsp_fallback = true,
async = false,
timeout_ms = 1000,
},
})
vim.keymap.set({ 'n', 'v' }, '<leader>mp', function()
conform.format({
lsp_fallback = true,
async = false,
timeout_ms = 1000,
})
end, { desc = 'Format file or range (in visual mode)' })
end,
}

View File

@ -1,27 +1,27 @@
return { return {
'mfussenegger/nvim-lint', "mfussenegger/nvim-lint",
event = { 'BufReadPre', 'BufNewFile' }, event = { "BufReadPre", "BufNewFile" },
config = function() config = function()
local lint = require('lint') local lint = require("lint")
lint.linters_by_ft = { lint.linters_by_ft = {
javascript = { 'eslint_d' }, javascript = { "eslint_d" },
typescript = { 'eslint_d' }, typescript = { "eslint_d" },
svelte = { 'eslint_d' }, svelte = { "eslint_d" },
python = { 'pylint' }, python = { "pylint" },
} }
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true }) local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, { vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
group = lint_augroup, group = lint_augroup,
callback = function() callback = function()
lint.try_lint() lint.try_lint()
end, end,
}) })
vim.keymap.set('n', '<leader>l', function() vim.keymap.set("n", "<leader>l", function()
lint.try_lint() lint.try_lint()
end, { desc = 'Trigger linting for current file' }) end, { desc = "Trigger linting for current file" })
end, end,
} }

View File

@ -1,106 +1,98 @@
return { return {
'neovim/nvim-lspconfig', "neovim/nvim-lspconfig",
event = { 'BufReadPre', 'BufNewFile' }, event = { "BufReadPre", "BufNewFile" },
dependencies = { dependencies = {
'hrsh7th/cmp-nvim-lsp', "hrsh7th/cmp-nvim-lsp",
{ 'antosha417/nvim-lsp-file-operations', config = true }, "mason-org/mason-lspconfig.nvim",
{ 'folke/neodev.nvim', opts = {} }, { "antosha417/nvim-lsp-file-operations", config = true },
{ "folke/lazydev.nvim", opts = {} },
}, },
config = function() config = function()
-- import lspconfig plugin -- import lspconfig plugin
local lspconfig = require('lspconfig') local lspconfig = require("lspconfig")
-- import mason_lspconfig plugin -- import mason_lspconfig plugin
local mason_lspconfig = require('mason-lspconfig') local mason_lspconfig = require("mason-lspconfig")
-- import cmp-nvim-lsp plugin -- import cmp-nvim-lsp plugin
local cmp_nvim_lsp = require('cmp_nvim_lsp') local cmp_nvim_lsp = require("cmp_nvim_lsp")
local keymap = vim.keymap -- for conciseness local keymap = vim.keymap -- for conciseness
vim.api.nvim_create_autocmd('LspAttach', { vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup('UserLspConfig', {}), group = vim.api.nvim_create_augroup("UserLspConfig", {}),
callback = function(ev) callback = function(ev)
-- Buffer local mappings. -- Buffer local mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions -- See `:help vim.lsp.*` for documentation on any of the below functions
local opts = { buffer = ev.buf, silent = true } local opts = { buffer = ev.buf, silent = true }
-- set keybinds -- set keybinds
opts.desc = 'Show LSP references' opts.desc = "Show LSP references"
keymap.set('n', 'gR', '<cmd>Telescope lsp_references<CR>', opts) -- show definition, references keymap.set("n", "gR", "<cmd>Telescope lsp_references<CR>", opts) -- show definition, references
opts.desc = 'Go to declaration' opts.desc = "Go to declaration"
keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) -- go to declaration keymap.set("n", "gD", vim.lsp.buf.declaration, opts) -- go to declaration
opts.desc = 'Show LSP definitions' opts.desc = "Show LSP definitions"
keymap.set('n', 'gd', '<cmd>Telescope lsp_definitions<CR>', opts) -- show lsp definitions keymap.set("n", "gd", "<cmd>Telescope lsp_definitions<CR>", opts) -- show lsp definitions
opts.desc = 'Show LSP implementations' opts.desc = "Show LSP implementations"
keymap.set('n', 'gi', '<cmd>Telescope lsp_implementations<CR>', opts) -- show lsp implementations keymap.set("n", "gi", "<cmd>Telescope lsp_implementations<CR>", opts) -- show lsp implementations
opts.desc = 'Show LSP type definitions' opts.desc = "Show LSP type definitions"
keymap.set('n', 'gt', '<cmd>Telescope lsp_type_definitions<CR>', opts) -- 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' 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 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' opts.desc = "Smart rename"
keymap.set('n', '<leader>rn', vim.lsp.buf.rename, opts) -- smart rename keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts) -- smart rename
opts.desc = 'Show buffer diagnostics' opts.desc = "Show buffer diagnostics"
keymap.set('n', '<leader>D', '<cmd>Telescope diagnostics bufnr=0<CR>', opts) -- show diagnostics for file keymap.set("n", "<leader>D", "<cmd>Telescope diagnostics bufnr=0<CR>", opts) -- show diagnostics for file
opts.desc = 'Show line diagnostics' opts.desc = "Show line diagnostics"
keymap.set('n', '<leader>d', vim.diagnostic.open_float, opts) -- show diagnostics for line keymap.set("n", "<leader>d", vim.diagnostic.open_float, opts) -- show diagnostics for line
opts.desc = 'Go to previous diagnostic' opts.desc = "Go to previous diagnostic"
keymap.set('n', '[d', vim.diagnostic.goto_prev, opts) -- jump to previous diagnostic in buffer keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) -- jump to previous diagnostic in buffer
opts.desc = 'Go to next diagnostic' opts.desc = "Go to next diagnostic"
keymap.set('n', ']d', vim.diagnostic.goto_next, opts) -- jump to next diagnostic in buffer keymap.set("n", "]d", vim.diagnostic.goto_next, opts) -- jump to next diagnostic in buffer
opts.desc = 'Show documentation for what is under cursor' 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 keymap.set("n", "K", vim.lsp.buf.hover, opts) -- show documentation for what is under cursor
opts.desc = 'Restart LSP' opts.desc = "Restart LSP"
keymap.set('n', '<leader>rs', ':LspRestart<CR>', opts) -- mapping to restart lsp if necessary keymap.set("n", "<leader>rs", ":LspRestart<CR>", opts) -- mapping to restart lsp if necessary
end, end,
}) })
-- Change the Diagnostic symbols in the sign column (gutter)
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
-- used to enable autocompletion (assign to every lsp server config) -- used to enable autocompletion (assign to every lsp server config)
local capabilities = cmp_nvim_lsp.default_capabilities() local capabilities = cmp_nvim_lsp.default_capabilities()
-- Change the Diagnostic symbols in the sign column (gutter) vim.lsp.config["lua_ls"] = {
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
mason_lspconfig.setup_handlers({
-- default handler for installed servers
function(server_name)
lspconfig[server_name].setup({
capabilities = capabilities,
})
end,
['lua_ls'] = function()
-- configure lua server (with special settings)
lspconfig['lua_ls'].setup({
capabilities = capabilities, capabilities = capabilities,
settings = { settings = {
Lua = { Lua = {
-- make the language server recognize 'vim' global -- make the language server recognize 'vim' global
diagnostics = { diagnostics = {
globals = { 'vim' }, globals = { "vim" },
}, },
completion = { completion = {
callSnippet = 'Replace', callSnippet = "Replace",
}, },
}, },
}, },
}) }
end,
}) mason_lspconfig.setup()
end, end,
} }

View File

@ -1,49 +1,19 @@
-- Plenary -- Plenary
return { return {
'williamboman/mason.nvim', "mason-org/mason.nvim",
dependencies = {
'williamboman/mason-lspconfig.nvim',
'WhoIsSethDaniel/mason-tool-installer.nvim',
},
config = function() config = function()
-- import mason -- import mason
local mason = require('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 -- enable mason and configure icons
mason.setup({ mason.setup({
ui = { ui = {
icons = { icons = {
package_installed = '', package_installed = "",
package_pending = '', package_pending = "",
package_uninstalled = '', package_uninstalled = "",
}, },
}, },
}) })
mason_lspconfig.setup({
-- list of servers for mason to install
ensure_installed = {
'html',
'cssls',
'svelte',
'lua_ls',
},
})
mason_tool_installer.setup({
ensure_installed = {
'prettier', -- prettier formatter
'stylua', -- lua formatter
'isort', -- python formatter
'black', -- python formatter
'pylint',
'eslint_d',
},
})
end, end,
} }

View File

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

View File

@ -1,15 +1,15 @@
return { return {
'nvim-treesitter/nvim-treesitter', "nvim-treesitter/nvim-treesitter",
event = { event = {
'BufReadPre', "BufReadPre",
'BufNewFile', "BufNewFile",
}, },
build = ':TSUpdate', build = ":TSUpdate",
dependencies = { dependencies = {
'windwp/nvim-ts-autotag', "windwp/nvim-ts-autotag",
}, },
config = function() config = function()
local treesitter = require('nvim-treesitter.configs') local treesitter = require("nvim-treesitter.configs")
treesitter.setup({ treesitter.setup({
highlight = { highlight = {
@ -22,25 +22,27 @@ return {
enable = true, enable = true,
}, },
ensure_installed = { ensure_installed = {
'json', "json",
'javascript', "javascript",
'yaml', "yaml",
'html', "html",
'css', "css",
'lua', "lua",
'vim', "vim",
'dockerfile', "dockerfile",
'gitignore', "gitignore",
'markdown', "markdown",
'bash', "bash",
"go",
"php",
}, },
incremental_selection = { incremental_selection = {
enable = true, enable = true,
keymaps = { keymaps = {
init_selection = '<C-space>', init_selection = "<C-space>",
node_incremental = '<C-space>', node_incremental = "<C-space>",
scope_incremental = false, scope_incremental = false,
node_decremental = '<bs>', node_decremental = "<bs>",
}, },
}, },
}) })

View File

@ -1,15 +1,19 @@
return { return {
'folke/trouble.nvim', "folke/trouble.nvim",
dependencies = { 'nvim-tree/nvim-web-devicons', 'folke/todo-comments.nvim' }, dependencies = { "nvim-tree/nvim-web-devicons", "folke/todo-comments.nvim" },
opts = { opts = {
focus = true, focus = true,
}, },
cmd = 'Trouble', cmd = "Trouble",
keys = { keys = {
{ '<leader>xw', '<cmd>Trouble diagnostics toggle<CR>', desc = 'Open trouble workspace diagnostics' }, { "<leader>xw", "<cmd>Trouble diagnostics toggle<CR>", desc = "Open trouble workspace diagnostics" },
{ '<leader>xd', '<cmd>Trouble diagnostics toggle filter.buf=0<CR>', desc = 'Open trouble document diagnostics' }, {
{ '<leader>xq', '<cmd>Trouble quickfix toggle<CR>', desc = 'Open trouble quickfix list' }, "<leader>xd",
{ '<leader>xl', '<cmd>Trouble loclist toggle<CR>', desc = 'Open trouble location list' }, "<cmd>Trouble diagnostics toggle filter.buf=0<CR>",
{ '<leader>xt', '<cmd>Trouble todo toggle<CR>', desc = 'Open todos in trouble' }, desc = "Open trouble document diagnostics",
},
{ "<leader>xq", "<cmd>Trouble quickfix toggle<CR>", desc = "Open trouble quickfix list" },
{ "<leader>xl", "<cmd>Trouble loclist toggle<CR>", desc = "Open trouble location list" },
{ "<leader>xt", "<cmd>Trouble todo toggle<CR>", desc = "Open todos in trouble" },
}, },
} }

View File

@ -1,4 +1,4 @@
-- Onedark theme -- Onedark theme
return { return {
'navarasu/onedark.nvim', "navarasu/onedark.nvim",
} }

View File

@ -1,32 +1,32 @@
-- Alpha (start screen/dashboard) -- Alpha (start screen/dashboard)
return { return {
'goolord/alpha-nvim', "goolord/alpha-nvim",
dependencies = { 'nvim-tree/nvim-web-devicons' }, dependencies = { "nvim-tree/nvim-web-devicons" },
event = 'VimEnter', event = "VimEnter",
config = function() config = function()
local alpha = require('alpha') local alpha = require("alpha")
local dashboard = require('alpha.themes.dashboard') local dashboard = require("alpha.themes.dashboard")
-- Set header -- Set header
dashboard.section.header.val = { dashboard.section.header.val = {
' ', " ",
' ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ', " ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ",
' ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ', " ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ",
' ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ', " ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ",
' ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ', " ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ",
' ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ', " ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ",
' ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ', " ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ",
' ', " ",
} }
-- Set menu -- Set menu
dashboard.section.buttons.val = { dashboard.section.buttons.val = {
dashboard.button('e', ' > New File', '<cmd>ene<CR>'), dashboard.button("e", " > New File", "<cmd>ene<CR>"),
dashboard.button('SPC ee', ' > Toggle file explorer', '<cmd>NvimTreeToggle<CR>'), dashboard.button("SPC ee", " > Toggle file explorer", "<cmd>NvimTreeToggle<CR>"),
dashboard.button('SPC ff', '󰱼 > Find File', '<cmd>Telescope find_files<CR>'), dashboard.button("SPC ff", "󰱼 > Find File", "<cmd>Telescope find_files<CR>"),
dashboard.button('SPC fs', ' > Find Word', '<cmd>Telescope live_grep<CR>'), dashboard.button("SPC fs", " > Find Word", "<cmd>Telescope live_grep<CR>"),
dashboard.button('SPC wr', '󰁯 > Restore Session For Current Directory', '<cmd>SessionRestore<CR>'), dashboard.button("SPC wr", "󰁯 > Restore Session For Current Directory", "<cmd>SessionRestore<CR>"),
dashboard.button('q', ' > Quit NVIM', '<cmd>qa<CR>'), dashboard.button("q", " > Quit NVIM", "<cmd>qa<CR>"),
} }
-- Send config to alpha -- Send config to alpha

View File

@ -1,9 +0,0 @@
-- Barbar (tabline bar)
return {
'romgrk/barbar.nvim',
enabled = false,
dependencies = {
'lewis6991/gitsigns.nvim',
'nvim-tree/nvim-web-devicons',
},
}

View File

@ -1,11 +1,12 @@
return { return {
'akinsho/bufferline.nvim', "akinsho/bufferline.nvim",
dependencies = { dependencies = {
'nvim-tree/nvim-web-devicons', "nvim-tree/nvim-web-devicons",
}, },
version = '*', version = "*",
opts = { opts = {
options = { options = {
numbers = "buffer_id",
-- mode = 'tabs', -- mode = 'tabs',
-- separator_style = 'slant', -- separator_style = 'slant',
}, },

View File

@ -1,4 +1,4 @@
return { return {
'stevearc/dressing.nvim', "stevearc/dressing.nvim",
event = 'VeryLazy', event = "VeryLazy",
} }

View File

@ -9,10 +9,11 @@ return {
-- configure lualine with modified theme -- configure lualine with modified theme
lualine.setup({ lualine.setup({
extensions = { "nvim-tree" },
options = { options = {
theme = "onedark", theme = "onedark",
disabled_filetypes = { disabled_filetypes = {
statusline = { "NvimTree" }, statusline = { "trouble" },
}, },
section_separators = "", section_separators = "",
component_separators = "", component_separators = "",

View File

@ -1,7 +1,7 @@
-- Mini.nvim -- Mini.nvim
return { return {
'echasnovski/mini.nvim', "echasnovski/mini.nvim",
config = function() config = function()
require('mini.icons').setup() require("mini.icons").setup()
end end,
} }

View File

@ -1,8 +1,8 @@
return { return {
'nvim-tree/nvim-tree.lua', "nvim-tree/nvim-tree.lua",
dependencies = 'nvim-tree/nvim-web-devicons', dependencies = "nvim-tree/nvim-web-devicons",
config = function() config = function()
local nvimtree = require('nvim-tree') local nvimtree = require("nvim-tree")
vim.g.loaded_netrw = 1 vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1 vim.g.loaded_netrwPlugin = 1
@ -19,8 +19,8 @@ return {
icons = { icons = {
glyphs = { glyphs = {
folder = { folder = {
arrow_closed = '', -- arrow when folder is closed arrow_closed = "", -- arrow when folder is closed
arrow_open = '', -- arrow when folder is open arrow_open = "", -- arrow when folder is open
}, },
}, },
}, },
@ -30,17 +30,9 @@ return {
}, },
}) })
vim.keymap.set('n', '<leader>ef', '<cmd>NvimTreeFindFile<CR>', { desc = 'Move to file in file explorer' }) vim.keymap.set("n", "<leader>ee", "<cmd>NvimTreeToggle<CR>", { desc = "Toggle file explorer" })
vim.keymap.set('n', '<leader>ec', '<cmd>NvimTreeCollapse<CR>', { desc = 'Collapse file explorer' }) vim.keymap.set("n", "<leader>ec", "<cmd>NvimTreeCollapse<CR>", { desc = "Collapse file explorer" })
vim.keymap.set('n', '<leader>er', '<cmd>NvimTreeRefresh<CR>', { desc = 'Refresh file explorer' }) vim.keymap.set("n", "<leader>er", "<cmd>NvimTreeRefresh<CR>", { desc = "Refresh file explorer" })
vim.keymap.set("n", "<leader>ef", "<cmd>NvimTreeFindFile<CR>", { desc = "Move to file in file explorer" })
end, end,
keys = {
{
'<leader>ee',
function()
require('nvim-tree.api').tree.toggle()
end,
desc = 'Toggle file explorer',
},
}
} }

View File

@ -1,5 +0,0 @@
-- Tagbar
return {
'preservim/tagbar',
enabled = false,
}

View File

@ -1,65 +1,65 @@
-- Telescope -- Telescope
return { return {
'nvim-telescope/telescope.nvim', "nvim-telescope/telescope.nvim",
dependencies = { dependencies = {
'nvim-lua/plenary.nvim', "nvim-lua/plenary.nvim",
{ 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }, { "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
'nvim-tree/nvim-web-devicons', "nvim-tree/nvim-web-devicons",
}, },
config = function(_, opts) config = function()
local telescope = require('telescope') local telescope = require("telescope")
local actions = require('telescope.actions') local actions = require("telescope.actions")
telescope.setup({ telescope.setup({
defaults = { defaults = {
path_display = { 'smart' }, path_display = { "smart" },
mappings = { mappings = {
i = { i = {
['<C-k>'] = actions.move_selection_previous, -- move to prev result ["<C-k>"] = actions.move_selection_previous, -- move to prev result
['<C-j>'] = actions.move_selection_next, -- move to next result ["<C-j>"] = actions.move_selection_next, -- move to next result
['<C-q>'] = actions.send_selected_to_qflist + actions.open_qflist, ["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
['<C-d>'] = actions.delete_buffer, ["<C-d>"] = actions.delete_buffer,
} },
} },
} },
}) })
telescope.load_extension('fzf') telescope.load_extension("fzf")
end, end,
keys = { keys = {
{ {
'<leader>ff', "<leader>ff",
'<cmd>Telescope find_files<cr>', "<cmd>Telescope find_files<cr>",
desc = 'Find files', desc = "Find files",
}, },
{ {
'<leader>fg', "<leader>fg",
'<cmd>Telescope live_grep<cr>', "<cmd>Telescope live_grep<cr>",
desc = 'Live grep', desc = "Live grep",
}, },
{ {
'<leader>fb', "<leader>fb",
'<cmd>Telescope buffers<cr>', "<cmd>Telescope buffers<cr>",
desc = 'Buffers' desc = "Buffers",
}, },
{ {
'<leader>fh', "<leader>fh",
'<cmd>Telescope help_tags<cr>', "<cmd>Telescope help_tags<cr>",
desc = 'Help tags', desc = "Help tags",
}, },
{ {
'<leader>fr', "<leader>fr",
'<cmd>Telescope oldfiles<cr>`', "<cmd>Telescope oldfiles<cr>`",
desc = 'Recent files', desc = "Recent files",
}, },
{ {
'<leader>fs', "<leader>fs",
'<cmd>Telescope grep_string<cr>', "<cmd>Telescope grep_string<cr>",
desc = 'Find string', desc = "Find string",
}, },
{ {
'<leader>ft', "<leader>ft",
'<cmd>TodoTelescope<cr>', "<cmd>TodoTelescope<cr>",
desc = 'Find todos', desc = "Find todos",
} },
}, },
} }

View File

@ -1,16 +1,22 @@
return { return {
'folke/which-key.nvim', "folke/which-key.nvim",
event = 'VeryLazy', event = "VeryLazy",
init = function() init = function()
vim.o.timeout = true vim.o.timeout = true
vim.o.timeoutlen = 500 vim.o.timeoutlen = 500
end, end,
config = function() config = function()
local wk = require('which-key') local wk = require("which-key")
wk.register({ wk.add({
{ '<leader>e', group = 'NeoTree' }, { "<leader>b", group = "🗄️ Buffers" },
{ '<leader>f', group = 'Telescope' }, { "<leader>c", group = "💻 Code" },
{ '<leader>s', group = 'splits' }, { "<leader>e", group = "🌲 NeoTree" },
{ "<leader>f", group = "🔭 Telescope" },
{ "<leader>h", group = "✏️ Version control" },
{ "<leader>r", group = "🪐 LSP" },
{ "<leader>s", group = "🪟 Splits" },
{ "<leader>w", group = "💾 Session" },
{ "<leader>x", group = "🚧 Trouble" },
}) })
end, end,
opts = {}, opts = {},

View File

@ -1,125 +0,0 @@
-----------------------------------------------------------
-- Plugin manager configuration file
-----------------------------------------------------------
-- Plugin manager: packer.nvim
-- url: https://github.com/wbthomason/packer.nvim
-- For information about installed plugins see the README:
-- neovim-lua/README.md
-- https://github.com/brainfucksec/neovim-lua#readme
-- Autocommand that reloads neovim whenever you save the packer.lua file
vim.cmd [[
augroup packer_user_config
autocmd!
autocmd BufWritePost packer.lua source <afile> | PackerCompile
augroup end
]]
-- Install plugins
require('packer').startup(function(use)
-- Add you plugins here:
use 'wbthomason/packer.nvim' -- packer can manage itself
-- Sensible defaults
use 'tpope/vim-sensible'
-- Plenary
use 'nvim-lua/plenary.nvim'
-- File explorer
use 'kyazdani42/nvim-tree.lua'
-- Indent line
use 'lukas-reineke/indent-blankline.nvim'
-- CSS color
use 'ap/vim-css-color'
-- Symlink follow
use 'aymericbeaumet/vim-symlink'
-- Git
--use 'tpope/vim-fugitive'
--use 'airblade/vim-gitgutter'
use 'kdheepak/lazygit.nvim'
use {
'lewis6991/gitsigns.nvim',
config = function()
require('gitsigns').setup()
end
}
-- Lastplace
use 'farmergreg/vim-lastplace'
-- Autopair
use {
'windwp/nvim-autopairs',
config = function()
require('nvim-autopairs').setup()
end
}
-- Icons
use 'kyazdani42/nvim-web-devicons'
-- Tag viewer
use 'preservim/tagbar'
-- Treesitter interface
use 'nvim-treesitter/nvim-treesitter'
-- Color schemes
use 'navarasu/onedark.nvim'
use { 'kyoz/purify', rtp = 'vim' }
-- Surround
use 'tpope/vim-surround'
-- LSP
--use 'neovim/nvim-lspconfig'
--use 'glepnir/lspsaga.nvim'
-- Autocomplete
use {
'hrsh7th/nvim-cmp',
requires = {
'L3MON4D3/LuaSnip',
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-path',
'hrsh7th/cmp-buffer',
'saadparwaiz1/cmp_luasnip',
},
}
-- Statusline
use {
'famiu/feline.nvim',
requires = { 'kyazdani42/nvim-web-devicons' },
}
-- Tabline bar
use {
'romgrk/barbar.nvim',
requires = {'kyazdani42/nvim-web-devicons'}
}
-- Dashboard (start screen)
use {
'goolord/alpha-nvim',
requires = { 'kyazdani42/nvim-web-devicons' },
config = function ()
require'alpha'.setup(require'alpha.themes.dashboard'.config)
end
}
-- Automatically set up your configuration after cloning packer.nvim
-- Put this at the end after all plugins
if packer_bootstrap then
require('packer').sync()
end
end)