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 5, 2024
2 parents 37765ba + db82e96 commit 67f39e0
Show file tree
Hide file tree
Showing 10 changed files with 90 additions and 30 deletions.
9 changes: 6 additions & 3 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ require 'config.autocommands'
require 'config.redir'


vim.treesitter.language.add('pandoc_markdown', { path = "/usr/local/lib/libtree-sitter-pandoc-markdown.so" })
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.add('pandoc_markdown', { path = "/usr/local/lib/libtree-sitter-pandoc-markdown.so" })
-- 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", 'text')

5 changes: 4 additions & 1 deletion lua/config/global.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

local animals = require('misc.style').animals

DefaultConcealLevel = 0
FullConcealLevel = 3

-- proper colors
vim.opt.termguicolors = true

Expand Down Expand Up @@ -101,7 +104,7 @@ vim.opt.formatoptions:remove 'o'
vim.opt.scrolloff = 5

-- (don't == 0) replace certain elements with prettier ones
vim.opt.conceallevel = 0
vim.opt.conceallevel = DefaultConcealLevel

-- diagnostics
vim.diagnostic.config {
Expand Down
12 changes: 10 additions & 2 deletions lua/config/keymap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,15 @@ end

vim.keymap.set("n", "<leader>os", get_otter_symbols_lang, { desc = "otter [s]ymbols" })

local function toggle_conceal()
local lvl = vim.o.conceallevel
if lvl > DefaultConcealLevel then
vim.o.conceallevel = DefaultConcealLevel
else
vim.o.conceallevel = FullConcealLevel
end
end


-- normal mode with <leader>
wk.add({
Expand Down Expand Up @@ -354,8 +363,7 @@ wk.add({
{ "<leader>gws", ":lua require('telescope').extensions.git_worktree.git_worktrees()<cr>", desc = "worktree switch" },
{ "<leader>h", group = "[h]elp / [h]ide / debug" },
{ "<leader>hc", group = "[c]onceal" },
{ "<leader>hch", ":set conceallevel=1<cr>", desc = "[h]ide/conceal" },
{ "<leader>hcs", ":set conceallevel=0<cr>", desc = "[s]how/unconceal" },
{ "<leader>hc", toggle_conceal, desc = "[c]onceal toggle" },
{ "<leader>ht", group = "[t]reesitter" },
{ "<leader>htt", vim.treesitter.inspect_tree, desc = "show [t]ree" },
{ "<leader>i", group = "[i]mage" },
Expand Down
2 changes: 1 addition & 1 deletion lua/config/lazy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ require('lazy').setup('plugins', {
'gzip',
'matchit',
'matchparen',
'netrwPlugin',
-- 'netrwPlugin',
'tarPlugin',
'tohtml',
'tutor',
Expand Down
2 changes: 1 addition & 1 deletion lua/plugins/completion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ return {

{ -- gh copilot
'zbirenbaum/copilot.lua',
enabled = true,
enabled = false,
config = function()
require('copilot').setup {
suggestion = {
Expand Down
8 changes: 5 additions & 3 deletions lua/plugins/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ return {
debounce_text_changes = 150,
}

vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, { border = require('misc.style').border })
vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = require('misc.style').border })

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
Expand Down Expand Up @@ -159,6 +156,11 @@ return {
flags = lsp_flags,
}

lspconfig.svelte.setup {
capabilities = capabilities,
flags = lsp_flags,
}

lspconfig.yamlls.setup {
capabilities = capabilities,
flags = lsp_flags,
Expand Down
43 changes: 32 additions & 11 deletions lua/plugins/notes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,49 @@ return {
'nvim-lua/plenary.nvim',
},
keys = {
{ '<leader>nd', ':ObsidianToday<cr>', desc = 'obsidian [d]aily' },
{ '<leader>nt', ':ObsidianToday 1<cr>', desc = 'obsidian [t]omorrow' },
{ '<leader>ny', ':ObsidianToday -1<cr>', desc = 'obsidian [y]esterday' },
{ '<leader>nb', ':ObsidianBacklinks<cr>', desc = 'obsidian [b]acklinks' },
{ '<leader>nl', ':ObsidianLink<cr>', desc = 'obsidian [l]ink selection' },
{ '<leader>nf', ':ObsidianFollowLink<cr>', desc = 'obsidian [f]ollow link' },
{ '<leader>nn', ':ObsidianNew<cr>', desc = 'obsidian [n]ew' },
{ '<leader>ns', ':ObsidianSearch<cr>', desc = 'obsidian [s]earch' },
{ '<leader>nd', ':ObsidianToday<cr>', desc = 'obsidian [d]aily' },
{ '<leader>nt', ':ObsidianToday 1<cr>', desc = 'obsidian [t]omorrow' },
{ '<leader>ny', ':ObsidianToday -1<cr>', desc = 'obsidian [y]esterday' },
{ '<leader>nb', ':ObsidianBacklinks<cr>', desc = 'obsidian [b]acklinks' },
{ '<leader>nl', ':ObsidianLink<cr>', desc = 'obsidian [l]ink selection' },
{ '<leader>nf', ':ObsidianFollowLink<cr>', desc = 'obsidian [f]ollow link' },
{ '<leader>nn', ':ObsidianNew<cr>', desc = 'obsidian [n]ew' },
{ '<leader>ns', ':ObsidianSearch<cr>', desc = 'obsidian [s]earch' },
{ '<leader>no', ':ObsidianQuickSwitch<cr>', desc = 'obsidian [o]pen quickswitch' },
{ '<leader>nO', ':ObsidianOpen<cr>', desc = 'obsidian [O]pen in app' },
{ '<leader>nO', ':ObsidianOpen<cr>', desc = 'obsidian [O]pen in app' },
},
config = function()
---@diagnostic disable-next-line: missing-fields
require('obsidian').setup {
ui = {
enable = false,
},
workspaces = {
{
name = 'notes',
path = '~/notes',
},
},
-- Optional, for templates (see below).
templates = {
folder = "templates",
date_format = "%Y-%m-%d",
time_format = "%H:%M",
-- A map for custom variables, the key should be the variable and the value a function
substitutions = {},
},
daily_notes = {
-- Optional, if you keep daily notes in a separate directory.
-- folder = "dailies",
-- Optional, if you want to change the date format for the ID of daily notes.
-- date_format = "%Y-%m-%d",
-- Optional, if you want to change the date format of the default alias of daily notes.
-- alias_format = "%B %-d, %Y",
-- Optional, default tags to add to each new daily note created.
-- default_tags = { "daily-notes" },
-- Optional, if you want to automatically insert a template from your template directory like 'daily.md'
template = 'template-daily.md'
},
mappings = {
-- Overrides the 'gf' mapping to work on markdown/wiki links within your vault.
['gf'] = {
Expand Down Expand Up @@ -93,8 +116,6 @@ return {
return tostring(os.time()) .. '-' .. suffix
end,
}

vim.wo.conceallevel = 1
end,
},
}
6 changes: 3 additions & 3 deletions lua/plugins/quarto.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ return {
opts = {
codeRunner = {
enabled = true,
default_method = "molten"
default_method = "slime"
}
},
dependencies = {
Expand Down Expand Up @@ -127,8 +127,8 @@ return {

{
'benlubas/molten-nvim',
dev = true,
enabled = true,
dev = false,
enabled = false,
build = ':UpdateRemotePlugins',
init = function()
vim.g.molten_image_provider = 'image.nvim'
Expand Down
29 changes: 24 additions & 5 deletions lua/plugins/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,35 @@ return {
table.insert(vimgrep_arguments, '--glob')
table.insert(vimgrep_arguments, '!docs/*')

table.insert(vimgrep_arguments, '--glob')
table.insert(vimgrep_arguments, '!_site/*')

table.insert(vimgrep_arguments, '--glob')
table.insert(vimgrep_arguments, '!*_files/libs/*')

table.insert(vimgrep_arguments, '--glob')
table.insert(vimgrep_arguments, '!.obsidian/*')

table.insert(vimgrep_arguments, '--glob')
table.insert(vimgrep_arguments, '!.quarto/*')

table.insert(vimgrep_arguments, '--glob')
table.insert(vimgrep_arguments, '!_freeze/*')

telescope.setup {
defaults = {
buffer_previewer_maker = new_maker,
vimgrep_arguments = vimgrep_arguments,
file_ignore_patterns = {
'node_modules',
'node%_modules',
'%_cache',
'.git/',
'site_libs',
'.venv',
'%.git/',
'site%_libs',
'%.venv/',
'%_files/libs/',
'%.obsidian/',
'%.quarto/',
'%_freeze/',
},
layout_strategy = 'flex',
sorting_strategy = 'ascending',
Expand Down Expand Up @@ -203,7 +222,7 @@ return {
},
config = function()
require('nvim-tree').setup {
disable_netrw = true,
disable_netrw = false,
update_focused_file = {
enable = true,
},
Expand Down
4 changes: 4 additions & 0 deletions snips/snippets/markdown.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"prefix": ["eq"],
"body": ["\\$\\$", "$1", "\\$\\$ {#eq-${2: label}}"]
},
"def": {
"prefix": ["def"],
"body": [":::{#def-$1}", "## $2\n", "$3", ":::"]
},
"Insert Block Equation": {
"prefix": "$$",
"body": ["\\$$", "${0}", "\\$$"]
Expand Down

0 comments on commit 67f39e0

Please sign in to comment.