Compare commits
1 Commits
3dbb63738b
...
nixos
| Author | SHA1 | Date | |
|---|---|---|---|
| 96004f4ce3 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,2 +0,0 @@
|
|||||||
lua/testing
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"diagnostics.disable": [
|
|
||||||
"undefined-global",
|
|
||||||
"unused-local"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
# My nvim configuration
|
# My nvim configuration
|
||||||
|
|
||||||
This mostly copies ThePrimeagen configs with some changes because I don't use dvorak
|
This mostly copies ThePrimeagen configs with some changes because I don't use dvorak
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
vim.opt_local.tabstop = 2
|
|
||||||
vim.opt_local.shiftwidth = 2
|
|
||||||
vim.opt_local.softtabstop = 2
|
|
||||||
vim.opt_local.expandtab = true
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
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,12 +0,0 @@
|
|||||||
vim.opt_local.tabstop = 4
|
|
||||||
vim.opt_local.shiftwidth = 4
|
|
||||||
vim.opt_local.softtabstop = 4
|
|
||||||
vim.opt_local.expandtab = false
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
|
||||||
pattern = "make",
|
|
||||||
callback = function()
|
|
||||||
print("Makefile detected and ftplugin loaded!")
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
vim.opt_local.conceallevel = 2
|
|
||||||
vim.opt.wrap = true
|
|
||||||
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
vim.opt_local.tabstop = 2
|
|
||||||
vim.opt_local.shiftwidth = 2
|
|
||||||
vim.opt_local.softtabstop = 2
|
|
||||||
vim.opt_local.expandtab = true
|
|
||||||
|
|
||||||
@@ -1,50 +1,41 @@
|
|||||||
{
|
{
|
||||||
"LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" },
|
"LuaSnip": { "branch": "master", "commit": "787dee55ca364cc9119787165418fe93b74c1842" },
|
||||||
"blink-ripgrep.nvim": { "branch": "main", "commit": "0c0d9db740ca70aa739e40f50589b01e537ade6d" },
|
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||||
"blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" },
|
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
|
||||||
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
|
"cmp-dotenv": { "branch": "main", "commit": "4dd53aab60982f1f75848aec5e6214986263325e" },
|
||||||
"fidget.nvim": { "branch": "main", "commit": "3f5475949679953af6d78654db29b944fa826e6a" },
|
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
||||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||||
"fzf-lua": { "branch": "main", "commit": "83e4080ae886a42ec48c5c26ce5892ceb557c425" },
|
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||||
"gitsigns.nvim": { "branch": "main", "commit": "1ee5c1fd068c81f9dd06483e639c2aa4587dc197" },
|
"dressing.nvim": { "branch": "master", "commit": "1b7921eecc65af1baf8ac1dc06f0794934cbcfb2" },
|
||||||
"gruvbox.nvim": { "branch": "main", "commit": "5e0a460d8e0f7f669c158dedd5f9ae2bcac31437" },
|
"fidget.nvim": { "branch": "main", "commit": "d855eed8a06531a7e8fd0684889b2943f373c469" },
|
||||||
"harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" },
|
"friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" },
|
||||||
"hererocks": { "branch": "master", "commit": "160228946bed9998f5e3b168bd0b66ba2690f8f3" },
|
"git-blame.nvim": { "branch": "master", "commit": "2883a7460f611c2705b23f12d58d398d5ce6ec00" },
|
||||||
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
|
"gruvbox.nvim": { "branch": "main", "commit": "49d9c0b150ba70efcd831ec7b3cb8ee740067045" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "1ea3c4085785f460fb0e46d2fe1ee895f5f9e7c1" },
|
"harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" },
|
||||||
"lazydev.nvim": { "branch": "main", "commit": "e28ce52fc7ff79fcb76f0e79ee6fb6182fca90b9" },
|
"icon-picker.nvim": { "branch": "master", "commit": "3ee9a0ea9feeef08ae35e40c8be6a2fa2c20f2d3" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "e533fac71bc361768f90004af695cd1f1aa1900a" },
|
"indent-blankline.nvim": { "branch": "master", "commit": "e7a4442e055ec953311e77791546238d1eaae507" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "6bdb14f230de0904229ec367b410fb817e59b072" },
|
"lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
|
"lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" },
|
||||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "c4c168e459395275c552179a1baf9c3d885d6a74" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "7446f47b3dfb7df801f31a6f6783c2ad119a6935" },
|
||||||
"none-ls.nvim": { "branch": "main", "commit": "a96172f673f720cd4f3572e1fcd08400ed3eb25d" },
|
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
"neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" },
|
||||||
|
"nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" },
|
||||||
|
"nvim-cmp": { "branch": "main", "commit": "29fb4854573355792df9e156cb779f0d31308796" },
|
||||||
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
|
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "5bfcc89fd155b4ffc02d18ab3b7d19c2d4e246a7" },
|
"nvim-lspconfig": { "branch": "master", "commit": "056f569f71e4b726323b799b9cfacc53653bceb3" },
|
||||||
"nvim-navic": { "branch": "master", "commit": "099b4c8cdc3e9ea026ea6b2a0d315e2d28362242" },
|
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
|
||||||
"nvim-sops": { "branch": "main", "commit": "cb2209562d00ef8c6c88bdec836d9edb8fbb96ef" },
|
"nvim-sops": { "branch": "main", "commit": "cb2209562d00ef8c6c88bdec836d9edb8fbb96ef" },
|
||||||
"nvim-surround": { "branch": "main", "commit": "a868c256c861044beb9794b4dd126480dcdfbdad" },
|
"nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" },
|
||||||
"nvim-treesitter": { "branch": "main", "commit": "0606c7a9dcaa5c5beee0b0f09043e9fdd1ba0a68" },
|
"nvim-treesitter": { "branch": "master", "commit": "00d219068385a4aa80859d4606ad6e03af6faa83" },
|
||||||
"nvim-ufo": { "branch": "main", "commit": "72d54c31079d38d8dfc5456131b1d0fb5c0264b0" },
|
"nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "b8221e42cf7287c4dcde81f232f58d7b947c210d" },
|
"oil.nvim": { "branch": "master", "commit": "cca1631d5ea450c09ba72f3951a9e28105a3632c" },
|
||||||
"obsidian.nvim": { "branch": "main", "commit": "6b2a22a74d1c883e797764c28f75aa6b532a1ae4" },
|
"plenary": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
|
||||||
"oil.nvim": { "branch": "master", "commit": "200df01e4b92d0010a3bfbde92b91a4ef5a5c9db" },
|
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
|
||||||
"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": "691651de4e02cbea9ff50c62d7d3a679abc95564" },
|
|
||||||
"search.nvim": { "branch": "main", "commit": "7b8f2315d031be73e14bc2d82386dfac15952614" },
|
"search.nvim": { "branch": "main", "commit": "7b8f2315d031be73e14bc2d82386dfac15952614" },
|
||||||
"statuscol.nvim": { "branch": "main", "commit": "c46172d0911aa5d49ba5f39f4351d1bb7aa289cc" },
|
"telescope.nvim": { "branch": "master", "commit": "37dc9233a473dd6c3f54456ef9994d8f77c80211" },
|
||||||
"tabby.nvim": { "branch": "main", "commit": "b3affa6db7eab80fca2a2db5b73b473144507039" },
|
"trouble.nvim": { "branch": "main", "commit": "2f3b537f2207ce32f4459f9d56746ee013b5e01b" },
|
||||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
|
"undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" },
|
||||||
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
|
"vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" },
|
||||||
"trouble.nvim": { "branch": "main", "commit": "c098362fe603d3922095e7db595961e020bdf2d0" },
|
"vim-gitgutter": { "branch": "main", "commit": "7b0b5098e3e57be86bb96cfbf2b8902381eef57c" },
|
||||||
"undotree": { "branch": "master", "commit": "0f1c9816975b5d7f87d5003a19c53c6fd2ff6f7f" },
|
"vim-helm": { "branch": "master", "commit": "ae1ebc160d2b9b90108477ab10df7a4fc501e358" }
|
||||||
"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": "2c8525fd98e57472769d137317bca83e477858ce" },
|
|
||||||
"vim-illuminate": { "branch": "master", "commit": "0d1e93684da00ab7c057410fecfc24f434698898" }
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,6 @@ 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')
|
|
||||||
|
|
||||||
autocmd('LspAttach', {
|
autocmd('LspAttach', {
|
||||||
group = CrentistGroup,
|
group = CrentistGroup,
|
||||||
@@ -16,17 +13,17 @@ autocmd('LspAttach', {
|
|||||||
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() 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>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>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>vrr", function() vim.lsp.buf.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.jump({ count = 1 }) 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", "<M-F>", function() vim.lsp.buf.format() end, opts)
|
vim.keymap.set("n", "<M-F>", "<cmd>lua vim.lsp.buf.format()<CR>")
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Add new line to the end of the file
|
-- Add new line to the end of the file
|
||||||
autocmd({ 'BufWritePre' }, {
|
autocmd({ "BufWritePre" }, {
|
||||||
group = OnSaveGroup,
|
group = OnSaveGroup,
|
||||||
pattern = '*',
|
pattern = '*',
|
||||||
callback = function()
|
callback = function()
|
||||||
@@ -40,7 +37,7 @@ autocmd({ 'BufWritePre' }, {
|
|||||||
})
|
})
|
||||||
|
|
||||||
-- Remove trailing spaces
|
-- Remove trailing spaces
|
||||||
autocmd({ 'BufWritePre' }, {
|
autocmd({ "BufWritePre" }, {
|
||||||
group = OnSaveGroup,
|
group = OnSaveGroup,
|
||||||
pattern = { "*" },
|
pattern = { "*" },
|
||||||
callback = function()
|
callback = function()
|
||||||
@@ -50,38 +47,3 @@ autocmd({ 'BufWritePre' }, {
|
|||||||
end,
|
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
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
require("crentist.remap")
|
require("crentist.remap")
|
||||||
require("crentist.set")
|
require("crentist.set")
|
||||||
require("crentist.lazy_init")
|
|
||||||
require("crentist.autocmd")
|
require("crentist.autocmd")
|
||||||
|
require("crentist.lazy_init")
|
||||||
require("crentist.filetype")
|
require("crentist.filetype")
|
||||||
require("crentist.snippets")
|
require("crentist.luasnip")
|
||||||
require("crentist.null-ls")
|
|
||||||
|
|
||||||
|
|||||||
5
lua/crentist/lazy/autopairs.lua
Normal file
5
lua/crentist/lazy/autopairs.lua
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
return {
|
||||||
|
'windwp/nvim-autopairs',
|
||||||
|
event = "InsertEnter",
|
||||||
|
config = true
|
||||||
|
}
|
||||||
@@ -1,44 +1,20 @@
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
'ellisonleao/gruvbox.nvim',
|
"ellisonleao/gruvbox.nvim",
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
local gruvbox = require('gruvbox')
|
require("gruvbox").setup({
|
||||||
|
|
||||||
---@module 'gruvbox'
|
|
||||||
---@type GruvboxConfig
|
|
||||||
local gruvbox_settings = {
|
|
||||||
transparent_mode = false,
|
|
||||||
italic = {
|
italic = {
|
||||||
strings = false,
|
strings = false,
|
||||||
emphasis = true,
|
|
||||||
comments = true,
|
|
||||||
operators = false,
|
|
||||||
folds = true,
|
|
||||||
},
|
|
||||||
overrides = {
|
|
||||||
FoldColumn = { bg = '#282828', fg = '#808080' },
|
|
||||||
GruvboxRedSign = { bg = '' },
|
|
||||||
GruvboxGreenSign = { bg = '' },
|
|
||||||
GruvboxYellowSign = { bg = '' },
|
|
||||||
GruvboxBlueSign = { bg = '' },
|
|
||||||
GruvboxPurpleSign = { bg = '' },
|
|
||||||
GruvboxAquaSign = { bg = '' },
|
|
||||||
GruvboxOrangeSign = { bg = '' },
|
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
|
vim.cmd("colorscheme gruvbox")
|
||||||
gruvbox.setup(gruvbox_settings)
|
|
||||||
vim.cmd('colorscheme gruvbox')
|
|
||||||
|
|
||||||
vim.api.nvim_set_hl(0, 'SignColumn', { link = 'FoldColumn' })
|
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'norcalli/nvim-colorizer.lua',
|
"norcalli/nvim-colorizer.lua",
|
||||||
config = function ()
|
config = function ()
|
||||||
require('colorizer').setup({ '*' })
|
require('colorizer').setup({ '*' })
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,104 +0,0 @@
|
|||||||
return {
|
|
||||||
'saghen/blink.cmp',
|
|
||||||
-- optional: provides snippets for the snippet source
|
|
||||||
dependencies = {
|
|
||||||
'mikavilpas/blink-ripgrep.nvim',
|
|
||||||
'rafamadriz/friendly-snippets',
|
|
||||||
{ 'L3MON4D3/LuaSnip', version = 'v2.*' }
|
|
||||||
},
|
|
||||||
-- use a release tag to download pre-built binaries
|
|
||||||
version = 'v1.7.*',
|
|
||||||
|
|
||||||
---@module 'blink-cmp'
|
|
||||||
---@type blink.cmp.Config
|
|
||||||
opts = {
|
|
||||||
fuzzy = { implementation = 'prefer_rust_with_warning' },
|
|
||||||
|
|
||||||
snippets = {
|
|
||||||
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 = {
|
|
||||||
keymap = { preset = 'cmdline' },
|
|
||||||
completion = {
|
|
||||||
list = { selection = { preselect = false, auto_insert = true } }
|
|
||||||
}
|
|
||||||
},
|
|
||||||
completion = { list = { selection = { preselect = false, auto_insert = true } } },
|
|
||||||
keymap = {
|
|
||||||
preset = 'enter',
|
|
||||||
['<Tab>'] = { 'select_next', 'snippet_forward', 'fallback' },
|
|
||||||
['<S-Tab>'] = { 'select_prev', 'snippet_backward', 'fallback' },
|
|
||||||
},
|
|
||||||
|
|
||||||
appearance = {
|
|
||||||
use_nvim_cmp_as_default = true,
|
|
||||||
nerd_font_variant = 'mono'
|
|
||||||
},
|
|
||||||
|
|
||||||
sources = {
|
|
||||||
default = { 'lazydev', 'lsp', 'snippets', 'ripgrep', 'path', 'buffer' },
|
|
||||||
per_filetype = {
|
|
||||||
sql = { 'snippets', 'dadbod', 'buffer', 'ripgrep' },
|
|
||||||
mysql = { 'snippets', 'dadbod', 'buffer', 'ripgrep' },
|
|
||||||
},
|
|
||||||
providers = {
|
|
||||||
lazydev = {
|
|
||||||
name = 'LazyDev',
|
|
||||||
module = 'lazydev.integrations.blink',
|
|
||||||
-- make lazydev completions top priority (see `:h blink.cmp`)
|
|
||||||
score_offset = 100,
|
|
||||||
},
|
|
||||||
ripgrep = {
|
|
||||||
module = 'blink-ripgrep',
|
|
||||||
name = 'Ripgrep',
|
|
||||||
score_offset = -5,
|
|
||||||
-- the options below are optional, some default values are shown
|
|
||||||
---@module 'blink-ripgrep'
|
|
||||||
---@type blink-ripgrep.Options
|
|
||||||
opts = {
|
|
||||||
backend = {
|
|
||||||
use = 'ripgrep',
|
|
||||||
},
|
|
||||||
ripgrep = {
|
|
||||||
ignore_paths = {},
|
|
||||||
additional_paths = {},
|
|
||||||
additional_rg_options = {},
|
|
||||||
max_filesize = '1M',
|
|
||||||
project_root_fallback = true,
|
|
||||||
search_casing = '--ignore-case',
|
|
||||||
},
|
|
||||||
project_root_marker = '.git',
|
|
||||||
fallback_to_regex_highlighting = true,
|
|
||||||
toggles = { debug = nil, },
|
|
||||||
},
|
|
||||||
transform_items = function(_, items)
|
|
||||||
for _, item in ipairs(items) do
|
|
||||||
-- example: append a description to easily distinguish rg results
|
|
||||||
item.labelDetails = {
|
|
||||||
description = '(rg)',
|
|
||||||
}
|
|
||||||
end
|
|
||||||
return items
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
dadbod = {
|
|
||||||
name = 'Dadbod', module = 'vim_dadbod_completion.blink'
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
signature = { enabled = true }
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
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,7 +1,4 @@
|
|||||||
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)
|
|
||||||
|
|
||||||
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 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 SwitchToMainbufnr = vim.api.nvim_get_current_buf()
|
local bufnr = 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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
22
lua/crentist/lazy/git-blame.lua
Normal file
22
lua/crentist/lazy/git-blame.lua
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
return {
|
||||||
|
'f-person/git-blame.nvim',
|
||||||
|
config = function()
|
||||||
|
local gitblame = require('gitblame')
|
||||||
|
gitblame.setup({
|
||||||
|
enabled = true,
|
||||||
|
date_format = '%r'
|
||||||
|
})
|
||||||
|
vim.keymap.set("n", "<leader>gbt", function()
|
||||||
|
gitblame.toggle()
|
||||||
|
end)
|
||||||
|
|
||||||
|
local CrentistGitBlame = vim.api.nvim_create_augroup("CrentistGitBlame", {})
|
||||||
|
vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||||
|
group = CrentistGitBlame,
|
||||||
|
pattern = "netrw",
|
||||||
|
callback = function()
|
||||||
|
gitblame.disable()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
}
|
||||||
3
lua/crentist/lazy/gitgutter.lua
Normal file
3
lua/crentist/lazy/gitgutter.lua
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
return {
|
||||||
|
"airblade/vim-gitgutter",
|
||||||
|
}
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
return {
|
|
||||||
'lewis6991/gitsigns.nvim',
|
|
||||||
---@module 'gitsigns.config'
|
|
||||||
---@type Gitsigns.Config
|
|
||||||
opts = {
|
|
||||||
current_line_blame = true,
|
|
||||||
attach_to_untracked = true,
|
|
||||||
current_line_blame_opts = {
|
|
||||||
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,28 +1,23 @@
|
|||||||
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
|
||||||
table.insert(file_paths, item.value)
|
table.insert(file_paths, item.value)
|
||||||
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({}),
|
||||||
@@ -30,15 +25,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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
13
lua/crentist/lazy/iconpicker.lua
Normal file
13
lua/crentist/lazy/iconpicker.lua
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
return {
|
||||||
|
"ziontee113/icon-picker.nvim",
|
||||||
|
config = function()
|
||||||
|
require("icon-picker").setup({ disable_legacy_commands = true })
|
||||||
|
|
||||||
|
local opts = { noremap = true, silent = true }
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<Leader><Leader>i", "<cmd>IconPickerNormal<cr>", opts)
|
||||||
|
vim.keymap.set("n", "<Leader><Leader>y", "<cmd>IconPickerYank<cr>", opts) --> Yank the selected icon into register
|
||||||
|
vim.keymap.set("i", "<C-i>", "<cmd>IconPickerInsert<cr>", opts)
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
return {
|
|
||||||
'RRethy/vim-illuminate',
|
|
||||||
config = function ()
|
|
||||||
local illuminate = require('illuminate')
|
|
||||||
illuminate.configure()
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,2 +1 @@
|
|||||||
return { 'lukas-reineke/indent-blankline.nvim', main = 'ibl', opts = {} }
|
return { "lukas-reineke/indent-blankline.nvim", main = "ibl", opts = {} }
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
'nvim-lua/plenary.nvim',
|
"nvim-lua/plenary.nvim",
|
||||||
name = 'plenary'
|
name = "plenary"
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,94 +1,189 @@
|
|||||||
return {
|
return {
|
||||||
'neovim/nvim-lspconfig',
|
'neovim/nvim-lspconfig',
|
||||||
version = '^2.3.0',
|
tag = "v1.0.0",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
'williamboman/mason.nvim',
|
'williamboman/mason.nvim',
|
||||||
'williamboman/mason-lspconfig.nvim',
|
'williamboman/mason-lspconfig.nvim',
|
||||||
'saghen/blink.cmp',
|
'hrsh7th/nvim-cmp',
|
||||||
|
'hrsh7th/cmp-nvim-lsp',
|
||||||
|
'hrsh7th/cmp-buffer',
|
||||||
|
'hrsh7th/cmp-path',
|
||||||
|
'SergioRibera/cmp-dotenv',
|
||||||
|
'hrsh7th/cmp-cmdline',
|
||||||
|
'saadparwaiz1/cmp_luasnip',
|
||||||
'L3MON4D3/LuaSnip',
|
'L3MON4D3/LuaSnip',
|
||||||
'j-hui/fidget.nvim',
|
'j-hui/fidget.nvim',
|
||||||
'rafamadriz/friendly-snippets',
|
'rafamadriz/friendly-snippets',
|
||||||
{ 'towolf/vim-helm', ft = 'helm' },
|
{ 'towolf/vim-helm', ft = 'helm' },
|
||||||
{
|
|
||||||
'folke/lazydev.nvim',
|
|
||||||
ft = 'lua', -- only load on lua files
|
|
||||||
opts = {
|
|
||||||
library = {
|
|
||||||
-- See the configuration section for more details
|
|
||||||
-- Load luvit types when the `vim.uv` word is found
|
|
||||||
{ path = '${3rd}/luv/library', words = { 'vim%.uv' } },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
config = function()
|
config = function()
|
||||||
vim.diagnostic.config({ virtual_text = false })
|
|
||||||
|
|
||||||
local lspconfig = require('lspconfig')
|
local lspconfig = require('lspconfig')
|
||||||
|
|
||||||
|
local cmp = require('cmp')
|
||||||
|
local luasnip = require('luasnip')
|
||||||
|
|
||||||
-- load snippets from friendly-snippets
|
-- load snippets from friendly-snippets
|
||||||
require('luasnip.loaders.from_vscode').lazy_load()
|
require('luasnip.loaders.from_vscode').lazy_load()
|
||||||
|
|
||||||
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_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 = {
|
||||||
'ts_ls',
|
|
||||||
'lua_ls',
|
'lua_ls',
|
||||||
'gopls',
|
|
||||||
'pylsp',
|
|
||||||
'gitlab_ci_ls',
|
|
||||||
'yamlls',
|
'yamlls',
|
||||||
'ansiblels',
|
|
||||||
'terraformls',
|
|
||||||
'helm_ls',
|
|
||||||
'marksman',
|
|
||||||
},
|
},
|
||||||
|
handlers = {
|
||||||
|
function(server_name)
|
||||||
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
|
require('lspconfig')[server_name].setup({
|
||||||
|
capabilities = capabilities
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
cmp.setup({
|
||||||
|
sources = {
|
||||||
|
{ name = 'path' },
|
||||||
|
{ name = 'nvim_lsp' },
|
||||||
|
{ name = 'luasnip', keyword_length = 2 },
|
||||||
|
{ name = 'buffer', keyword_length = 3 },
|
||||||
|
},
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
-- `Enter` key to confirm completion
|
||||||
|
['<CR>'] = cmp.mapping({
|
||||||
|
i = function(fallback)
|
||||||
|
if cmp.visible() and cmp.get_active_entry() then
|
||||||
|
cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
s = cmp.mapping.confirm({ select = true }),
|
||||||
|
c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }),
|
||||||
|
}),
|
||||||
|
['<Tab>'] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item()
|
||||||
|
elseif luasnip.locally_jumpable(1) then
|
||||||
|
luasnip.jump(1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { 'i', 's' }),
|
||||||
|
|
||||||
|
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_prev_item()
|
||||||
|
elseif luasnip.locally_jumpable(-1) then
|
||||||
|
luasnip.jump(-1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { 'i', 's' }),
|
||||||
|
|
||||||
|
-- Ctrl+Space to trigger completion menu
|
||||||
|
['<C-Space>'] = cmp.mapping.complete(),
|
||||||
|
|
||||||
|
-- Scroll up and down in the completion documentation
|
||||||
|
['<C-u>'] = cmp.mapping.scroll_docs(-4),
|
||||||
|
['<C-d>'] = cmp.mapping.scroll_docs(4),
|
||||||
|
}),
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
require('luasnip').lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
local lazydev = require('lazydev')
|
local pythonLineLength = 95
|
||||||
lazydev.setup()
|
lspconfig.pylsp.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 = {
|
|
||||||
enabled = false,
|
|
||||||
},
|
|
||||||
yapf = {
|
|
||||||
enabled = true,
|
|
||||||
},
|
|
||||||
pycodestyle = {
|
pycodestyle = {
|
||||||
ignore = { 'W391' },
|
ignore = { 'W391' },
|
||||||
maxLineLength = 95,
|
maxLineLength = pythonLineLength
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
lspconfig.ansiblels.setup {}
|
||||||
|
|
||||||
|
lspconfig.lua_ls.setup {
|
||||||
|
on_init = function(client)
|
||||||
|
local path = client.workspace_folders[1].name
|
||||||
|
if vim.loop.fs_stat(path .. '/.luarc.json') or vim.loop.fs_stat(path .. '/.luarc.jsonc') then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, {
|
||||||
|
runtime = {
|
||||||
|
-- Tell the language server which version of Lua you're using
|
||||||
|
-- (most likely LuaJIT in the case of Neovim)
|
||||||
|
version = 'LuaJIT'
|
||||||
|
},
|
||||||
|
-- Make the server aware of Neovim runtime files
|
||||||
|
workspace = {
|
||||||
|
checkThirdParty = false,
|
||||||
|
library = {
|
||||||
|
vim.env.VIMRUNTIME
|
||||||
|
-- Depending on the usage, you might want to add additional paths here.
|
||||||
|
-- '${3rd}/luv/library'
|
||||||
|
-- '${3rd}/busted/library',
|
||||||
|
}
|
||||||
|
-- or pull in all of 'runtimepath'. NOTE: this is a lot slower
|
||||||
|
-- library = vim.api.nvim_get_runtime_file('', true)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
end,
|
||||||
vim.lsp.config('helm-ls', {
|
settings = {
|
||||||
|
Lua = {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
lspconfig.helm_ls.setup {
|
||||||
settings = {
|
settings = {
|
||||||
['helm-ls'] = {
|
['helm-ls'] = {
|
||||||
helmLint = { enabled = false },
|
yamlls = {
|
||||||
yamlls = { enabled = false },
|
path = 'yaml-language-server',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
lspconfig.terraformls.setup {
|
||||||
|
filetypes = { 'terraform', 'terraform-vars', 'tf' }
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Add additional capabilities supported by nvim-cmp
|
||||||
|
-- nvim hasn't added foldingRange to default capabilities, users must add it manually
|
||||||
|
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
|
capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
|
capabilities.textDocument.foldingRange = {
|
||||||
|
dynamicRegistration = false,
|
||||||
|
lineFoldingOnly = true,
|
||||||
|
}
|
||||||
|
|
||||||
|
lspconfig.nixd.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
settings = {
|
||||||
|
nixd = {
|
||||||
|
nixpkgs = {
|
||||||
|
expr = "import <nixpkgs> { }",
|
||||||
|
},
|
||||||
|
formatting = {
|
||||||
|
command = { "alejandra" },
|
||||||
|
},
|
||||||
|
options = {
|
||||||
|
home_manager = {
|
||||||
|
expr = '(builtins.getFlake "~/.dotfiles/home-manager/").homeConfigurations.rtim.options',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
})
|
},
|
||||||
|
|
||||||
vim.lsp.config('terraformls', {
|
|
||||||
filetypes = { 'terraform', 'terraform-vars', 'tf' }
|
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,8 +17,7 @@ return {
|
|||||||
lightgray = '#504945',
|
lightgray = '#504945',
|
||||||
inactivegray = '#7c6f64',
|
inactivegray = '#7c6f64',
|
||||||
}
|
}
|
||||||
require('lualine').setup(
|
require('lualine').setup({
|
||||||
{
|
|
||||||
options = {
|
options = {
|
||||||
theme = {
|
theme = {
|
||||||
normal = {
|
normal = {
|
||||||
@@ -57,7 +56,7 @@ return {
|
|||||||
lualine_c = {
|
lualine_c = {
|
||||||
{
|
{
|
||||||
'filename',
|
'filename',
|
||||||
path = 1,
|
path = 4,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'navic',
|
'navic',
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
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,8 +7,7 @@ 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
|
||||||
|
|||||||
3
lua/crentist/lazy/neodev.lua
Normal file
3
lua/crentist/lazy/neodev.lua
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
return {
|
||||||
|
{ "folke/neodev.nvim", opts = {} }
|
||||||
|
}
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
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',
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
return {
|
|
||||||
'nvimtools/none-ls.nvim',
|
|
||||||
-- Optional dependencies
|
|
||||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
|
||||||
opts = {},
|
|
||||||
config = function()
|
|
||||||
local null_ls = require('null-ls')
|
|
||||||
null_ls.setup({})
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
return {
|
|
||||||
'obsidian-nvim/obsidian.nvim',
|
|
||||||
version = '*', -- recommended, use latest release instead of latest commit
|
|
||||||
dependencies = {
|
|
||||||
-- Required.
|
|
||||||
'nvim-lua/plenary.nvim',
|
|
||||||
},
|
|
||||||
keys = {
|
|
||||||
{ '<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.
|
|
||||||
["gf"] = {
|
|
||||||
action = function()
|
|
||||||
return require("obsidian").util.gf_passthrough()
|
|
||||||
end,
|
|
||||||
opts = { noremap = false, expr = true, buffer = true },
|
|
||||||
},
|
|
||||||
-- Toggle check-boxes.
|
|
||||||
["<leader>ch"] = {
|
|
||||||
action = function()
|
|
||||||
return require("obsidian").util.toggle_checkbox()
|
|
||||||
end,
|
|
||||||
opts = { buffer = true },
|
|
||||||
},
|
|
||||||
-- Smart action depending on context, either follow link or toggle checkbox.
|
|
||||||
["<cr>"] = {
|
|
||||||
action = function()
|
|
||||||
return require("obsidian").util.smart_action()
|
|
||||||
end,
|
|
||||||
opts = { buffer = true, expr = true },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
opts = {
|
|
||||||
legacy_commands = false,
|
|
||||||
workspaces = {
|
|
||||||
{
|
|
||||||
name = 'tech-work-hobby',
|
|
||||||
path = '/Users/rtim/Documents/Notes/tech-work-hobby/',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
daily_notes = {
|
|
||||||
folder = 'Daily',
|
|
||||||
date_format = '%Y-%m-%d (%A)',
|
|
||||||
default_tags = { 'daily' },
|
|
||||||
template = 'Daily.md',
|
|
||||||
},
|
|
||||||
templates = {
|
|
||||||
folder = 'Templates',
|
|
||||||
},
|
|
||||||
completion = {
|
|
||||||
blink = true,
|
|
||||||
nvim_cmp = false,
|
|
||||||
},
|
|
||||||
ui = {
|
|
||||||
enable = false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,28 +1,17 @@
|
|||||||
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-k>'] = false,
|
|
||||||
['<C-l>'] = false,
|
|
||||||
}
|
}
|
||||||
},
|
})
|
||||||
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,43 +0,0 @@
|
|||||||
return {
|
|
||||||
'frankroeder/parrot.nvim',
|
|
||||||
version = '2.3.0',
|
|
||||||
dependencies = { 'ibhagwan/fzf-lua', 'nvim-lua/plenary.nvim' },
|
|
||||||
opts = {
|
|
||||||
providers = {
|
|
||||||
anthropic = {
|
|
||||||
name = 'anthropic',
|
|
||||||
endpoint = 'https://api.anthropic.com/v1/messages',
|
|
||||||
model_endpoint = 'https://api.anthropic.com/v1/models',
|
|
||||||
api_key = { '/usr/local/bin/sops', "--config", "/dev/null", "-d", vim.fn.expand("$HOME") .. "/.claude-api" },
|
|
||||||
headers = function(self)
|
|
||||||
return {
|
|
||||||
['Content-Type'] = "application/json",
|
|
||||||
['x-api-key'] = self.api_key,
|
|
||||||
['anthropic-version'] = "2023-06-01",
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
params = {
|
|
||||||
chat = { max_tokens = 4096 },
|
|
||||||
command = { max_tokens = 4096 },
|
|
||||||
},
|
|
||||||
models = {
|
|
||||||
'claude-opus-4-1-20250805',
|
|
||||||
'claude-sonnet-4-5-20250929',
|
|
||||||
},
|
|
||||||
preprocess_payload = function(payload)
|
|
||||||
for _, message in ipairs(payload.messages) do
|
|
||||||
message.content = message.content:gsub('^%s*(.-)%s*$', "%1")
|
|
||||||
end
|
|
||||||
if payload.messages[1] and payload.messages[1].role == 'system' then
|
|
||||||
-- 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
|
|
||||||
payload.system = payload.messages[1].content
|
|
||||||
table.remove(payload.messages, 1)
|
|
||||||
end
|
|
||||||
return payload
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,10 +1,13 @@
|
|||||||
return {
|
return {
|
||||||
'lucidph3nx/nvim-sops',
|
'lucidph3nx/nvim-sops',
|
||||||
event = { 'BufEnter' },
|
event = { 'BufEnter' },
|
||||||
opts = { },
|
opts = {
|
||||||
|
-- your configuration comes here
|
||||||
|
-- or leave it empty to use the default settings
|
||||||
|
-- refer to the configuration section below
|
||||||
|
},
|
||||||
keys = {
|
keys = {
|
||||||
{ '<leader>ef', vim.cmd.SopsEncrypt, desc = '[E]ncrypt [F]ile' },
|
{ '<leader>ef', vim.cmd.SopsEncrypt, desc = '[E]ncrypt [F]ile' },
|
||||||
{ '<leader>df', vim.cmd.SopsDecrypt, desc = '[D]ecrypt [F]ile' },
|
{ '<leader>df', vim.cmd.SopsDecrypt, desc = '[D]ecrypt [F]ile' },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ return {
|
|||||||
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
config = function()
|
config = function()
|
||||||
require("nvim-surround").setup({})
|
require("nvim-surround").setup({
|
||||||
|
-- Configuration here, or leave empty to use defaults
|
||||||
|
})
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
-- 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...
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -2,12 +2,7 @@ return {
|
|||||||
'FabianWirth/search.nvim',
|
'FabianWirth/search.nvim',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
'nvim-lua/plenary.nvim',
|
'nvim-lua/plenary.nvim',
|
||||||
{
|
|
||||||
'nvim-telescope/telescope.nvim',
|
'nvim-telescope/telescope.nvim',
|
||||||
dependencies = {
|
|
||||||
{ 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
config = function()
|
config = function()
|
||||||
@@ -22,15 +17,17 @@ return {
|
|||||||
telescope.setup({
|
telescope.setup({
|
||||||
defaults = {
|
defaults = {
|
||||||
vimgrep_arguments = vimgrep_arguments,
|
vimgrep_arguments = vimgrep_arguments,
|
||||||
file_ignore_patterns = { "^.git/" }
|
file_ignore_patterns = {
|
||||||
|
'node_modules',
|
||||||
|
}
|
||||||
},
|
},
|
||||||
extensions = {
|
pickers = {
|
||||||
fzf = {}
|
find_files = {
|
||||||
|
find_command = { 'rg', '--files', '--hidden', '--glob', '!**/.git/*' },
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
telescope.load_extension('fzf')
|
|
||||||
|
|
||||||
local search = require('search')
|
local search = require('search')
|
||||||
local builtin = require('telescope.builtin')
|
local builtin = require('telescope.builtin')
|
||||||
|
|
||||||
@@ -40,8 +37,8 @@ return {
|
|||||||
prev = '<S-Tab>'
|
prev = '<S-Tab>'
|
||||||
},
|
},
|
||||||
tabs = {
|
tabs = {
|
||||||
{ name = 'Files', tele_func = builtin.find_files, tele_opts = { no_ignore = false, hidden = true, } },
|
{ 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 = 'Grep', tele_func = builtin.live_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
|
||||||
@@ -52,21 +49,6 @@ 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,50 +1,30 @@
|
|||||||
return {
|
return {
|
||||||
'nvim-treesitter/nvim-treesitter',
|
"nvim-treesitter/nvim-treesitter",
|
||||||
branch = 'main',
|
|
||||||
lazy = false,
|
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
config = function()
|
config = function()
|
||||||
local ts = require("nvim-treesitter")
|
require("nvim-treesitter.configs").setup({
|
||||||
local installed_parsers = {
|
-- A list of parser names, or "all" (the five listed parsers should always be installed)
|
||||||
"bash",
|
ensure_installed = { "bash", "javascript", "typescript", "python", "go", "terraform", "hcl", "helm", "jq", "yaml", "tmux", "lua", "vim", "vimdoc" },
|
||||||
"javascript",
|
|
||||||
"typescript",
|
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||||
"python",
|
sync_install = false,
|
||||||
"go",
|
|
||||||
"terraform",
|
-- Automatically install missing parsers when entering buffer
|
||||||
"hcl",
|
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||||
"helm",
|
auto_install = true,
|
||||||
"jq",
|
|
||||||
"yaml",
|
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
|
||||||
"tmux",
|
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
|
||||||
"lua",
|
|
||||||
"vim",
|
highlight = {
|
||||||
"vimdoc",
|
enable = true,
|
||||||
"latex",
|
|
||||||
"json",
|
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||||
"yaml",
|
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||||
"git_config",
|
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||||
"git_rebase",
|
-- Instead of true it can also be a list of languages
|
||||||
"gitattributes",
|
additional_vim_regex_highlighting = false,
|
||||||
"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,43 +0,0 @@
|
|||||||
return {
|
|
||||||
'kevinhwang91/nvim-ufo',
|
|
||||||
event = 'BufReadPost',
|
|
||||||
dependencies = {
|
|
||||||
'kevinhwang91/promise-async',
|
|
||||||
'nvim-treesitter/nvim-treesitter',
|
|
||||||
{
|
|
||||||
'luukvbaal/statuscol.nvim',
|
|
||||||
config = function()
|
|
||||||
local builtin = require('statuscol.builtin')
|
|
||||||
require('statuscol').setup({
|
|
||||||
relculright = true,
|
|
||||||
segments = {
|
|
||||||
{ text = { builtin.foldfunc }, sign = { colwidth = 1 }, click = 'v:lua.ScFa', },
|
|
||||||
{ text = { '%s' }, sign = { colwidth = 1 }, click = 'v:lua.ScSa', hl = 'FoldColumn' },
|
|
||||||
{ text = { builtin.lnumfunc, ' ' }, click = 'v:lua.ScLa', hl = 'FoldColumn' },
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end
|
|
||||||
}
|
|
||||||
},
|
|
||||||
init = function()
|
|
||||||
vim.opt.foldenable = true
|
|
||||||
vim.opt.foldcolumn = '1'
|
|
||||||
vim.opt.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
|
|
||||||
vim.opt.foldlevelstart = 99
|
|
||||||
vim.opt.fillchars = 'eob: ,fold: ,foldopen:,foldsep: ,foldclose:'
|
|
||||||
vim.opt.foldtext = ''
|
|
||||||
end,
|
|
||||||
opts = {
|
|
||||||
provider_selector = function(bufnr, filetype, buftype)
|
|
||||||
return { 'treesitter', 'indent' }
|
|
||||||
end
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require('ufo').setup({
|
|
||||||
provider_selector = function(bufnr, filetype, buftype)
|
|
||||||
return { 'treesitter', 'indent' }
|
|
||||||
end
|
|
||||||
})
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
80
lua/crentist/luasnip.lua
Normal file
80
lua/crentist/luasnip.lua
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
-- 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 })
|
||||||
|
|
||||||
|
-- nvim config
|
||||||
|
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 = '<>' }
|
||||||
|
)
|
||||||
|
),
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Comment block
|
||||||
|
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')
|
||||||
|
}
|
||||||
|
)
|
||||||
|
),
|
||||||
|
})
|
||||||
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
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,8 +2,6 @@ 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")
|
||||||
|
|
||||||
@@ -30,22 +28,6 @@ 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>")
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader><leader>x", "<cmd>source %<CR>")
|
|
||||||
vim.keymap.set("n", "<leader>x", ":.lua<CR>")
|
|
||||||
vim.keymap.set("v", "<leader>x", ":lua<CR>")
|
|
||||||
|
|
||||||
vim.keymap.set("n", "<C-M-j>", "<cmd>cnext<CR>")
|
|
||||||
vim.keymap.set("n", "<C-M-k>", "<cmd>cprev<CR>")
|
|
||||||
|
|
||||||
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 })
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ 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
|
||||||
@@ -25,12 +23,10 @@ vim.opt.incsearch = true
|
|||||||
vim.opt.termguicolors = true
|
vim.opt.termguicolors = true
|
||||||
|
|
||||||
vim.opt.scrolloff = 8
|
vim.opt.scrolloff = 8
|
||||||
vim.opt.signcolumn = "yes:1"
|
vim.opt.signcolumn = "yes"
|
||||||
vim.opt.isfname:append("@-@")
|
vim.opt.isfname:append("@-@")
|
||||||
|
|
||||||
vim.opt.updatetime = 50
|
vim.opt.updatetime = 50
|
||||||
|
|
||||||
vim.opt.colorcolumn = "80"
|
vim.opt.colorcolumn = "80"
|
||||||
|
|
||||||
vim.opt.diffopt = 'internal,filler,closeoff,algorithm:histogram'
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
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
|
|
||||||
|
|
||||||
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')
|
|
||||||
}
|
|
||||||
)
|
|
||||||
),
|
|
||||||
})
|
|
||||||
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
require('crentist.snippets.common')
|
|
||||||
require('crentist.snippets.lua')
|
|
||||||
require('crentist.snippets.terraform')
|
|
||||||
require('crentist.snippets.yaml')
|
|
||||||
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
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 = '<>' }
|
|
||||||
)
|
|
||||||
),
|
|
||||||
})
|
|
||||||
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
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 = '<>' }
|
|
||||||
)
|
|
||||||
),
|
|
||||||
})
|
|
||||||
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
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 })
|
|
||||||
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
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