26 Commits

Author SHA1 Message Date
53339e0d19 enable blink completion for cmdline
seems to be working fine now without being overintrusive
2025-02-19 10:15:03 +02:00
8b114f4da0 update modules 2025-02-18 17:31:48 +02:00
66fd13ec25 update completion 2025-02-18 17:31:23 +02:00
f7ff3f6f4f cleanup and add yaml schema snippet to helm 2025-01-09 11:17:18 +02:00
78d14b79a7 add yaml schema snippet 2025-01-02 09:57:11 +02:00
0f0dafb773 add mini.pairs, revert to surround 2025-01-02 09:57:00 +02:00
b6471168fb replace nvim surround with mini surround 2024-12-24 11:15:50 +02:00
8bf693ba29 cleanup 2024-12-24 11:05:16 +02:00
b1ecff2e08 fix blink cmp completion mapping 2024-12-24 11:05:15 +02:00
8894b0ccdb replace cmp with blink-cmp 2024-12-24 11:04:40 +02:00
132e1aa78a update plugins 2024-12-18 17:08:29 +02:00
b92b8ed602 refactor remaps with leader instead of space 2024-12-18 17:07:52 +02:00
a947bcda9b make gruvbox sign symbols transparent, and leave everything else as is
config.transparent didn't work because it made fidget non-transparrent.
Apprently it has default colors as black
2024-12-18 11:36:49 +02:00
0325d883bc add maps for quickfix, use telescope for references 2024-12-18 11:36:49 +02:00
67c2b52e4d advent of neovim suggestions to telescope and some remaps 2024-12-18 11:36:49 +02:00
23cf6254ec update colors for gruvbox, use transparent mode 2024-12-18 11:36:49 +02:00
f53b5f6905 add ft for helm and yaml 2024-12-18 11:36:49 +02:00
cb80bb1750 switch from neodev to lazydev 2024-12-18 11:36:49 +02:00
68ea39094c cleanup and refactor autocmd 2024-12-18 11:36:49 +02:00
0334178b6e add make filetype 2024-12-18 11:36:49 +02:00
4a596c757b remove code action keymap 2024-12-18 11:36:49 +02:00
a6bf1207d7 add make ft settings 2024-12-18 11:36:49 +02:00
a93c15e29e add none-ls 2024-12-18 11:36:49 +02:00
bcc806d349 fix hl for the symbol columns 2024-12-18 11:36:49 +02:00
6871470b6c add gitsigns in blace of gitgutter and git-blame 2024-12-18 11:36:49 +02:00
c49b758e86 configure folding 2024-12-18 11:36:49 +02:00
32 changed files with 398 additions and 231 deletions

7
.luarc.json Normal file
View File

@@ -0,0 +1,7 @@
{
"diagnostics.disable": [
"undefined-global",
"unused-local"
]
}

View File

@@ -1,3 +1,4 @@
# My nvim configuration
This mostly copies ThePrimeagen configs with some changes because I don't use dvorak

5
after/ftplugin/helm.lua Normal file
View File

@@ -0,0 +1,5 @@
vim.opt_local.tabstop = 2
vim.opt_local.shiftwidth = 2
vim.opt_local.softtabstop = 2
vim.opt_local.expandtab = true

12
after/ftplugin/make.lua Normal file
View File

@@ -0,0 +1,12 @@
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,
})

View File

@@ -0,0 +1,2 @@
vim.opt_local.conceallevel = 2

5
after/ftplugin/yaml.lua Normal file
View File

@@ -0,0 +1,5 @@
vim.opt_local.tabstop = 2
vim.opt_local.shiftwidth = 2
vim.opt_local.softtabstop = 2
vim.opt_local.expandtab = true

View File

