cosmetics: replace double-quotes with single-quotes

This commit is contained in:
2025-08-05 17:23:38 +03:00
parent 4baef6ee61
commit 552536e87b
7 changed files with 89 additions and 32 deletions

View File

@@ -1,34 +1,35 @@
return {
"tpope/vim-fugitive",
'tpope/vim-fugitive',
config = function()
vim.keymap.set("n", "<leader>gs", vim.cmd.Git)
vim.keymap.set('n', "<leader>gs", vim.cmd.Git)
local Crentist_Fugitive = vim.api.nvim_create_augroup("Crentist_Fugitive", {})
local Crentist_Fugitive = vim.api.nvim_create_augroup('Crentist_Fugitive', {})
local autocmd = vim.api.nvim_create_autocmd
autocmd("BufWinEnter", {
autocmd('BufWinEnter', {
group = Crentist_Fugitive,
pattern = "*",
pattern = '*',
callback = function()
if vim.bo.ft ~= "fugitive" then
if vim.bo.ft ~= 'fugitive' then
return
end
local bufnr = vim.api.nvim_get_current_buf()
local opts = {buffer = bufnr, remap = false}
vim.keymap.set("n", "<leader>p", function()
vim.keymap.set('n', "<leader>p", function()
vim.cmd.Git('push')
end, opts)
-- rebase always
vim.keymap.set("n", "<leader>P", function()
vim.keymap.set('n', "<leader>P", function()
vim.cmd.Git({'pull', '--rebase'})
end, opts)
-- NOTE: It allows me to easily set the branch i am pushing and any tracking
-- needed if i did not set the branch up correctly
vim.keymap.set("n", "<leader>t", ":Git push -u origin ", opts);
vim.keymap.set('n', "<leader>t", ":Git push -u origin ", opts);
end,
})
end
}

View File

@@ -1,5 +1,5 @@
return {
"lewis6991/gitsigns.nvim",
'lewis6991/gitsigns.nvim',
opts = {
current_line_blame = true,
attach_to_untracked = true,

View File

@@ -1,14 +1,14 @@
return {
"theprimeagen/harpoon",
branch = "harpoon2",
dependencies = { "nvim-lua/plenary.nvim" },
'theprimeagen/harpoon',
branch = 'harpoon2',
dependencies = { 'nvim-lua/plenary.nvim' },
config = function()
local harpoon = require("harpoon")
local harpoon = require('harpoon')
harpoon:setup()
-- basic telescope configuration
local conf = require("telescope.config").values
local conf = require('telescope.config').values
local function toggle_telescope(harpoon_files)
local file_paths = {}
for _, item in ipairs(harpoon_files.items) do
@@ -16,8 +16,8 @@ return {
end
require('telescope.pickers').new({}, {
prompt_title = "Harpoon",
finder = require("telescope.finders").new_table({
prompt_title = 'Harpoon',
finder = require('telescope.finders').new_table({
results = file_paths,
}),
previewer = conf.file_previewer({}),
@@ -25,15 +25,15 @@ return {
}):find()
end
vim.keymap.set("n", "<leader>a", function() harpoon:list():add() end)
vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
vim.keymap.set("n", "<leader><C-e>", function() toggle_telescope(harpoon:list()) end,
{ desc = "Open harpoon window" })
vim.keymap.set('n', '<leader>a', function() harpoon:list():add() end)
vim.keymap.set('n', '<C-e>', function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
vim.keymap.set('n', '<leader><C-e>', function() toggle_telescope(harpoon:list()) end,
{ desc = 'Open harpoon window' })
vim.keymap.set("n", "<C-h>", function() harpoon:list():select(1) end)
vim.keymap.set("n", "<C-j>", function() harpoon:list():select(2) end)
vim.keymap.set("n", "<C-k>", function() harpoon:list():select(3) end)
vim.keymap.set("n", "<C-l>", function() harpoon:list():select(4) end)
vim.keymap.set('n', '<C-h>', function() harpoon:list():select(1) end)
vim.keymap.set('n', '<C-j>', function() harpoon:list():select(2) end)
vim.keymap.set('n', '<C-k>', function() harpoon:list():select(3) end)
vim.keymap.set('n', '<C-l>', function() harpoon:list():select(4) end)
end
}

View File

@@ -1 +1,2 @@
return { "lukas-reineke/indent-blankline.nvim", main = "ibl", opts = {} }
return { 'lukas-reineke/indent-blankline.nvim', main = 'ibl', opts = {} }

View File

@@ -1,6 +1,7 @@
return {
{
"nvim-lua/plenary.nvim",
name = "plenary"
'nvim-lua/plenary.nvim',
name = 'plenary'
},
}

View File

@@ -7,7 +7,8 @@ return {
local navic = require('nvim-navic')
navic.setup({
lsp = {
auto_attach = true
auto_attach = true,
preference = { 'helm_ls', 'yamlls' }
}
})
end

View File

@@ -1,3 +1,56 @@
-- https://www.youtube.com/watch?v=q-oBU2fO1H4&t=189s
local null_ls = require("null-ls")
local null_ls = require('null-ls')
local plenary = require('plenary')
local kustomize_condition = function(node, params)
if node == nil then return false end
if vim.treesitter.get_node_text(node, params['bufnr']) ~= 'resources' then return false end
return true
end
---@module 'null-ls'
---@type
local kustomize_action = {
method = null_ls.methods.CODE_ACTION,
filetypes = { 'yaml' },
generator = {
fn = function(params)
local out = {}
local node = vim.treesitter.get_node()
if kustomize_condition(node, params) then
table.insert(out, {
title = '📁 Create resources',
action = function()
local node_below = vim.treesitter.get_node({ bufnr = 0, pos = { params['row'] + 1, 0 } })
if node_below == nil or node_below:type() ~= 'block_sequence' then
vim.api.nvim_echo({ { '❌Failed to get list items.', 'Normal' } }, false, {})
return
end
local checked_files = ''
for list_item, _ in node_below:iter_children() do
if list_item ~= nil then
local item_value_node = list_item:child(1) -- 0 is `-`, 1 is the actual value
if item_value_node ~= nil then
local file_name = vim.treesitter.get_node_text(item_value_node, params['bufnr'])
local file_name_path = plenary.path.new(file_name)
local current_file = plenary.path.new(vim.fn.expand('%'))
local parent = plenary.path.new(current_file:parents()[1])
local new_file = parent / file_name
new_file:touch({mode=644})
end
end
end
end,
})
end
return out
end,
},
}
-- null_ls.deregister(kustomize_action)
null_ls.register(kustomize_action)