This is essentially an easy way to get tags auto completed in vim.
- GNU Stow will make life a little easier with respect to copying scripts etc.
- Vim-Plug
- This will make FZF.Vim easier to install.
- ripgrep
- This provides an easy way to insert
#tags
- I'll post up a simple R script to pass
#tags
to [TMSU after exams and put a link here.
- I'll post up a simple R script to pass
- This provides an easy way to insert
This is really written with Linux in mind.
- Download the
printMarkdownTags
folder to~/bin/
- Alternatively download it to
~/DotFiles/Scripts/bin
and then performstow -S -t $HOME ~/DotFiles/Scripts
- Alternatively download it to
- Install FZF.Vim
- If youre Notes are in
~/Notes/MD/notes
then Add the following to your~/.vimrc
(and/or possibly~/.config/nvim/init.vim
), otherwise modify the directory to match your flavour:
imap <expr> <C-c><C-y> fzf#vim#complete('node ~/bin/printMarkdownTags/yaml-parse.js $HOME/Notes/MD/notes \| sort -u')
imap <expr> <C-c><C-t> fzf#vim#complete('rg --pcre2 "\s#[a-zA-Z-@]+\s" -o --no-filename $HOME/Notes/MD -t md \| sort -u')
- Open a fresh vim instance, open a markdown file and hit
C-c C-y
, you should get a popup of all the yaml tags in the notes folder,C-c C-t
will offer a popup of#tags
like in iaWriter, Zettlr or Obsidian
Check out this quick gif
:
- Searching
- It is very simple to integrate a terminal search with recoll such that
you never need to leave your terminal.
- TODO Put up this script
- Notational-fzf-vim is essentially a vim front end for fzf and
ripgrep, not as powerful as
recoll
but handy if you know the exact term your looking for
- It is very simple to integrate a terminal search with recoll such that
you never need to leave your terminal.
- Tags
- It's easy to pass both
#tags
andyaml
tags to TMSU so that you can browse them using mount- TODO Post this script up
- It's easy to pass both
I initially tried this in R because I didn't actually know any JavaScript, but it was too slow, the tags took just long enough to pop up that I found it irritating and did it in JS, if you want to play around with that R-script you can add the following to your vimrc:
"" RScript to give tags to FZF
imap <expr> <C-c><C-r> fzf#vim#complete('Rscript ~/bin/printMarkdownTags/ListTags.R > /dev/null 2>&1; cat /tmp/00tags.csv')
I couldn't figure out an easy way to do this in Emacs, the best method I currently have is to open vim from emacs like this:
(defun my-open-current-file-in-vim ()
(interactive)
(async-shell-command
; (format "gvim +%d %s"
(format "~/.local/kitty.app/bin/kitty -e nvim +%d %s"
(+ (if (bolp) 1 0) (count-lines 1 (point)))
(shell-quote-argument buffer-file-name))))
(global-set-key (kbd "C-c v") 'my-open-current-file-in-vim)
If anybody knows of a better way to do this from Emacs let me know!