Skip to content

Commit 218729a

Browse files
committed
wip
1 parent b704444 commit 218729a

File tree

4 files changed

+43
-47
lines changed

4 files changed

+43
-47
lines changed

lua/plugins/completion.lua

+32-45
Original file line numberDiff line numberDiff line change
@@ -14,80 +14,63 @@ return {
1414
-- optional: provides snippets for the snippet source
1515
dependencies = {
1616
{ 'rafamadriz/friendly-snippets' },
17-
{'L3MON4D3/LuaSnip',
18-
config = function ()
19-
local luasnip = require 'luasnip'
20-
-- for friendly snippets
21-
require('luasnip.loaders.from_vscode').lazy_load()
22-
-- for custom snippets
23-
require('luasnip.loaders.from_vscode').lazy_load { paths = { vim.fn.stdpath 'config' .. '/snips' } }
24-
-- link quarto and rmarkdown to markdown snippets
25-
luasnip.filetype_extend('quarto', { 'markdown' })
26-
luasnip.filetype_extend('rmarkdown', { 'markdown' })
27-
end
28-
},
2917
{
3018
'saghen/blink.compat',
3119
dev = false,
3220
opts = { impersonate_nvim_cmp = true, enable_events = true, debug = true },
3321
},
3422
{
3523
'jmbuhr/cmp-pandoc-references',
36-
dev = false,
37-
ft = { 'quarto', 'markdown', 'rmarkdown' },
24+
dev = true,
25+
-- ft = { 'quarto', 'markdown', 'rmarkdown' },
3826
},
3927
{
4028
"allaman/emoji.nvim",
4129
opts = { enable_cmp_integration = true },
4230
},
4331
{ 'kdheepak/cmp-latex-symbols' },
4432
},
45-
4633
-- use a release tag to download pre-built binaries
47-
version = 'v0.*',
48-
-- OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
49-
-- build = 'cargo build --release',
50-
-- If you use nix, you can build from source using latest nightly rust with:
51-
-- build = 'nix run .#build-plugin',
52-
34+
-- version = 'v0.*',
35+
build = 'cargo build --release',
5336
---@module 'blink.cmp'
5437
---@type blink.cmp.Config
5538
opts = {
56-
-- 'default' for mappings similar to built-in completion
57-
-- 'super-tab' for mappings similar to vscode (tab to accept, arrow keys to navigate)
58-
-- 'enter' for mappings similar to 'super-tab' but with 'enter' to accept
59-
-- see the "default configuration" section below for full documentation on how to define
60-
-- your own keymap.
6139
keymap = { preset = 'enter' },
62-
snippets = {
63-
expand = function(snippet) require('luasnip').lsp_expand(snippet) end,
64-
active = function(filter)
65-
if filter and filter.direction then
66-
return require('luasnip').jumpable(filter.direction)
67-
end
68-
return require('luasnip').in_snippet()
69-
end,
70-
jump = function(direction) require('luasnip').jump(direction) end,
71-
},
7240
sources = {
73-
completion = {
74-
enabled_providers = { "lsp", "path", "luasnip", "buffer", "lazydev", "pandoc_references", "emoji", "latex_symbols", "codecompanion", }
75-
},
41+
default = { "lsp", "path", "references", "snippets", "lazydev", "emoji", "latex_symbols", "codecompanion", "buffer" },
42+
cmdline = {},
7643
providers = {
7744
lazydev = { name = "LazyDev", module = "lazydev.integrations.blink" },
78-
pandoc_references = { name = "pandoc_references", module = "blink.compat.source", opts = {impersonate_nvim_cmp = true} },
45+
references = { name = "references", module = "cmp-pandoc-references.blink" },
7946
emoji = { name = "emoji", module = "blink.compat.source", opts = {impersonate_nvim_cmp = true} },
8047
latex_symbols = { name = "latex_symbols", module = "blink.compat.source", opts = {impersonate_nvim_cmp = true} },
8148
codecompanion = { name = 'CodeCompanion', module = 'codecompanion.providers.completion.blink', enabled = true },
8249
},
8350
},
84-
85-
highlight = {
86-
use_nvim_cmp_as_default = true,
51+
completion = {
52+
accept = { auto_brackets = { enabled = true } },
53+
menu = {
54+
draw = {
55+
treesitter = {'lsp'},
56+
columns = { { 'kind_icon' }, { 'label', 'label_description', gap = 1 }, {'source_name'} },
57+
components = {
58+
label_description = {
59+
width = { max = 30 },
60+
text = function(ctx)
61+
-- print(vim.inspect(ctx.label_description()))
62+
return ctx.label_description
63+
end,
64+
highlight = 'BlinkCmpLabelDescription',
65+
},
66+
},
67+
},
68+
},
8769
},
88-
nerd_font_variant = 'mono',
89-
completion = { accept = { auto_brackets = { enabled = true } } },
9070
signature = { enabled = true },
71+
appearance = {
72+
use_nvim_cmp_as_default = false,
73+
}
9174
}
9275
},
9376

@@ -284,6 +267,10 @@ return {
284267
adapter = "copilot",
285268
},
286269
},
270+
diff = {
271+
enabled = true,
272+
close_chat_at = 40
273+
}
287274
})
288275
end
289276
}

lua/plugins/lsp.lua

+5
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,11 @@ return {
180180
filetypes = { 'js', 'javascript', 'typescript', 'ojs' },
181181
}
182182

183+
lspconfig.svelte.setup {
184+
capabilities = capabilities,
185+
flags = lsp_flags,
186+
}
187+
183188
local function get_quarto_resource_path()
184189
local function strsplit(s, delimiter)
185190
local result = {}

lua/plugins/notes.lua

+5-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ return {
2222
{
2323
'epwalsh/obsidian.nvim',
2424
enabled = true,
25-
ft = 'markdown',
25+
-- ft = 'markdown',
2626
event = {
2727
-- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'.
2828
-- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/**.md"
@@ -50,6 +50,10 @@ return {
5050
ui = {
5151
enable = false,
5252
},
53+
completion = {
54+
nvim_cmp = false,
55+
min_chars = 2,
56+
},
5357
workspaces = {
5458
{
5559
name = 'notes',

snips/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "snippets",
2+
"name": "snips",
33
"engines": {
44
"vscode": "^1.11.0"
55
},

0 commit comments

Comments
 (0)