Compare commits

..

No commits in common. "0dd6558770ec8f9cd6cf72c782e808baeef1743b" and "024e8530d0fa98063f07d876bdf58b8acf65e091" have entirely different histories.

4 changed files with 60 additions and 17 deletions

View File

@ -53,9 +53,6 @@ via writing and typing.
I am in the process of moving away from Obsidian so that I can write ZK notes I am in the process of moving away from Obsidian so that I can write ZK notes
text-editor agnostically. text-editor agnostically.
#### mickael-menu/zk
- Config file: `zk/config.toml` - Config file: `zk/config.toml`
- Command: `ln [-s] $PWD/zk/config.toml ~/.config/zk/config.toml` - Command: `ln [-s] $PWD/zk/config.toml ~/.config/zk/config.toml`
@ -65,18 +62,6 @@ text-editor agnostically.
Note (2023-06-07): I'm now using a mix of nvim-zk with Notion. I'm still figuring out Note (2023-06-07): I'm now using a mix of nvim-zk with Notion. I'm still figuring out
a centralize place to put my notes and use it to do some knowledge graph magic a centralize place to put my notes and use it to do some knowledge graph magic
NOTE (2023-06-18): I used `mickael-menu/zk` for some time, but have found myself
resort to notion due to the need for easier linking (just copy-paste onto
selected note) where as I need to:
- `cS]` to encapsulate the selection with `[]`, then do `(<C-v>`. Too many keystrokes.
On retrospect, I could probably remap this workflow to `<LocalLeader>el"`:
Though, I want to just develop my own solution with
[`nucliadb`](https://github.com/nuclia/nucliadb) and
[`h2ogpt`](https://github.com/h2oai/h2ogpt)
## Troubleshoots ## Troubleshoots
### My MacOS just updated, `nix` is no-longer here ### My MacOS just updated, `nix` is no-longer here

View File

@ -61,6 +61,8 @@
} }
{ {
devShells = std.harvest self [["dotfiles" "devshells"]]; devShells = std.harvest self [["dotfiles" "devshells"]];
# nixosConfigurations = std.pick [ [ "dotfiles" "nixos" ] ];
# homeConfigurations = std.pick [ [ "dotfiles" "home" ] ];
homeModules = std.pick self [["repo" "home-modules"]]; homeModules = std.pick self [["repo" "home-modules"]];
packages = std.harvest self [["repo" "packages"]]; packages = std.harvest self [["repo" "packages"]];
legacyPackages = std.harvest self [["repo" "home-configs"]]; legacyPackages = std.harvest self [["repo" "home-configs"]];

View File

@ -111,6 +111,7 @@ WPlug('nvim-treesitter/nvim-treesitter-context') -- Top one-liner context of fun
WPlug('nvim-treesitter/playground') -- Sees Treesitter AST - less hair pulling, more PRs WPlug('nvim-treesitter/playground') -- Sees Treesitter AST - less hair pulling, more PRs
WPlug('saadparwaiz1/cmp_luasnip') -- snippet engine WPlug('saadparwaiz1/cmp_luasnip') -- snippet engine
WPlug('L3MON4D3/LuaSnip') -- snippet engine WPlug('L3MON4D3/LuaSnip') -- snippet engine
WPlug('mickael-menu/zk-nvim') -- Zettelkasten
WPlug('folke/neodev.nvim') -- Neovim + lua development setup WPlug('folke/neodev.nvim') -- Neovim + lua development setup
-- Switch cases: -- Switch cases:
-- `gsp` -> PascalCase (classes), `gsc` -> camelCase (Java), `gs_` -> snake_case (C/C++/Rust) -- `gsp` -> PascalCase (classes), `gsc` -> camelCase (Java), `gs_` -> snake_case (C/C++/Rust)
@ -208,8 +209,8 @@ vim.opt.completeopt = { "menu", "menuone", "noselect", "noinsert" }
-- vim.opt.clipboard = "unnamedplus" -- vim.opt.clipboard = "unnamedplus"
-- more aggressive swap file writing. ThePrimeagen believes higher number
-- more aggressive swap file writing. ThePrimeagen believes higher number leads to low DX -- leads to low DX
vim.opt.updatetime = 50 vim.opt.updatetime = 50
vim.g.mapleader = ' ' vim.g.mapleader = ' '
@ -437,6 +438,16 @@ remap('n', '<leader>fd', function()
require('telescope.builtin').diagnostics() require('telescope.builtin').diagnostics()
end, { desc = '[F]ind [D]iagnostics' }) end, { desc = '[F]ind [D]iagnostics' })
-- ZK remap stuffs
remap('n', '<leader>zf', function()
-- vim.cmd([[:ZkNotes]])
require('zk').edit({}, { multi_select = false })
end, { desc = '[Z]ettelkasten [F]iles' })
remap('n', '<leader>zg', function()
vim.cmd(":ZkGrep")
end, { desc = '[Z]ettelkasten [G]rep' })
-- tab management {{{ -- tab management {{{
-- Jump to specific tab with <C-t>[number] -- Jump to specific tab with <C-t>[number]
@ -1242,6 +1253,49 @@ require("rust-tools").setup {
}, },
} }
require('zk').setup({
picker = "telescope",
lsp = {
config = {
cmd = { "zk", "lsp" },
name = "zk",
on_attach = on_attach,
},
auto_attach = {
enable = true,
filetypes = { "markdown" }
},
},
})
-- Custom ZkOrphans that determines unlinked notes
-- `:ZkOrphans {tags = {"work"}}`
require('zk.commands').add("ZkOrphans", function(options)
options = vim.tbl_extend("force", { orphan = true }, options or {})
-- zk.edit opens notes picker
require('zk').edit(options, { title = "Zk Orphans (unlinked notes)" })
end)
--
-- ZkGrep: opens file picker
-- In the case where `match_ctor` is falsy, create a prompt.
-- This is so that we distinguish between ZkGrep and ZkNotes
-- Params:
-- match_ctor: string | {match= :string,...} | "" | nil
require('zk.commands').add("ZkGrep", function(match_ctor)
-- handle polymorphic `match_ctor`
local grep_str = match_ctor
local match
if match_ctor == nil or match_ctor == '' then
vim.fn.inputsave()
grep_str = vim.fn.input('Grep string: >')
match = { match = grep_str }
elseif type(match_ctor) == 'string' then
match = { match = grep_str }
end
require('zk').edit(match, { title = "Grep: '" .. grep_str .. "'", mutli_select = false })
end)
-- Gitsigns -- Gitsigns
require('gitsigns').setup { require('gitsigns').setup {
signs = { signs = {

View File

@ -22,7 +22,9 @@
pkgs.tree-sitter pkgs.tree-sitter
pkgs.fzf # file name fuzzy search pkgs.fzf # file name fuzzy search
pkgs.ripgrep # content fuzzy search pkgs.ripgrep # content fuzzy search
pkgs.zk # Zettelkasten (limited support)
pkgs.fd # Required by a Telescope plugin (?) pkgs.fd # Required by a Telescope plugin (?)
pkgs.stdenv.cc.cc.lib
pkgs.rnix-lsp # doesn't work, Mason just installs it using cargo pkgs.rnix-lsp # doesn't work, Mason just installs it using cargo
pkgs.rust4cargo pkgs.rust4cargo
pkgs.nickel pkgs.nickel