Skip to content

Commit

Permalink
Add obsidian plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
handdara committed Nov 29, 2024
1 parent 61ae2d7 commit bd3d2d5
Show file tree
Hide file tree
Showing 10 changed files with 332 additions and 45 deletions.
20 changes: 11 additions & 9 deletions fst/hez/wezterm-main/handdara/fonts.lua
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
local wezterm = require('wezterm')

local sym_fallback = { family = 'Symbols Nerd Font', scale = 1 }
return {
hasklug = wezterm.font_with_fallback({
{ family = 'Hasklug Nerd Font', weight = 'Regular' },
{ family = 'Symbols Nerd Font Mono', scale = 1 },
sym_fallback,
}),
monofur = wezterm.font_with_fallback({
{ family = 'Monofur Nerd Font', weight = 'Regular' },
{ family = 'Symbols Nerd Font Mono', scale = 1 },
sym_fallback,
}),
monoid = wezterm.font_with_fallback({
{ family = 'Monoid Nerd Font', weight = 'Regular' },
{ family = 'Symbols Nerd Font Mono', scale = 1 },
sym_fallback,
}),
f3270 = wezterm.font_with_fallback({
{ family = '3270 Nerd Font', weight = 'Regular' },
{ family = 'Symbols Nerd Font Mono', scale = 1 },
sym_fallback,
}),
agave = wezterm.font_with_fallback({
{ family = 'Agave Nerd Font', weight = 'Regular' },
{ family = 'Symbols Nerd Font Mono', scale = 1 },
}),
spacemono = wezterm.font_with_fallback({
{ family = 'SpaceMono Nerd Font', weight = 'Regular' },
{ family = 'Symbols Nerd Font Mono', scale = 1 },
sym_fallback,
}),
spacemono = wezterm.font 'SpaceMono Nerd Font',
-- spacemono = wezterm.font_with_fallback({
-- { family = 'SpaceMono Nerd Font', weight = 'Regular' },
-- sym_fallback,
-- }),
firacode = wezterm.font 'Fira Code',
jetbrains = wezterm.font 'JetBrains Mono',
}
7 changes: 3 additions & 4 deletions fst/hez/wezterm-main/handdara/looks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ local function apply_to_config(config)
}

-- fonts and window settings
local default_font = hf.spacemono
local default_font_size = 15.0
config.font = default_font
local default_font_size = 13.0
config.font = hf.agave
config.font_size = default_font_size
config.enable_tab_bar = false -- making the window layout simple, 99 times out of 100 scaling is handled
config.window_frame = {
font = hf.hasklug,
font = hf.agave,
font_size = default_font_size - 1,
}

Expand Down
25 changes: 16 additions & 9 deletions fst/him/nvim-nrw/after/ftplugin/markdown.lua
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
local map = vim.keymap.set
vim.opt_local.conceallevel = 0
local wikilink_regex = '\\[\\[.*\\]\\]'
local mdlink_regex = '\\[[^]]*\\](.*)'
local link_regex = [[\(]].. wikilink_regex ..[[\|]].. mdlink_regex ..[[\)]]
map('n', '<leader>it', '<CMD>r!today<CR>i##<Space><Esc>_',
{ buffer = true, desc = '[i]nsert [t]oday\'s date as heading' })
map('v', '<leader>t', '!pandoc -t gfm<CR>', { buffer = true, desc = 'format highlighted [T]able' })
map('v', '<leader>T', '!pandoc -t markdown_strict+grid_tables<CR>',
{ buffer = true, desc = 'format highlighted [T]able' })
map('n', '<leader>gt', 'vip!pandoc -t ', { buffer = true })
vim.keymap.set('n', '<leader>nt', function()
local lc = vim.api.nvim_get_option_value('conceallevel', {})
if lc == 0 then
vim.opt_local.conceallevel = 2
else
vim.opt_local.conceallevel = 0
end
end, { desc = '[n]otes [t]oggle conceal' , buffer = true})
-- vim.opt_local.conceallevel = 1
-- vim.keymap.set('n', '<leader>nt', function()
-- local lc = vim.api.nvim_get_option_value('conceallevel', {})
-- if lc == 0 then
-- vim.opt_local.conceallevel = 1
-- else
-- vim.opt_local.conceallevel = 0
-- end
-- end, { desc = '[n]otes [t]oggle conceal' , buffer = true})
map('n', '<Tab>', '/'.. wikilink_regex ..'<CR>zz', { desc = 'go to next link', buffer = true })
map('n', '<S-Tab>', '?'.. wikilink_regex ..'<CR>zz', { desc = 'go to prev link', buffer = true })
map('n', '<C-Tab>', '/'.. link_regex ..'<CR>zz', { desc = 'go to next link', buffer = true })
map('n', '<C-S-Tab>', '?'.. link_regex ..'<CR>zz', { desc = 'go to prev link', buffer = true })
17 changes: 9 additions & 8 deletions fst/him/nvim-nrw/after/ftplugin/telekasten.lua
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
local wikilink_regex = '\\[\\[.*\\]\\]'
local mdlink_regex = '\\[[^]]*\\](.*)'
local link_regex = [[\(]].. wikilink_regex ..[[\|]].. mdlink_regex ..[[\)]]

