6 Commits

Author SHA1 Message Date
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
10 changed files with 78 additions and 178 deletions

View File

@@ -1,48 +1,39 @@
{ {
"LuaSnip": { "branch": "master", "commit": "0f7bbce41ea152a94d12aea286f2ce98e63c0f58" }, "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "blink.cmp": { "branch": "main", "commit": "5f442681df24fe705d1ee7ce5b4d435aa4b4dee4" },
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" },
"cmp-dotenv": { "branch": "main", "commit": "4dd53aab60982f1f75848aec5e6214986263325e" }, "fidget.nvim": { "branch": "main", "commit": "9238947645ce17d96f30842e61ba81147185b657" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "gruvbox.nvim": { "branch": "main", "commit": "68c3460a5d1d1a362318960035c9f3466d5011f5" },
"dressing.nvim": { "branch": "master", "commit": "fc78a3ca96f4db9f8893bb7e2fd9823e0780451b" },
"fidget.nvim": { "branch": "main", "commit": "e2a175c2abe2d4f65357da1c98c59a5cfb2b543f" },
"friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" },
"gitsigns.nvim": { "branch": "main", "commit": "ac5aba6dce8c06ea22bea2c9016f51a2dbf90dc7" },
"gruvbox.nvim": { "branch": "main", "commit": "49d9c0b150ba70efcd831ec7b3cb8ee740067045" },
"harpoon": { "branch": "harpoon2", "commit": "a84ab829eaf3678b586609888ef52f7779102263" }, "harpoon": { "branch": "harpoon2", "commit": "a84ab829eaf3678b586609888ef52f7779102263" },
"hererocks": { "branch": "master", "commit": "c9c5444dea1e07e005484014a8231aa667be30b6" }, "hererocks": { "branch": "master", "commit": "c9c5444dea1e07e005484014a8231aa667be30b6" },
"icon-picker.nvim": { "branch": "master", "commit": "3ee9a0ea9feeef08ae35e40c8be6a2fa2c20f2d3" }, "indent-blankline.nvim": { "branch": "master", "commit": "259357fa4097e232730341fa60988087d189193a" },
"indent-blankline.nvim": { "branch": "master", "commit": "7871a88056f7144defca9c931e311a3134c5d509" }, "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" },
"lazy.nvim": { "branch": "main", "commit": "7967abe55752aa90532e6bb4bd4663fe27a264cb" }, "lazydev.nvim": { "branch": "main", "commit": "8620f82ee3f59ff2187647167b6b47387a13a018" },
"lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" },
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "43894adcf10bb1190c2184bd7c1750e8ea2b3dce" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "2daa8921b7afdcfa47419a21ea343c3df6d74fa0" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, "mini.surround": { "branch": "main", "commit": "0e67c4bc147f2a15cee94e7c94dcc0e115b9f55e" },
"none-ls.nvim": { "branch": "main", "commit": "b7cf202083b18bc9319e4c8ad5341a3d09241192" }, "none-ls.nvim": { "branch": "main", "commit": "40dc2e983560acaea29d6312b33fafba37b0c272" },
"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": "056f569f71e4b726323b799b9cfacc53653bceb3" }, "nvim-lspconfig": { "branch": "master", "commit": "056f569f71e4b726323b799b9cfacc53653bceb3" },
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
"nvim-sops": { "branch": "main", "commit": "cb2209562d00ef8c6c88bdec836d9edb8fbb96ef" }, "nvim-sops": { "branch": "main", "commit": "cb2209562d00ef8c6c88bdec836d9edb8fbb96ef" },
"nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, "nvim-treesitter": { "branch": "master", "commit": "50947387c20ec3fb8c30b8c1c1a1c39f68deb970" },
"nvim-treesitter": { "branch": "master", "commit": "37427012d1c77c544356bfff0c9acc88fd3256bc" }, "nvim-ufo": { "branch": "main", "commit": "270ca542dae992ffe40274718c63645217ebc8bf" },
"nvim-ufo": { "branch": "main", "commit": "c070ee849bfedb2ed778f60419a1eae8c8544be8" }, "nvim-web-devicons": { "branch": "master", "commit": "15c7d0f616ebf88960ce5c4221828f62789d36d9" },
"nvim-web-devicons": { "branch": "master", "commit": "e87554285f581047b1bf236794b0eb812b444b87" },
"obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" }, "obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" },
"oil.nvim": { "branch": "master", "commit": "8ea40b5506115b6d355e304dd9ee5089f7d78601" }, "oil.nvim": { "branch": "master", "commit": "ba858b662599eab8ef1cba9ab745afded99cb180" },
"plenary": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "plenary": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
"promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" },
"search.nvim": { "branch": "main", "commit": "7b8f2315d031be73e14bc2d82386dfac15952614" }, "search.nvim": { "branch": "main", "commit": "7b8f2315d031be73e14bc2d82386dfac15952614" },
"statuscol.nvim": { "branch": "main", "commit": "8822f76e105549620ef9c0d96e7b95aedf14c490" }, "statuscol.nvim": { "branch": "main", "commit": "8822f76e105549620ef9c0d96e7b95aedf14c490" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" },
"telescope.nvim": { "branch": "master", "commit": "85922dde3767e01d42a08e750a773effbffaea3e" }, "telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" },
"trouble.nvim": { "branch": "main", "commit": "3dc00c0447c016cd43e03054c3d49436a1f2076d" }, "trouble.nvim": { "branch": "main", "commit": "46cf952fc115f4c2b98d4e208ed1e2dce08c9bf6" },
"undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" }, "undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" },
"vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, "vim-fugitive": { "branch": "master", "commit": "fcb4db52e7f65b95705aa58f0f2df1312c1f2df2" },
"vim-helm": { "branch": "master", "commit": "ae1ebc160d2b9b90108477ab10df7a4fc501e358" } "vim-helm": { "branch": "master", "commit": "ae1ebc160d2b9b90108477ab10df7a4fc501e358" }
} }

