diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index f93ead1..41b8005 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -1,7 +1,7 @@ -require('core/keymap') +require("core/keymap") -require('lazy-init') +require("lazy-init") -require('core/basic-vars') -require('core/options') -require('core/theme') +require("core/basic-vars") +require("core/options") +require("core/theme") diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 8f1ff1c..819472b 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,48 +1,50 @@ { "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, - "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, + "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, "alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" }, - "auto-session": { "branch": "main", "commit": "82630e2f70be140f8dcc75a12e2ee2839e8488c2" }, + "auto-session": { "branch": "main", "commit": "00334ee24b9a05001ad50221c8daffbeedaa0842" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, - "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" }, + "cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "conform.nvim": { "branch": "master", "commit": "363243c03102a531a8203311d4f2ae704c620d9b" }, + "conform.nvim": { "branch": "master", "commit": "374aaf384e2e841607b8e2fe63fa3ad01d111c91" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, - "dressing.nvim": { "branch": "master", "commit": "56ef6a969a4990d938c5fed40c370f65e125fc97" }, - "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, - "gitsigns.nvim": { "branch": "main", "commit": "9b36d497495436c135659902054ee637e0ba6021" }, + "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, + "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, + "gitsigns.nvim": { "branch": "main", "commit": "43b0c856ae5f32a195d83f4a27fe21d63e6c966c" }, "hererocks": { "branch": "master", "commit": "c9c5444dea1e07e005484014a8231aa667be30b6" }, - "indent-blankline.nvim": { "branch": "master", "commit": "e10626f7fcd51ccd56d7ffc00883ba7e0aa28f78" }, - "lazy.nvim": { "branch": "main", "commit": "7527af40ddd4a93a02911be570b32609b9d4ea53" }, - "lazygit.nvim": { "branch": "main", "commit": "adc37c5a6d7d6e8d0a039f08f3c7837971a1c77a" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, + "lazygit.nvim": { "branch": "main", "commit": "b9eae3badab982e71abab96d3ee1d258f0c07961" }, "lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" }, - "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "f75e877f5266e87523eb5a18fcde2081820d087b" }, - "mason-tool-installer.nvim": { "branch": "main", "commit": "374c78d3ebb5c53f43ea6bd906b6587b5e899b9e" }, - "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "mini.nvim": { "branch": "main", "commit": "87fc38a8a2b8d498cecb021d057a38ea2e9f5a79" }, - "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, - "nvim-autopairs": { "branch": "master", "commit": "3d02855468f94bf435db41b661b58ec4f48a06b7" }, - "nvim-cmp": { "branch": "main", "commit": "12509903a5723a876abd65953109f926f4634c30" }, - "nvim-lint": { "branch": "master", "commit": "789b7ada1b4f00e08d026dffde410dcfa6a0ba87" }, + "lualine.nvim": { "branch": "master", "commit": "15884cee63a8c205334ab13ab1c891cd4d27101a" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "d39a75bbce4b8aad5d627191ea915179c77c100f" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" }, + "mason.nvim": { "branch": "main", "commit": "7c7318e8bae7e3536ef6b9e86b9e38e74f2e125e" }, + "mini.nvim": { "branch": "main", "commit": "009435c6c3653d54bc62997ca6b2e8513bc52cf4" }, + "nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" }, + "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, + "nvim-dap": { "branch": "master", "commit": "8df427aeba0a06c6577dc3ab82de3076964e3b8d" }, + "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-lspconfig": { "branch": "master", "commit": "66bc018936c6ff76beb75f89d986af6442db4001" }, - "nvim-surround": { "branch": "main", "commit": "ae298105122c87bbe0a36b1ad20b06d417c0433e" }, - "nvim-tree.lua": { "branch": "master", "commit": "70825f23db61ecd900c4cfea169bffe931926a9d" }, - "nvim-treesitter": { "branch": "master", "commit": "53a6b3993f5803378d4d031bf114c0b125a52ba8" }, - "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, + "nvim-lspconfig": { "branch": "master", "commit": "61e5109c8cf24807e4ae29813a3a82b31821dd45" }, + "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, + "nvim-surround": { "branch": "main", "commit": "0e62500b98f4513feaaf7425c135472457ea5b7d" }, + "nvim-tree.lua": { "branch": "master", "commit": "e7d1b7dadc62fe2eccc17d814354b0a5688621ce" }, + "nvim-treesitter": { "branch": "master", "commit": "066fd6505377e3fd4aa219e61ce94c2b8bdb0b79" }, + "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, - "nvim-web-devicons": { "branch": "master", "commit": "402377242b04be3f4f0f3720bd952df86e946c30" }, - "onedark.nvim": { "branch": "master", "commit": "67a74c275d1116d575ab25485d1bfa6b2a9c38a6" }, - "plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" }, - "rest.nvim": { "branch": "main", "commit": "62606c3599bd304227457d6e20580965939b191e" }, - "substitute.nvim": { "branch": "main", "commit": "97f49d16f8eea7967d41db4f657dd63af53eeba1" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" }, - "telescope.nvim": { "branch": "master", "commit": "415af52339215926d705cccc08145f3782c4d132" }, + "nvim-web-devicons": { "branch": "master", "commit": "f1420728f59843eb2ef084406b3d0201a0a0932d" }, + "onedark.nvim": { "branch": "master", "commit": "11de4da47f3e69cb70c3ae9816bd8af166cbe121" }, + "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, + "rest.nvim": { "branch": "main", "commit": "2ded89dbda1fd3c1430685ffadf2df8beb28336d" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, + "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, "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" }, - "which-key.nvim": { "branch": "main", "commit": "0e76a87ac51772569aec678dc74baa8e2a86100c" } + "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } } diff --git a/nvim/.config/nvim/lua/core/basic-vars.lua b/nvim/.config/nvim/lua/core/basic-vars.lua index 50a7a7b..51d3caa 100644 --- a/nvim/.config/nvim/lua/core/basic-vars.lua +++ b/nvim/.config/nvim/lua/core/basic-vars.lua @@ -3,7 +3,7 @@ vim.o.cursorline = true vim.o.expandtab = true -- Mouse -vim.o.mouse = 'a' +vim.o.mouse = "a" -- Line numbers vim.o.number = true @@ -21,7 +21,7 @@ vim.o.wrap = false vim.o.showmode = false -- Undo -vim.o.undodir = vim.fn.expand('~/.vim/undo') +vim.o.undodir = vim.fn.expand("~/.vim/undo") vim.o.undofile = true vim.o.undolevels = 1024 diff --git a/nvim/.config/nvim/lua/core/keymap.lua b/nvim/.config/nvim/lua/core/keymap.lua index 9dec9c4..69482d8 100644 --- a/nvim/.config/nvim/lua/core/keymap.lua +++ b/nvim/.config/nvim/lua/core/keymap.lua @@ -1,15 +1,17 @@ -vim.g.mapleader = ' ' -vim.g.maplocalleader = ' ' +vim.g.mapleader = " " +vim.g.maplocalleader = " " -- Insert mode tweaks -vim.keymap.set('i', 'jk', '', { desc = 'Exit insert mode' }) +vim.keymap.set("i", "jk", "", { desc = "Exit insert mode" }) -- Window management -vim.keymap.set('n', 'sv', 'v', { desc = 'Split window vertically' }) -vim.keymap.set('n', 'sh', 'h', { desc = 'Split window horizonatally' }) -vim.keymap.set('n', 'se', '=', { desc = 'Make splits equal size' }) -vim.keymap.set('n', 'sx', 'close', { desc = 'Close current split' }) +vim.keymap.set("n", "sv", "v", { desc = "Split window vertically" }) +vim.keymap.set("n", "sh", "h", { desc = "Split window horizonatally" }) +vim.keymap.set("n", "se", "=", { desc = "Make splits equal size" }) +vim.keymap.set("n", "sx", "close", { desc = "Close current split" }) -- Buffer management -vim.keymap.set('n', 'bn', 'bn', { desc = 'Next buffer' }) -vim.keymap.set('n', 'bp', 'bp', { desc = 'Prev buffer' }) +vim.keymap.set("n", "bn", "bn", { desc = "Next buffer" }) +vim.keymap.set("n", "bp", "bp", { desc = "Prev buffer" }) +vim.keymap.set("n", "bd", "bd", { desc = "Close buffer" }) +vim.keymap.set("n", "ba", "1,.-bd|.+,$bd", { desc = "Close other buffers" }) diff --git a/nvim/.config/nvim/lua/core/options.lua b/nvim/.config/nvim/lua/core/options.lua index dadd5a9..d0bd5bf 100644 --- a/nvim/.config/nvim/lua/core/options.lua +++ b/nvim/.config/nvim/lua/core/options.lua @@ -1 +1 @@ -vim.cmd('let g:netrw_liststyle = 3') +vim.cmd("let g:netrw_liststyle = 3") diff --git a/nvim/.config/nvim/lua/core/theme.lua b/nvim/.config/nvim/lua/core/theme.lua index 975b885..e8b9148 100644 --- a/nvim/.config/nvim/lua/core/theme.lua +++ b/nvim/.config/nvim/lua/core/theme.lua @@ -6,14 +6,14 @@ -- Load nvim 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 - return + return end -- OneDark styles: dark, darker, cool, deep, warm, warmer, light -require('onedark').setup { - style = 'deep', - colors = { fg = '#b2bbcc' }, --default: #a0a8b7 -} -require('onedark').load() +require("onedark").setup({ + style = "deep", + colors = { fg = "#b2bbcc" }, --default: #a0a8b7 +}) +require("onedark").load() diff --git a/nvim/.config/nvim/lua/lazy-init.lua b/nvim/.config/nvim/lua/lazy-init.lua index b620a10..f3960df 100644 --- a/nvim/.config/nvim/lua/lazy-init.lua +++ b/nvim/.config/nvim/lua/lazy-init.lua @@ -3,31 +3,30 @@ ----------------------------------------------------------- -- 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 - 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 + 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) -require('lazy').setup('lazy-plugins', { - checker = { - enabled = true, - notify = false, - }, - change_detection = { - notify = false, - }, +require("lazy").setup("lazy-plugins", { + checker = { + enabled = true, + notify = false, + }, + change_detection = { + notify = false, + }, }) - diff --git a/nvim/.config/nvim/lua/lazy-plugins/debug-nvim-dap.lua b/nvim/.config/nvim/lua/lazy-plugins/debug-nvim-dap.lua new file mode 100644 index 0000000..33e0d7a --- /dev/null +++ b/nvim/.config/nvim/lua/lazy-plugins/debug-nvim-dap.lua @@ -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 = { + { + "dB", + function() + require("dap").set_breakpoint(vim.fn.input("Breakpoint condition: ")) + end, + desc = "Breakpoint Condition", + }, + { + "db", + function() + require("dap").toggle_breakpoint() + end, + desc = "Toggle Breakpoint", + }, + { + "dc", + function() + require("dap").continue() + end, + desc = "Run/Continue", + }, + { + "da", + function() + require("dap").continue({ before = get_args }) + end, + desc = "Run with Args", + }, + { + "dC", + function() + require("dap").run_to_cursor() + end, + desc = "Run to Cursor", + }, + { + "dg", + function() + require("dap").goto_() + end, + desc = "Go to Line (No Execute)", + }, + { + "di", + function() + require("dap").step_into() + end, + desc = "Step Into", + }, + { + "dj", + function() + require("dap").down() + end, + desc = "Down", + }, + { + "dk", + function() + require("dap").up() + end, + desc = "Up", + }, + { + "dl", + function() + require("dap").run_last() + end, + desc = "Run Last", + }, + { + "do", + function() + require("dap").step_out() + end, + desc = "Step Out", + }, + { + "dO", + function() + require("dap").step_over() + end, + desc = "Step Over", + }, + { + "dP", + function() + require("dap").pause() + end, + desc = "Pause", + }, + { + "dr", + function() + require("dap").repl.toggle() + end, + desc = "Toggle REPL", + }, + { + "ds", + function() + require("dap").session() + end, + desc = "Session", + }, + { + "dt", + function() + require("dap").terminate() + end, + desc = "Terminate", + }, + { + "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 = { + { + "du", + function() + require("dapui").toggle({}) + end, + desc = "Dap UI", + }, + { + "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 = {}, + }, + }, +} diff --git a/nvim/.config/nvim/lua/lazy-plugins/editor-auto-session.lua b/nvim/.config/nvim/lua/lazy-plugins/editor-auto-session.lua index 462cdb8..8210c7c 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/editor-auto-session.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/editor-auto-session.lua @@ -1,23 +1,23 @@ return { - 'rmagatti/auto-session', - event = 'VeryLazy', - config = function() - local auto_session = require('auto-session') + "rmagatti/auto-session", + event = "VeryLazy", + config = function() + local auto_session = require("auto-session") - auto_session.setup({ - auto_restore_enabled = false, - }) - end, - keys = { - { - 'wr', - 'SessionRestore', - desc = 'Session restore', - }, - { - 'ws', - 'SessionSave', - desc = 'Session save', - } - }, + auto_session.setup({ + auto_restore_enabled = false, + }) + end, + keys = { + { + "wr", + "SessionRestore", + desc = "Session restore", + }, + { + "ws", + "SessionSave", + desc = "Session save", + }, + }, } diff --git a/nvim/.config/nvim/lua/lazy-plugins/editor-autopairs.lua b/nvim/.config/nvim/lua/lazy-plugins/editor-autopairs.lua index 609c5cf..cb8dfb7 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/editor-autopairs.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/editor-autopairs.lua @@ -1,31 +1,30 @@ -- Autopairs return { - 'windwp/nvim-autopairs', - event = 'InsertEnter', - dependencies = { - 'hrsh7th/nvim-cmp', - }, - config = function() - -- import nvim-autopairs - local autopairs = require('nvim-autopairs') + "windwp/nvim-autopairs", + event = "InsertEnter", + dependencies = { + "hrsh7th/nvim-cmp", + }, + config = function() + -- import nvim-autopairs + local autopairs = require("nvim-autopairs") - -- configure autopairs - autopairs.setup({ - check_ts = true, -- enable treesitter - ts_config = { - lua = { 'string' }, -- don't add pairs in lua string treesitter nodes - javascript = { 'template_string' }, -- don't add pairs in javscript template_string treesitter nodes - java = false, -- don't check treesitter on java - }, - }) + -- configure autopairs + autopairs.setup({ + check_ts = true, -- enable treesitter + ts_config = { + lua = { "string" }, -- don't add pairs in lua string treesitter nodes + javascript = { "template_string" }, -- don't add pairs in javscript template_string treesitter nodes + }, + }) - -- import nvim-autopairs completion functionality - local cmp_autopairs = require('nvim-autopairs.completion.cmp') + -- import nvim-autopairs completion functionality + local cmp_autopairs = require("nvim-autopairs.completion.cmp") - -- import nvim-cmp plugin (completions plugin) - local cmp = require('cmp') + -- import nvim-cmp plugin (completions plugin) + local cmp = require("cmp") - -- make autopairs and completion work together - cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done()) - end, -} + -- make autopairs and completion work together + cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) + end, +} diff --git a/nvim/.config/nvim/lua/lazy-plugins/editor-comment-todo.lua b/nvim/.config/nvim/lua/lazy-plugins/editor-comment-todo.lua index 3309773..ee76ec6 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/editor-comment-todo.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/editor-comment-todo.lua @@ -1,21 +1,21 @@ return { - 'folke/todo-comments.nvim', - event = { 'BufReadPre', 'BufNewFile' }, - dependencies = { 'nvim-lua/plenary.nvim' }, - config = function() - local todo_comments = require('todo-comments') + "folke/todo-comments.nvim", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + local todo_comments = require("todo-comments") - -- set keymaps - local keymap = vim.keymap -- for conciseness + -- set keymaps + local keymap = vim.keymap -- for conciseness - keymap.set('n', ']t', function() - todo_comments.jump_next() - end, { desc = 'Next todo comment' }) + keymap.set("n", "]t", function() + todo_comments.jump_next() + end, { desc = "Next todo comment" }) - keymap.set('n', '[t', function() - todo_comments.jump_prev() - end, { desc = 'Previous todo comment' }) + keymap.set("n", "[t", function() + todo_comments.jump_prev() + end, { desc = "Previous todo comment" }) - todo_comments.setup() - end, + todo_comments.setup() + end, } diff --git a/nvim/.config/nvim/lua/lazy-plugins/editor-comment.lua b/nvim/.config/nvim/lua/lazy-plugins/editor-comment.lua index 2b03f55..7c2700a 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/editor-comment.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/editor-comment.lua @@ -1,18 +1,18 @@ return { - 'numToStr/Comment.nvim', - event = { 'BufReadPre', 'BufNewFile' }, - dependencies = { - 'JoosepAlviste/nvim-ts-context-commentstring', - }, - config = function() - -- import comment plugin safely - local comment = require('Comment') - local ts_context_commentstring = require('ts_context_commentstring.integrations.comment_nvim') + "numToStr/Comment.nvim", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + "JoosepAlviste/nvim-ts-context-commentstring", + }, + config = function() + -- import comment plugin safely + local comment = require("Comment") + local ts_context_commentstring = require("ts_context_commentstring.integrations.comment_nvim") - -- enable comment - comment.setup({ - -- for commenting tsx, jsx, svelte, html files - pre_hook = ts_context_commentstring.create_pre_hook(), - }) - end, + -- enable comment + comment.setup({ + -- for commenting tsx, jsx, svelte, html files + pre_hook = ts_context_commentstring.create_pre_hook(), + }) + end, } diff --git a/nvim/.config/nvim/lua/lazy-plugins/editor-css-color.lua b/nvim/.config/nvim/lua/lazy-plugins/editor-css-color.lua index ea2d6f5..66494ee 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/editor-css-color.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/editor-css-color.lua @@ -1,6 +1,5 @@ -- CSS color return { - 'ap/vim-css-color', + "ap/vim-css-color", + ft = { "css" }, } - - diff --git a/nvim/.config/nvim/lua/lazy-plugins/editor-diffview.lua b/nvim/.config/nvim/lua/lazy-plugins/editor-diffview.lua index 2e450d9..0f4e176 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/editor-diffview.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/editor-diffview.lua @@ -1,4 +1,4 @@ -- Diffview return { - 'sindrets/diffview.nvim', + "sindrets/diffview.nvim", } diff --git a/nvim/.config/nvim/lua/lazy-plugins/editor-git-lazygit.lua b/nvim/.config/nvim/lua/lazy-plugins/editor-git-lazygit.lua index 6cf4a3a..4770c52 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/editor-git-lazygit.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/editor-git-lazygit.lua @@ -1,19 +1,19 @@ return { - 'kdheepak/lazygit.nvim', + "kdheepak/lazygit.nvim", cmd = { - 'LazyGit', - 'LazyGitConfig', - 'LazyGitCurrentFile', - 'LazyGitFilter', - 'LazyGitFilterCurrentFile', + "LazyGit", + "LazyGitConfig", + "LazyGitCurrentFile", + "LazyGitFilter", + "LazyGitFilterCurrentFile", }, -- optional for floating window border decoration dependencies = { - 'nvim-lua/plenary.nvim', + "nvim-lua/plenary.nvim", }, -- setting the keybinding for LazyGit with 'keys' is recommended in -- order to load the plugin when the command is run for the first time keys = { - { 'lg', 'LazyGit', desc = 'Open lazy git' }, + { "hg", "LazyGit", desc = "Open lazy git" }, }, } diff --git a/nvim/.config/nvim/lua/lazy-plugins/editor-git-signs.lua b/nvim/.config/nvim/lua/lazy-plugins/editor-git-signs.lua index d314cc7..6cafd1b 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/editor-git-signs.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/editor-git-signs.lua @@ -1,7 +1,7 @@ -- Git signs return { - 'lewis6991/gitsigns.nvim', - event = { 'BufReadPre', 'BufNewFile' }, + "lewis6991/gitsigns.nvim", + event = { "BufReadPre", "BufNewFile" }, opts = { on_attach = function(bufnr) local gs = package.loaded.gitsigns @@ -11,38 +11,38 @@ return { end -- Navigation - map('n', ']h', gs.next_hunk, 'Next Hunk') - map('n', '[h', gs.prev_hunk, 'Prev Hunk') + map("n", "]h", gs.next_hunk, "Next Hunk") + map("n", "[h", gs.prev_hunk, "Prev Hunk") -- Actions - map('n', 'hs', gs.stage_hunk, 'Stage hunk') - map('n', 'hr', gs.reset_hunk, 'Reset hunk') - map('v', 'hs', function() - gs.stage_hunk({ vim.fn.line('.'), vim.fn.line('v') }) - end, 'Stage hunk') - map('v', 'hr', function() - gs.reset_hunk({ vim.fn.line('.'), vim.fn.line('v') }) - end, 'Reset hunk') + map("n", "hs", gs.stage_hunk, "Stage hunk") + map("n", "hr", gs.reset_hunk, "Reset hunk") + map("v", "hs", function() + gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) + end, "Stage hunk") + map("v", "hr", function() + gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) + end, "Reset hunk") - map('n', 'hS', gs.stage_buffer, 'Stage buffer') - map('n', 'hR', gs.reset_buffer, 'Reset buffer') + map("n", "hS", gs.stage_buffer, "Stage buffer") + map("n", "hR", gs.reset_buffer, "Reset buffer") - map('n', 'hu', gs.undo_stage_hunk, 'Undo stage hunk') + map("n", "hu", gs.undo_stage_hunk, "Undo stage hunk") - map('n', 'hp', gs.preview_hunk, 'Preview hunk') + map("n", "hp", gs.preview_hunk, "Preview hunk") - map('n', 'hb', function() + map("n", "hb", function() gs.blame_line({ full = true }) - end, 'Blame line') - map('n', 'hB', gs.toggle_current_line_blame, 'Toggle line blame') + end, "Blame line") + map("n", "hB", gs.toggle_current_line_blame, "Toggle line blame") - map('n', 'hd', gs.diffthis, 'Diff this') - map('n', 'hD', function() - gs.diffthis('~') - end, 'Diff this ~') + map("n", "hd", gs.diffthis, "Diff this") + map("n", "hD", function() + gs.diffthis("~") + end, "Diff this ~") -- Text object - map({ 'o', 'x' }, 'ih', ':Gitsigns select_hunk', 'Gitsigns select hunk') + map({ "o", "x" }, "ih", ":Gitsigns select_hunk", "Gitsigns select hunk") end, }, } diff --git a/nvim/.config/nvim/lua/lazy-plugins/editor-indent-blankline.lua b/nvim/.config/nvim/lua/lazy-plugins/editor-indent-blankline.lua deleted file mode 100644 index e33e53d..0000000 --- a/nvim/.config/nvim/lua/lazy-plugins/editor-indent-blankline.lua +++ /dev/null @@ -1,12 +0,0 @@ --- Indent blankline -return { - 'lukas-reineke/indent-blankline.nvim', - event = { - 'BufReadPre', - 'BufNewFile', - }, - main = 'ibl', - opts = { - indent = { char = '┊' }, - }, -} diff --git a/nvim/.config/nvim/lua/lazy-plugins/editor-substitute.lua b/nvim/.config/nvim/lua/lazy-plugins/editor-substitute.lua deleted file mode 100644 index 6c4cb36..0000000 --- a/nvim/.config/nvim/lua/lazy-plugins/editor-substitute.lua +++ /dev/null @@ -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, -} diff --git a/nvim/.config/nvim/lua/lazy-plugins/editor-surround.lua b/nvim/.config/nvim/lua/lazy-plugins/editor-surround.lua index 43cf984..5fb90a8 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/editor-surround.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/editor-surround.lua @@ -1,7 +1,7 @@ -- Surround return { - 'kylechui/nvim-surround', - event = { 'BufReadPre', 'BufNewFile' }, - version = '*', -- Use for stability; omit to use `main` branch for the latest features - config = true, + "kylechui/nvim-surround", + event = { "BufReadPre", "BufNewFile" }, + version = "*", -- Use for stability; omit to use `main` branch for the latest features + config = true, } diff --git a/nvim/.config/nvim/lua/lazy-plugins/feat-rest-nvim.lua b/nvim/.config/nvim/lua/lazy-plugins/feat-rest-nvim.lua index 3ffbf92..1e796fc 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/feat-rest-nvim.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/feat-rest-nvim.lua @@ -1,53 +1,53 @@ return { - 'rest-nvim/rest.nvim', - dependencies = { { 'nvim-lua/plenary.nvim' } }, - event = 'BufEnter *.http', - config = function() - require('rest-nvim').setup({ - -- Open request results in a horizontal split - result_split_horizontal = false, - -- Keep the http file buffer above|left when split horizontal|vertical - result_split_in_place = false, - -- stay in current windows (.http file) or change to results window (default) - stay_in_current_window_after_split = false, - -- Skip SSL verification, useful for unknown certificates - skip_ssl_verification = false, - -- Encode URL before making request - encode_url = true, - -- Highlight request on run - highlight = { - enabled = true, - timeout = 150, - }, - result = { - -- toggle showing URL, HTTP info, headers at top the of result window - show_url = true, - -- show the generated curl command in case you want to launch - -- the same request via the terminal (can be verbose) - show_curl_command = false, - show_http_info = true, - show_headers = true, - -- table of curl `--write-out` variables or false if disabled - -- for more granular control see Statistics Spec - show_statistics = false, - -- executables or functions for formatting response body [optional] - -- set them to false if you want to disable them - formatters = { - json = 'jq', - html = function(body) - return vim.fn.system({'tidy', '-i', '-q', '-'}, body) - end - }, - }, - -- Jump to request line on run - jump_to_request = false, - env_file = '.env', - -- for telescope select - env_pattern = '\\.env$', - env_edit_command = 'tabedit', - custom_dynamic_variables = {}, - yank_dry_run = true, - search_back = true, - }) - end + "rest-nvim/rest.nvim", + dependencies = { { "nvim-lua/plenary.nvim" } }, + event = "BufEnter *.http", + config = function() + require("rest-nvim").setup({ + -- Open request results in a horizontal split + result_split_horizontal = false, + -- Keep the http file buffer above|left when split horizontal|vertical + result_split_in_place = false, + -- stay in current windows (.http file) or change to results window (default) + stay_in_current_window_after_split = false, + -- Skip SSL verification, useful for unknown certificates + skip_ssl_verification = false, + -- Encode URL before making request + encode_url = true, + -- Highlight request on run + highlight = { + enabled = true, + timeout = 150, + }, + result = { + -- toggle showing URL, HTTP info, headers at top the of result window + show_url = true, + -- show the generated curl command in case you want to launch + -- the same request via the terminal (can be verbose) + show_curl_command = false, + show_http_info = true, + show_headers = true, + -- table of curl `--write-out` variables or false if disabled + -- for more granular control see Statistics Spec + show_statistics = false, + -- executables or functions for formatting response body [optional] + -- set them to false if you want to disable them + formatters = { + json = "jq", + html = function(body) + return vim.fn.system({ "tidy", "-i", "-q", "-" }, body) + end, + }, + }, + -- Jump to request line on run + jump_to_request = false, + env_file = ".env", + -- for telescope select + env_pattern = "\\.env$", + env_edit_command = "tabedit", + custom_dynamic_variables = {}, + yank_dry_run = true, + search_back = true, + }) + end, } diff --git a/nvim/.config/nvim/lua/lazy-plugins/lsp-conform.lua b/nvim/.config/nvim/lua/lazy-plugins/lsp-conform.lua new file mode 100644 index 0000000..7d9b997 --- /dev/null +++ b/nvim/.config/nvim/lua/lazy-plugins/lsp-conform.lua @@ -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" }, "mp", function() + conform.format({ + lsp_fallback = true, + async = false, + timeout_ms = 1000, + }) + end, { desc = "Format file or range (in visual mode)" }) + end, +} diff --git a/nvim/.config/nvim/lua/lazy-plugins/lsp-formatting.lua b/nvim/.config/nvim/lua/lazy-plugins/lsp-formatting.lua deleted file mode 100644 index bcb1bff..0000000 --- a/nvim/.config/nvim/lua/lazy-plugins/lsp-formatting.lua +++ /dev/null @@ -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' }, 'mp', function() - conform.format({ - lsp_fallback = true, - async = false, - timeout_ms = 1000, - }) - end, { desc = 'Format file or range (in visual mode)' }) - end, -} diff --git a/nvim/.config/nvim/lua/lazy-plugins/lsp-linting.lua b/nvim/.config/nvim/lua/lazy-plugins/lsp-linting.lua index 8836b18..a8ad4b7 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/lsp-linting.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/lsp-linting.lua @@ -1,27 +1,27 @@ return { - 'mfussenegger/nvim-lint', - event = { 'BufReadPre', 'BufNewFile' }, + "mfussenegger/nvim-lint", + event = { "BufReadPre", "BufNewFile" }, config = function() - local lint = require('lint') + local lint = require("lint") lint.linters_by_ft = { - javascript = { 'eslint_d' }, - typescript = { 'eslint_d' }, - svelte = { 'eslint_d' }, - python = { 'pylint' }, + javascript = { "eslint_d" }, + typescript = { "eslint_d" }, + svelte = { "eslint_d" }, + 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, callback = function() lint.try_lint() end, }) - vim.keymap.set('n', 'l', function() + vim.keymap.set("n", "l", function() lint.try_lint() - end, { desc = 'Trigger linting for current file' }) + end, { desc = "Trigger linting for current file" }) end, } diff --git a/nvim/.config/nvim/lua/lazy-plugins/lsp-lspconfig.lua b/nvim/.config/nvim/lua/lazy-plugins/lsp-lspconfig.lua index b18784b..460c1f8 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/lsp-lspconfig.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/lsp-lspconfig.lua @@ -1,106 +1,98 @@ return { - 'neovim/nvim-lspconfig', - event = { 'BufReadPre', 'BufNewFile' }, - dependencies = { - 'hrsh7th/cmp-nvim-lsp', - { 'antosha417/nvim-lsp-file-operations', config = true }, - { 'folke/neodev.nvim', opts = {} }, - }, - config = function() - -- import lspconfig plugin - local lspconfig = require('lspconfig') + "neovim/nvim-lspconfig", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "mason-org/mason-lspconfig.nvim", + { "antosha417/nvim-lsp-file-operations", config = true }, + { "folke/lazydev.nvim", opts = {} }, + }, + config = function() + -- import lspconfig plugin + local lspconfig = require("lspconfig") - -- import mason_lspconfig plugin - local mason_lspconfig = require('mason-lspconfig') + -- import mason_lspconfig plugin + local mason_lspconfig = require("mason-lspconfig") - -- import cmp-nvim-lsp plugin - local cmp_nvim_lsp = require('cmp_nvim_lsp') + -- import cmp-nvim-lsp plugin + 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', { - group = vim.api.nvim_create_augroup('UserLspConfig', {}), - callback = function(ev) - -- Buffer local mappings. - -- See `:help vim.lsp.*` for documentation on any of the below functions - local opts = { buffer = ev.buf, silent = true } + vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("UserLspConfig", {}), + callback = function(ev) + -- Buffer local mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + local opts = { buffer = ev.buf, silent = true } - -- set keybinds - opts.desc = 'Show LSP references' - keymap.set('n', 'gR', 'Telescope lsp_references', opts) -- show definition, references + -- set keybinds + opts.desc = "Show LSP references" + keymap.set("n", "gR", "Telescope lsp_references", opts) -- show definition, references - opts.desc = 'Go to declaration' - keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) -- go to declaration + opts.desc = "Go to declaration" + keymap.set("n", "gD", vim.lsp.buf.declaration, opts) -- go to declaration - opts.desc = 'Show LSP definitions' - keymap.set('n', 'gd', 'Telescope lsp_definitions', opts) -- show lsp definitions + opts.desc = "Show LSP definitions" + keymap.set("n", "gd", "Telescope lsp_definitions", opts) -- show lsp definitions - opts.desc = 'Show LSP implementations' - keymap.set('n', 'gi', 'Telescope lsp_implementations', opts) -- show lsp implementations + opts.desc = "Show LSP implementations" + keymap.set("n", "gi", "Telescope lsp_implementations", opts) -- show lsp implementations - opts.desc = 'Show LSP type definitions' - keymap.set('n', 'gt', 'Telescope lsp_type_definitions', opts) -- show lsp type definitions + opts.desc = "Show LSP type definitions" + keymap.set("n", "gt", "Telescope lsp_type_definitions", opts) -- show lsp type definitions - opts.desc = 'See available code actions' - keymap.set({ 'n', 'v' }, 'ca', vim.lsp.buf.code_action, opts) -- see available code actions, in visual mode will apply to selection + opts.desc = "See available code actions" + keymap.set({ "n", "v" }, "ca", vim.lsp.buf.code_action, opts) -- see available code actions, in visual mode will apply to selection - opts.desc = 'Smart rename' - keymap.set('n', 'rn', vim.lsp.buf.rename, opts) -- smart rename + opts.desc = "Smart rename" + keymap.set("n", "rn", vim.lsp.buf.rename, opts) -- smart rename - opts.desc = 'Show buffer diagnostics' - keymap.set('n', 'D', 'Telescope diagnostics bufnr=0', opts) -- show diagnostics for file + opts.desc = "Show buffer diagnostics" + keymap.set("n", "D", "Telescope diagnostics bufnr=0", opts) -- show diagnostics for file - opts.desc = 'Show line diagnostics' - keymap.set('n', 'd', vim.diagnostic.open_float, opts) -- show diagnostics for line + opts.desc = "Show line diagnostics" + keymap.set("n", "d", vim.diagnostic.open_float, opts) -- show diagnostics for line - opts.desc = 'Go to previous diagnostic' - keymap.set('n', '[d', vim.diagnostic.goto_prev, opts) -- jump to previous diagnostic in buffer + opts.desc = "Go to previous diagnostic" + keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) -- jump to previous diagnostic in buffer - opts.desc = 'Go to next diagnostic' - keymap.set('n', ']d', vim.diagnostic.goto_next, opts) -- jump to next diagnostic in buffer + opts.desc = "Go to next diagnostic" + keymap.set("n", "]d", vim.diagnostic.goto_next, opts) -- jump to next diagnostic in buffer - 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 + 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 - opts.desc = 'Restart LSP' - keymap.set('n', 'rs', ':LspRestart', opts) -- mapping to restart lsp if necessary - end, - }) + opts.desc = "Restart LSP" + keymap.set("n", "rs", ":LspRestart", opts) -- mapping to restart lsp if necessary + end, + }) - -- used to enable autocompletion (assign to every lsp server config) - local capabilities = cmp_nvim_lsp.default_capabilities() + -- 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 - -- 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) + local capabilities = cmp_nvim_lsp.default_capabilities() - 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, - settings = { - Lua = { - -- make the language server recognize 'vim' global - diagnostics = { - globals = { 'vim' }, - }, - completion = { - callSnippet = 'Replace', - }, - }, - }, - }) - end, - }) - end, + vim.lsp.config["lua_ls"] = { + capabilities = capabilities, + settings = { + Lua = { + -- make the language server recognize 'vim' global + diagnostics = { + globals = { "vim" }, + }, + completion = { + callSnippet = "Replace", + }, + }, + }, + } + + mason_lspconfig.setup() + end, } diff --git a/nvim/.config/nvim/lua/lazy-plugins/lsp-mason.lua b/nvim/.config/nvim/lua/lazy-plugins/lsp-mason.lua index f4e6706..45c5630 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/lsp-mason.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/lsp-mason.lua @@ -1,49 +1,19 @@ -- Plenary return { - 'williamboman/mason.nvim', - dependencies = { - 'williamboman/mason-lspconfig.nvim', - 'WhoIsSethDaniel/mason-tool-installer.nvim', - }, - config = function() - -- import mason - local mason = require('mason') + "mason-org/mason.nvim", + config = function() + -- import 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 - mason.setup({ - ui = { - icons = { - package_installed = '✓', - package_pending = '➜', - 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, + -- enable mason and configure icons + mason.setup({ + ui = { + icons = { + package_installed = "✓", + package_pending = "➜", + package_uninstalled = "✗", + }, + }, + }) + end, } diff --git a/nvim/.config/nvim/lua/lazy-plugins/lsp-nvim-cmp.lua b/nvim/.config/nvim/lua/lazy-plugins/lsp-nvim-cmp.lua index dd9045f..16f66d7 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/lsp-nvim-cmp.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/lsp-nvim-cmp.lua @@ -1,61 +1,61 @@ return { - 'hrsh7th/nvim-cmp', - event = 'InsertEnter', - dependencies = { - 'hrsh7th/cmp-buffer', -- source for text in buffer - 'hrsh7th/cmp-path', -- source for file system paths - { - 'L3MON4D3/LuaSnip', - -- follow latest release. - version = 'v2.*', -- Replace by the latest released major (first number of latest release) - -- install jsregexp (optional!). - build = 'make install_jsregexp', - }, - 'saadparwaiz1/cmp_luasnip', -- for autocompletion - 'rafamadriz/friendly-snippets', -- useful snippets - 'onsails/lspkind.nvim', -- vs-code like pictograms - }, - config = function() - local cmp = require('cmp') - local luasnip = require('luasnip') - local lspkind = require('lspkind') + "hrsh7th/nvim-cmp", + event = "InsertEnter", + dependencies = { + "hrsh7th/cmp-buffer", -- source for text in buffer + "hrsh7th/cmp-path", -- source for file system paths + { + "L3MON4D3/LuaSnip", + -- follow latest release. + version = "v2.*", -- Replace by the latest released major (first number of latest release) + -- install jsregexp (optional!). + build = "make install_jsregexp", + }, + "saadparwaiz1/cmp_luasnip", -- for autocompletion + "rafamadriz/friendly-snippets", -- useful snippets + "onsails/lspkind.nvim", -- vs-code like pictograms + }, + config = function() + local cmp = require("cmp") + local luasnip = require("luasnip") + local lspkind = require("lspkind") - -- loads vscode style snippets from installed plugins (e.g. friendly-snippets) - require('luasnip.loaders.from_vscode').lazy_load() + -- loads vscode style snippets from installed plugins (e.g. friendly-snippets) + require("luasnip.loaders.from_vscode").lazy_load() - cmp.setup({ - completion = { - completeopt = 'menu,menuone,preview,noselect', - }, - snippet = { -- configure how nvim-cmp interacts with snippet engine - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.select_prev_item(), -- previous suggestion - [''] = cmp.mapping.select_next_item(), -- next suggestion - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), -- show completion suggestions - [''] = cmp.mapping.abort(), -- close completion window - [''] = cmp.mapping.confirm({ select = false }), - }), - -- sources for autocompletion - sources = cmp.config.sources({ - { name = 'nvim_lsp'}, - { name = 'luasnip' }, -- snippets - { name = 'buffer' }, -- text within current buffer - { name = 'path' }, -- file system paths - }), + cmp.setup({ + completion = { + completeopt = "menu,menuone,preview,noselect", + }, + snippet = { -- configure how nvim-cmp interacts with snippet engine + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.select_prev_item(), -- previous suggestion + [""] = cmp.mapping.select_next_item(), -- next suggestion + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), -- show completion suggestions + [""] = cmp.mapping.abort(), -- close completion window + [""] = cmp.mapping.confirm({ select = false }), + }), + -- sources for autocompletion + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, -- snippets + { name = "buffer" }, -- text within current buffer + { name = "path" }, -- file system paths + }), - -- configure lspkind for vs-code like pictograms in completion menu - formatting = { - format = lspkind.cmp_format({ - maxwidth = 50, - ellipsis_char = '...', - }), - }, - }) - end, + -- configure lspkind for vs-code like pictograms in completion menu + formatting = { + format = lspkind.cmp_format({ + maxwidth = 50, + ellipsis_char = "...", + }), + }, + }) + end, } diff --git a/nvim/.config/nvim/lua/lazy-plugins/lsp-treesitter.lua b/nvim/.config/nvim/lua/lazy-plugins/lsp-treesitter.lua index 52aee82..7c53a3f 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/lsp-treesitter.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/lsp-treesitter.lua @@ -1,48 +1,50 @@ return { - 'nvim-treesitter/nvim-treesitter', - event = { - 'BufReadPre', - 'BufNewFile', - }, - build = ':TSUpdate', - dependencies = { - 'windwp/nvim-ts-autotag', - }, - config = function() - local treesitter = require('nvim-treesitter.configs') + "nvim-treesitter/nvim-treesitter", + event = { + "BufReadPre", + "BufNewFile", + }, + build = ":TSUpdate", + dependencies = { + "windwp/nvim-ts-autotag", + }, + config = function() + local treesitter = require("nvim-treesitter.configs") - treesitter.setup({ - highlight = { - enable = true, - }, - indent = { - enable = true, - }, - autotag = { - enable = true, - }, - ensure_installed = { - 'json', - 'javascript', - 'yaml', - 'html', - 'css', - 'lua', - 'vim', - 'dockerfile', - 'gitignore', - 'markdown', - 'bash', - }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = '', - node_incremental = '', - scope_incremental = false, - node_decremental = '', - }, - }, - }) - end, + treesitter.setup({ + highlight = { + enable = true, + }, + indent = { + enable = true, + }, + autotag = { + enable = true, + }, + ensure_installed = { + "json", + "javascript", + "yaml", + "html", + "css", + "lua", + "vim", + "dockerfile", + "gitignore", + "markdown", + "bash", + "go", + "php", + }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "", + node_incremental = "", + scope_incremental = false, + node_decremental = "", + }, + }, + }) + end, } diff --git a/nvim/.config/nvim/lua/lazy-plugins/lsp-trouble.lua b/nvim/.config/nvim/lua/lazy-plugins/lsp-trouble.lua index 04efa22..610b85a 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/lsp-trouble.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/lsp-trouble.lua @@ -1,15 +1,19 @@ return { - 'folke/trouble.nvim', - dependencies = { 'nvim-tree/nvim-web-devicons', 'folke/todo-comments.nvim' }, - opts = { - focus = true, - }, - cmd = 'Trouble', - keys = { - { 'xw', 'Trouble diagnostics toggle', desc = 'Open trouble workspace diagnostics' }, - { 'xd', 'Trouble diagnostics toggle filter.buf=0', desc = 'Open trouble document diagnostics' }, - { 'xq', 'Trouble quickfix toggle', desc = 'Open trouble quickfix list' }, - { 'xl', 'Trouble loclist toggle', desc = 'Open trouble location list' }, - { 'xt', 'Trouble todo toggle', desc = 'Open todos in trouble' }, - }, + "folke/trouble.nvim", + dependencies = { "nvim-tree/nvim-web-devicons", "folke/todo-comments.nvim" }, + opts = { + focus = true, + }, + cmd = "Trouble", + keys = { + { "xw", "Trouble diagnostics toggle", desc = "Open trouble workspace diagnostics" }, + { + "xd", + "Trouble diagnostics toggle filter.buf=0", + desc = "Open trouble document diagnostics", + }, + { "xq", "Trouble quickfix toggle", desc = "Open trouble quickfix list" }, + { "xl", "Trouble loclist toggle", desc = "Open trouble location list" }, + { "xt", "Trouble todo toggle", desc = "Open todos in trouble" }, + }, } diff --git a/nvim/.config/nvim/lua/lazy-plugins/theme-onedark.lua b/nvim/.config/nvim/lua/lazy-plugins/theme-onedark.lua index 772249d..2539e84 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/theme-onedark.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/theme-onedark.lua @@ -1,4 +1,4 @@ -- Onedark theme return { - 'navarasu/onedark.nvim', + "navarasu/onedark.nvim", } diff --git a/nvim/.config/nvim/lua/lazy-plugins/ui-alpha.lua b/nvim/.config/nvim/lua/lazy-plugins/ui-alpha.lua index 48ed730..fc4cee6 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/ui-alpha.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/ui-alpha.lua @@ -1,38 +1,38 @@ -- Alpha (start screen/dashboard) return { - 'goolord/alpha-nvim', - dependencies = { 'nvim-tree/nvim-web-devicons' }, - event = 'VimEnter', - config = function() - local alpha = require('alpha') - local dashboard = require('alpha.themes.dashboard') + "goolord/alpha-nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + event = "VimEnter", + config = function() + local alpha = require("alpha") + local dashboard = require("alpha.themes.dashboard") - -- Set header - dashboard.section.header.val = { - ' ', - ' ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ', - ' ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ', - ' ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ', - ' ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ', - ' ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ', - ' ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ', - ' ', - } + -- Set header + dashboard.section.header.val = { + " ", + " ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ", + " ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ", + " ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ", + " ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ", + " ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ", + " ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ", + " ", + } - -- Set menu - dashboard.section.buttons.val = { - dashboard.button('e', ' > New File', 'ene'), - dashboard.button('SPC ee', ' > Toggle file explorer', 'NvimTreeToggle'), - dashboard.button('SPC ff', '󰱼 > Find File', 'Telescope find_files'), - dashboard.button('SPC fs', ' > Find Word', 'Telescope live_grep'), - dashboard.button('SPC wr', '󰁯 > Restore Session For Current Directory', 'SessionRestore'), - dashboard.button('q', ' > Quit NVIM', 'qa'), - } + -- Set menu + dashboard.section.buttons.val = { + dashboard.button("e", " > New File", "ene"), + dashboard.button("SPC ee", " > Toggle file explorer", "NvimTreeToggle"), + dashboard.button("SPC ff", "󰱼 > Find File", "Telescope find_files"), + dashboard.button("SPC fs", " > Find Word", "Telescope live_grep"), + dashboard.button("SPC wr", "󰁯 > Restore Session For Current Directory", "SessionRestore"), + dashboard.button("q", " > Quit NVIM", "qa"), + } - -- Send config to alpha - alpha.setup(dashboard.opts) + -- Send config to alpha + alpha.setup(dashboard.opts) - -- Disable folding on alpha buffer - vim.cmd([[autocmd FileType alpha setlocal nofoldenable]]) - end, + -- Disable folding on alpha buffer + vim.cmd([[autocmd FileType alpha setlocal nofoldenable]]) + end, } diff --git a/nvim/.config/nvim/lua/lazy-plugins/ui-barbar.lua b/nvim/.config/nvim/lua/lazy-plugins/ui-barbar.lua deleted file mode 100644 index c296aa5..0000000 --- a/nvim/.config/nvim/lua/lazy-plugins/ui-barbar.lua +++ /dev/null @@ -1,9 +0,0 @@ --- Barbar (tabline bar) -return { - 'romgrk/barbar.nvim', - enabled = false, - dependencies = { - 'lewis6991/gitsigns.nvim', - 'nvim-tree/nvim-web-devicons', - }, -} diff --git a/nvim/.config/nvim/lua/lazy-plugins/ui-bufferline.lua b/nvim/.config/nvim/lua/lazy-plugins/ui-bufferline.lua index 7716b8c..4c8bd31 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/ui-bufferline.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/ui-bufferline.lua @@ -1,13 +1,14 @@ return { - 'akinsho/bufferline.nvim', - dependencies = { - 'nvim-tree/nvim-web-devicons', - }, - version = '*', - opts = { - options = { --- mode = 'tabs', --- separator_style = 'slant', - }, - }, + "akinsho/bufferline.nvim", + dependencies = { + "nvim-tree/nvim-web-devicons", + }, + version = "*", + opts = { + options = { + numbers = "buffer_id", + -- mode = 'tabs', + -- separator_style = 'slant', + }, + }, } diff --git a/nvim/.config/nvim/lua/lazy-plugins/ui-dressing.lua b/nvim/.config/nvim/lua/lazy-plugins/ui-dressing.lua index ef0bfc9..98f56c1 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/ui-dressing.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/ui-dressing.lua @@ -1,4 +1,4 @@ return { - 'stevearc/dressing.nvim', - event = 'VeryLazy', + "stevearc/dressing.nvim", + event = "VeryLazy", } diff --git a/nvim/.config/nvim/lua/lazy-plugins/ui-lualine.lua b/nvim/.config/nvim/lua/lazy-plugins/ui-lualine.lua index 7e6a66e..93af95f 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/ui-lualine.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/ui-lualine.lua @@ -9,10 +9,11 @@ return { -- configure lualine with modified theme lualine.setup({ + extensions = { "nvim-tree" }, options = { theme = "onedark", disabled_filetypes = { - statusline = { "NvimTree" }, + statusline = { "trouble" }, }, section_separators = "", component_separators = "", diff --git a/nvim/.config/nvim/lua/lazy-plugins/ui-mini-nvim.lua b/nvim/.config/nvim/lua/lazy-plugins/ui-mini-nvim.lua index c0f7a8a..825e12b 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/ui-mini-nvim.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/ui-mini-nvim.lua @@ -1,7 +1,7 @@ -- Mini.nvim return { - 'echasnovski/mini.nvim', - config = function() - require('mini.icons').setup() - end + "echasnovski/mini.nvim", + config = function() + require("mini.icons").setup() + end, } diff --git a/nvim/.config/nvim/lua/lazy-plugins/ui-nvim-tree.lua b/nvim/.config/nvim/lua/lazy-plugins/ui-nvim-tree.lua index c5a2935..849edcc 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/ui-nvim-tree.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/ui-nvim-tree.lua @@ -1,46 +1,38 @@ return { - 'nvim-tree/nvim-tree.lua', - dependencies = 'nvim-tree/nvim-web-devicons', - config = function() - local nvimtree = require('nvim-tree') - vim.g.loaded_netrw = 1 - vim.g.loaded_netrwPlugin = 1 + "nvim-tree/nvim-tree.lua", + dependencies = "nvim-tree/nvim-web-devicons", + config = function() + local nvimtree = require("nvim-tree") + vim.g.loaded_netrw = 1 + vim.g.loaded_netrwPlugin = 1 - nvimtree.setup({ - view = { - width = 35, - relativenumber = true, - }, - -- change folder arrow icons - renderer = { - indent_markers = { - enable = true, - }, - icons = { - glyphs = { - folder = { - arrow_closed = '', -- arrow when folder is closed - arrow_open = '', -- arrow when folder is open - }, - }, - }, - }, - git = { - ignore = false, - }, - }) + nvimtree.setup({ + view = { + width = 35, + relativenumber = true, + }, + -- change folder arrow icons + renderer = { + indent_markers = { + enable = true, + }, + icons = { + glyphs = { + folder = { + arrow_closed = "", -- arrow when folder is closed + arrow_open = "", -- arrow when folder is open + }, + }, + }, + }, + git = { + ignore = false, + }, + }) - vim.keymap.set('n', 'ef', 'NvimTreeFindFile', { desc = 'Move to file in file explorer' }) - vim.keymap.set('n', 'ec', 'NvimTreeCollapse', { desc = 'Collapse file explorer' }) - vim.keymap.set('n', 'er', 'NvimTreeRefresh', { desc = 'Refresh file explorer' }) - end, - keys = { - { - 'ee', - function() - require('nvim-tree.api').tree.toggle() - end, - desc = 'Toggle file explorer', - }, - } + vim.keymap.set("n", "ee", "NvimTreeToggle", { desc = "Toggle file explorer" }) + vim.keymap.set("n", "ec", "NvimTreeCollapse", { desc = "Collapse file explorer" }) + vim.keymap.set("n", "er", "NvimTreeRefresh", { desc = "Refresh file explorer" }) + vim.keymap.set("n", "ef", "NvimTreeFindFile", { desc = "Move to file in file explorer" }) + end, } diff --git a/nvim/.config/nvim/lua/lazy-plugins/ui-tagbar.lua b/nvim/.config/nvim/lua/lazy-plugins/ui-tagbar.lua deleted file mode 100644 index 2f1ee7d..0000000 --- a/nvim/.config/nvim/lua/lazy-plugins/ui-tagbar.lua +++ /dev/null @@ -1,5 +0,0 @@ --- Tagbar -return { - 'preservim/tagbar', - enabled = false, -} diff --git a/nvim/.config/nvim/lua/lazy-plugins/ui-telescope.lua b/nvim/.config/nvim/lua/lazy-plugins/ui-telescope.lua index d32de02..c68e1ac 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/ui-telescope.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/ui-telescope.lua @@ -1,65 +1,65 @@ -- Telescope return { - 'nvim-telescope/telescope.nvim', - dependencies = { - 'nvim-lua/plenary.nvim', - { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }, - 'nvim-tree/nvim-web-devicons', - }, - config = function(_, opts) - local telescope = require('telescope') - local actions = require('telescope.actions') + "nvim-telescope/telescope.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, + "nvim-tree/nvim-web-devicons", + }, + config = function() + local telescope = require("telescope") + local actions = require("telescope.actions") - telescope.setup({ - defaults = { - path_display = { 'smart' }, - mappings = { - i = { - [''] = actions.move_selection_previous, -- move to prev result - [''] = actions.move_selection_next, -- move to next result - [''] = actions.send_selected_to_qflist + actions.open_qflist, - [''] = actions.delete_buffer, - } - } - } - }) - telescope.load_extension('fzf') - end, - keys = { - { - 'ff', - 'Telescope find_files', - desc = 'Find files', - }, - { - 'fg', - 'Telescope live_grep', - desc = 'Live grep', - }, - { - 'fb', - 'Telescope buffers', - desc = 'Buffers' - }, - { - 'fh', - 'Telescope help_tags', - desc = 'Help tags', - }, - { - 'fr', - 'Telescope oldfiles`', - desc = 'Recent files', - }, - { - 'fs', - 'Telescope grep_string', - desc = 'Find string', - }, - { - 'ft', - 'TodoTelescope', - desc = 'Find todos', - } - }, + telescope.setup({ + defaults = { + path_display = { "smart" }, + mappings = { + i = { + [""] = actions.move_selection_previous, -- move to prev result + [""] = actions.move_selection_next, -- move to next result + [""] = actions.send_selected_to_qflist + actions.open_qflist, + [""] = actions.delete_buffer, + }, + }, + }, + }) + telescope.load_extension("fzf") + end, + keys = { + { + "ff", + "Telescope find_files", + desc = "Find files", + }, + { + "fg", + "Telescope live_grep", + desc = "Live grep", + }, + { + "fb", + "Telescope buffers", + desc = "Buffers", + }, + { + "fh", + "Telescope help_tags", + desc = "Help tags", + }, + { + "fr", + "Telescope oldfiles`", + desc = "Recent files", + }, + { + "fs", + "Telescope grep_string", + desc = "Find string", + }, + { + "ft", + "TodoTelescope", + desc = "Find todos", + }, + }, } diff --git a/nvim/.config/nvim/lua/lazy-plugins/ui-which-key.lua b/nvim/.config/nvim/lua/lazy-plugins/ui-which-key.lua index 57abfde..c9172f4 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/ui-which-key.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/ui-which-key.lua @@ -1,17 +1,23 @@ return { - 'folke/which-key.nvim', - event = 'VeryLazy', - init = function() - vim.o.timeout = true - vim.o.timeoutlen = 500 - end, - config = function() - local wk = require('which-key') - wk.register({ - { 'e', group = 'NeoTree' }, - { 'f', group = 'Telescope' }, - { 's', group = 'splits' }, - }) - end, - opts = { }, + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 500 + end, + config = function() + local wk = require("which-key") + wk.add({ + { "b", group = "🗄️ Buffers" }, + { "c", group = "💻 Code" }, + { "e", group = "🌲 NeoTree" }, + { "f", group = "🔭 Telescope" }, + { "h", group = "✏️ Version control" }, + { "r", group = "🪐 LSP" }, + { "s", group = "🪟 Splits" }, + { "w", group = "💾 Session" }, + { "x", group = "🚧 Trouble" }, + }) + end, + opts = {}, } diff --git a/nvim/.config/nvim/lua/packer-init.lua b/nvim/.config/nvim/lua/packer-init.lua deleted file mode 100644 index 477f271..0000000 --- a/nvim/.config/nvim/lua/packer-init.lua +++ /dev/null @@ -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 | 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) -