@@ -1,41 +1,40 @@
{
"LuaSnip": { "branch": "master", "commit": "787dee55ca364cc9119787165418fe93b74c1842" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
"cmp-dotenv": { "branch": "main", "commit": "4dd53aab60982f1f75848aec5e6214986263325e" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"dressing.nvim": { "branch": "master", "commit": "1b7921eecc65af1baf8ac1dc06f0794934cbcfb2" },
"fidget.nvim": { "branch": "main", "commit": "d855eed8a06531a7e8fd0684889b2943f373c469" },
"friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" },
"git-blame.nvim": { "branch": "master", "commit": "2883a7460f611c2705b23f12d58d398d5ce6ec00" },
"gruvbox.nvim": { "branch": "main", "commit": "49d9c0b150ba70efcd831ec7b3cb8ee740067045" },
"harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" },
"icon-picker.nvim": { "branch": "master", "commit": "3ee9a0ea9feeef08ae35e40c8be6a2fa2c20f2d3" },
"indent-blankline.nvim": { "branch": "master", "commit": "e7a4442e055ec953311e77791546238d1eaae507" },
"lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" },
"lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "7446f47b3dfb7df801f31a6f6783c2ad119a6935" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" },
"nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" },
"nvim-cmp": { "branch": "main", "commit": "29fb4854573355792df9e156cb779f0d31308796" },
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
"blink.cmp": { "branch": "main", "commit": "18b352d12b35bca148427b607098df14b75a218f" },
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
"fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" },
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
"gitsigns.nvim": { "branch": "main", "commit": "6668f379ca634c36b8e11453118590b91bf8b295" },
"gruvbox.nvim": { "branch": "main", "commit": "089b60e92aa0a1c6fa76ff527837cd35b6f5ac81" },
"harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" },
"hererocks": { "branch": "master", "commit": "c9c5444dea1e07e005484014a8231aa667be30b6" },
"indent-blankline.nvim": { "branch": "master", "commit": "e10626f7fcd51ccd56d7ffc00883ba7e0aa28f78" },
"lazy.nvim": { "branch": "main", "commit": "e5e9bf48211a13d9ee6c1077c88327c49c1ab4a0" },
"lazydev.nvim": { "branch": "main", "commit": "a1b78b2ac6f978c72e76ea90ae92a94edf380cfc" },
"lualine.nvim": { "branch": "master", "commit": "f4f791f67e70d378a754d02da068231d2352e5bc" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
"mini.pairs": { "branch": "main", "commit": "7e834c5937d95364cc1740e20d673afe2d034cdb" },
"none-ls.nvim": { "branch": "main", "commit": "f41624ea1a73f020ddbd33438f74abb95ea17d55" },
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
"nvim-lspconfig": { "branch": "master", "commit": "056f569f71e4b726323b799b9cfacc53653bceb3" },
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
"nvim-sops": { "branch": "main", "commit": "cb2209562d00ef8c6c88bdec836d9edb8fbb96ef" },
"nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" },
"nvim-treesitter": { "branch": "master", "commit": "00d219068385a4aa80859d4606ad6e03af6faa83" },
"nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" },
"oil.nvim": { "branch": "master", "commit": "cca1631d5ea450c09ba72f3951a9e28105a3632c" },
"plenary": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
"nvim-surround": { "branch": "main", "commit": "ae298105122c87bbe0a36b1ad20b06d417c0433e" },
"nvim-treesitter": { "branch": "master", "commit": "1a6e42bb8c5c23d8e2c0acb842dcacac5ee06761" },
"nvim-ufo": { "branch": "main", "commit": "a52c92c3bbaa10f0c9b547a50adaa8c7d8b29f94" },
"nvim-web-devicons": { "branch": "master", "commit": "1020869742ecb191f260818234517f4a1515cfe8" },
"obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" },
"oil.nvim": { "branch": "master", "commit": "975a77cce3c8cb742bc1b3629f4328f5ca977dad" },
"plenary": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" },
"search.nvim": { "branch": "main", "commit": "7b8f2315d031be73e14bc2d82386dfac15952614" },
"telescope.nvim": { "branch": "master", "commit": "37dc9233a473dd6c3f54456ef9994d8f77c80211" },
"trouble.nvim": { "branch": "main", "commit": "2f3b537f2207ce32f4459f9d56746ee013b5e01b" },
"undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" },
"vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" },
"vim-gitgutter": { "branch": "main", "commit": "7b0b5098e3e57be86bb96cfbf2b8902381eef57c" },
"statuscol.nvim": { "branch": "main", "commit": "a2a0e3ed55ba0f636ce0b2ccf61bca4050edd288" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "2a5ceff981501cff8f46871d5402cd3378a8ab6a" },
"telescope.nvim": { "branch": "master", "commit": "78857db9e8d819d3cc1a9a7bdc1d39d127a36495" },
"trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" },
"undotree": { "branch": "master", "commit": "2556c6800b210b2096b55b66e74b4cc1d9ebbe4f" },
"vim-fugitive": { "branch": "master", "commit": "b068eaf1e6cbe35d1ac100d435cd7f7b74a5c87d" },
"vim-helm": { "branch": "master", "commit": "ae1ebc160d2b9b90108477ab10df7a4fc501e358" }
}

