Compare commits
40 Commits
feature/te
...
a947bcda9b
| Author | SHA1 | Date | |
|---|---|---|---|
| a947bcda9b | |||
| 0325d883bc | |||
| 67c2b52e4d | |||
| 23cf6254ec | |||
| f53b5f6905 | |||
| cb80bb1750 | |||
| 68ea39094c | |||
| 0334178b6e | |||
| 4a596c757b | |||
| a6bf1207d7 | |||
| a93c15e29e | |||
| bcc806d349 | |||
| 6871470b6c | |||
| c49b758e86 | |||
| 231db82c0f | |||
| 7dcd4ec2f7 | |||
| b1a0742ffa | |||
| b10e7d85eb | |||
| e3c38b2da9 | |||
| 3b65386a9f | |||
| 24b4c23635 | |||
| 2338b310f2 | |||
| 758322bd93 | |||
| 1a2df25f5e | |||
| aac1e91dcb | |||
| 6d91d0c963 | |||
| a33c92ce5b | |||
| 4053addac9 | |||
| 751829deb0 | |||
| c0adfd43a1 | |||
| 69067d5410 | |||
| d91c167d6e | |||
| 6a8be9a1e3 | |||
| b685e528af | |||
| 7200602b10 | |||
| 56316c6986 | |||
| 4ccc8ae093 | |||
| 8e153ee524 | |||
| 153f3d36c0 | |||
| b71f7c2cce |
7
.luarc.json
Normal file
7
.luarc.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"diagnostics.disable": [
|
||||||
|
"undefined-global",
|
||||||
|
"unused-local"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
# 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
|
||||||
|
|
||||||
|
|||||||
5
after/ftplugin/helm.lua
Normal file
5
after/ftplugin/helm.lua
Normal 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
12
after/ftplugin/make.lua
Normal 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,
|
||||||
|
})
|
||||||
|
|
||||||
2
after/ftplugin/markdown.lua
Normal file
2
after/ftplugin/markdown.lua
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
vim.opt_local.conceallevel = 2
|
||||||
|
|
||||||
4
after/ftplugin/nix.lua
Normal file
4
after/ftplugin/nix.lua
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
vim.opt.shiftwidth = 2
|
||||||
|
vim.opt.tabstop = 2
|
||||||
|
vim.opt.expandtab = true
|
||||||
|
|
||||||
1
after/ftplugin/python.lua
Normal file
1
after/ftplugin/python.lua
Normal file
@@ -0,0 +1 @@
|
|||||||
|
vim.opt.colorcolumn = "95"
|
||||||
6
after/ftplugin/terraform.lua
Normal file
6
after/ftplugin/terraform.lua
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
vim.opt.colorcolumn = "95"
|
||||||
|
vim.opt.shiftwidth = 2
|
||||||
|
vim.opt.tabstop = 2
|
||||||
|
vim.opt.expandtab = true
|
||||||
|
vim.bo.commentstring = '# %s'
|
||||||
|
|
||||||
5
after/ftplugin/yaml.lua
Normal file
5
after/ftplugin/yaml.lua
Normal 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
|
||||||
|
|
||||||
@@ -1,34 +1,48 @@
|
|||||||
{
|
{
|
||||||
"LuaSnip": { "branch": "master", "commit": "2b6860d15aaab01d3fb90859c0ba97f20ad7bc5f" },
|
"LuaSnip": { "branch": "master", "commit": "0f7bbce41ea152a94d12aea286f2ce98e63c0f58" },
|
||||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||||
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
|
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
|
||||||
"cmp-dotenv": { "branch": "main", "commit": "4dd53aab60982f1f75848aec5e6214986263325e" },
|
"cmp-dotenv": { "branch": "main", "commit": "4dd53aab60982f1f75848aec5e6214986263325e" },
|
||||||
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
||||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||||
"fidget.nvim": { "branch": "main", "commit": "ef99df04a1c53a453602421bc0f756997edc8289" },
|
"dressing.nvim": { "branch": "master", "commit": "fc78a3ca96f4db9f8893bb7e2fd9823e0780451b" },
|
||||||
"git-blame.nvim": { "branch": "master", "commit": "408d5487d908dfe5d48e5645d8b27ddcc16b11e0" },
|
"fidget.nvim": { "branch": "main", "commit": "e2a175c2abe2d4f65357da1c98c59a5cfb2b543f" },
|
||||||
"gruvbox.nvim": { "branch": "main", "commit": "d4cde3853a172485961b515c36d51d757728d6e6" },
|
"friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" },
|
||||||
"harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" },
|
"gitsigns.nvim": { "branch": "main", "commit": "ac5aba6dce8c06ea22bea2c9016f51a2dbf90dc7" },
|
||||||
"indent-blankline.nvim": { "branch": "master", "commit": "d98f537c3492e87b6dc6c2e3f66ac517528f406f" },
|
"gruvbox.nvim": { "branch": "main", "commit": "49d9c0b150ba70efcd831ec7b3cb8ee740067045" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "70f2c090d3ffb14f8702d468e05beb240b768881" },
|
"harpoon": { "branch": "harpoon2", "commit": "a84ab829eaf3678b586609888ef52f7779102263" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
|
"hererocks": { "branch": "master", "commit": "c9c5444dea1e07e005484014a8231aa667be30b6" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "a4caa0d083aab56f6cd5acf2d42331b74614a585" },
|
"icon-picker.nvim": { "branch": "master", "commit": "3ee9a0ea9feeef08ae35e40c8be6a2fa2c20f2d3" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "0950b15060067f752fde13a779a994f59516ce3d" },
|
"indent-blankline.nvim": { "branch": "master", "commit": "7871a88056f7144defca9c931e311a3134c5d509" },
|
||||||
"neodev.nvim": { "branch": "main", "commit": "02893eeb9d6e8503817bd52385e111cba9a90500" },
|
"lazy.nvim": { "branch": "main", "commit": "7967abe55752aa90532e6bb4bd4663fe27a264cb" },
|
||||||
"nvim-autopairs": { "branch": "master", "commit": "c15de7e7981f1111642e7e53799e1211d4606cb9" },
|
"lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" },
|
||||||
"nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" },
|
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
|
||||||
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "43894adcf10bb1190c2184bd7c1750e8ea2b3dce" },
|
||||||
|
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||||
|
"neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" },
|
||||||
|
"none-ls.nvim": { "branch": "main", "commit": "b7cf202083b18bc9319e4c8ad5341a3d09241192" },
|
||||||
|
"nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" },
|
||||||
|
"nvim-cmp": { "branch": "main", "commit": "f17d9b4394027ff4442b298398dfcaab97e40c4f" },
|
||||||
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
|
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "92166b89ab4b3d60f24e58170cac53b7141fd032" },
|
"nvim-lspconfig": { "branch": "master", "commit": "056f569f71e4b726323b799b9cfacc53653bceb3" },
|
||||||
"nvim-surround": { "branch": "main", "commit": "f1f0699a1d49f28e607ffa4361f1bbe757ac5ebc" },
|
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "3a74b5831058d0daf8952a5b8c556c61b30a3f46" },
|
"nvim-sops": { "branch": "main", "commit": "cb2209562d00ef8c6c88bdec836d9edb8fbb96ef" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "b77921fdc44833c994fdb389d658ccbce5490c16" },
|
"nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" },
|
||||||
"plenary": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
|
"nvim-treesitter": { "branch": "master", "commit": "37427012d1c77c544356bfff0c9acc88fd3256bc" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
|
"nvim-ufo": { "branch": "main", "commit": "c070ee849bfedb2ed778f60419a1eae8c8544be8" },
|
||||||
|
"nvim-web-devicons": { "branch": "master", "commit": "e87554285f581047b1bf236794b0eb812b444b87" },
|
||||||
|
"obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" },
|
||||||
|
"oil.nvim": { "branch": "master", "commit": "8ea40b5506115b6d355e304dd9ee5089f7d78601" },
|
||||||
|
"plenary": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
|
||||||
|
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
|
||||||
|
"promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" },
|
||||||
"search.nvim": { "branch": "main", "commit": "7b8f2315d031be73e14bc2d82386dfac15952614" },
|
"search.nvim": { "branch": "main", "commit": "7b8f2315d031be73e14bc2d82386dfac15952614" },
|
||||||
"telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" },
|
"statuscol.nvim": { "branch": "main", "commit": "8822f76e105549620ef9c0d96e7b95aedf14c490" },
|
||||||
"undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" },
|
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },
|
||||||
"vim-be-good": { "branch": "master", "commit": "4fa57b7957715c91326fcead58c1fa898b9b3625" },
|
"telescope.nvim": { "branch": "master", "commit": "85922dde3767e01d42a08e750a773effbffaea3e" },
|
||||||
"vim-fugitive": { "branch": "master", "commit": "4f59455d2388e113bd510e85b310d15b9228ca0d" },
|
"trouble.nvim": { "branch": "main", "commit": "3dc00c0447c016cd43e03054c3d49436a1f2076d" },
|
||||||
"vim-gitgutter": { "branch": "main", "commit": "e801371917e52805a4ceb1e93f55ed1fba712f82" }
|
"undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" },
|
||||||
}
|
"vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" },
|
||||||
|
"vim-helm": { "branch": "master", "commit": "ae1ebc160d2b9b90108477ab10df7a4fc501e358" }
|
||||||
|
}
|
||||||
|
|||||||
51
lua/crentist/autocmd.lua
Normal file
51
lua/crentist/autocmd.lua
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
local autocmd = vim.api.nvim_create_autocmd
|
||||||
|
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)
|
||||||
|
local opts = { buffer = e.buf }
|
||||||
|
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
|
||||||
|
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
|
||||||
|
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
|
||||||
|
vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts)
|
||||||
|
vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts)
|
||||||
|
vim.keymap.set("n", "<leader>vrr", function() builtin.lsp_references() end, opts)
|
||||||
|
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
|
||||||
|
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
|
||||||
|
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
|
||||||
|
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
|
||||||
|
vim.keymap.set("n", "<M-F>", function() vim.lsp.buf.format() end, opts)
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Add new line to the end of the file
|
||||||
|
autocmd({ 'BufWritePre' }, {
|
||||||
|
group = OnSaveGroup,
|
||||||
|
pattern = '*',
|
||||||
|
callback = function()
|
||||||
|
local n_lines = vim.api.nvim_buf_line_count(0)
|
||||||
|
local last_nonblank = vim.fn.prevnonblank(n_lines)
|
||||||
|
if last_nonblank <= n_lines then
|
||||||
|
vim.api.nvim_buf_set_lines(0,
|
||||||
|
last_nonblank, n_lines, true, { '' })
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Remove trailing spaces
|
||||||
|
autocmd({ 'BufWritePre' }, {
|
||||||
|
group = OnSaveGroup,
|
||||||
|
pattern = { "*" },
|
||||||
|
callback = function()
|
||||||
|
local save_cursor = vim.fn.winsaveview()
|
||||||
|
pcall(function() vim.cmd [[%s/\s\+$//e]] end)
|
||||||
|
vim.fn.winrestview(save_cursor)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
20
lua/crentist/filetype.lua
Normal file
20
lua/crentist/filetype.lua
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
vim.filetype.add({
|
||||||
|
extension = {
|
||||||
|
['tf'] = 'terraform',
|
||||||
|
},
|
||||||
|
pattern = {
|
||||||
|
['.*/playbooks/.*%.ya?ml'] = 'yaml.ansible',
|
||||||
|
['.*/roles/.*%.ya?ml'] = 'yaml.ansible',
|
||||||
|
['.*/tasks/.*%.ya?ml'] = 'yaml.ansible',
|
||||||
|
['.*/plays/.*%.ya?ml'] = 'yaml.ansible',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.filetype.add({
|
||||||
|
extension = {
|
||||||
|
j2 = 'jinja',
|
||||||
|
jinja = 'jinja',
|
||||||
|
jinja2 = 'jinja',
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
@@ -1,25 +1,8 @@
|
|||||||
require("crentist.remap")
|
require("crentist.remap")
|
||||||
require("crentist.set")
|
require("crentist.set")
|
||||||
require("crentist.lazy_init")
|
require("crentist.lazy_init")
|
||||||
|
require("crentist.autocmd")
|
||||||
|
require("crentist.filetype")
|
||||||
|
require("crentist.luasnip")
|
||||||
|
require("crentist.null-ls")
|
||||||
|
|
||||||
local augroup = vim.api.nvim_create_augroup
|
|
||||||
local CrentistGroup = augroup('Crentist', {})
|
|
||||||
local autocmd = vim.api.nvim_create_autocmd
|
|
||||||
|
|
||||||
autocmd('LspAttach', {
|
|
||||||
group = CrentistGroup,
|
|
||||||
callback = function(e)
|
|
||||||
local opts = { buffer = e.buf }
|
|
||||||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
|
|
||||||
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
|
|
||||||
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
|
|
||||||
vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts)
|
|
||||||
vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts)
|
|
||||||
vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.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>")
|
|
||||||
end
|
|
||||||
})
|
|
||||||
|
|||||||
@@ -1,16 +1,40 @@
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"ellisonleao/gruvbox.nvim",
|
'ellisonleao/gruvbox.nvim',
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
require("gruvbox").setup({})
|
local gruvbox = require('gruvbox')
|
||||||
vim.cmd("colorscheme 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.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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
4
lua/crentist/lazy/dressing.lua
Normal file
4
lua/crentist/lazy/dressing.lua
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
return {
|
||||||
|
'stevearc/dressing.nvim',
|
||||||
|
opts = {},
|
||||||
|
}
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
return {
|
|
||||||
"airblade/vim-gitgutter",
|
|
||||||
}
|
|
||||||
11
lua/crentist/lazy/gitsigns.lua
Normal file
11
lua/crentist/lazy/gitsigns.lua
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
return {
|
||||||
|
"lewis6991/gitsigns.nvim",
|
||||||
|
opts = {
|
||||||
|
current_line_blame = true,
|
||||||
|
attach_to_untracked = true,
|
||||||
|
current_line_blame_opts = {
|
||||||
|
delay = 500,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -7,8 +7,28 @@ return {
|
|||||||
|
|
||||||
harpoon:setup()
|
harpoon:setup()
|
||||||
|
|
||||||
|
-- basic telescope configuration
|
||||||
|
local conf = require("telescope.config").values
|
||||||
|
local function toggle_telescope(harpoon_files)
|
||||||
|
local file_paths = {}
|
||||||
|
for _, item in ipairs(harpoon_files.items) do
|
||||||
|
table.insert(file_paths, item.value)
|
||||||
|
end
|
||||||
|
|
||||||
|
require('telescope.pickers').new({}, {
|
||||||
|
prompt_title = "Harpoon",
|
||||||
|
finder = require("telescope.finders").new_table({
|
||||||
|
results = file_paths,
|
||||||
|
}),
|
||||||
|
previewer = conf.file_previewer({}),
|
||||||
|
sorter = conf.generic_sorter({}),
|
||||||
|
}):find()
|
||||||
|
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,
|
||||||
|
{ 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)
|
||||||
@@ -16,3 +36,4 @@ return {
|
|||||||
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,32 +1,65 @@
|
|||||||
return {
|
return {
|
||||||
"neovim/nvim-lspconfig",
|
'neovim/nvim-lspconfig',
|
||||||
|
tag = 'v1.0.0',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"williamboman/mason.nvim",
|
'williamboman/mason.nvim',
|
||||||
"williamboman/mason-lspconfig.nvim",
|
'williamboman/mason-lspconfig.nvim',
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
'hrsh7th/nvim-cmp',
|
||||||
"hrsh7th/cmp-buffer",
|
'hrsh7th/cmp-nvim-lsp',
|
||||||
"hrsh7th/cmp-path",
|
'hrsh7th/cmp-buffer',
|
||||||
"SergioRibera/cmp-dotenv",
|
'hrsh7th/cmp-path',
|
||||||
"hrsh7th/cmp-cmdline",
|
'SergioRibera/cmp-dotenv',
|
||||||
"hrsh7th/nvim-cmp",
|
'hrsh7th/cmp-cmdline',
|
||||||
"L3MON4D3/LuaSnip",
|
'saadparwaiz1/cmp_luasnip',
|
||||||
"saadparwaiz1/cmp_luasnip",
|
'L3MON4D3/LuaSnip',
|
||||||
"j-hui/fidget.nvim",
|
'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()
|
config = function()
|
||||||
local cmp = require('cmp')
|
local lspconfig = require('lspconfig')
|
||||||
local luasnip = require("luasnip")
|
|
||||||
|
|
||||||
require("fidget").setup({})
|
local cmp = require('cmp')
|
||||||
|
local luasnip = require('luasnip')
|
||||||
|
|
||||||
|
-- load snippets from friendly-snippets
|
||||||
|
require('luasnip.loaders.from_vscode').lazy_load()
|
||||||
|
|
||||||
|
require('fidget').setup({})
|
||||||
require('mason').setup({})
|
require('mason').setup({})
|
||||||
require('mason-lspconfig').setup({
|
require('mason-lspconfig').setup({
|
||||||
-- 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 = { 'tsserver', 'lua_ls', 'gopls', 'pylsp', 'gitlab_ci_ls', 'yamlls' },
|
ensure_installed = {
|
||||||
|
'ts_ls',
|
||||||
|
'lua_ls',
|
||||||
|
'gopls',
|
||||||
|
'pylsp',
|
||||||
|
'gitlab_ci_ls',
|
||||||
|
'yamlls',
|
||||||
|
'ansiblels',
|
||||||
|
'terraformls',
|
||||||
|
'helm_ls',
|
||||||
|
'marksman',
|
||||||
|
},
|
||||||
handlers = {
|
handlers = {
|
||||||
function(server_name)
|
function(server_name)
|
||||||
require('lspconfig')[server_name].setup({})
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
|
require('lspconfig')[server_name].setup({
|
||||||
|
capabilities = capabilities
|
||||||
|
})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -34,27 +67,23 @@ return {
|
|||||||
sources = {
|
sources = {
|
||||||
{ name = 'path' },
|
{ name = 'path' },
|
||||||
{ name = 'nvim_lsp' },
|
{ name = 'nvim_lsp' },
|
||||||
{ name = 'dotenv' },
|
|
||||||
{ name = 'luasnip', keyword_length = 2 },
|
{ name = 'luasnip', keyword_length = 2 },
|
||||||
{ name = 'buffer', keyword_length = 3 },
|
{ name = 'buffer', keyword_length = 3 },
|
||||||
},
|
},
|
||||||
mapping = cmp.mapping.preset.insert({
|
mapping = cmp.mapping.preset.insert({
|
||||||
-- `Enter` key to confirm completion
|
-- `Enter` key to confirm completion
|
||||||
['<CR>'] = cmp.mapping(function(fallback)
|
['<CR>'] = cmp.mapping({
|
||||||
if cmp.visible() then
|
i = function(fallback)
|
||||||
if luasnip.expandable() then
|
if cmp.visible() and cmp.get_active_entry() then
|
||||||
luasnip.expand()
|
cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })
|
||||||
else
|
else
|
||||||
cmp.confirm({
|
fallback()
|
||||||
select = true,
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
else
|
end,
|
||||||
fallback()
|
s = cmp.mapping.confirm({ select = true }),
|
||||||
end
|
c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }),
|
||||||
end),
|
}),
|
||||||
|
['<Tab>'] = cmp.mapping(function(fallback)
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item()
|
cmp.select_next_item()
|
||||||
elseif luasnip.locally_jumpable(1) then
|
elseif luasnip.locally_jumpable(1) then
|
||||||
@@ -62,9 +91,9 @@ return {
|
|||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end, { "i", "s" }),
|
end, { 'i', 's' }),
|
||||||
|
|
||||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_prev_item()
|
cmp.select_prev_item()
|
||||||
elseif luasnip.locally_jumpable(-1) then
|
elseif luasnip.locally_jumpable(-1) then
|
||||||
@@ -72,7 +101,7 @@ return {
|
|||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end, { "i", "s" }),
|
end, { 'i', 's' }),
|
||||||
|
|
||||||
-- Ctrl+Space to trigger completion menu
|
-- Ctrl+Space to trigger completion menu
|
||||||
['<C-Space>'] = cmp.mapping.complete(),
|
['<C-Space>'] = cmp.mapping.complete(),
|
||||||
@@ -88,5 +117,42 @@ return {
|
|||||||
},
|
},
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
|
local pythonLineLength = 95
|
||||||
|
lspconfig.pylsp.setup {
|
||||||
|
settings = {
|
||||||
|
pylsp = {
|
||||||
|
plugins = {
|
||||||
|
pycodestyle = {
|
||||||
|
ignore = { 'W391' },
|
||||||
|
maxLineLength = pythonLineLength
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
lspconfig.ansiblels.setup {}
|
||||||
|
|
||||||
|
lspconfig.lua_ls.setup {}
|
||||||
|
|
||||||
|
lspconfig.helm_ls.setup {
|
||||||
|
settings = {
|
||||||
|
['helm-ls'] = {
|
||||||
|
yamlls = {
|
||||||
|
path = 'yaml-language-server',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lspconfig.yamlls.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
}
|
||||||
|
|
||||||
|
lspconfig.terraformls.setup {
|
||||||
|
filetypes = { 'terraform', 'terraform-vars', 'tf' }
|
||||||
|
}
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
return {
|
return {
|
||||||
'nvim-lualine/lualine.nvim',
|
'nvim-lualine/lualine.nvim',
|
||||||
dependencies = { 'nvim-tree/nvim-web-devicons', branch = 'master' },
|
dependencies = {
|
||||||
|
{ 'nvim-tree/nvim-web-devicons', branch = 'master', },
|
||||||
|
'SmiteshP/nvim-navic',
|
||||||
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local colors = {
|
local colors = {
|
||||||
black = '#282828',
|
black = '#282828',
|
||||||
@@ -51,16 +54,16 @@ return {
|
|||||||
},
|
},
|
||||||
sections = {
|
sections = {
|
||||||
lualine_c = {
|
lualine_c = {
|
||||||
'filename',
|
{
|
||||||
function()
|
'filename',
|
||||||
return require("nvim-treesitter").statusline({
|
path = 4,
|
||||||
indicator_size = 70,
|
},
|
||||||
type_patterns = { "class", "function", "method" },
|
{
|
||||||
separator = " -> ",
|
'navic',
|
||||||
})
|
},
|
||||||
end,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
15
lua/crentist/lazy/navic.lua
Normal file
15
lua/crentist/lazy/navic.lua
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
return {
|
||||||
|
'SmiteshP/nvim-navic',
|
||||||
|
dependencies = {
|
||||||
|
'neovim/nvim-lspconfig'
|
||||||
|
},
|
||||||
|
config = function ()
|
||||||
|
local navic = require('nvim-navic')
|
||||||
|
navic.setup({
|
||||||
|
lsp = {
|
||||||
|
auto_attach = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
return {
|
|
||||||
{ "folke/neodev.nvim", opts = {} }
|
|
||||||
}
|
|
||||||
11
lua/crentist/lazy/none-ls.lua
Normal file
11
lua/crentist/lazy/none-ls.lua
Normal 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
|
||||||
|
}
|
||||||
|
|
||||||
62
lua/crentist/lazy/obsidian.lua
Normal file
62
lua/crentist/lazy/obsidian.lua
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
return {
|
||||||
|
'epwalsh/obsidian.nvim',
|
||||||
|
version = '*', -- recommended, use latest release instead of latest commit
|
||||||
|
-- lazy = true,
|
||||||
|
-- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault:
|
||||||
|
-- event = {
|
||||||
|
-- -- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'.
|
||||||
|
-- -- E.g. 'BufReadPre ' .. vim.fn.expand '~' .. '/my-vault/*.md'
|
||||||
|
-- -- refer to `:h file-pattern` for more examples
|
||||||
|
-- 'BufReadPre /Users/rtim/Documents/Notes/tech-work-hobby/*.md',
|
||||||
|
-- 'BufNewFile /Users/rtim/Documents/Notes/tech-work-hobby/*.md',
|
||||||
|
-- },
|
||||||
|
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',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
20
lua/crentist/lazy/oil.lua
Normal file
20
lua/crentist/lazy/oil.lua
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
return {
|
||||||
|
'stevearc/oil.nvim',
|
||||||
|
-- Optional dependencies
|
||||||
|
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||||
|
opts = {},
|
||||||
|
config = function()
|
||||||
|
require('oil').setup({
|
||||||
|
view_options = {
|
||||||
|
show_hidden = true,
|
||||||
|
},
|
||||||
|
keymaps = {
|
||||||
|
['<C-h>'] = false,
|
||||||
|
['<C-j>'] = false,
|
||||||
|
['<C-k>'] = false,
|
||||||
|
['<C-l>'] = false,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
13
lua/crentist/lazy/sops.lua
Normal file
13
lua/crentist/lazy/sops.lua
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
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
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{ '<leader>ef', vim.cmd.SopsEncrypt, desc = '[E]ncrypt [F]ile' },
|
||||||
|
{ '<leader>df', vim.cmd.SopsDecrypt, desc = '[D]ecrypt [F]ile' },
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -1,14 +1,39 @@
|
|||||||
return {
|
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' }
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
version = "0.1.6",
|
|
||||||
|
|
||||||
config = function()
|
config = function()
|
||||||
require('telescope').setup({})
|
local telescope = require('telescope')
|
||||||
|
local telescopeConfig = require('telescope.config')
|
||||||
|
|
||||||
|
local vimgrep_arguments = { unpack(telescopeConfig.values.vimgrep_arguments) }
|
||||||
|
table.insert(vimgrep_arguments, '--hidden')
|
||||||
|
table.insert(vimgrep_arguments, '--glob')
|
||||||
|
table.insert(vimgrep_arguments, '!**/.git/*')
|
||||||
|
|
||||||
|
telescope.setup({
|
||||||
|
defaults = {
|
||||||
|
vimgrep_arguments = vimgrep_arguments,
|
||||||
|
file_ignore_patterns = {
|
||||||
|
'node_modules',
|
||||||
|
'.git/'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
extensions = {
|
||||||
|
fzf = {}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
telescope.load_extension('fzf')
|
||||||
|
|
||||||
local search = require('search')
|
local search = require('search')
|
||||||
local builtin = require('telescope.builtin')
|
local builtin = require('telescope.builtin')
|
||||||
|
|
||||||
@@ -17,9 +42,14 @@ return {
|
|||||||
next = '<Tab>',
|
next = '<Tab>',
|
||||||
prev = '<S-Tab>'
|
prev = '<S-Tab>'
|
||||||
},
|
},
|
||||||
|
tabs = {
|
||||||
|
{ name = 'Files', tele_func = builtin.find_files, tele_opts = { no_ignore = true, hidden = true } },
|
||||||
|
{ name = 'Grep', tele_func = builtin.live_grep },
|
||||||
|
{ name = 'Buffers', tele_func = builtin.buffers },
|
||||||
|
},
|
||||||
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
|
||||||
{
|
{
|
||||||
'Commits', -- or name = "Commits"
|
'Commits', -- or name = 'Commits'
|
||||||
builtin.git_commits, -- or tele_func = require('telescope.builtin').git_commits
|
builtin.git_commits, -- or tele_func = require('telescope.builtin').git_commits
|
||||||
available = function() -- optional
|
available = function() -- optional
|
||||||
return vim.fn.isdirectory('.git') == 1
|
return vim.fn.isdirectory('.git') == 1
|
||||||
@@ -29,17 +59,21 @@ return {
|
|||||||
})
|
})
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>pf', search.open, {})
|
vim.keymap.set('n', '<leader>pf', search.open, {})
|
||||||
|
vim.keymap.set('n', '<leader>pb', function()
|
||||||
|
search.open({ tab_name = 'Buffers' })
|
||||||
|
end)
|
||||||
vim.keymap.set('n', '<leader>pws', function()
|
vim.keymap.set('n', '<leader>pws', function()
|
||||||
local word = vim.fn.expand("<cword>")
|
local word = vim.fn.expand('<cword>')
|
||||||
builtin.grep_string({ search = word })
|
builtin.grep_string({ search = word })
|
||||||
end)
|
end)
|
||||||
vim.keymap.set('n', '<leader>pWs', function()
|
vim.keymap.set('n', '<leader>pWs', function()
|
||||||
local word = vim.fn.expand("<cWORD>")
|
local word = vim.fn.expand('<cWORD>')
|
||||||
builtin.grep_string({ search = word })
|
builtin.grep_string({ search = word })
|
||||||
end)
|
end)
|
||||||
vim.keymap.set('n', '<leader>ps', function()
|
vim.keymap.set('n', '<leader>ps', function()
|
||||||
builtin.grep_string({ search = vim.fn.input("Grep > ") })
|
builtin.grep_string({ search = vim.fn.input('Grep > ') })
|
||||||
end)
|
end)
|
||||||
vim.keymap.set('n', '<leader>vh', builtin.help_tags, {})
|
vim.keymap.set('n', '<leader>vh', builtin.help_tags, {})
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
return {
|
return {
|
||||||
"nvim-treesitter/nvim-treesitter",
|
'nvim-treesitter/nvim-treesitter',
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
config = function()
|
config = function()
|
||||||
require("nvim-treesitter.configs").setup({
|
require("nvim-treesitter.configs").setup({
|
||||||
@@ -28,3 +28,4 @@ return {
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
37
lua/crentist/lazy/trouble.lua
Normal file
37
lua/crentist/lazy/trouble.lua
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
return {
|
||||||
|
"folke/trouble.nvim",
|
||||||
|
opts = {}, -- for default options, refer to the configuration section for custom setup.
|
||||||
|
cmd = "Trouble",
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>tt",
|
||||||
|
"<cmd>Trouble diagnostics toggle<cr>",
|
||||||
|
desc = "Diagnostics (Trouble)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>tT",
|
||||||
|
"<cmd>Trouble diagnostics toggle filter.buf=0<cr>",
|
||||||
|
desc = "Buffer Diagnostics (Trouble)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>ts",
|
||||||
|
"<cmd>Trouble symbols toggle focus=false<cr>",
|
||||||
|
desc = "Symbols (Trouble)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>tl",
|
||||||
|
"<cmd>Trouble lsp toggle focus=false win.position=right<cr>",
|
||||||
|
desc = "LSP Definitions / references / ... (Trouble)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>tL",
|
||||||
|
"<cmd>Trouble loclist toggle<cr>",
|
||||||
|
desc = "Location List (Trouble)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>tQ",
|
||||||
|
"<cmd>Trouble qflist toggle<cr>",
|
||||||
|
desc = "Quickfix List (Trouble)",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
43
lua/crentist/lazy/ufo.lua
Normal file
43
lua/crentist/lazy/ufo.lua
Normal 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
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
return {
|
|
||||||
'ThePrimeagen/vim-be-good'
|
|
||||||
}
|
|
||||||
110
lua/crentist/luasnip.lua
Normal file
110
lua/crentist/luasnip.lua
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
-- luasnip.lua
|
||||||
|
local ls = require('luasnip')
|
||||||
|
local s = ls.snippet
|
||||||
|
local i = ls.insert_node
|
||||||
|
local f = ls.function_node
|
||||||
|
local fmt = require("luasnip.extras.fmt").fmt
|
||||||
|
|
||||||
|
vim.keymap.set({ "i", "s" }, "<C-l>", function()
|
||||||
|
if ls.expand_or_jumpable() then
|
||||||
|
ls.expand_or_jump()
|
||||||
|
end
|
||||||
|
end, { desc = "Snippet next argument", silent = true })
|
||||||
|
|
||||||
|
--------------------
|
||||||
|
-- Snippets for LUA
|
||||||
|
--------------------
|
||||||
|
ls.add_snippets('lua', {
|
||||||
|
s({ name = 'LuaSnip Snippet', trig = 'snipf' },
|
||||||
|
fmt([[
|
||||||
|
s({ name='<name>', trig='<trig>'},
|
||||||
|
fmt(<template>,
|
||||||
|
{ <inputs> },
|
||||||
|
{ <opts> }
|
||||||
|
)
|
||||||
|
),
|
||||||
|
]], {
|
||||||
|
name = i(1, 'name'),
|
||||||
|
trig = i(2, 'trig'),
|
||||||
|
template = i(3, '[[]]'),
|
||||||
|
inputs = i(4, 'nodes'),
|
||||||
|
opts = i(5,
|
||||||
|
'opts')
|
||||||
|
},
|
||||||
|
{ delimiters = '<>' }
|
||||||
|
)
|
||||||
|
),
|
||||||
|
s({ name = 'Add snippets block', trig = 'add_snip' },
|
||||||
|
fmt([[
|
||||||
|
ls.add_snippets('<filetype>', {
|
||||||
|
<snippets>
|
||||||
|
})
|
||||||
|
]],
|
||||||
|
{ filetype = i(1, 'Filetype'), snippets = i(2, 'Snippets') },
|
||||||
|
{ delimiters = '<>' }
|
||||||
|
)
|
||||||
|
),
|
||||||
|
})
|
||||||
|
|
||||||
|
--------------------
|
||||||
|
-- Generic snippets
|
||||||
|
--------------------
|
||||||
|
local function com_string(_, snip, to_multiply)
|
||||||
|
local comment_string = vim.bo.commentstring
|
||||||
|
local repeats = snip.captures[1]
|
||||||
|
local result = comment_string:gsub("%%s", ""):gsub(" ", "")
|
||||||
|
|
||||||
|
if to_multiply then
|
||||||
|
return string.sub(
|
||||||
|
string.rep(result, repeats),
|
||||||
|
0,
|
||||||
|
repeats
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|
||||||
|
ls.add_snippets('all', {
|
||||||
|
s({ name = 'Comment block', trig = '#com(%d+)', regTrig = true },
|
||||||
|
fmt([[
|
||||||
|
{comment_block}
|
||||||
|
{comment} {comment_text}
|
||||||
|
{comment_block}
|
||||||
|
]],
|
||||||
|
{
|
||||||
|
comment_block = f(com_string, {}, { user_args = { true } }),
|
||||||
|
comment = f(com_string, {}, { user_args = { false } }),
|
||||||
|
comment_text = i(1,
|
||||||
|
'Comment')
|
||||||
|
}
|
||||||
|
)
|
||||||
|
),
|
||||||
|
})
|
||||||
|
|
||||||
|
--------------------
|
||||||
|
-- Terraform
|
||||||
|
--------------------
|
||||||
|
ls.add_snippets('terraform', {
|
||||||
|
s({ name = 'data_assume', trig = 'tf_assume' },
|
||||||
|
fmt([[
|
||||||
|
data "aws_iam_policy_document" "<name>" {
|
||||||
|
statement {
|
||||||
|
actions = ["sts:AssumeRole"]
|
||||||
|
|
||||||
|
principals {
|
||||||
|
type = "Service"
|
||||||
|
identifiers = ["<service>.amazonaws.com"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]],
|
||||||
|
{
|
||||||
|
name = i(1, 'assume'),
|
||||||
|
service = i(2, 'service')
|
||||||
|
},
|
||||||
|
{ delimiters = '<>' }
|
||||||
|
)
|
||||||
|
),
|
||||||
|
})
|
||||||
|
|
||||||
42
lua/crentist/null-ls.lua
Normal file
42
lua/crentist/null-ls.lua
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
-- https://www.youtube.com/watch?v=q-oBU2fO1H4&t=189s
|
||||||
|
local null_ls = require("null-ls")
|
||||||
|
|
||||||
|
-- local function check_if_comment(node, params)
|
||||||
|
-- if node == 'nil' then return false
|
||||||
|
-- if node:type() ~= 'comment' or node:type() ~= 'comment_content' then return false end
|
||||||
|
--
|
||||||
|
-- if node:type() == 'comment' then
|
||||||
|
-- local child = node:child()
|
||||||
|
--
|
||||||
|
-- if child == 'nil' then return false end
|
||||||
|
-- end
|
||||||
|
--
|
||||||
|
-- -- node exists and is a part of comment
|
||||||
|
-- if node == 'nil' or node:type() ~= 'comment' or node:type() ~= 'comment_content' then return false end
|
||||||
|
--
|
||||||
|
-- local parent = node:parent()
|
||||||
|
-- if parent == 'nil' or parent:type() ~= 'comment' then return false end
|
||||||
|
--
|
||||||
|
-- local text = vim.treesitter.get_node_text(node, )
|
||||||
|
-- end
|
||||||
|
|
||||||
|
-- null_ls.register({
|
||||||
|
-- name = 'Comment actions',
|
||||||
|
-- method = null_ls.methods.CODE_ACTION,
|
||||||
|
-- filetypes = {},
|
||||||
|
-- generator = {
|
||||||
|
-- fn = function(params)
|
||||||
|
-- local out = {}
|
||||||
|
--
|
||||||
|
-- table.insert(out,
|
||||||
|
-- {
|
||||||
|
-- title = 'Test',
|
||||||
|
-- action = function()
|
||||||
|
-- print(vim.treesitter.get_node())
|
||||||
|
-- end
|
||||||
|
-- })
|
||||||
|
-- return out
|
||||||
|
-- end
|
||||||
|
-- }
|
||||||
|
-- })
|
||||||
|
|
||||||
@@ -1,18 +1,22 @@
|
|||||||
vim.g.mapleader = " "
|
vim.g.mapleader = " "
|
||||||
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
|
vim.keymap.set("n", "<leader>Pv", ":Oil .<CR>")
|
||||||
|
vim.keymap.set("n", "<leader>pv", ":Oil<CR>")
|
||||||
|
|
||||||
-- move selected blocks
|
vim.keymap.set("n", "<C-d>", "<C-d>zz")
|
||||||
|
vim.keymap.set("n", "<C-u>", "<C-u>zz")
|
||||||
|
|
||||||
|
-- move selected blocks
|
||||||
vim.keymap.set("v", "<S-J>", ":m '>+1<CR>gv=gv")
|
vim.keymap.set("v", "<S-J>", ":m '>+1<CR>gv=gv")
|
||||||
vim.keymap.set("v", "<S-K>", ":m '<-2<CR>gv=gv")
|
vim.keymap.set("v", "<S-K>", ":m '<-2<CR>gv=gv")
|
||||||
|
|
||||||
-- keep cursor on J
|
-- keep cursor on J
|
||||||
vim.keymap.set("n", "J", "mzJ`z")
|
vim.keymap.set("n", "J", "mzJ`z")
|
||||||
-- keep search in the middle
|
-- keep search in the middle
|
||||||
vim.keymap.set("n", "n", "nzzzv")
|
vim.keymap.set("n", "n", "nzzzv")
|
||||||
vim.keymap.set("n", "N", "Nzzzv")
|
vim.keymap.set("n", "N", "Nzzzv")
|
||||||
|
|
||||||
-- greatest remap ever
|
-- greatest remap ever
|
||||||
-- save register on pasting
|
-- save register on pasting
|
||||||
vim.keymap.set("x", "<leader>p", [["_dP]])
|
vim.keymap.set("x", "<leader>p", [["_dP]])
|
||||||
|
|
||||||
-- next greatest remap ever : asbjornHaland
|
-- next greatest remap ever : asbjornHaland
|
||||||
@@ -24,3 +28,13 @@ 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", "<C-s>", "<cmd>silent !tmux neww tmux-sessionizer<CR>")
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<space><space>x", "<cmd>source %<CR>")
|
||||||
|
vim.keymap.set("n", "<space>x", ":.lua<CR>")
|
||||||
|
vim.keymap.set("v", "<space>x", ":lua<CR>")
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<M-j>", "<cmd>cnext<CR>")
|
||||||
|
vim.keymap.set("n", "<M-k>", "<cmd>cprev<CR>")
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ vim.opt.incsearch = true
|
|||||||
vim.opt.termguicolors = true
|
vim.opt.termguicolors = true
|
||||||
|
|
||||||
vim.opt.scrolloff = 8
|
vim.opt.scrolloff = 8
|
||||||
vim.opt.signcolumn = "yes"
|
vim.opt.signcolumn = "yes:1"
|
||||||
vim.opt.isfname:append("@-@")
|
vim.opt.isfname:append("@-@")
|
||||||
|
|
||||||
vim.opt.updatetime = 50
|
vim.opt.updatetime = 50
|
||||||
|
|||||||
Reference in New Issue
Block a user