Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyuga-Tsukui committed Aug 24, 2024
1 parent b4881f0 commit 00a29de
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 2 deletions.
58 changes: 56 additions & 2 deletions dot_config/nvim/init.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
if not vim.g.vscode then
require("core.keymaps")
vim.cmd[[colorscheme tokyonight]]
require("core.keymaps")
vim.cmd[[colorscheme tokyonight]]
local opt = vim.opt
opt.tabstop = 4
opt.expandtab = true
opt.shiftwidth = 4
opt.smartindent = true
opt.relativenumber = true
opt.cmdheight = 0
opt.conceallevel = 2

vim.keymap.set('t', '<C-w>h', "<C-\\><C-n><C-w>h",{silent = true})

-- autocmd
vim.api.nvim_create_autocmd("TermOpen", {
pattern = "*",
callback = function()
opt.relativenumber = false
opt.number = false
end,
})


function Open_cheatsheet()
local che = vim.fn.stdpath("config") .. "/cheatsheet.md"
Expand Down Expand Up @@ -177,6 +190,47 @@ if not vim.g.vscode then
vim.g.memolist_path = vim.fn.expand("~/.config/memo/_posts")
end,
})

-- obsidian
use({
"epwalsh/obsidian.nvim",
tag = "*", -- recommended, use latest release instead of latest commit
requires = {
-- Required.
"nvim-lua/plenary.nvim",

-- see below for full list of optional dependencies 👇
},
config = function()
require("obsidian").setup({
workspaces = {
{
name = "personal",
path = vim.fn.expand("~/obsidian")
},
},

-- see below for full list of options 👇
disable_frontmatter = true,
note_id_func = function(title)
-- Create note IDs in a Zettelkasten format with a timestamp and a suffix.
-- In this case a note with the title 'My new note' will be given an ID that looks
-- like '1657296016-my-new-note', and therefore the file name '1657296016-my-new-note.md'
local suffix = ""
if title ~= nil then
-- If title is given, transform it into valid file name.
suffix = title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower()
else
-- If title is nil, just add 4 random uppercase letters to the suffix.
for _ = 1, 4 do
suffix = suffix .. string.char(math.random(65, 90))
end
end
return tostring(os.time()) .. "-" .. suffix
end,
})
end,
})
end)
end

Expand Down
6 changes: 6 additions & 0 deletions dot_config/nvim/lua/core/keymaps.lua
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
vim.g.mapleader = " "

vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
vim.keymap.set("n", "<leader>nh", ":nohl<CR>")

vim.keymap.set("c", "<C-r>", "<C-c>:FzfLua command_history<CR>", { noremap = true, silent = true })


0 comments on commit 00a29de

Please sign in to comment.