Compare commits
51 Commits
feature/de
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 869be617bf | |||
| fddc6b8ee1 | |||
| 70dfeab75c | |||
| 7dad3514e0 | |||
| cd7f789302 | |||
| 405ec5da4f | |||
| 788ef34c04 | |||
| a44a75b745 | |||
| 74e77ca34a | |||
| a4a48adc08 | |||
| 3dbb63738b | |||
| 3c768051f5 | |||
| 39b68e0d54 | |||
| 24bb947547 | |||
| 9d9934f133 | |||
| 7e7a4a5543 | |||
| f38e7720e1 | |||
| 0b756ba15f | |||
| bd6f9a6279 | |||
| 6abfea8c60 | |||
| 0e4c1c54c4 | |||
| 42ca780fac | |||
| 89a49ccc5d | |||
| cd2434ca93 | |||
| fed56619b9 | |||
| 03492410b0 | |||
| c575f7b67e | |||
| 99707245a6 | |||
| 79a572e033 | |||
| 2178d4f312 | |||
| d01d304a3e | |||
| af9644740e | |||
| 3cd2838ebf | |||
| ba7948b5c2 | |||
| e5428a7eb3 | |||
| d9deabce05 | |||
| 23b0bedf0e | |||
| 8335cbbaec | |||
| 9a15e2a905 | |||
| da47eb3177 | |||
| 8b74702fb4 | |||
| 4aa3e696b8 | |||
| 0ba639e806 | |||
| ca193e334a | |||
| 17abcf48ae | |||
| 552536e87b | |||
| 4baef6ee61 | |||
| c8e33adba0 | |||
| 28fb8bea85 | |||
| bd09133cf6 | |||
| 8650bc76a5 |
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
lua/testing
|
||||||
|
|
||||||
7
after/ftplugin/json.lua
Normal file
7
after/ftplugin/json.lua
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
vim.opt_local.tabstop = 2
|
||||||
|
vim.opt_local.shiftwidth = 2
|
||||||
|
vim.opt_local.softtabstop = 2
|
||||||
|
vim.opt_local.expandtab = true
|
||||||
|
|
||||||
|
vim.opt_local.conceallevel = 0
|
||||||
|
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
vim.opt_local.conceallevel = 2
|
vim.opt_local.conceallevel = 2
|
||||||
|
vim.opt.wrap = true
|
||||||
|
|
||||||
|
|||||||
@@ -1,43 +1,49 @@
|
|||||||
{
|
{
|
||||||
"LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" },
|
"LuaSnip": { "branch": "master", "commit": "5a1e39223db9a0498024a77b8441169d260c8c25" },
|
||||||
"blink-ripgrep.nvim": { "branch": "main", "commit": "12fb7348cf9d32a0ed2e3ab4960d561632e57ba4" },
|
"blink-ripgrep.nvim": { "branch": "main", "commit": "64e26b597303d9ed175f8ed832df8328731b93cd" },
|
||||||
"blink.cmp": { "branch": "main", "commit": "9bcb14b43852a6f2bfd5ac9ef29cb5cf09b1b39b" },
|
"blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" },
|
||||||
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
|
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
|
||||||
"fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" },
|
"fidget.nvim": { "branch": "main", "commit": "e32b672d8fd343f9d6a76944fedb8c61d7d8111a" },
|
||||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||||
"fzf-lua": { "branch": "main", "commit": "c53ba4f40f0514a5038646fb1e9ce05872b18eb1" },
|
"fzf-lua": { "branch": "main", "commit": "43bda24f711e0c13428f16056002aebc20b38e04" },
|
||||||
"gitsigns.nvim": { "branch": "main", "commit": "88205953bd748322b49b26e1dfb0389932520dc9" },
|
"gitsigns.nvim": { "branch": "main", "commit": "5813e4878748805f1518cee7abb50fd7205a3a48" },
|
||||||
"gruvbox.nvim": { "branch": "main", "commit": "00e38a379bab3389e187b3953566d67d494dfddd" },
|
"gruvbox.nvim": { "branch": "main", "commit": "5e0a460d8e0f7f669c158dedd5f9ae2bcac31437" },
|
||||||
"harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" },
|
"harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" },
|
||||||
"hererocks": { "branch": "master", "commit": "4ce92131e9858950440ab99a25db9a9b43db8cd4" },
|
"hererocks": { "branch": "master", "commit": "f540b58acb0952bc82f5465b3c45999d2fe39ece" },
|
||||||
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
|
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
|
||||||
"lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
|
"lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" },
|
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "f54e3c11fc9ebfcfc27e696182b0295b071d0811" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "c55bd8a8fb191e24176c206a7af1dd51ce7276a5" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" },
|
"mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" },
|
||||||
"mini.pairs": { "branch": "main", "commit": "42407ccb80ec59c84e7c91d815f42ed90a8cc093" },
|
"neo-tree.nvim": { "branch": "v3.x", "commit": "f3df514fff2bdd4318127c40470984137f87b62e" },
|
||||||
"none-ls.nvim": { "branch": "main", "commit": "db2a48b79cfcdab8baa5d3f37f21c78b6705c62e" },
|
"none-ls.nvim": { "branch": "main", "commit": "5abf61927023ea83031753504adb19630ba80eef" },
|
||||||
|
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||||
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
|
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "056f569f71e4b726323b799b9cfacc53653bceb3" },
|
"nvim-lspconfig": { "branch": "master", "commit": "5bfcc89fd155b4ffc02d18ab3b7d19c2d4e246a7" },
|
||||||
"nvim-navic": { "branch": "master", "commit": "f887d794a0f4594882814d7780980a949200a238" },
|
"nvim-navic": { "branch": "master", "commit": "7d914a39a1ef8f4e22c2c4381abeef7c556f5a13" },
|
||||||
"nvim-sops": { "branch": "main", "commit": "cb2209562d00ef8c6c88bdec836d9edb8fbb96ef" },
|
"nvim-sops": { "branch": "main", "commit": "cb2209562d00ef8c6c88bdec836d9edb8fbb96ef" },
|
||||||
"nvim-surround": { "branch": "main", "commit": "8dd9150ca7eae5683660ea20cec86edcd5ca4046" },
|
"nvim-surround": { "branch": "main", "commit": "fcfa7e02323d57bfacc3a141f8a74498e1522064" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
"nvim-treesitter": { "branch": "main", "commit": "f47f549f74cea5d5f25a5205c9e127cd882f1d20" },
|
||||||
"nvim-ufo": { "branch": "main", "commit": "80fe8215ba566df2fbf3bf4d25f59ff8f41bc0e1" },
|
"nvim-ufo": { "branch": "main", "commit": "72d54c31079d38d8dfc5456131b1d0fb5c0264b0" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" },
|
"nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" },
|
||||||
"obsidian.nvim": { "branch": "main", "commit": "2f0222b3eb20382cadf3e1d91f368318b768771c" },
|
"obsidian.nvim": { "branch": "main", "commit": "6939efc2c7145cf83644192c588eccd935b57826" },
|
||||||
"oil.nvim": { "branch": "master", "commit": "08c2bce8b00fd780fb7999dbffdf7cd174e896fb" },
|
"oil.nvim": { "branch": "master", "commit": "cbcb3f997f6f261c577b943ec94e4ef55108dd95" },
|
||||||
"parrot.nvim": { "branch": "main", "commit": "0477748832812707e53db078d0180299a0c15d6c" },
|
"parrot.nvim": { "branch": "main", "commit": "dcae923c7070431c8cb628b19594ab640168684c" },
|
||||||
"plenary": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
"plenary": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||||
"promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" },
|
"promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" },
|
||||||
|
"render-markdown.nvim": { "branch": "main", "commit": "b2b135347e299ffbf7f4123fb7811899b0c9f4b8" },
|
||||||
"search.nvim": { "branch": "main", "commit": "7b8f2315d031be73e14bc2d82386dfac15952614" },
|
"search.nvim": { "branch": "main", "commit": "7b8f2315d031be73e14bc2d82386dfac15952614" },
|
||||||
"statuscol.nvim": { "branch": "main", "commit": "c46172d0911aa5d49ba5f39f4351d1bb7aa289cc" },
|
"statuscol.nvim": { "branch": "main", "commit": "c46172d0911aa5d49ba5f39f4351d1bb7aa289cc" },
|
||||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
|
"tabby.nvim": { "branch": "main", "commit": "b3affa6db7eab80fca2a2db5b73b473144507039" },
|
||||||
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
|
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
|
||||||
"trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" },
|
"telescope.nvim": { "branch": "master", "commit": "e69b434b968a33815e2f02a5c7bd7b8dd4c7d4b2" },
|
||||||
"undotree": { "branch": "master", "commit": "b951b87b46c34356d44aa71886aecf9dd7f5788a" },
|
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" },
|
||||||
"vim-fugitive": { "branch": "master", "commit": "4a745ea72fa93bb15dd077109afbb3d1809383f2" },
|
"undotree": { "branch": "master", "commit": "0f1c9816975b5d7f87d5003a19c53c6fd2ff6f7f" },
|
||||||
"vim-helm": { "branch": "master", "commit": "cc5ac22444332381f38084a6c7f023c25eef6201" }
|
"vim-dadbod": { "branch": "master", "commit": "e95afed23712f969f83b4857a24cf9d59114c2e6" },
|
||||||
|
"vim-dadbod-completion": { "branch": "master", "commit": "a8dac0b3cf6132c80dc9b18bef36d4cf7a9e1fe6" },
|
||||||
|
"vim-dadbod-ui": { "branch": "master", "commit": "48c4f271da13d380592f4907e2d1d5558044e4e5" },
|
||||||
|
"vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" },
|
||||||
|
"vim-illuminate": { "branch": "master", "commit": "0d1e93684da00ab7c057410fecfc24f434698898" }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ local augroup = vim.api.nvim_create_augroup
|
|||||||
|
|
||||||
local CrentistGroup = augroup('Crentist', {})
|
local CrentistGroup = augroup('Crentist', {})
|
||||||
local OnSaveGroup = augroup('CrentistOnSave', {})
|
local OnSaveGroup = augroup('CrentistOnSave', {})
|
||||||
|
local CrentistTreeSitter = augroup('CrentistTreeSitter', {})
|
||||||
|
|
||||||
local builtin = require('telescope.builtin')
|
local builtin = require('telescope.builtin')
|
||||||
|
|
||||||
@@ -18,8 +19,8 @@ autocmd('LspAttach', {
|
|||||||
vim.keymap.set("n", "<leader>vrr", function() builtin.lsp_references() 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("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("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.jump({ count = 1 }) end, opts)
|
||||||
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() 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)
|
vim.keymap.set("n", "<M-F>", function() vim.lsp.buf.format() end, opts)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
@@ -49,11 +50,38 @@ autocmd({ 'BufWritePre' }, {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
autocmd({'FileType'}, {
|
autocmd({ 'FileType' }, {
|
||||||
group = CrentistGroup,
|
group = CrentistGroup,
|
||||||
pattern = { 'json' },
|
pattern = { 'json' },
|
||||||
callback = function (e)
|
callback = function(e)
|
||||||
vim.keymap.set("n", "<M-F>", function() vim.cmd('silent %!jq .') end, {buffer = e.buf})
|
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
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,6 @@ require("crentist.set")
|
|||||||
require("crentist.lazy_init")
|
require("crentist.lazy_init")
|
||||||
require("crentist.autocmd")
|
require("crentist.autocmd")
|
||||||
require("crentist.filetype")
|
require("crentist.filetype")
|
||||||
require("crentist.luasnip")
|
require("crentist.snippets")
|
||||||
require("crentist.null-ls")
|
require("crentist.null-ls")
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,9 @@ return {
|
|||||||
config = function()
|
config = function()
|
||||||
local gruvbox = require('gruvbox')
|
local gruvbox = require('gruvbox')
|
||||||
|
|
||||||
gruvbox.setup({
|
---@module 'gruvbox'
|
||||||
|
---@type GruvboxConfig
|
||||||
|
local gruvbox_settings = {
|
||||||
transparent_mode = false,
|
transparent_mode = false,
|
||||||
italic = {
|
italic = {
|
||||||
strings = false,
|
strings = false,
|
||||||
@@ -24,7 +26,9 @@ return {
|
|||||||
GruvboxAquaSign = { bg = '' },
|
GruvboxAquaSign = { bg = '' },
|
||||||
GruvboxOrangeSign = { bg = '' },
|
GruvboxOrangeSign = { bg = '' },
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
|
||||||
|
gruvbox.setup(gruvbox_settings)
|
||||||
vim.cmd('colorscheme gruvbox')
|
vim.cmd('colorscheme gruvbox')
|
||||||
|
|
||||||
vim.api.nvim_set_hl(0, 'SignColumn', { link = 'FoldColumn' })
|
vim.api.nvim_set_hl(0, 'SignColumn', { link = 'FoldColumn' })
|
||||||
|
|||||||
@@ -7,13 +7,25 @@ return {
|
|||||||
{ 'L3MON4D3/LuaSnip', version = 'v2.*' }
|
{ 'L3MON4D3/LuaSnip', version = 'v2.*' }
|
||||||
},
|
},
|
||||||
-- use a release tag to download pre-built binaries
|
-- use a release tag to download pre-built binaries
|
||||||
version = 'v1.4.*',
|
version = 'v1.8.*',
|
||||||
|
|
||||||
|
---@module 'blink-cmp'
|
||||||
|
---@type blink.cmp.Config
|
||||||
opts = {
|
opts = {
|
||||||
fuzzy = { implementation = 'prefer_rust_with_warning' },
|
fuzzy = { implementation = 'prefer_rust_with_warning' },
|
||||||
|
|
||||||
snippets = {
|
snippets = {
|
||||||
preset = 'luasnip',
|
preset = 'luasnip',
|
||||||
|
active = function(filter)
|
||||||
|
local snippet = require('luasnip')
|
||||||
|
local blink = require('blink.cmp')
|
||||||
|
if snippet.in_snippet() and not blink.is_visible() then
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
if not snippet.in_snippet() and vim.fn.mode() == 'n' then snippet.unlink_current() end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
},
|
},
|
||||||
|
|
||||||
cmdline = {
|
cmdline = {
|
||||||
@@ -23,12 +35,7 @@ return {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
completion = { list = { selection = { preselect = false, auto_insert = true } } },
|
completion = { list = { selection = { preselect = false, auto_insert = true } } },
|
||||||
keymap = {
|
keymap = { preset = 'enter' },
|
||||||
preset = 'enter',
|
|
||||||
['<Tab>'] = { 'select_next', 'snippet_forward', 'fallback' },
|
|
||||||
['<S-Tab>'] = { 'select_prev', 'snippet_backward', 'fallback' },
|
|
||||||
},
|
|
||||||
|
|
||||||
appearance = {
|
appearance = {
|
||||||
use_nvim_cmp_as_default = true,
|
use_nvim_cmp_as_default = true,
|
||||||
nerd_font_variant = 'mono'
|
nerd_font_variant = 'mono'
|
||||||
@@ -36,6 +43,10 @@ return {
|
|||||||
|
|
||||||
sources = {
|
sources = {
|
||||||
default = { 'lazydev', 'lsp', 'snippets', 'ripgrep', 'path', 'buffer' },
|
default = { 'lazydev', 'lsp', 'snippets', 'ripgrep', 'path', 'buffer' },
|
||||||
|
per_filetype = {
|
||||||
|
sql = { 'snippets', 'dadbod', 'buffer', 'ripgrep' },
|
||||||
|
mysql = { 'snippets', 'dadbod', 'buffer', 'ripgrep' },
|
||||||
|
},
|
||||||
providers = {
|
providers = {
|
||||||
lazydev = {
|
lazydev = {
|
||||||
name = 'LazyDev',
|
name = 'LazyDev',
|
||||||
@@ -46,25 +57,25 @@ return {
|
|||||||
ripgrep = {
|
ripgrep = {
|
||||||
module = 'blink-ripgrep',
|
module = 'blink-ripgrep',
|
||||||
name = 'Ripgrep',
|
name = 'Ripgrep',
|
||||||
score_offset = -2,
|
score_offset = -5,
|
||||||
-- the options below are optional, some default values are shown
|
-- the options below are optional, some default values are shown
|
||||||
---@module 'blink-ripgrep'
|
---@module 'blink-ripgrep'
|
||||||
---@type blink-ripgrep.Options
|
---@type blink-ripgrep.Options
|
||||||
opts = {
|
opts = {
|
||||||
max_filesize = '1M',
|
|
||||||
project_root_marker = '.git',
|
|
||||||
project_root_fallback = true,
|
|
||||||
search_casing = '--ignore-case',
|
|
||||||
additional_rg_options = {},
|
|
||||||
fallback_to_regex_highlighting = true,
|
|
||||||
ignore_paths = {},
|
|
||||||
additional_paths = {},
|
|
||||||
future_features = {
|
|
||||||
backend = {
|
backend = {
|
||||||
use = 'ripgrep',
|
use = 'ripgrep',
|
||||||
},
|
},
|
||||||
|
ripgrep = {
|
||||||
|
ignore_paths = {},
|
||||||
|
additional_paths = {},
|
||||||
|
additional_rg_options = {},
|
||||||
|
max_filesize = '1M',
|
||||||
|
project_root_fallback = true,
|
||||||
|
search_casing = '--ignore-case',
|
||||||
},
|
},
|
||||||
debug = false,
|
project_root_marker = '.git',
|
||||||
|
fallback_to_regex_highlighting = true,
|
||||||
|
toggles = { debug = nil, },
|
||||||
},
|
},
|
||||||
transform_items = function(_, items)
|
transform_items = function(_, items)
|
||||||
for _, item in ipairs(items) do
|
for _, item in ipairs(items) do
|
||||||
@@ -76,6 +87,14 @@ return {
|
|||||||
return items
|
return items
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
dadbod = {
|
||||||
|
name = 'Dadbod', module = 'vim_dadbod_completion.blink'
|
||||||
|
},
|
||||||
|
snippets = {
|
||||||
|
opts = {
|
||||||
|
friendly_snippets = true,
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
20
lua/crentist/lazy/dadbod.lua
Normal file
20
lua/crentist/lazy/dadbod.lua
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
return {
|
||||||
|
'kristijanhusak/vim-dadbod-ui',
|
||||||
|
dependencies = {
|
||||||
|
{ 'tpope/vim-dadbod', lazy = true },
|
||||||
|
{ 'kristijanhusak/vim-dadbod-completion', ft = { 'sql', 'mysql', 'plsql' }, lazy = true }, -- Optional
|
||||||
|
},
|
||||||
|
cmd = {
|
||||||
|
'DBUI',
|
||||||
|
'DBUIToggle',
|
||||||
|
'DBUIAddConnection',
|
||||||
|
'DBUIFindBuffer',
|
||||||
|
},
|
||||||
|
init = function()
|
||||||
|
-- Your DBUI configuration
|
||||||
|
vim.g.db_ui_use_nerd_fonts = 1
|
||||||
|
vim.g.db_ui_auto_execute_table_helpers = 1
|
||||||
|
vim.g.db_ui_win_position = 'left'
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
return {}
|
|
||||||
-- return {
|
|
||||||
-- { dir = "~/.dotfiles/nvim-plugins/decrypt.nvim" },
|
|
||||||
-- -- config = function()
|
|
||||||
-- -- require "decrypt"
|
|
||||||
-- -- end
|
|
||||||
-- }
|
|
||||||
--
|
|
||||||
|
|
||||||
@@ -1,4 +1,7 @@
|
|||||||
return {
|
return {
|
||||||
'stevearc/dressing.nvim',
|
'stevearc/dressing.nvim',
|
||||||
|
---@module 'dressing'
|
||||||
|
---@type dressing.InputConfig
|
||||||
opts = {},
|
opts = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,34 +1,34 @@
|
|||||||
return {
|
return {
|
||||||
"tpope/vim-fugitive",
|
'tpope/vim-fugitive',
|
||||||
config = function()
|
config = function()
|
||||||
vim.keymap.set("n", "<leader>gs", vim.cmd.Git)
|
vim.keymap.set('n', "<leader>gs", vim.cmd.Git)
|
||||||
|
vim.keymap.set('n', "<leader><leader>gl", function () vim.cmd.Git({ 'pull' }) end)
|
||||||
|
|
||||||
local Crentist_Fugitive = vim.api.nvim_create_augroup("Crentist_Fugitive", {})
|
vim.api.nvim_create_user_command('Gcm', function() vim.cmd.Git({ 'switch main' }) end, {})
|
||||||
|
|
||||||
|
local Crentist_Fugitive = vim.api.nvim_create_augroup('Crentist_Fugitive', {})
|
||||||
|
|
||||||
local autocmd = vim.api.nvim_create_autocmd
|
local autocmd = vim.api.nvim_create_autocmd
|
||||||
autocmd("BufWinEnter", {
|
autocmd('BufWinEnter', {
|
||||||
group = Crentist_Fugitive,
|
group = Crentist_Fugitive,
|
||||||
pattern = "*",
|
pattern = '*',
|
||||||
callback = function()
|
callback = function()
|
||||||
if vim.bo.ft ~= "fugitive" then
|
if vim.bo.ft ~= 'fugitive' then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local bufnr = vim.api.nvim_get_current_buf()
|
local SwitchToMainbufnr = vim.api.nvim_get_current_buf()
|
||||||
local opts = {buffer = bufnr, remap = false}
|
local opts = { buffer = bufnr, remap = false }
|
||||||
vim.keymap.set("n", "<leader>p", function()
|
vim.keymap.set('n', "<leader>p", function()
|
||||||
vim.cmd.Git('push')
|
vim.cmd.Git('push')
|
||||||
end, opts)
|
end, opts)
|
||||||
|
|
||||||
-- rebase always
|
-- rebase always
|
||||||
vim.keymap.set("n", "<leader>P", function()
|
vim.keymap.set('n', "<leader>P", function()
|
||||||
vim.cmd.Git({'pull', '--rebase'})
|
vim.cmd.Git({ 'pull', '--rebase' })
|
||||||
end, opts)
|
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);
|
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,74 @@
|
|||||||
return {
|
return {
|
||||||
"lewis6991/gitsigns.nvim",
|
'lewis6991/gitsigns.nvim',
|
||||||
|
---@module 'gitsigns.config'
|
||||||
|
---@type Gitsigns.Config
|
||||||
opts = {
|
opts = {
|
||||||
current_line_blame = true,
|
current_line_blame = true,
|
||||||
attach_to_untracked = true,
|
attach_to_untracked = true,
|
||||||
current_line_blame_opts = {
|
current_line_blame_opts = {
|
||||||
delay = 500,
|
delay = 500,
|
||||||
|
ignore_whitespace = true,
|
||||||
|
virt_text_pos = 'right_align',
|
||||||
},
|
},
|
||||||
|
on_attach = function(bufnr)
|
||||||
|
local gitsigns = require('gitsigns')
|
||||||
|
|
||||||
|
local function map(mode, l, r, opts)
|
||||||
|
opts = opts or {}
|
||||||
|
opts.buffer = bufnr
|
||||||
|
vim.keymap.set(mode, l, r, opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Navigation
|
||||||
|
map('n', ']c', function()
|
||||||
|
if vim.wo.diff then
|
||||||
|
vim.cmd.normal({ ']c', bang = true })
|
||||||
|
else
|
||||||
|
gitsigns.nav_hunk('next')
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
map('n', '[c', function()
|
||||||
|
if vim.wo.diff then
|
||||||
|
vim.cmd.normal({ '[c', bang = true })
|
||||||
|
else
|
||||||
|
gitsigns.nav_hunk('prev')
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
-- Actions
|
||||||
|
map('n', '<leader>hs', gitsigns.stage_hunk)
|
||||||
|
map('n', '<leader>hr', gitsigns.reset_hunk)
|
||||||
|
|
||||||
|
map('v', '<leader>hs', function()
|
||||||
|
gitsigns.stage_hunk({ vim.fn.line('.'), vim.fn.line('v') })
|
||||||
|
end)
|
||||||
|
|
||||||
|
map('v', '<leader>hr', function()
|
||||||
|
gitsigns.reset_hunk({ vim.fn.line('.'), vim.fn.line('v') })
|
||||||
|
end)
|
||||||
|
|
||||||
|
map('n', '<leader>hS', gitsigns.stage_buffer)
|
||||||
|
map('n', '<leader>hR', gitsigns.reset_buffer)
|
||||||
|
map('n', '<leader>hp', gitsigns.preview_hunk)
|
||||||
|
map('n', '<leader>hi', gitsigns.preview_hunk_inline)
|
||||||
|
|
||||||
|
map('n', '<leader>hd', gitsigns.diffthis)
|
||||||
|
|
||||||
|
map('n', '<leader>hD', function()
|
||||||
|
gitsigns.diffthis('~')
|
||||||
|
end)
|
||||||
|
|
||||||
|
map('n', '<leader>hQ', function() gitsigns.setqflist('all') end)
|
||||||
|
map('n', '<leader>hq', gitsigns.setqflist)
|
||||||
|
|
||||||
|
-- Toggles
|
||||||
|
map('n', '<leader>tb', gitsigns.toggle_current_line_blame)
|
||||||
|
map('n', '<leader>tw', gitsigns.toggle_word_diff)
|
||||||
|
|
||||||
|
-- Text object
|
||||||
|
map({ 'o', 'x' }, 'ih', gitsigns.select_hunk)
|
||||||
|
end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,19 @@
|
|||||||
return {
|
return {
|
||||||
"theprimeagen/harpoon",
|
'theprimeagen/harpoon',
|
||||||
branch = "harpoon2",
|
branch = 'harpoon2',
|
||||||
dependencies = { "nvim-lua/plenary.nvim" },
|
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||||
config = function()
|
config = function()
|
||||||
local harpoon = require("harpoon")
|
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
|
-- basic telescope configuration
|
||||||
local conf = require("telescope.config").values
|
local conf = require('telescope.config').values
|
||||||
local function toggle_telescope(harpoon_files)
|
local function toggle_telescope(harpoon_files)
|
||||||
local file_paths = {}
|
local file_paths = {}
|
||||||
for _, item in ipairs(harpoon_files.items) do
|
for _, item in ipairs(harpoon_files.items) do
|
||||||
@@ -16,8 +21,8 @@ return {
|
|||||||
end
|
end
|
||||||
|
|
||||||
require('telescope.pickers').new({}, {
|
require('telescope.pickers').new({}, {
|
||||||
prompt_title = "Harpoon",
|
prompt_title = 'Harpoon',
|
||||||
finder = require("telescope.finders").new_table({
|
finder = require('telescope.finders').new_table({
|
||||||
results = file_paths,
|
results = file_paths,
|
||||||
}),
|
}),
|
||||||
previewer = conf.file_previewer({}),
|
previewer = conf.file_previewer({}),
|
||||||
@@ -25,15 +30,15 @@ return {
|
|||||||
}):find()
|
}):find()
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>a", function() harpoon:list():add() 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', '<C-e>', function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
|
||||||
vim.keymap.set("n", "<leader><C-e>", function() toggle_telescope(harpoon:list()) end,
|
vim.keymap.set('n', '<leader><C-e>', function() toggle_telescope(harpoon:list()) end,
|
||||||
{ desc = "Open harpoon window" })
|
{ desc = 'Open harpoon window' })
|
||||||
|
|
||||||
vim.keymap.set("n", "<C-h>", function() harpoon:list():select(1) 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-j>', function() harpoon:list():select(2) end)
|
||||||
vim.keymap.set("n", "<C-k>", function() harpoon:list():select(3) 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-l>', function() harpoon:list():select(4) end)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
8
lua/crentist/lazy/illuminate.lua
Normal file
8
lua/crentist/lazy/illuminate.lua
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
return {
|
||||||
|
'RRethy/vim-illuminate',
|
||||||
|
config = function ()
|
||||||
|
local illuminate = require('illuminate')
|
||||||
|
illuminate.configure()
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1 +1,2 @@
|
|||||||
return { "lukas-reineke/indent-blankline.nvim", main = "ibl", opts = {} }
|
return { 'lukas-reineke/indent-blankline.nvim', main = 'ibl', opts = {} }
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"nvim-lua/plenary.nvim",
|
'nvim-lua/plenary.nvim',
|
||||||
name = "plenary"
|
name = 'plenary'
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
return {
|
return {
|
||||||
'neovim/nvim-lspconfig',
|
'neovim/nvim-lspconfig',
|
||||||
tag = 'v1.0.0',
|
version = '^2.3.0',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
'williamboman/mason.nvim',
|
'williamboman/mason.nvim',
|
||||||
'williamboman/mason-lspconfig.nvim',
|
'williamboman/mason-lspconfig.nvim',
|
||||||
@@ -8,7 +8,6 @@ return {
|
|||||||
'L3MON4D3/LuaSnip',
|
'L3MON4D3/LuaSnip',
|
||||||
'j-hui/fidget.nvim',
|
'j-hui/fidget.nvim',
|
||||||
'rafamadriz/friendly-snippets',
|
'rafamadriz/friendly-snippets',
|
||||||
{ 'towolf/vim-helm', ft = 'helm' },
|
|
||||||
{
|
{
|
||||||
'folke/lazydev.nvim',
|
'folke/lazydev.nvim',
|
||||||
ft = 'lua', -- only load on lua files
|
ft = 'lua', -- only load on lua files
|
||||||
@@ -32,8 +31,10 @@ return {
|
|||||||
|
|
||||||
require('fidget').setup({})
|
require('fidget').setup({})
|
||||||
require('mason').setup({})
|
require('mason').setup({})
|
||||||
|
---@module 'mason-lspconfig'
|
||||||
|
---@type MasonLspconfigSettings
|
||||||
require('mason-lspconfig').setup({
|
require('mason-lspconfig').setup({
|
||||||
automatic_installation = false,
|
automatic_enable = true,
|
||||||
-- Replace the language servers listed here
|
-- Replace the language servers listed here
|
||||||
-- with the ones you want to install
|
-- with the ones you want to install
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
@@ -48,20 +49,18 @@ return {
|
|||||||
'helm_ls',
|
'helm_ls',
|
||||||
'marksman',
|
'marksman',
|
||||||
},
|
},
|
||||||
handlers = {
|
|
||||||
function(server_name)
|
|
||||||
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
|
||||||
require('lspconfig')[server_name].setup({
|
|
||||||
capabilities = capabilities
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
local pythonLineLength = 95
|
local lazydev = require('lazydev')
|
||||||
lspconfig.pylsp.setup {
|
lazydev.setup()
|
||||||
|
vim.lsp.config('lua_ls', {
|
||||||
|
root_dir = function(bufnr, on_dir) on_dir(lazydev.find_workspace(bufnr)) end
|
||||||
|
})
|
||||||
|
|
||||||
|
---@type lspconfig.Config
|
||||||
|
vim.lsp.config('pylsp', {
|
||||||
settings = {
|
settings = {
|
||||||
pylsp = {
|
['pylsp'] = {
|
||||||
plugins = {
|
plugins = {
|
||||||
autopep8 = {
|
autopep8 = {
|
||||||
enabled = false,
|
enabled = false,
|
||||||
@@ -71,41 +70,25 @@ return {
|
|||||||
},
|
},
|
||||||
pycodestyle = {
|
pycodestyle = {
|
||||||
ignore = { 'W391' },
|
ignore = { 'W391' },
|
||||||
maxLineLength = pythonLineLength
|
maxLineLength = 95,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
lspconfig.ansiblels.setup {}
|
|
||||||
|
|
||||||
lspconfig.lua_ls.setup {}
|
vim.lsp.config('helm-ls', {
|
||||||
|
|
||||||
lspconfig.helm_ls.setup {
|
|
||||||
settings = {
|
settings = {
|
||||||
['helm-ls'] = {
|
['helm-ls'] = {
|
||||||
yamlls = {
|
helmLint = { enabled = false },
|
||||||
path = 'yaml-language-server',
|
yamlls = { enabled = false },
|
||||||
}
|
},
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
|
||||||
lspconfig.yamlls.setup {}
|
vim.lsp.config('terraformls', {
|
||||||
lspconfig.helm_ls.setup {
|
|
||||||
settings = {
|
|
||||||
['helm-ls'] = {
|
|
||||||
yamlls = {
|
|
||||||
enabled = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
lspconfig.terraformls.setup {
|
|
||||||
filetypes = { 'terraform', 'terraform-vars', 'tf' }
|
filetypes = { 'terraform', 'terraform-vars', 'tf' }
|
||||||
}
|
})
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ return {
|
|||||||
lightgray = '#504945',
|
lightgray = '#504945',
|
||||||
inactivegray = '#7c6f64',
|
inactivegray = '#7c6f64',
|
||||||
}
|
}
|
||||||
require('lualine').setup({
|
require('lualine').setup(
|
||||||
|
{
|
||||||
options = {
|
options = {
|
||||||
theme = {
|
theme = {
|
||||||
normal = {
|
normal = {
|
||||||
|
|||||||
15
lua/crentist/lazy/markdown.lua
Normal file
15
lua/crentist/lazy/markdown.lua
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
return {
|
||||||
|
'MeanderingProgrammer/render-markdown.nvim',
|
||||||
|
dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
|
||||||
|
---@module 'render-markdown'
|
||||||
|
---@type render.md.UserConfig
|
||||||
|
opts = {
|
||||||
|
completions = {
|
||||||
|
blink = { enabled = true }
|
||||||
|
},
|
||||||
|
heading = {
|
||||||
|
icons = { ' ', ' ', ' ', ' ', ' ', ' ' },
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
@@ -7,7 +7,8 @@ return {
|
|||||||
local navic = require('nvim-navic')
|
local navic = require('nvim-navic')
|
||||||
navic.setup({
|
navic.setup({
|
||||||
lsp = {
|
lsp = {
|
||||||
auto_attach = true
|
auto_attach = true,
|
||||||
|
preference = { 'helm_ls', 'yamlls' }
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|||||||
27
lua/crentist/lazy/neotree.lua
Normal file
27
lua/crentist/lazy/neotree.lua
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
'nvim-neo-tree/neo-tree.nvim',
|
||||||
|
branch = 'v3.x',
|
||||||
|
dependencies = {
|
||||||
|
'nvim-lua/plenary.nvim',
|
||||||
|
'MunifTanjim/nui.nvim',
|
||||||
|
'nvim-tree/nvim-web-devicons', -- optional, but recommended
|
||||||
|
},
|
||||||
|
lazy = false, -- neo-tree will lazily load itself
|
||||||
|
---@module 'neo-tree'
|
||||||
|
---@type neotree.Config
|
||||||
|
opts = {
|
||||||
|
filesystem = {
|
||||||
|
hijack_netrw_behavior = 'disabled',
|
||||||
|
filtered_items = {
|
||||||
|
hide_dotfiles = false,
|
||||||
|
never_show = {'.DS_Store'},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
window = {
|
||||||
|
position = 'current',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -6,8 +6,8 @@ return {
|
|||||||
'nvim-lua/plenary.nvim',
|
'nvim-lua/plenary.nvim',
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
{ '<leader>ot', '<cmd>ObsidianToday<CR>', desc = "Open today's daily note" },
|
{ '<leader>ot', '<cmd>Obsidian today<CR>', desc = "Open today's daily note" },
|
||||||
{ '<leader>os', '<cmd>ObsidianQuickSwitch<CR>', desc = 'Search notes in my vault and switch to selected' },
|
{ '<leader>os', '<cmd>Obsidian quick_switch<CR>', desc = 'Search notes in my vault and switch to selected' },
|
||||||
},
|
},
|
||||||
mappings = {
|
mappings = {
|
||||||
-- Overrides the 'gf' mapping to work on markdown/wiki links within your vault.
|
-- Overrides the 'gf' mapping to work on markdown/wiki links within your vault.
|
||||||
@@ -33,6 +33,7 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {
|
||||||
|
legacy_commands = false,
|
||||||
workspaces = {
|
workspaces = {
|
||||||
{
|
{
|
||||||
name = 'tech-work-hobby',
|
name = 'tech-work-hobby',
|
||||||
@@ -51,7 +52,10 @@ return {
|
|||||||
completion = {
|
completion = {
|
||||||
blink = true,
|
blink = true,
|
||||||
nvim_cmp = false,
|
nvim_cmp = false,
|
||||||
}
|
},
|
||||||
|
ui = {
|
||||||
|
enable = false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +1,28 @@
|
|||||||
return {
|
return {
|
||||||
'stevearc/oil.nvim',
|
'stevearc/oil.nvim',
|
||||||
-- Optional dependencies
|
|
||||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||||
opts = {},
|
opts = {
|
||||||
config = function()
|
|
||||||
require('oil').setup({
|
|
||||||
view_options = {
|
view_options = {
|
||||||
show_hidden = true,
|
show_hidden = true,
|
||||||
},
|
},
|
||||||
|
float = {
|
||||||
|
border = 'rounded',
|
||||||
|
},
|
||||||
|
confirmation = {
|
||||||
|
border = 'rounded',
|
||||||
|
},
|
||||||
|
progress = {
|
||||||
|
border = 'rounded',
|
||||||
|
},
|
||||||
|
keymaps_help = {
|
||||||
|
border = 'rounded',
|
||||||
|
},
|
||||||
keymaps = {
|
keymaps = {
|
||||||
['<C-h>'] = false,
|
['<C-h>'] = false,
|
||||||
['<C-j>'] = false,
|
['<C-j>'] = false,
|
||||||
['<C-k>'] = false,
|
['<C-k>'] = false,
|
||||||
['<C-l>'] = false,
|
['<C-l>'] = false,
|
||||||
}
|
}
|
||||||
})
|
},
|
||||||
end
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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,
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,19 +1,19 @@
|
|||||||
return {
|
return {
|
||||||
'frankroeder/parrot.nvim',
|
'frankroeder/parrot.nvim',
|
||||||
version = "2.1.0",
|
version = '2.3.0',
|
||||||
dependencies = { 'ibhagwan/fzf-lua', 'nvim-lua/plenary.nvim' },
|
dependencies = { 'ibhagwan/fzf-lua', 'nvim-lua/plenary.nvim' },
|
||||||
opts = {
|
opts = {
|
||||||
providers = {
|
providers = {
|
||||||
anthropic = {
|
anthropic = {
|
||||||
name = "anthropic",
|
name = 'anthropic',
|
||||||
endpoint = "https://api.anthropic.com/v1/messages",
|
endpoint = 'https://api.anthropic.com/v1/messages',
|
||||||
model_endpoint = "https://api.anthropic.com/v1/models",
|
model_endpoint = 'https://api.anthropic.com/v1/models',
|
||||||
api_key = { "/usr/local/bin/sops", "--config", "/dev/null", "-d", vim.fn.expand("$HOME") .. "/.claude-api" },
|
api_key = { '/usr/local/bin/sops', "--config", "/dev/null", "-d", vim.fn.expand("$HOME") .. "/.claude-api" },
|
||||||
headers = function(self)
|
headers = function(self)
|
||||||
return {
|
return {
|
||||||
["Content-Type"] = "application/json",
|
['Content-Type'] = "application/json",
|
||||||
["x-api-key"] = self.api_key,
|
['x-api-key'] = self.api_key,
|
||||||
["anthropic-version"] = "2023-06-01",
|
['anthropic-version'] = "2023-06-01",
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
params = {
|
params = {
|
||||||
@@ -21,16 +21,14 @@ return {
|
|||||||
command = { max_tokens = 4096 },
|
command = { max_tokens = 4096 },
|
||||||
},
|
},
|
||||||
models = {
|
models = {
|
||||||
"claude-sonnet-4-20250514",
|
'claude-opus-4-5-20251101',
|
||||||
"claude-3-7-sonnet-20250219",
|
'claude-haiku-4-5-20251001',
|
||||||
"claude-3-5-sonnet-20241022",
|
|
||||||
"claude-3-5-haiku-20241022",
|
|
||||||
},
|
},
|
||||||
preprocess_payload = function(payload)
|
preprocess_payload = function(payload)
|
||||||
for _, message in ipairs(payload.messages) do
|
for _, message in ipairs(payload.messages) do
|
||||||
message.content = message.content:gsub("^%s*(.-)%s*$", "%1")
|
message.content = message.content:gsub('^%s*(.-)%s*$', "%1")
|
||||||
end
|
end
|
||||||
if payload.messages[1] and payload.messages[1].role == "system" then
|
if payload.messages[1] and payload.messages[1].role == 'system' then
|
||||||
-- remove the first message that serves as the system prompt as anthropic
|
-- remove the first message that serves as the system prompt as anthropic
|
||||||
-- expects the system prompt to be part of the API call body and not the messages
|
-- expects the system prompt to be part of the API call body and not the messages
|
||||||
payload.system = payload.messages[1].content
|
payload.system = payload.messages[1].content
|
||||||
@@ -39,7 +37,8 @@ return {
|
|||||||
return payload
|
return payload
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
user_input_ui = "buffer",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
11
lua/crentist/lazy/tabline.lua
Normal file
11
lua/crentist/lazy/tabline.lua
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
-- I literally need this for Dadbod for a nicer name in tabs. I don't use tabs
|
||||||
|
-- in any other way
|
||||||
|
return {
|
||||||
|
'nanozuki/tabby.nvim',
|
||||||
|
---@module 'tabby'
|
||||||
|
---@type TabbyConfig
|
||||||
|
opts = {
|
||||||
|
-- configs...
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
@@ -22,10 +22,7 @@ return {
|
|||||||
telescope.setup({
|
telescope.setup({
|
||||||
defaults = {
|
defaults = {
|
||||||
vimgrep_arguments = vimgrep_arguments,
|
vimgrep_arguments = vimgrep_arguments,
|
||||||
file_ignore_patterns = {
|
file_ignore_patterns = { "^.git/" }
|
||||||
'node_modules',
|
|
||||||
'.git/'
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
extensions = {
|
extensions = {
|
||||||
fzf = {}
|
fzf = {}
|
||||||
@@ -43,8 +40,8 @@ return {
|
|||||||
prev = '<S-Tab>'
|
prev = '<S-Tab>'
|
||||||
},
|
},
|
||||||
tabs = {
|
tabs = {
|
||||||
{ name = 'Files', tele_func = builtin.find_files, tele_opts = { no_ignore = true, hidden = true } },
|
{ name = 'Files', tele_func = builtin.find_files, tele_opts = { no_ignore = false, hidden = true, } },
|
||||||
{ name = 'Grep', tele_func = builtin.live_grep },
|
{ name = 'Advanced Grep', tele_func = require('crentist.telescope.advanced_grep').advanced_grep },
|
||||||
{ name = 'Buffers', tele_func = builtin.buffers },
|
{ name = 'Buffers', tele_func = builtin.buffers },
|
||||||
},
|
},
|
||||||
append_tabs = { -- append_tabs will add the provided tabs to the default ones
|
append_tabs = { -- append_tabs will add the provided tabs to the default ones
|
||||||
@@ -55,6 +52,21 @@ return {
|
|||||||
return vim.fn.isdirectory('.git') == 1
|
return vim.fn.isdirectory('.git') == 1
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'Stash',
|
||||||
|
builtin.git_stash,
|
||||||
|
available = function()
|
||||||
|
return vim.fn.isdirectory('.git') == 1
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'All files',
|
||||||
|
builtin.find_files,
|
||||||
|
tele_opts = { no_ignore = true, hidden = true },
|
||||||
|
available = function()
|
||||||
|
return vim.fn.isdirectory('.git') == 1
|
||||||
|
end
|
||||||
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -1,32 +1,50 @@
|
|||||||
return {
|
return {
|
||||||
'nvim-treesitter/nvim-treesitter',
|
'nvim-treesitter/nvim-treesitter',
|
||||||
branch='master',
|
branch = 'main',
|
||||||
|
lazy = false,
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
config = function()
|
config = function()
|
||||||
require("nvim-treesitter.configs").setup({
|
local ts = require("nvim-treesitter")
|
||||||
-- A list of parser names, or "all" (the five listed parsers should always be installed)
|
local installed_parsers = {
|
||||||
ensure_installed = { "bash", "javascript", "typescript", "python", "go", "terraform", "hcl", "helm", "jq", "yaml", "tmux", "lua", "vim", "vimdoc" },
|
"bash",
|
||||||
|
"javascript",
|
||||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
"typescript",
|
||||||
sync_install = false,
|
"python",
|
||||||
|
"go",
|
||||||
-- Automatically install missing parsers when entering buffer
|
"terraform",
|
||||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
"hcl",
|
||||||
auto_install = true,
|
"helm",
|
||||||
|
"jq",
|
||||||
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
|
"yaml",
|
||||||
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
|
"tmux",
|
||||||
|
"lua",
|
||||||
highlight = {
|
"vim",
|
||||||
enable = true,
|
"vimdoc",
|
||||||
|
"latex",
|
||||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
"json",
|
||||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
"yaml",
|
||||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
"git_config",
|
||||||
-- Instead of true it can also be a list of languages
|
"git_rebase",
|
||||||
additional_vim_regex_highlighting = false,
|
"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
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,128 +0,0 @@
|
|||||||
-- luasnip.lua
|
|
||||||
local ls = require('luasnip')
|
|
||||||
local s = ls.snippet
|
|
||||||
local i = ls.insert_node
|
|
||||||
local f = ls.function_node
|
|
||||||
local fmt = require("luasnip.extras.fmt").fmt
|
|
||||||
|
|
||||||
vim.keymap.set({ "i", "s" }, "<C-l>", function()
|
|
||||||
if ls.expand_or_jumpable() then
|
|
||||||
ls.expand_or_jump()
|
|
||||||
end
|
|
||||||
end, { desc = "Snippet next argument", silent = true })
|
|
||||||
|
|
||||||
--------------------
|
|
||||||
-- Snippets for LUA
|
|
||||||
--------------------
|
|
||||||
ls.add_snippets('lua', {
|
|
||||||
s({ name = 'LuaSnip Snippet', trig = 'snipf' },
|
|
||||||
fmt([[
|
|
||||||
s({ name='<name>', trig='<trig>'},
|
|
||||||
fmt(<template>,
|
|
||||||
{ <inputs> },
|
|
||||||
{ <opts> }
|
|
||||||
)
|
|
||||||
),
|
|
||||||
]], {
|
|
||||||
name = i(1, 'name'),
|
|
||||||
trig = i(2, 'trig'),
|
|
||||||
template = i(3, '[[]]'),
|
|
||||||
inputs = i(4, 'nodes'),
|
|
||||||
opts = i(5,
|
|
||||||
'opts')
|
|
||||||
},
|
|
||||||
{ delimiters = '<>' }
|
|
||||||
)
|
|
||||||
),
|
|
||||||
s({ name = 'Add snippets block', trig = 'add_snip' },
|
|
||||||
fmt([[
|
|
||||||
ls.add_snippets('<filetype>', {
|
|
||||||
<snippets>
|
|
||||||
})
|
|
||||||
]],
|
|
||||||
{ filetype = i(1, 'Filetype'), snippets = i(2, 'Snippets') },
|
|
||||||
{ delimiters = '<>' }
|
|
||||||
)
|
|
||||||
),
|
|
||||||
})
|
|
||||||
|
|
||||||
--------------------
|
|
||||||
-- Generic snippets
|
|
||||||
--------------------
|
|
||||||
local function com_string(_, snip, to_multiply)
|
|
||||||
local comment_string = vim.bo.commentstring
|
|
||||||
local repeats = snip.captures[1]
|
|
||||||
local result = comment_string:gsub("%%s", ""):gsub(" ", "")
|
|
||||||
|
|
||||||
if to_multiply then
|
|
||||||
return string.sub(
|
|
||||||
string.rep(result, repeats),
|
|
||||||
0,
|
|
||||||
repeats
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
return result
|
|
||||||
end
|
|
||||||
|
|
||||||
ls.add_snippets('all', {
|
|
||||||
s({ name = 'Comment block', trig = '#com(%d+)', regTrig = true },
|
|
||||||
fmt([[
|
|
||||||
{comment_block}
|
|
||||||
{comment} {comment_text}
|
|
||||||
{comment_block}
|
|
||||||
]],
|
|
||||||
{
|
|
||||||
comment_block = f(com_string, {}, { user_args = { true } }),
|
|
||||||
comment = f(com_string, {}, { user_args = { false } }),
|
|
||||||
comment_text = i(1,
|
|
||||||
'Comment')
|
|
||||||
}
|
|
||||||
)
|
|
||||||
),
|
|
||||||
})
|
|
||||||
|
|
||||||
--------------------
|
|
||||||
-- Terraform
|
|
||||||
--------------------
|
|
||||||
ls.add_snippets('terraform', {
|
|
||||||
s({ name = 'data_assume', trig = 'tf_assume' },
|
|
||||||
fmt([[
|
|
||||||
data "aws_iam_policy_document" "<name>" {
|
|
||||||
statement {
|
|
||||||
actions = ["sts:AssumeRole"]
|
|
||||||
|
|
||||||
principals {
|
|
||||||
type = "Service"
|
|
||||||
identifiers = ["<service>.amazonaws.com"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]],
|
|
||||||
{
|
|
||||||
name = i(1, 'assume'),
|
|
||||||
service = i(2, 'service')
|
|
||||||
},
|
|
||||||
{ delimiters = '<>' }
|
|
||||||
)
|
|
||||||
),
|
|
||||||
})
|
|
||||||
|
|
||||||
------------------------------
|
|
||||||
-- YAML
|
|
||||||
------------------------------
|
|
||||||
local yaml_schema_snippet = s(
|
|
||||||
{ name = 'yaml_schema', trig = 'yaml_schema' },
|
|
||||||
fmt([[
|
|
||||||
{comment} yaml-language-server: $schema={path}
|
|
||||||
]],
|
|
||||||
{
|
|
||||||
path = i(1, 'path'),
|
|
||||||
comment = f(com_string, {}, { user_args = { false } }),
|
|
||||||
}
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
ls.add_snippets('yaml', { yaml_schema_snippet })
|
|
||||||
ls.add_snippets('helm', { yaml_schema_snippet })
|
|
||||||
|
|
||||||
@@ -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)
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ vim.g.mapleader = " "
|
|||||||
vim.keymap.set("n", "<leader>Pv", ":Oil .<CR>")
|
vim.keymap.set("n", "<leader>Pv", ":Oil .<CR>")
|
||||||
vim.keymap.set("n", "<leader>pv", ":Oil<CR>")
|
vim.keymap.set("n", "<leader>pv", ":Oil<CR>")
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>pt", ":Neotree .<CR>")
|
||||||
|
|
||||||
vim.keymap.set("n", "<C-d>", "<C-d>zz")
|
vim.keymap.set("n", "<C-d>", "<C-d>zz")
|
||||||
vim.keymap.set("n", "<C-u>", "<C-u>zz")
|
vim.keymap.set("n", "<C-u>", "<C-u>zz")
|
||||||
|
|
||||||
@@ -28,6 +30,9 @@ vim.keymap.set({"n", "v"}, "<leader>d", [["_d]])
|
|||||||
vim.keymap.set("n", "Q", "<nop>")
|
vim.keymap.set("n", "Q", "<nop>")
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
|
vim.keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
|
||||||
|
vim.keymap.set("n", "<leader>S", [[:%s/\<<C-r><C-a>\>/<C-r><C-a>/gI<Left><Left><Left>]])
|
||||||
|
|
||||||
|
vim.keymap.set("v", "<leader>s", [["vy:%s/\<<C-r>v\>/<C-r>v/gI<Left><Left><Left>]])
|
||||||
|
|
||||||
vim.keymap.set("n", "<C-s>", "<cmd>silent !tmux neww tmux-sessionizer<CR>")
|
vim.keymap.set("n", "<C-s>", "<cmd>silent !tmux neww tmux-sessionizer<CR>")
|
||||||
|
|
||||||
@@ -38,3 +43,5 @@ vim.keymap.set("v", "<leader>x", ":lua<CR>")
|
|||||||
vim.keymap.set("n", "<C-M-j>", "<cmd>cnext<CR>")
|
vim.keymap.set("n", "<C-M-j>", "<cmd>cnext<CR>")
|
||||||
vim.keymap.set("n", "<C-M-k>", "<cmd>cprev<CR>")
|
vim.keymap.set("n", "<C-M-k>", "<cmd>cprev<CR>")
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<F12>", "<cmd>PrtChatToggle<CR>")
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ vim.opt.softtabstop = 4
|
|||||||
vim.opt.shiftwidth = 4
|
vim.opt.shiftwidth = 4
|
||||||
vim.opt.expandtab = true
|
vim.opt.expandtab = true
|
||||||
|
|
||||||
|
vim.o.winborder = ''
|
||||||
|
|
||||||
vim.opt.smartindent = true
|
vim.opt.smartindent = true
|
||||||
|
|
||||||
vim.opt.wrap = false
|
vim.opt.wrap = false
|
||||||
@@ -30,3 +32,5 @@ vim.opt.updatetime = 50
|
|||||||
|
|
||||||
vim.opt.colorcolumn = "80"
|
vim.opt.colorcolumn = "80"
|
||||||
|
|
||||||
|
vim.opt.diffopt = 'internal,filler,closeoff,algorithm:histogram'
|
||||||
|
|
||||||
|
|||||||
45
lua/crentist/snippets/common.lua
Normal file
45
lua/crentist/snippets/common.lua
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
local ls = require('luasnip')
|
||||||
|
local s = ls.snippet
|
||||||
|
local i = ls.insert_node
|
||||||
|
local f = ls.function_node
|
||||||
|
local fmt = require('luasnip.extras.fmt').fmt
|
||||||
|
|
||||||
|
vim.keymap.set({ 'i', 's' }, '<C-l>', function()
|
||||||
|
if ls.expand_or_jumpable() then
|
||||||
|
ls.expand_or_jump()
|
||||||
|
end
|
||||||
|
end, { desc = 'Snippet next argument', silent = true })
|
||||||
|
|
||||||
|
local function com_string(_, snip, to_multiply)
|
||||||
|
local comment_string = vim.bo.commentstring
|
||||||
|
local repeats = snip.captures[1]
|
||||||
|
local result = comment_string:gsub('%%s', ''):gsub(' ', '')
|
||||||
|
|
||||||
|
if to_multiply then
|
||||||
|
return string.sub(
|
||||||
|
string.rep(result, repeats),
|
||||||
|
0,
|
||||||
|
repeats
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|
||||||
|
ls.add_snippets('all', {
|
||||||
|
s({ name = 'Comment block', trig = '#com(%d+)', regTrig = true },
|
||||||
|
fmt([[
|
||||||
|
{comment_block}
|
||||||
|
{comment} {comment_text}
|
||||||
|
{comment_block}
|
||||||
|
]],
|
||||||
|
{
|
||||||
|
comment_block = f(com_string, {}, { user_args = { true } }),
|
||||||
|
comment = f(com_string, {}, { user_args = { false } }),
|
||||||
|
comment_text = i(1,
|
||||||
|
'Comment')
|
||||||
|
}
|
||||||
|
)
|
||||||
|
),
|
||||||
|
})
|
||||||
|
|
||||||
5
lua/crentist/snippets/init.lua
Normal file
5
lua/crentist/snippets/init.lua
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require('crentist.snippets.common')
|
||||||
|
require('crentist.snippets.lua')
|
||||||
|
require('crentist.snippets.terraform')
|
||||||
|
require('crentist.snippets.yaml')
|
||||||
|
|
||||||
38
lua/crentist/snippets/lua.lua
Normal file
38
lua/crentist/snippets/lua.lua
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
local ls = require('luasnip')
|
||||||
|
local s = ls.snippet
|
||||||
|
local i = ls.insert_node
|
||||||
|
local f = ls.function_node
|
||||||
|
local fmt = require('luasnip.extras.fmt').fmt
|
||||||
|
|
||||||
|
ls.add_snippets('lua', {
|
||||||
|
s({ name = 'LuaSnip Snippet', trig = 'snipf' },
|
||||||
|
fmt([[
|
||||||
|
s({ name='<name>', trig='<trig>'},
|
||||||
|
fmt(<template>,
|
||||||
|
{ <inputs> },
|
||||||
|
{ <opts> }
|
||||||
|
)
|
||||||
|
),
|
||||||
|
]], {
|
||||||
|
name = i(1, 'name'),
|
||||||
|
trig = i(2, 'trig'),
|
||||||
|
template = i(3, '[[]]'),
|
||||||
|
inputs = i(4, 'nodes'),
|
||||||
|
opts = i(5,
|
||||||
|
'opts')
|
||||||
|
},
|
||||||
|
{ delimiters = '<>' }
|
||||||
|
)
|
||||||
|
),
|
||||||
|
s({ name = 'Add snippets block', trig = 'add_snip' },
|
||||||
|
fmt([[
|
||||||
|
ls.add_snippets('<filetype>', {
|
||||||
|
<snippets>
|
||||||
|
})
|
||||||
|
]],
|
||||||
|
{ filetype = i(1, 'Filetype'), snippets = i(2, 'Snippets') },
|
||||||
|
{ delimiters = '<>' }
|
||||||
|
)
|
||||||
|
),
|
||||||
|
})
|
||||||
|
|
||||||
29
lua/crentist/snippets/terraform.lua
Normal file
29
lua/crentist/snippets/terraform.lua
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
local ls = require('luasnip')
|
||||||
|
local s = ls.snippet
|
||||||
|
local i = ls.insert_node
|
||||||
|
local f = ls.function_node
|
||||||
|
local fmt = require('luasnip.extras.fmt').fmt
|
||||||
|
|
||||||
|
ls.add_snippets('terraform', {
|
||||||
|
s({ name = 'data_assume', trig = 'tf_assume' },
|
||||||
|
fmt([[
|
||||||
|
data "aws_iam_policy_document" "<name>" {
|
||||||
|
statement {
|
||||||
|
actions = ["sts:AssumeRole"]
|
||||||
|
|
||||||
|
principals {
|
||||||
|
type = "Service"
|
||||||
|
identifiers = ["<service>.amazonaws.com"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]],
|
||||||
|
{
|
||||||
|
name = i(1, 'assume'),
|
||||||
|
service = i(2, 'service')
|
||||||
|
},
|
||||||
|
{ delimiters = '<>' }
|
||||||
|
)
|
||||||
|
),
|
||||||
|
})
|
||||||
|
|
||||||
64
lua/crentist/snippets/yaml.lua
Normal file
64
lua/crentist/snippets/yaml.lua
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
local ls = require('luasnip')
|
||||||
|
local s = ls.snippet
|
||||||
|
local i = ls.insert_node
|
||||||
|
local f = ls.function_node
|
||||||
|
local fmt = require('luasnip.extras.fmt').fmt
|
||||||
|
|
||||||
|
------------------------------
|
||||||
|
-- YAML
|
||||||
|
------------------------------
|
||||||
|
local yaml_schema_snippet = s(
|
||||||
|
{ name = 'yaml_schema', trig = 'yaml_schema' },
|
||||||
|
fmt([[
|
||||||
|
{comment} yaml-language-server: $schema={path}
|
||||||
|
]],
|
||||||
|
{
|
||||||
|
path = i(1, 'path'),
|
||||||
|
comment = f(com_string, {}, { user_args = { false } }),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
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 })
|
||||||
|
|
||||||
|
local sleep_command = s(
|
||||||
|
{ name = 'sleep_command', trig = 'sleep' },
|
||||||
|
fmt([[
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- while true; do sleep 3600; done
|
||||||
|
]], {})
|
||||||
|
)
|
||||||
|
|
||||||
|
ls.add_snippets('yaml', { sleep_command })
|
||||||
|
|
||||||
64
lua/crentist/telescope/advanced_grep.lua
Normal file
64
lua/crentist/telescope/advanced_grep.lua
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
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")
|
||||||
|
|
||||||
|
local input_glob = pieces[2]
|
||||||
|
local glob = input_glob
|
||||||
|
if not input_glob:find("*", 1, true) then
|
||||||
|
glob = "*" .. input_glob .. "*"
|
||||||
|
if input_glob:find("d:", 1, true) then
|
||||||
|
glob = "**/" .. glob .. "/**"
|
||||||
|
glob = glob:gsub("d:", "")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
table.insert(args, glob)
|
||||||
|
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