View File

@@ -4,6 +4,8 @@ local augroup = vim.api.nvim_create_augroup
local CrentistGroup = augroup('Crentist', {})
local OnSaveGroup = augroup('CrentistOnSave', {})
local builtin = require('telescope.builtin')
autocmd('LspAttach', {
group = CrentistGroup,
callback = function(e)
@@ -13,17 +15,17 @@ autocmd('LspAttach', {
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts)
vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts)
vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.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("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
vim.keymap.set("n", "<M-F>", "<cmd>lua vim.lsp.buf.format()<CR>")
vim.keymap.set("n", "<M-F>", function() vim.lsp.buf.format() end, opts)
end
})
-- Add new line to the end of the file
autocmd({ "BufWritePre" }, {
autocmd({ 'BufWritePre' }, {
group = OnSaveGroup,
pattern = '*',
callback = function()
@@ -37,7 +39,7 @@ autocmd({ "BufWritePre" }, {
})
-- Remove trailing spaces
autocmd({ "BufWritePre" }, {
autocmd({ 'BufWritePre' }, {
group = OnSaveGroup,
pattern = { "*" },
callback = function()
@@ -47,3 +49,11 @@ autocmd({ "BufWritePre" }, {
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
})

View File

@@ -1,7 +1,8 @@
require("crentist.remap")
require("crentist.set")
require("crentist.autocmd")
require("crentist.lazy_init")
require("crentist.autocmd")
require("crentist.filetype")
require("crentist.luasnip")
require("crentist.null-ls")

View File

@@ -1,5 +0,0 @@
return {
'windwp/nvim-autopairs',
event = "InsertEnter",
config = true
}

View File

@@ -1,20 +1,40 @@
return {
{
"ellisonleao/gruvbox.nvim",
'ellisonleao/gruvbox.nvim',
priority = 1000,
config = function()
require("gruvbox").setup({
local gruvbox = require('gruvbox')
gruvbox.setup({
transparent_mode = false,
italic = {
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")
vim.cmd('colorscheme gruvbox')
vim.api.nvim_set_hl(0, 'SignColumn', { link = 'FoldColumn' })
end
},
{
"norcalli/nvim-colorizer.lua",
'norcalli/nvim-colorizer.lua',
config = function()
require('colorizer').setup({ '*' })
end
}
}

View File

@@ -0,0 +1,43 @@
return {
'saghen/blink.cmp',
-- optional: provides snippets for the snippet source
dependencies = {
'rafamadriz/friendly-snippets',
{ 'L3MON4D3/LuaSnip', version = 'v2.*' }
},
-- use a release tag to download pre-built binaries
version = 'v0.*',
opts = {
snippets = {
preset = 'luasnip',
expand = function(snippet) require('luasnip').lsp_expand(snippet) end,
active = function(filter)
if filter and filter.direction then
return require('luasnip').jumpable(filter.direction)
end
return require('luasnip').in_snippet()
end,
jump = function(direction) require('luasnip').jump(direction) end,
},
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 = { 'lsp', 'snippets', 'path', 'buffer' },
},
signature = { enabled = true }
},
}

View File

@@ -1,22 +0,0 @@
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
}

View File

@@ -1,3 +0,0 @@
return {
"airblade/vim-gitgutter",
}

View File

@@ -0,0 +1,11 @@
return {
"lewis6991/gitsigns.nvim",
opts = {
current_line_blame = true,
attach_to_untracked = true,
current_line_blame_opts = {
delay = 500,
},
}
}

View File

@@ -15,7 +15,7 @@ return {
table.insert(file_paths, item.value)
end
require("telescope.pickers").new({}, {
require('telescope.pickers').new({}, {
prompt_title = "Harpoon",
finder = require("telescope.finders").new_table({
results = file_paths,

View File

@@ -1,13 +0,0 @@
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
}

View File

@@ -1,28 +1,30 @@
return {
'neovim/nvim-lspconfig',
tag = "v1.0.0",
tag = 'v1.0.0',
dependencies = {
'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim',
'hrsh7th/nvim-cmp',
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-path',
'SergioRibera/cmp-dotenv',
'hrsh7th/cmp-cmdline',
'saadparwaiz1/cmp_luasnip',
'saghen/blink.cmp',
'L3MON4D3/LuaSnip',
'j-hui/fidget.nvim',
'rafamadriz/friendly-snippets',
{ '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()
local lspconfig = require('lspconfig')
local cmp = require('cmp')
local luasnip = require('luasnip')
-- load snippets from friendly-snippets
require('luasnip.loaders.from_vscode').lazy_load()
@@ -32,78 +34,38 @@ return {
-- Replace the language servers listed here
-- with the ones you want to install
ensure_installed = {
'ts_ls',
'lua_ls',
'gopls',
'pylsp',
'gitlab_ci_ls',
'yamlls',
'ansiblels',
'terraformls',
'helm_ls',
'marksman',
},
handlers = {
function(server_name)
local capabilities = require('cmp_nvim_lsp').default_capabilities()
local capabilities = require('blink.cmp').get_lsp_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 pythonLineLength = 95
lspconfig.pylsp.setup {
settings = {
pylsp = {
plugins = {
autopep8 = {
enabled = false,
},
yapf = {
enabled = true,
},
pycodestyle = {
ignore = { 'W391' },
maxLineLength = pythonLineLength
@@ -114,37 +76,8 @@ return {
}
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
lspconfig.lua_ls.setup {}
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,
settings = {
Lua = {}
}
}
lspconfig.helm_ls.setup {
settings = {
['helm-ls'] = {
@@ -154,37 +87,22 @@ return {
}
}
}
lspconfig.yamlls.setup {}
lspconfig.helm_ls.setup {
settingsa = {
['helm-ls'] = {
yamlls = {
enabled = false
}
}
}
}
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',
},
},
}
},
})
end
}

View File

@@ -0,0 +1,8 @@
return {
'echasnovski/mini.pairs',
version = '*',
config = function()
require('mini.pairs').setup()
end
}

View File

@@ -1,3 +0,0 @@
return {
{ "folke/neodev.nvim", opts = {} }
}

View File

@@ -0,0 +1,11 @@
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
}

View File

@@ -0,0 +1,53 @@
return {
'epwalsh/obsidian.nvim',
version = '*', -- recommended, use latest release instead of latest commit
dependencies = {
-- Required.
'nvim-lua/plenary.nvim',
},
keys = {
{'<leader>ot', '<cmd>ObsidianToday<CR>', desc = "Open today's daily note"},
{'<leader>os', '<cmd>ObsidianQuickSwitch<CR>', desc = 'Search notes in my vault and switch to selected'},
},
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 = {
workspaces = {
{
name = 'tech-work-hobby',
path = '/Users/rtim/Documents/Notes/tech-work-hobby/',
},
},
daily_notes = {
folder = 'Daily',
date_format = '%d-%b-%y (%A)',
default_tags = { 'daily' },
template = 'Daily.md',
},
templates = {
folder = 'Templates',
}
},
}

View File

@@ -10,6 +10,9 @@ return {
},
keymaps = {
['<C-h>'] = false,
['<C-j>'] = false,
['<C-k>'] = false,
['<C-l>'] = false,
}
})
end

View File

@@ -1,13 +1,10 @@
return {
'lucidph3nx/nvim-sops',
event = { 'BufEnter' },
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
},
opts = { },
keys = {
{ '<leader>ef', vim.cmd.SopsEncrypt, desc = '[E]ncrypt [F]ile' },
{ '<leader>df', vim.cmd.SopsDecrypt, desc = '[D]ecrypt [F]ile' },
},
}

View File

@@ -3,8 +3,7 @@ return {
version = "*", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
config = function()
require("nvim-surround").setup({
-- Configuration here, or leave empty to use defaults
})
require("nvim-surround").setup({})
end
}

View File

@@ -2,7 +2,12 @@ return {
'FabianWirth/search.nvim',
dependencies = {
'nvim-lua/plenary.nvim',
{
'nvim-telescope/telescope.nvim',
dependencies = {
{ 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }
}
},
},
config = function()
@@ -19,15 +24,16 @@ return {
vimgrep_arguments = vimgrep_arguments,
file_ignore_patterns = {
'node_modules',
'.git/'
}
},
pickers = {
find_files = {
find_command = { 'rg', '--files', '--hidden', '--glob', '!**/.git/*' },
}
extensions = {
fzf = {}
}
})
telescope.load_extension('fzf')
local search = require('search')
local builtin = require('telescope.builtin')

View File

@@ -1,5 +1,5 @@
return {
"nvim-treesitter/nvim-treesitter",
'nvim-treesitter/nvim-treesitter',
build = ":TSUpdate",
config = function()
require("nvim-treesitter.configs").setup({
@@ -28,3 +28,4 @@ return {
})
end
}

43
lua/crentist/lazy/ufo.lua Normal file
View File

@@ -0,0 +1,43 @@
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 = 2 }, click = 'v:lua.ScFa', },
{ text = { '%s' }, 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
}

View File

@@ -11,7 +11,9 @@ vim.keymap.set({ "i", "s" }, "<C-l>", function()
end
end, { desc = "Snippet next argument", silent = true })
-- nvim config
--------------------
-- Snippets for LUA
--------------------
ls.add_snippets('lua', {
s({ name = 'LuaSnip Snippet', trig = 'snipf' },
fmt([[
@@ -44,7 +46,9 @@ ls.add_snippets('lua', {
),
})
-- Comment block
--------------------
-- Generic snippets
--------------------
local function com_string(_, snip, to_multiply)
local comment_string = vim.bo.commentstring
local repeats = snip.captures[1]
@@ -78,3 +82,47 @@ ls.add_snippets('all', {
),
})
--------------------
-- 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 })

3
lua/crentist/null-ls.lua Normal file
View File

@@ -0,0 +1,3 @@
-- https://www.youtube.com/watch?v=q-oBU2fO1H4&t=189s
local null_ls = require("null-ls")

View File

@@ -31,3 +31,10 @@ vim.keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><
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", "<M-j>", "<cmd>cnext<CR>")
vim.keymap.set("n", "<M-k>", "<cmd>cprev<CR>")

View File

@@ -23,7 +23,7 @@ vim.opt.incsearch = true
vim.opt.termguicolors = true
vim.opt.scrolloff = 8
vim.opt.signcolumn = "yes"
vim.opt.signcolumn = "yes:1"
vim.opt.isfname:append("@-@")
vim.opt.updatetime = 50