Skip to content

Commit dad4f82

Browse files
committed
adding settings for markdown LSP and zk
1 parent 367d522 commit dad4f82

26 files changed

+518
-459
lines changed

after/ftplugin/gotmpl.vim

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
autocmd BufNewFile,BufRead *.tmpl if search('{{.\+}}', 'nw') | setlocal filetype=gotmpl | endif

after/ftplugin/markdown.vim

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
setlocal expandtab
2+
setlocal shiftwidth=2
3+
setlocal softtabstop=2
4+
setlocal tabstop=2
5+
setlocal conceallevel=0

after/queries/gomod/highlights.scm

-2
This file was deleted.

after/queries/html/injections.scm

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(text) @yaml

ftdetect/gotmpl.vim

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
autocmd BufNewFile,BufRead *.tmpl if search('{{.\+}}', 'nw') | setlocal filetype=gotmpl | endif

init.lua

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
-- Load Modules:
22
require("core")
3-

lua/core/init.lua

+2
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,15 @@ local load_core = function()
5555
require('core.colorscheme').load_colorscheme()
5656
end
5757
if vim.wo.diff then
58+
vim.wo.wrap = true
5859
return
5960
end
6061
require('core.commands')
6162
lprint('load compiled and lazy', uv.now() - start)
6263

6364
require('core.lazy').setup(fsz)
6465
lprint('lazy done', uv.now() - start)
66+
require('utils.markdown')
6567
end
6668

6769
load_core()

lua/keymap/keys.lua