View File

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

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 = {
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 = "auto_insert" } },
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', 'luasnip', 'path', 'buffer' },
cmdline = {},
},
signature = { enabled = true }
},
}

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

@@ -4,13 +4,7 @@ return {
dependencies = { dependencies = {
'williamboman/mason.nvim', 'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim', 'williamboman/mason-lspconfig.nvim',
'hrsh7th/nvim-cmp', 'saghen/blink.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',
@@ -31,9 +25,6 @@ return {
config = function() config = function()
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()
@@ -56,69 +47,14 @@ return {
}, },
handlers = { handlers = {
function(server_name) function(server_name)
local capabilities = require('cmp_nvim_lsp').default_capabilities() local capabilities = require('blink.cmp').get_lsp_capabilities()
require('lspconfig')[server_name].setup({ require('lspconfig')[server_name].setup({
capabilities = capabilities capabilities = capabilities
}) })
end, 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 capabilities = require('cmp_nvim_lsp').default_capabilities()
local pythonLineLength = 95 local pythonLineLength = 95
lspconfig.pylsp.setup { lspconfig.pylsp.setup {
settings = { settings = {
@@ -146,9 +82,7 @@ return {
} }
} }
lspconfig.yamlls.setup { lspconfig.yamlls.setup { }
capabilities = capabilities,
}
lspconfig.terraformls.setup { lspconfig.terraformls.setup {
filetypes = { 'terraform', 'terraform-vars', 'tf' } filetypes = { 'terraform', 'terraform-vars', 'tf' }

View File

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

View File

@@ -1,15 +1,6 @@
return { return {
'epwalsh/obsidian.nvim', 'epwalsh/obsidian.nvim',
version = '*', -- recommended, use latest release instead of latest commit 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 = { dependencies = {
-- Required. -- Required.
'nvim-lua/plenary.nvim', 'nvim-lua/plenary.nvim',

View File

@@ -1,10 +0,0 @@
return {
"kylechui/nvim-surround",
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
})
end
}

View File

@@ -1,42 +1,3 @@
-- https://www.youtube.com/watch?v=q-oBU2fO1H4&t=189s -- https://www.youtube.com/watch?v=q-oBU2fO1H4&t=189s
local null_ls = require("null-ls") 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
-- }
-- })

View File

@@ -31,9 +31,9 @@ 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", "<C-s>", "<cmd>silent !tmux neww tmux-sessionizer<CR>")
vim.keymap.set("n", "<space><space>x", "<cmd>source %<CR>") vim.keymap.set("n", "<leader><leader>x", "<cmd>source %<CR>")
vim.keymap.set("n", "<space>x", ":.lua<CR>") vim.keymap.set("n", "<leader>x", ":.lua<CR>")
vim.keymap.set("v", "<space>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-j>", "<cmd>cnext<CR>")
vim.keymap.set("n", "<M-k>", "<cmd>cprev<CR>") vim.keymap.set("n", "<M-k>", "<cmd>cprev<CR>")