Skip to content

Commit

Permalink
chore: renamed plugins.config to my_config and updated imports
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham-cpp committed Jan 14, 2025
1 parent 8ed4636 commit 1f0ef83
Show file tree
Hide file tree
Showing 32 changed files with 139 additions and 116 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ require('catppuccin').setup({
shade = 'dark',
percentage = 0.15, -- percentage of the shade to apply to the inactive window
},
integrations = {
navic = {
enabled = true,
},
blink_cmp = true,
fzf = true,
},
custom_highlights = function(colors)
return {
QuickScopePrimary = { fg = '#dfbb78', bg = '#505050', style = { 'underline', 'bold' } },
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions .config/nvim/lua/plugins/avante.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ return {
version = false,
build = 'make',
opts = function()
vim.env.GEMINI_API_KEY = require('plugins.config.util').get_age_credentials 'gemini_api.age'
vim.env.GEMINI_API_KEY = require('my_config.util').get_age_credentials 'gemini_api.age'
if not vim.env.GEMINI_API_KEY then
return get_ollama_setup()
end
Expand Down Expand Up @@ -144,7 +144,7 @@ return {
env = {
url = 'https://glhf.chat',
api_key = function()
return require('plugins.config.util').get_age_credentials 'glhf.age'
return require('my_config.util').get_age_credentials 'glhf.age'
end,
chat_url = '/api/openai/v1/chat/completions',
},
Expand Down
117 changes: 63 additions & 54 deletions .config/nvim/lua/plugins/blink-cmp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ local trigger_text = ';'
---@type LazySpec
return {
'Saghen/blink.cmp',
enabled = false,
enabled = true,
version = '*',
dependencies = {
'mikavilpas/blink-ripgrep.nvim',
{
'folke/lazydev.nvim',
ft = 'lua', -- only load on lua files
dependencies = { 'Bilal2453/luvit-meta' },
opts = {
library = {
'lazy.nvim',
Expand All @@ -19,7 +20,6 @@ return {
},
},
},
{ 'Bilal2453/luvit-meta', lazy = true },
{
'L3MON4D3/LuaSnip',
version = 'v2.*',
Expand Down Expand Up @@ -64,6 +64,13 @@ return {
['<C-j>'] = { 'select_next', 'fallback' },
['<Tab>'] = { 'select_next', 'snippet_forward', 'fallback' },
['<S-Tab>'] = { 'select_prev', 'snippet_backward', 'fallback' },
-- show with a list of providers
['<C-x><C-x>'] = {
function(cmp)
cmp.show({ providers = { 'snippets' } })
end,
'fallback',
},
cmdline = {
preset = 'enter',
['<Up>'] = {},
Expand All @@ -88,12 +95,12 @@ return {
},
sources = {
default = {
'lazydev',
'lsp',
'path',
'snippets',
'buffer',
'snippets',
'ripgrep',
'lazydev',
},
providers = {
ripgrep = {
Expand All @@ -111,77 +118,79 @@ return {
lazydev = {
name = 'LazyDev',
module = 'lazydev.integrations.blink',
-- make lazydev completions top priority (see `:h blink.cmp`)
score_offset = 100,
},
lsp = {
name = 'lsp',
enabled = true,
name = 'LSP',
module = 'blink.cmp.sources.lsp',
kind = 'LSP',
fallbacks = { 'snippets', 'buffer' },
score_offset = 95, -- the higher the number, the higher the priority
fallbacks = { 'lazydev' },
score_offset = 150, -- the higher the number, the higher the priority
-- Filter text items from the LSP provider, since we have the buffer provider for that
transform_items = function(_, items)
for _, item in ipairs(items) do
if item.kind == require('blink.cmp.types').CompletionItemKind.Snippet then
item.score_offset = item.score_offset - 3
end
end

return vim.tbl_filter(function(item)
return item.kind ~= require('blink.cmp.types').CompletionItemKind.Text
end, items)
end,
},
path = {
name = 'Path',
module = 'blink.cmp.sources.path',
score_offset = 25,
fallbacks = { 'buffer' },
-- fallbacks = { 'buffer' },
opts = {
trailing_slash = false,
label_trailing_slash = true,
get_cwd = function(context)
return vim.fn.expand(('#%d:p:h'):format(context.bufnr))
end,
show_hidden_files_by_default = true,
},
},
buffer = {
name = 'Buffer',
enabled = true,
module = 'blink.cmp.sources.buffer',
min_keyword_length = 3,
score_offset = 15, -- the higher the number, the higher the priority
},
snippets = {
name = 'snippets',
enabled = true,
min_keyword_length = 2,
name = 'Snippets',
module = 'blink.cmp.sources.snippets',
score_offset = 80, -- the higher the number, the higher the priority
-- Only show snippets if I type the trigger_text characters, so
-- to expand the "bash" snippet, if the trigger_text is ";" I have to
should_show_items = function()
local col = vim.api.nvim_win_get_cursor(0)[2]
local before_cursor = vim.api.nvim_get_current_line():sub(1, col)
-- NOTE: remember that `trigger_text` is modified at the top of the file
return before_cursor:match(trigger_text .. '%w*$') ~= nil
end,
-- After accepting the completion, delete the trigger_text characters
-- from the final inserted text
transform_items = function(_, items)
local col = vim.api.nvim_win_get_cursor(0)[2]
local before_cursor = vim.api.nvim_get_current_line():sub(1, col)
local trigger_pos = before_cursor:find(trigger_text .. '[^' .. trigger_text .. ']*$')
if trigger_pos then
for _, item in ipairs(items) do
item.textEdit = {
newText = item.insertText or item.label,
range = {
start = { line = vim.fn.line '.' - 1, character = trigger_pos - 1 },
['end'] = { line = vim.fn.line '.' - 1, character = col },
},
}
end
end
-- NOTE: After the transformation, I have to reload the luasnip source
-- Otherwise really crazy shit happens and I spent way too much time
-- figurig this out
vim.schedule(function()
require('blink.cmp').reload 'snippets'
end)
return items
end,
min_keyword_length = 2,
score_offset = 60, -- the higher the number, the higher the priority
-- -- Only show snippets if I type the trigger_text characters, so
-- -- to expand the "bash" snippet, if the trigger_text is ";" I have to
-- should_show_items = function()
-- local col = vim.api.nvim_win_get_cursor(0)[2]
-- local before_cursor = vim.api.nvim_get_current_line():sub(1, col)
-- -- NOTE: remember that `trigger_text` is modified at the top of the file
-- return before_cursor:match(trigger_text .. '%w*$') ~= nil
-- end,
-- -- After accepting the completion, delete the trigger_text characters
-- -- from the final inserted text
-- transform_items = function(_, items)
-- local col = vim.api.nvim_win_get_cursor(0)[2]
-- local before_cursor = vim.api.nvim_get_current_line():sub(1, col)
-- local trigger_pos = before_cursor:find(trigger_text .. '[^' .. trigger_text .. ']*$')
-- if trigger_pos then
-- for _, item in ipairs(items) do
-- item.textEdit = {
-- newText = item.insertText or item.label,
-- range = {
-- start = { line = vim.fn.line '.' - 1, character = trigger_pos - 1 },
-- ['end'] = { line = vim.fn.line '.' - 1, character = col },
-- },
-- }
-- end
-- end
-- -- NOTE: After the transformation, I have to reload the luasnip source
-- -- Otherwise really crazy shit happens and I spent way too much time
-- -- figurig this out
-- vim.schedule(function()
-- require('blink.cmp').reload 'snippets'
-- end)
-- return items
-- end,
},
},
cmdline = function()
Expand Down
2 changes: 1 addition & 1 deletion .config/nvim/lua/plugins/dial.lua
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ return {
},
lua = {
augend.integer.alias.decimal, -- nonnegative and negative decimal number
augend.constant.alias.bool, -- boolean value (true <-> false)
augend.constant.alias.bool,
augend.constant.new({
elements = { 'and', 'or' },
word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc.
Expand Down
30 changes: 15 additions & 15 deletions .config/nvim/lua/plugins/fzf-lua.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,21 +103,21 @@ return {
-- ['--tiebreak'] = 'end',
},
winopts = { preview = { default = 'bat' } },
hls = {
normal = hl_validate 'TelescopeNormal',
border = hl_validate 'TelescopeBorder',
title = hl_validate 'TelescopePromptTitle',
help_normal = hl_validate 'TelescopeNormal',
help_border = hl_validate 'TelescopeBorder',
preview_normal = hl_validate 'TelescopeNormal',
preview_border = hl_validate 'TelescopeBorder',
preview_title = hl_validate 'TelescopePreviewTitle',
-- builtin preview only
cursor = hl_validate 'Cursor',
cursorline = hl_validate 'TelescopeSelection',
cursorlinenr = hl_validate 'TelescopeSelection',
search = hl_validate 'IncSearch',
},
-- hls = {
-- normal = hl_validate 'TelescopeNormal',
-- border = hl_validate 'TelescopeBorder',
-- title = hl_validate 'TelescopePromptTitle',
-- help_normal = hl_validate 'TelescopeNormal',
-- help_border = hl_validate 'TelescopeBorder',
-- preview_normal = hl_validate 'TelescopeNormal',
-- preview_border = hl_validate 'TelescopeBorder',
-- preview_title = hl_validate 'TelescopePreviewTitle',
-- -- builtin preview only
-- cursor = hl_validate 'Cursor',
-- cursorline = hl_validate 'TelescopeSelection',
-- cursorlinenr = hl_validate 'TelescopeSelection',
-- search = hl_validate 'IncSearch',
-- },
keymap = {
fzf = {
true,
Expand Down
2 changes: 1 addition & 1 deletion .config/nvim/lua/plugins/lsp/astrolsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ return {
},
handlers = {
function(server, opts)
opts.capabilities = require('plugins.config.util').get_lsp_capabilities(opts.capabilities)
opts.capabilities = require('my_config.util').get_lsp_capabilities(opts.capabilities)
require('lspconfig')[server].setup(opts)
end,
efm = false,
Expand Down
4 changes: 2 additions & 2 deletions .config/nvim/lua/plugins/lsp/cpp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ return {
{
'williamboman/mason.nvim',
opts = function(_, opts)
opts.ensure_installed = require('plugins.config.util').unique_append_table(opts.ensure_installed, {
opts.ensure_installed = require('my_config.util').unique_append_table(opts.ensure_installed, {
'clangd',
})
return opts
Expand All @@ -12,7 +12,7 @@ return {
{
'nvim-treesitter/nvim-treesitter',
opts = function(_, opts)
opts.ensure_installed = require('plugins.config.util').unique_append_table(opts.ensure_installed, {
opts.ensure_installed = require('my_config.util').unique_append_table(opts.ensure_installed, {
'c',
'cpp',
'make',
Expand Down
6 changes: 3 additions & 3 deletions .config/nvim/lua/plugins/lsp/elixir.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ return {
{
'williamboman/mason.nvim',
opts = function(_, opts)
opts.ensure_installed = require('plugins.config.util').unique_append_table(opts.ensure_installed, {
opts.ensure_installed = require('my_config.util').unique_append_table(opts.ensure_installed, {
'elixir-ls',
})
return opts
Expand All @@ -12,7 +12,7 @@ return {
{
'nvim-treesitter/nvim-treesitter',
opts = function(_, opts)
opts.ensure_installed = require('plugins.config.util').unique_append_table(opts.ensure_installed, {
opts.ensure_installed = require('my_config.util').unique_append_table(opts.ensure_installed, {
'elixir',
'erlang',
'eex',
Expand All @@ -34,7 +34,7 @@ return {
elixir_ls = function(_, opts)
local elixir = require 'elixir'
local elixirls = require 'elixir.elixirls'
opts.capabilities = require('plugins.config.util').get_lsp_capabilities(opts.capabilities)
opts.capabilities = require('my_config.util').get_lsp_capabilities(opts.capabilities)

elixir.setup({
nextls = { enable = false },
Expand Down
2 changes: 1 addition & 1 deletion .config/nvim/lua/plugins/lsp/gleam.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ return {
{
'nvim-treesitter/nvim-treesitter',
opts = function(_, opts)
opts.ensure_installed = require('plugins.config.util').unique_append_table(opts.ensure_installed, {
opts.ensure_installed = require('my_config.util').unique_append_table(opts.ensure_installed, {
'gleam',
})
return opts
Expand Down
4 changes: 2 additions & 2 deletions .config/nvim/lua/plugins/lsp/go.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ return {
{
'williamboman/mason.nvim',
opts = function(_, opts)
opts.ensure_installed = require('plugins.config.util').unique_append_table(opts.ensure_installed, {
opts.ensure_installed = require('my_config.util').unique_append_table(opts.ensure_installed, {
'gopls',
'goimports',
'golangci-lint',
Expand All @@ -14,7 +14,7 @@ return {
{
'nvim-treesitter/nvim-treesitter',
opts = function(_, opts)
opts.ensure_installed = require('plugins.config.util').unique_append_table(opts.ensure_installed, {
opts.ensure_installed = require('my_config.util').unique_append_table(opts.ensure_installed, {
'go',
'gomod',
'gosum',
Expand Down
4 changes: 2 additions & 2 deletions .config/nvim/lua/plugins/lsp/htmlcss.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ return {
{
'williamboman/mason.nvim',
opts = function(_, opts)
opts.ensure_installed = require('plugins.config.util').unique_append_table(opts.ensure_installed, {
opts.ensure_installed = require('my_config.util').unique_append_table(opts.ensure_installed, {
'cspell',
'html-lsp',
'stylelint',
Expand All @@ -19,7 +19,7 @@ return {
{
'nvim-treesitter/nvim-treesitter',
opts = function(_, opts)
opts.ensure_installed = require('plugins.config.util').unique_append_table(opts.ensure_installed, {
opts.ensure_installed = require('my_config.util').unique_append_table(opts.ensure_installed, {
'html',
'css',
'scss',
Expand Down
6 changes: 3 additions & 3 deletions .config/nvim/lua/plugins/lsp/json.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ return {
{
'williamboman/mason.nvim',
opts = function(_, opts)
opts.ensure_installed = require('plugins.config.util').unique_append_table(opts.ensure_installed, {
opts.ensure_installed = require('my_config.util').unique_append_table(opts.ensure_installed, {
'json-lsp',
})
return opts
Expand All @@ -12,7 +12,7 @@ return {
{
'nvim-treesitter/nvim-treesitter',
opts = function(_, opts)
opts.ensure_installed = require('plugins.config.util').unique_append_table(opts.ensure_installed, {
opts.ensure_installed = require('my_config.util').unique_append_table(opts.ensure_installed, {
'json',
'jsonc',
'json5',
Expand All @@ -26,7 +26,7 @@ return {
opts = {
handlers = {
jsonls = function(server, opts)
opts.capabilities = require('plugins.config.util').get_lsp_capabilities(opts.capabilities)
opts.capabilities = require('my_config.util').get_lsp_capabilities(opts.capabilities)
opts.on_new_config = function(new_config)
new_config.settings.json.schemas = new_config.settings.json.schemas or {}
vim.list_extend(new_config.settings.json.schemas, require('schemastore').json.schemas())
Expand Down
Loading

0 comments on commit 1f0ef83

Please sign in to comment.