+6-4
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ local def_map = {
112112
-- Vim map
113113
['n|<C-x>k'] = map_cmd('Bd'):with_noremap():with_silent(),
114114
['n|<C-S-y>'] = map_cmd('%y +'), -- yank file
115-
['n|]b'] = map_cmd('bp'):with_noremap(),
116-
['n|[b'] = map_cmd('bn'):with_noremap(),
115+
['n|]b'] = map_cmd('BufferLineCycleNext'):with_noremap(),
116+
['n|[b'] = map_cmd('BufferLineCyclePrev'):with_noremap(),
117117
-- ["n|<Space>cw"] = map_cmd([[silent! keeppatterns %substitute/\s\+$//e]]):with_noremap():with_silent(),
118118
['n|<A-[>'] = map_cmd('vertical resize -5'):with_silent(),
119119
['n|<A-]>'] = map_cmd('vertical resize +5'):with_silent(),
@@ -193,7 +193,7 @@ local plug_keys = {
193193
--
194194
["n|<F13>"] = map_cmd("NvimTreeToggle"),
195195
["n|<S-F1>"] = map_cmd("NvimTreeToggle"),
196-
["n|<Leader>s"] = map_func(function() require("flash").toggle(true) end),
196+
["n|<Leader>S"] = map_func(function() require("flash").toggle(true) end),
197197
["n|<F9>"] = map_func(function()
198198
if vim.o.ft == 'go' then
199199
return vim.cmd('GoBreakToggle')
@@ -377,7 +377,7 @@ bind.nvim_load_mapping(def_map)
377377
local keymap = vim.keymap
378378
keymap.amend = require('keymap.amend')
379379

380-
keymap.amend('n', '<Esc>', function(original)
380+
keymap.amend('n', '<ESC>', function(original)
381381
if vim.v.hlsearch and vim.v.hlsearch == 1 then
382382
vim.cmd('nohlsearch')
383383
end
@@ -404,6 +404,8 @@ keymap.amend('n', '[c', function()
404404
end
405405
end, { desc = 'prevdiff/hunk' })
406406

407+
vim.keymap.set('n', '<leader>u', require('utils.markdown').fetch_and_paste_url_title, {desc = 'Fetch and paste URL title'})
408+
407409
return { keymap = def_map }
408410

409411
-- no longer used

lua/modules/completion/config.lua

+10-6
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,14 @@ function config.nvim_cmp()
2626
end
2727

2828
local sources = {
29-
{ name = 'nvim_lsp' },
29+
{
30+
name = 'nvim_lsp',
31+
option = {
32+
markdown_oxide = {
33+
keyword_pattern = [[\(\k\| \|\/\|#\)\+]],
34+
},
35+
},
36+
},
3037
{ name = 'luasnip' },
3138
{ name = 'treesitter', keyword_length = 2 },
3239

@@ -54,6 +61,8 @@ function config.nvim_cmp()
5461
table.insert(sources, { name = 'spell' })
5562
-- table.insert(sources, { name = 'look' })
5663
table.insert(sources, { name = 'latex_symbols' })
64+
table.insert(sources, { name = 'emoji' })
65+
-- table.insert(sources, { name = 'mkdnflow' })
5766
end
5867
if vim.o.ft == 'lua' then
5968
table.insert(sources, { name = 'nvim_lua' })
@@ -116,11 +125,6 @@ function config.nvim_cmp()
116125
if cmp.visible() then
117126
cmp.abort()
118127
cmp.close()
119-
-- vim.api.nvim_feedkeys(
120-
-- vim.api.nvim_replace_termcodes('<C-e>', true, true, true),
121-
-- 'n',
122-
-- true
123-
-- )
124128
else
125129
vim.api.nvim_feedkeys(
126130
vim.api.nvim_replace_termcodes('<End>', true, true, true),

lua/modules/completion/lsp.lua

+21
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,26 @@ M.setup = function()
2828
require('lspconfig').grammarly.setup({
2929
filetypes = { 'markdown', 'text', 'html', 'latex', 'org' },
3030
})
31+
-- configs["markdown_oxide"] = {
32+
-- default_config = {
33+
-- -- root_dir = function() return vim.fn.getcwd() end,
34+
-- root_dir = lspconfig.util.root_pattern('.git', vim.fn.getcwd()),
35+
-- filetypes = {"markdown"},
36+
-- -- cmd = {(function()
37+
-- -- if vim.env.MOXIDE_DEBUG then
38+
-- -- return "/home/felix/coding/LargerIdeas/ObsidianLS/obsidian-ls/target/debug/markdown-oxide"
39+
-- -- else
40+
-- -- return "/home/felix/coding/LargerIdeas/ObsidianLS/obsidian-ls/target/release/markdown-oxide"
41+
-- -- end
42+
-- -- end)()}
43+
-- },
44+
-- on_attach = on_attach,
45+
-- capabilities = capabilities,
46+
-- }
47+
require("lspconfig").markdown_oxide.setup({
48+
-- root_dir = function() return vim.fn.getcwd() end,
49+
root_dir = lspconfig.util.root_pattern('.marksman.toml','.git', vim.fn.getcwd()),
50+
filetypes = {"markdown"}
51+
})
3152
end
3253
return M

lua/modules/completion/plugins.lua

+8-9
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ return function(use)
3535
{ 'ray-x/cmp-treesitter', dev = (plugin_folder():find('github') ~= nil), lazy = true },
3636
{ 'hrsh7th/cmp-nvim-lsp', lazy = true },
3737
{ 'saadparwaiz1/cmp_luasnip', lazy = true },
38-
{ 'kdheepak/cmp-latex-symbols' },
38+
{ 'kdheepak/cmp-latex-symbols', lazy = true, ft = {'markdown'} },
39+
{ 'hrsh7th/cmp-emoji' },
3940
{ 'windwp/nvim-autopairs', event = 'InsertEnter', module = true, config = function() require('modules.completion.config').autopairs() end },
4041
},
4142
-- stylua: ignore end
@@ -158,13 +159,11 @@ return function(use)
158159
vim.g.copilot_no_tab_map = true
159160
end,
160161
})
161-
use({
162-
'hinell/lsp-timeout.nvim', -- reset lsp from time to time
163-
dependencies = { 'neovim/nvim-lspconfig' },
164-
event = 'InsertEnter',
165-
})
162+
-- use({
163+
-- 'hinell/lsp-timeout.nvim', -- reset lsp from time to time
164+
-- dependencies = { 'neovim/nvim-lspconfig' },
165+
-- event = 'InsertEnter',
166+
-- })
166167
end
167168

168-
-- { 'hrsh7th/cmp-calc', lazy = true },
169-
-- { 'hrsh7th/cmp-emoji', lazy = true },
170-
-- { 'tzachar/cmp-fuzzy-buffer', lazy = true, dependencies = { 'tzachar/fuzzy.nvim' } },
169+

0 commit comments

Comments
 (0)