4 ms·
Hi thanks for your sharing your usage! I'm very interested in doing this. I tried to use a sqlite database (using dbrowser gui) to handle my resources for my re
by duckgoesmooo 5y ago
Hi thanks for your sharing your usage! I'm very interested in doing this. I tried to use a sqlite database (using dbrowser gui) to handle my resources for my researching. But I'm not a programmer so I struggled to learn SQL.
Couple questions:
How do you handle mistyping the wrong tag? Is there something you use that could lint mistakes?
Is there a way to show all the tags that's available or you've used? Like grepping to show all the unique tags, but in emacs.
How do you handle stale links (links you no longer visit)? Delete them, move them, mark them stale or something?
If you wanted to see everything related to say tag1, tag2, keyword1, and keyword2, is there some way to like "grab" all those links and view them in a separate buffer? I guess it's more like filtering and reactively changing the list to show you what you want.
- foobarbaz33 5y ago> Is there a way to show all the tags that's available or you've used? No. But I could implement that in a few minutes. I could search for "tags:" headers, add the trailing text items to a list, then call function delete-dups. Or I could use a pre-defined list of tags and have a function that lets me select from that. But this starts moving away from the "just a text file" thing, and I'd have to start creating my own custom mode. That's nice but then I'm also forcing rules, structure, and even custom user interface that's beyond "just a text file". Minimal structure and rules is a feature too, it's easier to add new bookmarks. > How do you handle stale links I haven't had a stale link yet. If I ever notice one, I'll delete or correct. Or maybe add a flag STALE: in front of the URL if i want to keep it for historical purposes. > see everything related to say tag1, tag2, keyword1, and keyword2, is there some way to like "grab" all those links and view them in a separate buffer? Sort of. I use grep-like line based searching. It searching lines only, not "records". So it treats each line as it's own thing. But it gets the job done. I use the swiper package. With it's out-of-order matching mode. So my search query might be: food meat It would find lines that contained both search items in any order. I only bother with "and" style search not "or". It is flawed. If food and meat are on separate lines, it would not find the match. A more advanced search feature that understands the file format could solve that. Or a better suited database file structure. But not worth it for me. 99% of the time I'm searching 1 keyword only.
- duckgoesmooo 5y agoThanks for answering! I looked into everything you said and gained a lot of ideas from this. For anyone who uses vim or anyone interested reading, because the setup is pretty simple, I managed to put together a similar setup in vim. I'm using bookmarks.txt for web and files.txt for local files (I have a TON of pdfs, books, .md, .txt, .doc, etc. to cross reference). For web I need to open urls with different profiles (firefox/opera/chrome). "Add chrome folder to env variables nnoremap <Leader>j :silent execute "!chrome <C-r><C-a>"<CR> "Add firefox folder to env variables nnoremap <Leader>k :silent execute "!firefox <C-r><C-a>"<CR> For files I'm using cmd (windows) to open the files using the default applications under the cursor. "https://stackoverflow.com/questions/23316272/gvim-windows-7-netrw-open-url-under-text-cursor "https://vi.stackexchange.com/questions/26007/getting-gx-to-open-a-url "https://vi.stackexchange.com/questions/26052/select-word-under-cursor "https://stackoverflow.com/questions/21224865/what-does-the-number-1-in-the-shellescape-function-mean-in-vim nnoremap <Leader>h :silent execute '!explorer ' . shellescape(expand('<cfile>'), 1)<CR> I picked FZF to find the files quickly in the terminal. Also using FZF Vim plugin to search tags in bookmarks.txt and files.txt. It has similar behavior to how you described swiper. From https://github.com/junegunn/fzf/blob/master/README-VIM.md#examples https://github.com/junegunn/fzf/blob/master/README-VIM.md#ex..., I send the FZF buffer line results to the quickfix window so results persist and jump easily to each bookmark. Use :BLines, "tag1 tag2 keyword" or "tag: tag1 tag2", <ctrl-a> selects all results, then <ctrl-q> sends it to the quickfix results. Didn't modify the code from the example at all: " An action can be a reference to a function that processes selected lines function! s:build_quickfix_list(lines) call setqflist(map(copy(a:lines), '{ "filename": v:val }')) copen cc endfunction let g:fzf_action = { \ 'ctrl-q': function('s:build_quickfix_list'), \ 'ctrl-t': 'tab split', \ 'ctrl-x': 'split', \ 'ctrl-v': 'vsplit' } I would have liked to use the location list instead of the quickfix window. Unfortunately, I couldn't get the location list to work for the buffer lines results. Seems like it only works for file results. See: https://github.com/junegunn/fzf/issues/1885 https://github.com/junegunn/fzf/issues/1885. Using <f2> to open the quickfix window. Then using <ctrl+shift+n> (next) and <ctrl+shift+p> (previous) to jump to each results. command! -nargs=0 JojoToggleQuickFix if empty(filter(getwininfo(), "v:val.quickfix")) | copen | else | cclose | endif nnoremap <f2> :JojoToggleQuickFix<CR> nnoremap <C-S-n> :cnext<CR> nnoremap <C-S-p> :cprevious<CR> I type "bmk" and it will expand to the following snippet. title: link: tags: date: @2021-07-07 description: This is the abbreviation in vim. "Bookmark/File snippet iabbrev bmk title:<CR> \link:<CR> \tags:<CR> \date: <C-R>=strftime("@%Y-%m-%d")<CR><CR> \description:<CR> I setup custom syntax highlighting (title:, link:, tags:, date:, description:, and tags) for .txt files in vim. title: "Pixologic ZBrush - YouTube" tags: @youtube @zbrush @3d @modeling @learn link: https://www.youtube.com/c/PixologicZBrush/videos description: Industry standard 3D sculpting application. Also using AutoHotkey to open files in the clipboard: ;https://www.autohotkey.com/docs/misc/Clipboard.htm :R*:````q:: run, "%Clipboard%" return I'm using this when I'm outside of vim.