Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:jmbuhr/quarto-nvim-kickstarter into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbuhr committed Nov 15, 2024
2 parents 5dd7a5d + a33656e commit 607fff1
Show file tree
Hide file tree
Showing 7 changed files with 135 additions and 19 deletions.
2 changes: 2 additions & 0 deletions ftplugin/quarto.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ vim.b.slime_cell_delimiter = '```'
vim.b['quarto_is_r_mode'] = nil
vim.b['reticulate_running'] = false

vim.bo.commentstring = '<!-- %s -->'

-- wrap text, but by word no character
-- indent the wrappped line
vim.wo.wrap = true
Expand Down
1 change: 1 addition & 0 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ require 'config.redir'
-- vim.treesitter.language.add('pandoc_markdown_inline', { path = "/usr/local/lib/libtree-sitter-pandoc-markdown-inline.so" })
-- vim.treesitter.language.register('pandoc_markdown', { 'quarto', 'rmarkdown' })

vim.treesitter.language.register("markdown", 'quarto')
vim.treesitter.language.register("markdown", 'text')

13 changes: 13 additions & 0 deletions lua/plugins/common.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
return {
-- common dependencies
{ 'nvim-lua/plenary.nvim' },
{
"folke/snacks.nvim",
priority = 1000,
lazy = false,
opts = {
styles = {},
bigfile = { enabled = true },
notifier = { enabled = true },
quickfile = { enabled = true },
statuscolumn = { enabled = false },
words = { enabled = false },
},
},
}
94 changes: 93 additions & 1 deletion lua/plugins/completion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,99 @@ return {
end,
},

{ -- new completion plugin
'saghen/blink.cmp',
enabled = true,
lazy = false, -- lazy loading handled internally
-- optional: provides snippets for the snippet source
dependencies = {
{ 'rafamadriz/friendly-snippets' },
{
'saghen/blink.compat',
dev = false,
opts = {
impersonate_nvim_cmp = false,
enable_events = false,
debug = false,
},
},
{
'jmbuhr/cmp-pandoc-references',
dev = false,
ft = { 'quarto', 'markdown', 'rmarkdown' },
config = function()
vim.api.nvim_create_autocmd('FileType', {
pattern = { "markdown", "quarto", "rmarkdown" },
callback = function()
require('cmp-pandoc-references.lsp').start()
end
})
end
},
{ 'hrsh7th/cmp-emoji' },
{ 'kdheepak/cmp-latex-symbols' },
},

-- use a release tag to download pre-built binaries
version = 'v0.*',
-- OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
-- build = 'cargo build --release',
-- If you use nix, you can build from source using latest nightly rust with:
-- build = 'nix run .#build-plugin',

---@module 'blink.cmp'
---@type blink.cmp.Config
opts = {
-- 'default' for mappings similar to built-in completion
-- 'super-tab' for mappings similar to vscode (tab to accept, arrow keys to navigate)
-- 'enter' for mappings similar to 'super-tab' but with 'enter' to accept
-- see the "default configuration" section below for full documentation on how to define
-- your own keymap.
keymap = { preset = 'enter' },

sources = {
completion = {
enabled_providers = { "lsp", "path", "snippets", "buffer", "lazydev", "references", "emoji", "symbols" },
},
providers = {
-- dont show LuaLS require statements when lazydev has items
lsp = { fallback_for = { "lazydev" } },
lazydev = { name = "LazyDev", module = "lazydev.integrations.blink" },
-- references = {
-- name = "pandoc_references",
-- module = "blink.compat.source",
-- opts = {
-- impersonate_nvim_cmp = true,
-- enable_events = true,
-- debug = true,
-- }
-- },
emoji = { name = "emoji", module = "blink.compat.source" },
symbols = { name = "symbols", module = "blink.compat.source" },
},
},

highlight = {
-- sets the fallback highlight groups to nvim-cmp's highlight groups
-- useful for when your theme doesn't support blink.cmp
-- will be removed in a future release, assuming themes add support
use_nvim_cmp_as_default = true,
},
-- set to 'mono' for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
-- adjusts spacing to ensure icons are aligned
nerd_font_variant = 'mono',

-- experimental auto-brackets support
accept = { auto_brackets = { enabled = true } },

-- experimental signature help support
trigger = { signature_help = { enabled = true } },
}
},