vim.keymap.set('n', '<Tab>', '/'.. wikilink_regex ..'<CR>zz', { desc = 'go to next link', buffer = true })
vim.keymap.set('n', '<S-Tab>', '?'.. wikilink_regex ..'<CR>zz', { desc = 'go to prev link', buffer = true })
vim.keymap.set('n', '<C-Tab>', '/'.. link_regex ..'<CR>zz', { desc = 'go to next link', buffer = true })
vim.keymap.set('n', '<C-S-Tab>', '?'.. link_regex ..'<CR>zz', { desc = 'go to prev link', buffer = true })
vim.keymap.set('n', '<leader>nt', function()
local lc = vim.api.nvim_get_option_value('conceallevel', {})
if lc == 0 then
vim.opt_local.conceallevel = 2
else
vim.opt_local.conceallevel = 0
end
end, { desc = '[n]otes [t]oggle conceal' , buffer = true})
-- vim.keymap.set('n', '<leader>nt', function()
-- local lc = vim.api.nvim_get_option_value('conceallevel', {})
-- if lc == 0 then
-- vim.opt_local.conceallevel = 2
-- else
-- vim.opt_local.conceallevel = 0
-- end
-- end, { desc = '[n]otes [t]oggle conceal' , buffer = true})
vim.cmd [[hi link tkTag Constant]] -- custom highlights
-- vim.cmd [[hi link tkHighlight @comment.note]]
vim.cmd [[hi link tkHighlight Visual]]
4 changes: 2 additions & 2 deletions fst/him/nvim-nrw/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ vim.cmd('colorscheme ' .. inital_colorscheme)

