Compare commits
11 Commits
8335cbbaec
...
c575f7b67e
| Author | SHA1 | Date | |
|---|---|---|---|
| c575f7b67e | |||
| 99707245a6 | |||
| 79a572e033 | |||
| 2178d4f312 | |||
| d01d304a3e | |||
| af9644740e | |||
| 3cd2838ebf | |||
| ba7948b5c2 | |||
| e5428a7eb3 | |||
| d9deabce05 | |||
| 23b0bedf0e |
@@ -1,2 +1,3 @@
|
||||
vim.opt_local.conceallevel = 2
|
||||
vim.opt.wrap = true
|
||||
|
||||
|
||||
@@ -1,51 +1,50 @@
|
||||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" },
|
||||
"blink-ripgrep.nvim": { "branch": "main", "commit": "b035188bc6d8bcbf86c49ac230ee0bbadca7f7fb" },
|
||||
"blink-ripgrep.nvim": { "branch": "main", "commit": "d6e2b1356a8c184d4d254f7d32635f4b637d0bf0" },
|
||||
"blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "4d5858bd4c471c895060e1b9f3575f1551184dc5" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "3f5475949679953af6d78654db29b944fa826e6a" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||
"fzf-lua": { "branch": "main", "commit": "2dce48dac09cec8143820f1d33381fe6d03a3900" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "6e3c66548035e50db7bd8e360a29aec6620c3641" },
|
||||
"gruvbox.nvim": { "branch": "main", "commit": "a56f758f9d3eed0b8afbab6ea3ee523887755aed" },
|
||||
"fzf-lua": { "branch": "main", "commit": "db3ccffe79480543d8e0f7b0cac0d9b220f9486e" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "1ee5c1fd068c81f9dd06483e639c2aa4587dc197" },
|
||||
"gruvbox.nvim": { "branch": "main", "commit": "5e0a460d8e0f7f669c158dedd5f9ae2bcac31437" },
|
||||
"harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" },
|
||||
"hererocks": { "branch": "master", "commit": "d2e2b7ab1ce5b6d4e517619746a810159f0e18db" },
|
||||
"hererocks": { "branch": "master", "commit": "160228946bed9998f5e3b168bd0b66ba2690f8f3" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "1ea3c4085785f460fb0e46d2fe1ee895f5f9e7c1" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "e28ce52fc7ff79fcb76f0e79ee6fb6182fca90b9" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "5e085efe67fccb13372d54331d849219662a7e93" },
|
||||
"mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" },
|
||||
"mini.pairs": { "branch": "main", "commit": "6e1cc569130f25b2c6fa16d8b21b31ddb1420a4a" },
|
||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "f1deac7ecec88c28a250d890ba7bb35843e69cbd" },
|
||||
"none-ls.nvim": { "branch": "main", "commit": "53ec77181d96494b9dc9457110dd62dc623cc78d" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "6bdb14f230de0904229ec367b410fb817e59b072" },
|
||||
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
|
||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "4c60a198e3f92098778a32a1c76d2bd7ba46a3b5" },
|
||||
"none-ls.nvim": { "branch": "main", "commit": "5cf63841461b49989972d35bf886e076a1ab3649" },
|
||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "3db16ceeea947517f0dc1404c24dcb5ab0c91d26" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "5bfcc89fd155b4ffc02d18ab3b7d19c2d4e246a7" },
|
||||
"nvim-navic": { "branch": "master", "commit": "f887d794a0f4594882814d7780980a949200a238" },
|
||||
"nvim-sops": { "branch": "main", "commit": "cb2209562d00ef8c6c88bdec836d9edb8fbb96ef" },
|
||||
"nvim-surround": { "branch": "main", "commit": "a868c256c861044beb9794b4dd126480dcdfbdad" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"nvim-ufo": { "branch": "main", "commit": "d31e2a9fd572a25a4d5011776677223a8ccb7e35" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "f66cdfef5e84112045b9ebc3119fee9bddb3c687" },
|
||||
"obsidian.nvim": { "branch": "main", "commit": "705cc9b4f66eca1e54040ac819102e80a32896d3" },
|
||||
"oil.nvim": { "branch": "master", "commit": "07f80ad645895af849a597d1cac897059d89b686" },
|
||||
"nvim-treesitter": { "branch": "main", "commit": "0606c7a9dcaa5c5beee0b0f09043e9fdd1ba0a68" },
|
||||
"nvim-ufo": { "branch": "main", "commit": "72d54c31079d38d8dfc5456131b1d0fb5c0264b0" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "b8221e42cf7287c4dcde81f232f58d7b947c210d" },
|
||||
"obsidian.nvim": { "branch": "main", "commit": "6b2a22a74d1c883e797764c28f75aa6b532a1ae4" },
|
||||
"oil.nvim": { "branch": "master", "commit": "919e155fdf38e9148cdb5304faaaf53c20d703ea" },
|
||||
"parrot.nvim": { "branch": "main", "commit": "dcae923c7070431c8cb628b19594ab640168684c" },
|
||||
"plenary": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" },
|
||||
"render-markdown.nvim": { "branch": "main", "commit": "e76eb2e4262f0f0a1a7bd7a454dd7d44f1299afd" },
|
||||
"render-markdown.nvim": { "branch": "main", "commit": "d53856423be5ef3c267d26ee261b0981b372f718" },
|
||||
"search.nvim": { "branch": "main", "commit": "7b8f2315d031be73e14bc2d82386dfac15952614" },
|
||||
"statuscol.nvim": { "branch": "main", "commit": "c46172d0911aa5d49ba5f39f4351d1bb7aa289cc" },
|
||||
"tabby.nvim": { "branch": "main", "commit": "b3affa6db7eab80fca2a2db5b73b473144507039" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" },
|
||||
"undotree": { "branch": "master", "commit": "fe9a9d0645f0f5532360b5e5f5c550d7bb4f1869" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "c098362fe603d3922095e7db595961e020bdf2d0" },
|
||||
"undotree": { "branch": "master", "commit": "0f1c9816975b5d7f87d5003a19c53c6fd2ff6f7f" },
|
||||
"vim-dadbod": { "branch": "master", "commit": "e95afed23712f969f83b4857a24cf9d59114c2e6" },
|
||||
"vim-dadbod-completion": { "branch": "master", "commit": "a8dac0b3cf6132c80dc9b18bef36d4cf7a9e1fe6" },
|
||||
"vim-dadbod-ui": { "branch": "master", "commit": "e8b53c0f3aa6e6127ac2a2d2071d9aade6c6e373" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" },
|
||||
"vim-helm": { "branch": "master", "commit": "cc5ac22444332381f38084a6c7f023c25eef6201" },
|
||||
"vim-helm": { "branch": "master", "commit": "2c8525fd98e57472769d137317bca83e477858ce" },
|
||||
"vim-illuminate": { "branch": "master", "commit": "0d1e93684da00ab7c057410fecfc24f434698898" }
|
||||
}
|
||||
|
||||
@@ -3,57 +3,85 @@ local augroup = vim.api.nvim_create_augroup
|
||||
|
||||
local CrentistGroup = augroup('Crentist', {})
|
||||
local OnSaveGroup = augroup('CrentistOnSave', {})
|
||||
local CrentistTreeSitter = augroup('CrentistTreeSitter', {})
|
||||
|
||||
local builtin = require('telescope.builtin')
|
||||
|
||||
autocmd('LspAttach', {
|
||||
group = CrentistGroup,
|
||||
callback = function(e)
|
||||
local opts = { buffer = e.buf }
|
||||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
|
||||
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
|
||||
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
|
||||
vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts)
|
||||
vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts)
|
||||
vim.keymap.set("n", "<leader>vrr", function() builtin.lsp_references() end, opts)
|
||||
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
|
||||
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
|
||||
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
|
||||
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
|
||||
vim.keymap.set("n", "<M-F>", function() vim.lsp.buf.format() end, opts)
|
||||
end
|
||||
group = CrentistGroup,
|
||||
callback = function(e)
|
||||
local opts = { buffer = e.buf }
|
||||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
|
||||
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
|
||||
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
|
||||
vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts)
|
||||
vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts)
|
||||
vim.keymap.set("n", "<leader>vrr", function() builtin.lsp_references() end, opts)
|
||||
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
|
||||
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
|
||||
vim.keymap.set("n", "[d", function() vim.diagnostic.jump({ count = 1 }) end, opts)
|
||||
vim.keymap.set("n", "]d", function() vim.diagnostic.jump({ count = -1 }) end, opts)
|
||||
vim.keymap.set("n", "<M-F>", function() vim.lsp.buf.format() end, opts)
|
||||
end
|
||||
})
|
||||
|
||||
-- Add new line to the end of the file
|
||||
autocmd({ 'BufWritePre' }, {
|
||||
group = OnSaveGroup,
|
||||
pattern = '*',
|
||||
callback = function()
|
||||
local n_lines = vim.api.nvim_buf_line_count(0)
|
||||
local last_nonblank = vim.fn.prevnonblank(n_lines)
|
||||
if last_nonblank <= n_lines then
|
||||
vim.api.nvim_buf_set_lines(0,
|
||||
last_nonblank, n_lines, true, { '' })
|
||||
end
|
||||
end,
|
||||
group = OnSaveGroup,
|
||||
pattern = '*',
|
||||
callback = function()
|
||||
local n_lines = vim.api.nvim_buf_line_count(0)
|
||||
local last_nonblank = vim.fn.prevnonblank(n_lines)
|
||||
if last_nonblank <= n_lines then
|
||||
vim.api.nvim_buf_set_lines(0,
|
||||
last_nonblank, n_lines, true, { '' })
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- Remove trailing spaces
|
||||
autocmd({ 'BufWritePre' }, {
|
||||
group = OnSaveGroup,
|
||||
pattern = { "*" },
|
||||
callback = function()
|
||||
local save_cursor = vim.fn.winsaveview()
|
||||
pcall(function() vim.cmd [[%s/\s\+$//e]] end)
|
||||
vim.fn.winrestview(save_cursor)
|
||||
end,
|
||||
group = OnSaveGroup,
|
||||
pattern = { "*" },
|
||||
callback = function()
|
||||
local save_cursor = vim.fn.winsaveview()
|
||||
pcall(function() vim.cmd [[%s/\s\+$//e]] end)
|
||||
vim.fn.winrestview(save_cursor)
|
||||
end,
|
||||
})
|
||||
|
||||
autocmd({'FileType'}, {
|
||||
group = CrentistGroup,
|
||||
pattern = { 'json' },
|
||||
callback = function (e)
|
||||
vim.keymap.set("n", "<M-F>", function() vim.cmd('silent %!jq .') end, {buffer = e.buf})
|
||||
end
|
||||
autocmd({ 'FileType' }, {
|
||||
group = CrentistGroup,
|
||||
pattern = { 'json' },
|
||||
callback = function(e)
|
||||
vim.keymap.set("n", "<M-F>", function() vim.cmd('silent %!jq .') end, { buffer = e.buf })
|
||||
end
|
||||
})
|
||||
|
||||
autocmd({ 'FileType' }, {
|
||||
group = CrentistTreeSitter,
|
||||
pattern = {
|
||||
'sh',
|
||||
'javascript',
|
||||
'typescript',
|
||||
'python',
|
||||
'go',
|
||||
'terraform*',
|
||||
'yaml',
|
||||
'helm',
|
||||
'tmux',
|
||||
'lua',
|
||||
'vim',
|
||||
'vimdoc',
|
||||
'latex',
|
||||
'json',
|
||||
'yaml*',
|
||||
'git*',
|
||||
'make',
|
||||
'markdown*',
|
||||
},
|
||||
callback = function(e)
|
||||
vim.treesitter.start(e.buf)
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
@@ -4,8 +4,13 @@ return {
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
config = function()
|
||||
local harpoon = require('harpoon')
|
||||
local extensions = require('harpoon.extensions')
|
||||
|
||||
harpoon:setup()
|
||||
harpoon:setup({
|
||||
settings = { sync_on_ui_close = true }
|
||||
})
|
||||
harpoon:extend(extensions.builtins.navigate_with_number())
|
||||
harpoon:extend(extensions.builtins.highlight_current_file())
|
||||
|
||||
-- basic telescope configuration
|
||||
local conf = require('telescope.config').values
|
||||
|
||||
@@ -6,6 +6,9 @@ return {
|
||||
opts = {
|
||||
completions = {
|
||||
blink = { enabled = true }
|
||||
},
|
||||
heading = {
|
||||
icons = { ' ', ' ', ' ', ' ', ' ', ' ' },
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@ return {
|
||||
'nvim-lua/plenary.nvim',
|
||||
},
|
||||
keys = {
|
||||
{ '<leader>ot', '<cmd>ObsidianToday<CR>', desc = "Open today's daily note" },
|
||||
{ '<leader>os', '<cmd>ObsidianQuickSwitch<CR>', desc = 'Search notes in my vault and switch to selected' },
|
||||
{ '<leader>ot', '<cmd>Obsidian today<CR>', desc = "Open today's daily note" },
|
||||
{ '<leader>os', '<cmd>Obsidian quick_switch<CR>', desc = 'Search notes in my vault and switch to selected' },
|
||||
},
|
||||
mappings = {
|
||||
-- Overrides the 'gf' mapping to work on markdown/wiki links within your vault.
|
||||
@@ -33,6 +33,7 @@ return {
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
legacy_commands = false,
|
||||
workspaces = {
|
||||
{
|
||||
name = 'tech-work-hobby',
|
||||
@@ -51,7 +52,10 @@ return {
|
||||
completion = {
|
||||
blink = true,
|
||||
nvim_cmp = false,
|
||||
}
|
||||
},
|
||||
ui = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
return {
|
||||
'stevearc/oil.nvim',
|
||||
-- Optional dependencies
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
opts = {},
|
||||
config = function()
|
||||
require('oil').setup({
|
||||
view_options = {
|
||||
show_hidden = true,
|
||||
},
|
||||
keymaps = {
|
||||
['<C-h>'] = false,
|
||||
['<C-j>'] = false,
|
||||
['<C-k>'] = false,
|
||||
['<C-l>'] = false,
|
||||
}
|
||||
})
|
||||
end
|
||||
opts = {
|
||||
view_options = {
|
||||
show_hidden = true,
|
||||
},
|
||||
keymaps = {
|
||||
['<C-h>'] = false,
|
||||
['<C-j>'] = false,
|
||||
['<C-k>'] = false,
|
||||
['<C-l>'] = false,
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
return {
|
||||
'echasnovski/mini.pairs',
|
||||
event = 'VeryLazy',
|
||||
opts = {
|
||||
modes = { insert = true, command = true, terminal = false },
|
||||
-- skip autopair when next character is one of these
|
||||
skip_next = [=[[%w%%%'%[%"%.%`%$]]=],
|
||||
-- skip autopair when the cursor is inside these treesitter nodes
|
||||
skip_ts = { "string" },
|
||||
-- skip autopair when next character is closing pair
|
||||
-- and there are more closing pairs than opening pairs
|
||||
skip_unbalanced = true,
|
||||
-- better deal with markdown code blocks
|
||||
markdown = true,
|
||||
},
|
||||
|
||||
config = function(_, opts)
|
||||
local pairs = require("mini.pairs")
|
||||
pairs.setup(opts)
|
||||
local open = pairs.open
|
||||
pairs.open = function(pair, neigh_pattern)
|
||||
if vim.fn.getcmdline() ~= "" then
|
||||
return open(pair, neigh_pattern)
|
||||
end
|
||||
local o, c = pair:sub(1, 1), pair:sub(2, 2)
|
||||
local line = vim.api.nvim_get_current_line()
|
||||
local cursor = vim.api.nvim_win_get_cursor(0)
|
||||
local next = line:sub(cursor[2] + 1, cursor[2] + 1)
|
||||
local before = line:sub(1, cursor[2])
|
||||
if opts.markdown and o == "`" and vim.bo.filetype == "markdown" and before:match("^%s*``") then
|
||||
return "`\n```" .. vim.api.nvim_replace_termcodes("<up>", true, true, true)
|
||||
end
|
||||
if opts.skip_next and next ~= "" and next:match(opts.skip_next) then
|
||||
return o
|
||||
end
|
||||
if opts.skip_ts and #opts.skip_ts > 0 then
|
||||
local ok, captures = pcall(vim.treesitter.get_captures_at_pos, 0, cursor[1] - 1,
|
||||
math.max(cursor[2] - 1, 0))
|
||||
for _, capture in ipairs(ok and captures or {}) do
|
||||
if vim.tbl_contains(opts.skip_ts, capture.capture) then
|
||||
return o
|
||||
end
|
||||
end
|
||||
end
|
||||
if opts.skip_unbalanced and next == c and c ~= o then
|
||||
local _, count_open = line:gsub(vim.pesc(pair:sub(1, 1)), "")
|
||||
local _, count_close = line:gsub(vim.pesc(pair:sub(2, 2)), "")
|
||||
if count_close > count_open then
|
||||
return o
|
||||
end
|
||||
end
|
||||
return open(pair, neigh_pattern)
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -21,10 +21,8 @@ return {
|
||||
command = { max_tokens = 4096 },
|
||||
},
|
||||
models = {
|
||||
"claude-opus-4-1-20250805",
|
||||
"claude-sonnet-4-20250514",
|
||||
"claude-3-7-sonnet-20250219",
|
||||
"claude-3-5-sonnet-20241022",
|
||||
"claude-3-5-haiku-20241022",
|
||||
},
|
||||
preprocess_payload = function(payload)
|
||||
for _, message in ipairs(payload.messages) do
|
||||
|
||||
@@ -24,7 +24,10 @@ return {
|
||||
vimgrep_arguments = vimgrep_arguments,
|
||||
file_ignore_patterns = {
|
||||
'node_modules',
|
||||
'.git/'
|
||||
'galaxy-roles',
|
||||
'galaxy-collections',
|
||||
'.git',
|
||||
'.terraform',
|
||||
}
|
||||
},
|
||||
extensions = {
|
||||
@@ -43,9 +46,9 @@ return {
|
||||
prev = '<S-Tab>'
|
||||
},
|
||||
tabs = {
|
||||
{ name = 'Files', tele_func = builtin.find_files, tele_opts = { no_ignore = true, hidden = true } },
|
||||
{ name = 'Grep', tele_func = builtin.live_grep },
|
||||
{ name = 'Buffers', tele_func = builtin.buffers },
|
||||
{ name = 'Files', tele_func = builtin.find_files, tele_opts = { no_ignore = true, hidden = true } },
|
||||
{ name = 'Advanced Grep', tele_func = require('crentist.telescope.advanced_grep').advanced_grep },
|
||||
{ name = 'Buffers', tele_func = builtin.buffers },
|
||||
},
|
||||
append_tabs = { -- append_tabs will add the provided tabs to the default ones
|
||||
{
|
||||
@@ -55,6 +58,13 @@ return {
|
||||
return vim.fn.isdirectory('.git') == 1
|
||||
end
|
||||
},
|
||||
{
|
||||
'Stash',
|
||||
builtin.git_stash,
|
||||
available = function()
|
||||
return vim.fn.isdirectory('.git') == 1
|
||||
end
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@@ -1,32 +1,50 @@
|
||||
return {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
branch='master',
|
||||
branch = 'main',
|
||||
lazy = false,
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
-- A list of parser names, or "all" (the five listed parsers should always be installed)
|
||||
ensure_installed = { "bash", "javascript", "typescript", "python", "go", "terraform", "hcl", "helm", "jq", "yaml", "tmux", "lua", "vim", "vimdoc" },
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
auto_install = true,
|
||||
|
||||
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
|
||||
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
})
|
||||
local ts = require("nvim-treesitter")
|
||||
local installed_parsers = {
|
||||
"bash",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"python",
|
||||
"go",
|
||||
"terraform",
|
||||
"hcl",
|
||||
"helm",
|
||||
"jq",
|
||||
"yaml",
|
||||
"tmux",
|
||||
"lua",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"latex",
|
||||
"json",
|
||||
"yaml",
|
||||
"git_config",
|
||||
"git_rebase",
|
||||
"gitattributes",
|
||||
"gitcommit",
|
||||
"gitignore",
|
||||
"make",
|
||||
"markdown_inline",
|
||||
"nginx",
|
||||
"properties",
|
||||
"ini",
|
||||
"ssh_config",
|
||||
"ssh_client_config",
|
||||
"editorconfig",
|
||||
"passwd",
|
||||
"regex",
|
||||
"sql",
|
||||
"sqlite",
|
||||
"toml",
|
||||
"xml",
|
||||
}
|
||||
ts.setup()
|
||||
ts.install(installed_parsers)
|
||||
end
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ local s = ls.snippet
|
||||
local i = ls.insert_node
|
||||
local f = ls.function_node
|
||||
local fmt = require("luasnip.extras.fmt").fmt
|
||||
local vscode_loader = require("luasnip.loaders.from_vscode")
|
||||
|
||||
vim.keymap.set({ "i", "s" }, "<C-l>", function()
|
||||
if ls.expand_or_jumpable() then
|
||||
@@ -126,3 +127,32 @@ local yaml_schema_snippet = s(
|
||||
ls.add_snippets('yaml', { yaml_schema_snippet })
|
||||
ls.add_snippets('helm', { yaml_schema_snippet })
|
||||
|
||||
|
||||
local flux_cd_kustomization = s(
|
||||
{ name = 'fluxcd_kustomization', trig = 'fluxkust' },
|
||||
fmt([[
|
||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||
kind: Kustomization
|
||||
metadata:
|
||||
name: {name}
|
||||
namespace: {namespace}
|
||||
spec:
|
||||
interval: {interval}
|
||||
path: {path}
|
||||
prune: true
|
||||
sourceRef:
|
||||
kind: GitRepository
|
||||
name: {repository_name}
|
||||
]],
|
||||
{
|
||||
name = i(1, 'name'),
|
||||
namespace = i(2, 'flux-system'),
|
||||
interval = i(3, '5m'),
|
||||
path = i(4, 'path'),
|
||||
repository_name = i(5, 'repository_name'),
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
ls.add_snippets('yaml', { flux_cd_kustomization })
|
||||
|
||||
|
||||
54
lua/crentist/telescope/advanced_grep.lua
Normal file
54
lua/crentist/telescope/advanced_grep.lua
Normal file
@@ -0,0 +1,54 @@
|
||||
local pickers = require("telescope.pickers")
|
||||
local finders = require("telescope.finders")
|
||||
local make_entry = require("telescope.make_entry")
|
||||
local conf = require("telescope.config").values
|
||||
|
||||
local M = {}
|
||||
|
||||
local advanced_grep = function(opts)
|
||||
opts = opts or {}
|
||||
opts.cwd = opts.cwd or vim.uv.cwd()
|
||||
|
||||
|
||||
local finder = finders.new_async_job({
|
||||
command_generator = function(prompt)
|
||||
if not prompt or prompt == "" then
|
||||
return nil
|
||||
end
|
||||
|
||||
local pieces = vim.split(prompt, " ")
|
||||
|
||||
local args = { "rg" }
|
||||
|
||||
if pieces[1] then
|
||||
table.insert(args, "-e")
|
||||
table.insert(args, pieces[1])
|
||||
end
|
||||
|
||||
if pieces[2] then
|
||||
table.insert(args, "-g")
|
||||
table.insert(args, pieces[2])
|
||||
end
|
||||
|
||||
return vim.iter({ args, { "--color=never", "--no-heading", "--with-filename", "--line-number", "--column", "--smart-case" } })
|
||||
:flatten()
|
||||
:totable()
|
||||
end,
|
||||
entry_maker = make_entry.gen_from_vimgrep(opts),
|
||||
cwd = opts.cwd,
|
||||
})
|
||||
|
||||
pickers.new(opts, {
|
||||
debounce = 100,
|
||||
prompt_title = "Advanced Grep",
|
||||
finder = finder,
|
||||
previewer = conf.grep_previewer(opts),
|
||||
sorter = require("telescope.sorters").empty(),
|
||||
}):find()
|
||||
end
|
||||
|
||||
|
||||
M.advanced_grep = advanced_grep
|
||||
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user