{ -- completion
'hrsh7th/nvim-cmp',
enabled = false,
event = 'InsertEnter',
dependencies = {
'hrsh7th/cmp-nvim-lsp',
Expand Down Expand Up @@ -154,7 +245,7 @@ return {

{ -- gh copilot
'zbirenbaum/copilot.lua',
enabled = false,
enabled = true,
config = function()
require('copilot').setup {
suggestion = {
Expand All @@ -177,6 +268,7 @@ return {

{ -- LLMs
"olimorris/codecompanion.nvim",
enabled = false,
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
Expand Down
3 changes: 0 additions & 3 deletions lua/plugins/editing.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
return {

-- disables hungry features for files larget than 2MB
{ 'LunarVim/bigfile.nvim' },

-- add/delete/change can be done with the keymaps
-- ys{motion}{char}, ds{char}, and cs{target}{replacement}
{
Expand Down
25 changes: 13 additions & 12 deletions lua/plugins/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ return {
},
},
{ 'Bilal2453/luvit-meta', lazy = true }, -- optional `vim.uv` typings
{ -- optional completion source for require statements and module annotations
'hrsh7th/nvim-cmp',
opts = function(_, opts)
opts.sources = opts.sources or {}
table.insert(opts.sources, {
name = 'lazydev',
group_index = 0, -- set group index to 0 to skip loading LuaLS completions
})
end,
},
-- { -- optional completion source for require statements and module annotations
-- 'hrsh7th/nvim-cmp',
-- opts = function(_, opts)
-- opts.sources = opts.sources or {}
-- table.insert(opts.sources, {
-- name = 'lazydev',
-- group_index = 0, -- set group index to 0 to skip loading LuaLS completions
-- })
-- end,
-- },
-- { "folke/neodev.nvim", enabled = false }, -- make sure to uninstall or disable neodev.nvim
},
{ 'folke/neoconf.nvim', opts = {}, enabled = false },
Expand Down Expand Up @@ -116,8 +116,9 @@ return {
}

local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities())
capabilities.textDocument.completion.completionItem.snippetSupport = true
-- capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities())
-- capabilities.textDocument.completion.completionItem.snippetSupport = true
capabilities = require('blink.cmp').get_lsp_capabilities(capabilities)

-- also needs:
-- $home/.config/marksman/config.toml :
Expand Down
16 changes: 13 additions & 3 deletions lua/plugins/ui.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
return {

{ -- nice quickfix list
'stevearc/quicker.nvim',
event = "FileType qf",
opts = {},
},
{ -- more qf improvements
'romainl/vim-qf'
},

-- telescope
-- a nice seletion UI also to find and open files
{
Expand Down Expand Up @@ -273,7 +283,7 @@ return {
},
opts = {
providers = {
priority = { 'markdown', 'lsp', 'norg' },
priority = { 'markdown', 'lsp', 'norg' },
-- Configuration for each provider (3rd party providers are supported)
lsp = {
-- Lsp client names to ignore
Expand Down Expand Up @@ -374,10 +384,10 @@ return {
ft = { 'markdown', 'quarto', 'vimwiki' },
cond = function()
-- Disable on Windows system
return vim.fn.has 'win32' ~= 1
return vim.fn.has 'win32' ~= 1
end,
dependencies = {
'leafo/magick', -- that's a lua rock
'leafo/magick', -- that's a lua rock
},
config = function()
-- Requirements
Expand Down

0 comments on commit 607fff1

Please sign in to comment.