require 'handdara'.setup {
-- colorscheme = "rose-pine-moon",
colorscheme = { name = "rose-pine-dawn", is_light = true },
-- colorscheme = { name = "rose-pine-dawn", is_light = true },
-- colorscheme = "darkrose",
-- colorscheme = "lunaperche",
-- colorscheme = "archery",
-- colorscheme = "tmp-archery",
-- colorscheme = "marrissa",
colorscheme = "marrissa",
}
23 changes: 11 additions & 12 deletions fst/him/nvim-nrw/lazy-lock.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
"calendar-vim": { "branch": "master", "commit": "a7e73e02c92566bf427b2a1d6a61a8f23542cc21" },
"carrot.nvim": { "branch": "main", "commit": "722b9bf195fc6bccbf8151c22fb2275386f41e08" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
Expand All @@ -11,28 +10,28 @@
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
"due.nvim": { "branch": "main", "commit": "70a93319fa0345c116f2b57cf1f99e0d20026c5e" },
"fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
"gitsigns.nvim": { "branch": "main", "commit": "ac5aba6dce8c06ea22bea2c9016f51a2dbf90dc7" },
"gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" },
"kmonad-vim": { "branch": "master", "commit": "37978445197ab00edeb5b731e9ca90c2b141723f" },
"lazy.nvim": { "branch": "main", "commit": "7967abe55752aa90532e6bb4bd4663fe27a264cb" },
"lazydev.nvim": { "branch": "main", "commit": "d5800897d9180cea800023f2429bce0a94ed6064" },
"lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" },
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
"mini.files": { "branch": "main", "commit": "6abe854f1410fc6aec69897a78b1db994c32d9c6" },
"mini.icons": { "branch": "main", "commit": "54686be7d58807906cb2c8c2216e0bf9c044f19a" },
"neogit": { "branch": "master", "commit": "89d13fb9898619774d359a3900959181d60dd02f" },
"nvim-cmp": { "branch": "main", "commit": "f17d9b4394027ff4442b298398dfcaab97e40c4f" },
"nvim-lspconfig": { "branch": "master", "commit": "87c7c83ce62971e0bdb29bb32b8ad2b19c8f95d0" },
"nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" },
"nvim-treesitter": { "branch": "master", "commit": "06611c75fec573420838369fe76ac5f8bd740240" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "3e450cd85243da99dc23ebbf14f9c70e9a0c26a4" },
"nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" },
"neogit": { "branch": "master", "commit": "c3a1e8f1b568c7ea844645bc327c22908ea3df68" },
"nvim-cmp": { "branch": "main", "commit": "ed31156aa2cc14e3bc066c59357cc91536a2bc01" },
"nvim-lspconfig": { "branch": "master", "commit": "e869c7e6af0a3c40a2b344a9765779d74dd12720" },
"nvim-surround": { "branch": "main", "commit": "9f0cb495f25bff32c936062d85046fbda0c43517" },
"nvim-treesitter": { "branch": "master", "commit": "427a90ae70f66c2fdf2d9ad16a0f08e9697d90d9" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" },
"nvim-web-devicons": { "branch": "master", "commit": "edbe0a65cfacbbfff6a4a1e98ddd60c28c560509" },
"obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" },
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
"popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" },
"rose-pine": { "branch": "main", "commit": "07a887a7bef4aacea8c7caebaf8cbf808cdc7a8e" },
"telekasten.nvim": { "branch": "main", "commit": "6a10a7929421d6e696e46bbc5aa5627a8cbcf61d" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },
"telescope-media-files.nvim": { "branch": "master", "commit": "0826c7a730bc4d36068f7c85cf4c5b3fd9fb570a" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" },
"which-key.nvim": { "branch": "main", "commit": "68e37e12913a66b60073906f5d3f14dee0de19f2" }
"which-key.nvim": { "branch": "main", "commit": "9b365a6428a9633e3eeb34dbef1b791511c54f70" }
}
4 changes: 4 additions & 0 deletions fst/him/nvim-nrw/lua/handdara/carrot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ vim.keymap.set('n', '<leader>ce', function ()
vim.bo.filetype = prev_ft
vim.cmd 'write'
vim.cmd 'edit'
elseif prev_ft == "markdown" then
c.execute_normal()
end
end, { desc = '[c]arrot: [e]val code block' })
vim.keymap.set('n', '<leader>cE', function ()
Expand All @@ -18,5 +20,7 @@ vim.keymap.set('n', '<leader>cE', function ()
vim.bo.filetype = prev_ft
vim.cmd 'write'
vim.cmd 'edit'
elseif prev_ft == "markdown" then
c.execute_all()
end
end, { desc = '[c]arrot: [E]val all code block' })
1 change: 1 addition & 0 deletions fst/him/nvim-nrw/lua/handdara/config/set.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
return function()
vim.o.conceallevel = 1
vim.o.breakindent = true -- Enable break indent
vim.o.expandtab = true
vim.o.hlsearch = false -- highlight on search
Expand Down
32 changes: 32 additions & 0 deletions fst/him/nvim-nrw/lua/handdara/obsidian.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
-- THIS IS CALLED ON VIM INIT, NOT LAZY CONFIG!
local map = vim.keymap.set
local maps = {
["<leader>nx"] = {
modes = 'v',
action = ":ObsidianExtractNote<CR>",
opts = { buffer = true },
},
["<leader>nln"] = {
modes = 'v',
action = ":ObsidianLinkNew<CR>",
opts = {},
},
["<leader>nll"] = {
modes = 'v',
action = ":ObsidianLink<CR>",
opts = { buffer = true },
},
["<leader>na"] = {
modes = 'n',
action = ":ObsidianToday<CR>",
opts = {},
},
["<leader>nf"] = {
modes = 'n',
action = ":ObsidianQuickSwitch<CR>",
opts = {},
},
}
for combos, dat in pairs(maps) do
map(dat.modes, combos, dat.action, dat.opts )
end
Loading

0 comments on commit bd3d2d5

Please sign in to comment.