From 713c1ae5cfdeb6a6757d9edf6488376e78a2dca3 Mon Sep 17 00:00:00 2001 From: SzymonIwaniuk Date: Mon, 23 Mar 2026 12:55:59 +0100 Subject: [PATCH 1/3] update custom config --- init.lua | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 3593ca2e194..2b320ed4887 100644 --- a/init.lua +++ b/init.lua @@ -271,7 +271,29 @@ require('lazy').setup({ -- -- Here is a more advanced example where we pass configuration -- options to `gitsigns.nvim`. - -- + -- MY PLUGINS SECTION + { -- auto pair braces { [ ( + 'windwp/nvim-autopairs', + event = 'InsertEnter', + config = true, + }, + { -- pr reviews + 'pwntester/octo.nvim', + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-telescope/telescope.nvim', + 'nvim-tree/nvim-web-devicons', + }, + config = function() + require('octo').setup { + enable_builtin = true, + use_local_fs = false, + default_remote = { 'upstream', 'origin' }, + ssh_aliases = {}, + } + end, + }, + -- MY PLUGNS SECTION -- See `:help gitsigns` to understand what the configuration keys do { -- Adds git related signs to the gutter, as well as utilities for managing changes 'lewis6991/gitsigns.nvim', @@ -603,7 +625,8 @@ require('lazy').setup({ -- See `:help lsp-config` for information about keys and how to configure ---@type table local servers = { - -- clangd = {}, + clangd = {}, + elp = {}, -- gopls = {}, -- pyright = {}, -- rust_analyzer = {}, @@ -612,7 +635,7 @@ require('lazy').setup({ -- https://github.com/pmizio/typescript-tools.nvim -- -- But for many setups, the LSP (`ts_ls`) will work just fine - -- ts_ls = {}, + ts_ls = {}, stylua = {}, -- Used to format Lua code @@ -687,7 +710,7 @@ require('lazy').setup({ -- Disable "format_on_save lsp_fallback" for languages that don't -- have a well standardized coding style. You can add additional -- languages here or re-enable it for the disabled ones. - local disable_filetypes = { c = true, cpp = true } + local disable_filetypes = { c = false, cpp = false } if disable_filetypes[vim.bo[bufnr].filetype] then return nil else @@ -699,6 +722,9 @@ require('lazy').setup({ end, formatters_by_ft = { lua = { 'stylua' }, + c = { 'clang-format' }, + cpp = { 'clang-format' }, + erlang = { 'erlfmt', 'elp' }, -- Conform can also run multiple formatters sequentially -- python = { "isort", "black" }, -- @@ -875,6 +901,7 @@ require('lazy').setup({ lazy = false, build = ':TSUpdate', branch = 'main', + main = 'nvim.treesitter.configs', -- [[ Configure Treesitter ]] See `:help nvim-treesitter-intro` config = function() local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' } From 1fb2f695ea2b872c20ddb3c976241240fd9fcc2a Mon Sep 17 00:00:00 2001 From: SzymonIwaniuk Date: Fri, 27 Mar 2026 19:19:07 +0100 Subject: [PATCH 2/3] feat: plugins --- init.lua | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 2b320ed4887..8216a4c6905 100644 --- a/init.lua +++ b/init.lua @@ -293,7 +293,15 @@ require('lazy').setup({ } end, }, + { + 'stevearc/quicker.nvim', + ft = 'qf', + ---@module "quicker" + ---@type quicker.SetupOptions + opts = {}, + }, -- MY PLUGNS SECTION + -- -- See `:help gitsigns` to understand what the configuration keys do { -- Adds git related signs to the gutter, as well as utilities for managing changes 'lewis6991/gitsigns.nvim', @@ -308,6 +316,14 @@ require('lazy').setup({ topdelete = { text = '‾' }, ---@diagnostic disable-line: missing-fields changedelete = { text = '~' }, ---@diagnostic disable-line: missing-fields }, + + -- Inline who changed this line + current_line_blame = true, + current_line_blame_opts = { + virt_text = true, + virt_text_pos = 'eol', + delay = 500, + }, }, }, @@ -627,6 +643,18 @@ require('lazy').setup({ local servers = { clangd = {}, elp = {}, + cucumber_language_server = { + settings = { + cucumber = { + features = { 'features/**/*.feature' }, + glue = { + 'steps/**/*.ts', + 'support/**/*.ts', + 'tests/**/*.ts', + }, + }, + }, + }, -- gopls = {}, -- pyright = {}, -- rust_analyzer = {}, @@ -710,7 +738,7 @@ require('lazy').setup({ -- Disable "format_on_save lsp_fallback" for languages that don't -- have a well standardized coding style. You can add additional -- languages here or re-enable it for the disabled ones. - local disable_filetypes = { c = false, cpp = false } + local disable_filetypes = { c = false, cpp = false, cucumber = true } if disable_filetypes[vim.bo[bufnr].filetype] then return nil else @@ -725,6 +753,8 @@ require('lazy').setup({ c = { 'clang-format' }, cpp = { 'clang-format' }, erlang = { 'erlfmt', 'elp' }, + javascript = { 'eslint_d' }, + typescript = { 'eslint_d' }, -- Conform can also run multiple formatters sequentially -- python = { "isort", "black" }, -- @@ -980,3 +1010,34 @@ require('lazy').setup({ -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et +-- +-- Test Automation Cucumber-TypeScript-Playwright config +vim.api.nvim_create_autocmd('FileType', { + pattern = 'cucumber', + callback = function() + vim.keymap.set('n', 'gd', function() + local line = vim.api.nvim_get_current_line() + local step = line:match '^%s*[%w%*]+%s+(.*)$' or line + + step = step:gsub('".-"', '.*') + step = step:gsub("'.-'", '.*') + step = step:gsub('%d+', '.*') + step = step:gsub('^%s*(.-)%s*$', '%1') + + require('telescope.builtin').grep_string { + search = step, + use_regex = true, + search_dirs = { 'steps', 'support', 'tests' }, + additional_args = function() return { '--no-ignore', '--hidden' } end, + } + end, { buffer = true, desc = '[G]o to [D]efinition (Smart Telescope)' }) + end, +}) +-- +vim.api.nvim_create_autocmd('FileType', { + pattern = { 'typescript', 'typescriptreact', 'javascript', 'javascriptreact' }, + callback = function() + vim.keymap.set('n', 'gd', function() require('telescope.builtin').lsp_definitions() end, { buffer = true, desc = '[G]o to [D]efinition (LSP)' }) + end, +}) +-- From 2750d7b2201408fdf5ac923dff7667c111335330 Mon Sep 17 00:00:00 2001 From: SzymonIwaniuk Date: Thu, 11 Jun 2026 11:33:15 +0200 Subject: [PATCH 3/3] feat: update config --- init.lua | 122 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 108 insertions(+), 14 deletions(-) diff --git a/init.lua b/init.lua index e224e922f79..b2441b540c8 100644 --- a/init.lua +++ b/init.lua @@ -91,7 +91,7 @@ vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = false +vim.g.have_nerd_font = true -- [[ Setting options ]] -- See `:help vim.o` @@ -641,27 +641,31 @@ require('lazy').setup({ clangd = {}, elp = {}, cucumber_language_server = { + root_dir = function(bufnr, on_dir) + local fname = vim.api.nvim_buf_get_name(bufnr) + on_dir(vim.fs.root(fname, '.git')) + end, settings = { cucumber = { features = { 'features/**/*.feature' }, glue = { 'steps/**/*.ts', 'support/**/*.ts', + 'pages/**/*.ts', 'tests/**/*.ts', }, }, }, }, - -- gopls = {}, + gopls = {}, -- pyright = {}, - -- rust_analyzer = {}, + rust_analyzer = {}, -- -- Some languages (like typescript) have entire language plugins that can be useful: -- https://github.com/pmizio/typescript-tools.nvim -- -- But for many setups, the LSP (`ts_ls`) will work just fine ts_ls = {}, - stylua = {}, -- Used to format Lua code -- Special Lua Config, as recommended by neovim help docs @@ -740,7 +744,7 @@ require('lazy').setup({ return nil else return { - timeout_ms = 500, + timeout_ms = 3000, lsp_format = 'fallback', } end @@ -1016,16 +1020,75 @@ vim.api.nvim_create_autocmd('FileType', { local line = vim.api.nvim_get_current_line() local step = line:match '^%s*[%w%*]+%s+(.*)$' or line - step = step:gsub('".-"', '.*') - step = step:gsub("'.-'", '.*') - step = step:gsub('%d+', '.*') - step = step:gsub('^%s*(.-)%s*$', '%1') + local function re_esc(s) + return (s:gsub('([%.%+%(%)%[%]%{%}%|%^%$%\\])', '\\%1')) + end + + local parts = {} + local rest = step + local has_param = false + + while #rest > 0 do + local qs, qe = rest:find '"[^"]*"' + local ss, se = rest:find "'[^']*'" + local ds, de = rest:find '%d+' + + -- pick the earliest parameter match + local fs, fe, rep = nil, nil, nil + if qs then fs, fe, rep = qs, qe, '.*' end + if ss and (not fs or ss < fs) then fs, fe, rep = ss, se, '.*' end + if ds and (not fs or ds < fs) then fs, fe, rep = ds, de, '\\d+' end + + if fs then + has_param = true + table.insert(parts, re_esc(rest:sub(1, fs - 1))) + table.insert(parts, rep) + rest = rest:sub(fe + 1) + else + table.insert(parts, re_esc(rest)) + break + end + end + + -- Trim the trailing literal (after the last param) to avoid matching failures + -- caused by optional groups like (not )? and alternations like (dropdown|button) + -- in step definitions. Rules: + -- > 3 words → keep first 3 (e.g. "event label should be visible" → "event label should") + -- 2 words → keep first 1 (e.g. "using dropdown" → "using", avoids (dropdown|button)) + -- 1 word → keep as-is + local param_reps = { ['.*'] = true, ['\\d+'] = true } + if has_param and #parts > 0 and not param_reps[parts[#parts]] then + local trailing = parts[#parts] + local leading_space = trailing:match '^(%s*)' + local words = {} + for w in trailing:gmatch '%S+' do table.insert(words, w) end + local keep = #words + if #words > 3 then + keep = 3 + elseif #words == 2 then + keep = 1 + end + if keep < #words then + parts[#parts] = leading_space .. table.concat(words, ' ', 1, keep) + end + end + + local search_term + if has_param then + search_term = table.concat(parts, ''):gsub('%s+', '\\s+') + else + search_term = step:gsub('%s+', ' '):gsub('^%s*(.-)%s*$', '%1') + end + + local file_dir = vim.fn.expand '%:p:h' + local git_root = vim.fn.systemlist('git -C ' .. vim.fn.shellescape(file_dir) .. ' rev-parse --show-toplevel')[1] + if not git_root or git_root == '' then git_root = vim.fn.getcwd() end require('telescope.builtin').grep_string { - search = step, - use_regex = true, - search_dirs = { 'steps', 'support', 'tests' }, - additional_args = function() return { '--no-ignore', '--hidden' } end, + search = search_term, + use_regex = has_param, + search_dirs = { git_root }, + additional_args = function() return { '--no-ignore', '--hidden', '--type', 'ts', '--type', 'js', '-i' } end, } end, { buffer = true, desc = '[G]o to [D]efinition (Smart Telescope)' }) end, @@ -1037,4 +1100,35 @@ vim.api.nvim_create_autocmd('FileType', { vim.keymap.set('n', 'gd', function() require('telescope.builtin').lsp_definitions() end, { buffer = true, desc = '[G]o to [D]efinition (LSP)' }) end, }) --- + +-- Manual Config +vim.keymap.set('n', 'gm', function() + local word = vim.fn.expand '' + local orig_win = vim.api.nvim_get_current_win() + + pcall(function() vim.cmd('Man ' .. word) end) + + local curr_win = vim.api.nvim_get_current_win() + local curr_buf = vim.api.nvim_get_current_buf() + + if vim.bo[curr_buf].filetype == 'man' then + if curr_win ~= orig_win then + vim.cmd 'hide' + vim.api.nvim_win_set_buf(orig_win, curr_buf) + vim.api.nvim_set_current_win(orig_win) + end + + local bufname = vim.api.nvim_buf_get_name(curr_buf) + local section = string.match(bufname, '%((%d+)%)') + vim.cmd 'redraw' + if section then + print('man ' .. section .. ' ' .. word) + else + print('man ' .. word) + end + else + if curr_win ~= orig_win then vim.cmd 'hide' end + vim.cmd 'redraw' + print('Not found: ' .. word) + end +end, { desc = '[G]o to [M]anual' })