Just wanted to say a massive thank you for the incredibly useful and professional content! So clear and well presented. Just implimented your buildNote / BufWritePost setup for my markdown note taking in nvim and it's made my life sooo much easier:) again, thanks so much!
Next level productivity configuration here, by which I mean a setup that works well and spans multiple programs for a holistic solution. Lot’s of inspiring ideas!
I tried the nvim command but it was doing some funny thing for me. Like deleting the previous taken note, adding a newline, writing note's time and putting cursor at start of the timestamp line I just replaced -c to the + operator in nvim command and its working now. maybe some nvimrc settings were conflicting
Instead of `:wq` and `:q!`, you can use `ZZ`, and `ZQ` to do the same jobs. Not a huge deal, but since I found out about it, those became how I exit vim most of the time. I also added a ZS mapping to write the file to a temporary file (and exit), so that I can `sudo mv ~/tmp/foo /etc/write/protected/file.conf` (actually, I have a script that does the moving, but you get the idea).
@@Flackon It's not good. `nmap ZS :w !preparePrivWrite %:q!` With ~/.local/bin/preparePrivWrite ``` #!/bin/sh DEST="$HOME/tmp" NAME="$DEST/privilege_write" if [ ! -d "$DEST" ]; then echo "error: $DEST does not exist." exit 1 fi cat - > "$NAME.content" printf '#!/bin/sh sudo mv %s %s ' "$NAME.content" "$1" > "$NAME.sh" chmod u+x "$NAME.sh" ``` (Actually it's better than I remembered, but still messy. Also, this is in my config on a remote machine. I don't have ZS on my own machine, but if I do copy it over, I'll be able to improve it with dmenu)
Thanks, I was not aware of ZZ! I have :wq keymapped for this purpose but now that I know there is a built in way to do this I can get that keybind back.
So I implemented it. Works like a charm. Thanks again. But I want to share a little hiccup I faced. My terminal emulator of choice is Alacritty. When copying the i3config keybindings I kept the sequence of arguments for bringing up the floating terminal as suggested for termite. But Alacritty wouldn't open as a floating window. With xprop I figured out that the window title wouldn't change as expected. Reading the man page for Alacritty I finally noticed that the "-e" option has to be the last option of the command. So I changed the alacritty command as required and the window started floating. :) Hope that helps anybody having the same issue.
I fucking love you man !!!! I was wondering about journal app exactly like this. I bow to the youtube algorithm that suggested me this video !!!🙇 I use markdown-preview to preview my markdown files. I am using kde and I have added a global shortcut. Its awesome !!!!❤ And you got another subscriber !! I love how you gently explain things. Cheers 🍻
Nice workflow. Sucks that Markdown to PDF conversion isn't instantaneous. Those PDFs must take up some space on your Dropbox. Maybe using `cmark | htmlviewer` thing would be cool. Maybe MD to GROFF to PDF?
Yea, I could just pipe the MD straight into pandoc when I want to view them but I like storing the static files in dropbox so I can get to them from my phone if necessary. I have a 2 TB dropbox account anyway so It's not a problem in terms of space. I *could* set up a little webservice to generated the PDFs on request but then we're getting silly :D
For those of you who did not successfully float the window using title, for me setting a class for the instance of the window worked: for_window [class="notetaker_window"] floating enable bindsym $mod+Shift+n exec --class notetaker_window -e
If you :wq for some reason the autocmd does not recognize the BufBritePost, I do not know if its because it closes too fast but it incapacitates the ability to do :wq and then read the last note, has anyone encountered this? do they know a solution? if so please respond to this comment
How did i end up on this vim video? I don't even use vim! life works in mysterious ways. Great stuff though, gave me some ideas for my own note taking.
Awesome stuff, this seems quite suitable for my use case. Any ideas on how to implement the floating window if one does not use i3, since I'm using macOS?
Slight clarification perhaps: It's not just neovim. It's neovim + i3. I'm guessing that I as a mac user can't use any of this, right? Note: Still like the configuration you have here it's pretty cool.
Unfortunately, Macs are very locked down in terms of their customisation (this is main reason I don't use one) so you probably can't do exactly what I do but I hope you get some inspiration at least.
Hey, not sure if you changed it already, but a shebang like `#!/bin/sh` isn't really what you want to do. `/bin/sh` is the default shell that doesn't necessarily has to be POSIX compliant (like fish, for example). So, using bash inside a file with this shebang is probably wrong. I recommend you use `#!/usr/bin/env bash` instead, which will always use bash, regardless of where it is installed.
Hi, thanks for your comment but it's not quite right. Firstly the scripts featured in this video have no bashisms at all. They aren't bash scripts, they are shell scripts so it's fine to use #!/bin/sh. Note that I don't use #!/bin/bash nor do I use any bash at all in this video. Secondly !#/bin/sh doesn't point to the default user shell, it specifically points to a POSIX compliant (or at least compatible) shell on the system. If you change the symlink /bin/sh to point at fish you are going to have a bad time very quickly. Changing the user shell does *not* change /bin/sh. Thirdly the !#/usr/bin/env bash hack is kinda silly when talking about POSIX compliance because POSIX doesn't specify the location of the env executable either so it's kinda arbitrary and mainly exists because of MacOS users. Also, using env will cause the script to use the first instance of that executable in the user's path which means it will run differently depending on who runs it. That might not matter for most things but it can definitely matter for system scripts. Fourthly, kind of as aside, there's no real requirement to make personal shell scripts 100% portable (not that that's possible) across *NIX systems. This is not production code. I talk about this in more depth in the animated backgrounds video if you're interested. Hope that helped.
Out of curiousity have you tried Org Mode much? Took me a while to learn, but no exaggeration, org mode has changed my life. *looks* like you use GTD, Org Mode is very much based on gtd. No judgement on how you're doing it, obviously, but recommend giving it a shot. Also: expecting weekly videos as the norm now. ;)
Org mode is something i've avoided simply because my current system seems pretty well optimised and the switching cost is likely to be too high to be worth it. My systems are not *quite* GTD as described by David Allen but I do adhere to a lot of the principles he set out, yea. I do have a couple more videos in the pipeline so theres at least a few more coming before i drop off a cliff again.
Very interesting.... sounds a bit like a zettelkasten method in vim zettelkasten.de/ en.wikipedia.org/wiki/Zettelkasten Just missing inner links between the notes
I love the script you were not too proud of. Modified it slightly to use norg format instead of markdown and to create a symbolic link from the norg file to a txt file so that the txt file would be viewable on Google Drive: #!/bin/sh norgFilename="$HOME/Notes/ideas/$(date +%Y-%m-%d).norg" textFilename="$HOME/Notes/ideas/$(date +%Y-%m-%d).txt" if [ ! -f "$norgFilename" ]; then echo "* $(date +'%A, %-d %B %Y')" > $norgFilename fi if [ ! -f "$textFilename" ]; then ln $norgFilename $textFilename fi nvim -c "norm G2o" \ -c "norm Go** $(date +%H:%M)" \ -c "norm Go " \ -c "norm zz" \ -c "startinsert" $norgFilename
when you said, "here's a script that I'm pretty ashamed of, but it works" I felt that in my soul
Just wanted to say a massive thank you for the incredibly useful and professional content! So clear and well presented. Just implimented your buildNote / BufWritePost setup for my markdown note taking in nvim and it's made my life sooo much easier:) again, thanks so much!
Awesome, I'm glad the videos helped you get better at this stuff.
Next level productivity configuration here, by which I mean a setup that works well and spans multiple programs for a holistic solution. Lot’s of inspiring ideas!
That is exactly what I need. Capture fleeting thoughts. Using Neovim.
Thank you!
Even 2 years later works well with my window manager! Exactly what I was looking for!
Thanks for your video. All your content is outstanding. Keep up the great work.
Amazing workflow. I will surely steal that from you. Just what I need right now. Thanks for sharing!
Uuy
Rhgl
Super cool! I implemented your scripts with DWM, Alacritty and Groff! Works really well, thank you very much!!
I tried the nvim command but it was doing some funny thing for me. Like deleting the previous taken note, adding a newline, writing note's time and putting cursor at start of the timestamp line
I just replaced -c to the + operator in nvim command and its working now. maybe some nvimrc settings were conflicting
Instead of `:wq` and `:q!`, you can use `ZZ`, and `ZQ` to do the same jobs. Not a huge deal, but since I found out about it, those became how I exit vim most of the time. I also added a ZS mapping to write the file to a temporary file (and exit), so that I can `sudo mv ~/tmp/foo /etc/write/protected/file.conf` (actually, I have a script that does the moving, but you get the idea).
Sounds useful. What's your ZS command if you don't mind?
@@Flackon It's not good.
`nmap ZS :w !preparePrivWrite %:q!`
With ~/.local/bin/preparePrivWrite
```
#!/bin/sh
DEST="$HOME/tmp"
NAME="$DEST/privilege_write"
if [ ! -d "$DEST" ]; then
echo "error: $DEST does not exist."
exit 1
fi
cat - > "$NAME.content"
printf '#!/bin/sh
sudo mv %s %s
' "$NAME.content" "$1" > "$NAME.sh"
chmod u+x "$NAME.sh"
```
(Actually it's better than I remembered, but still messy. Also, this is in my config on a remote machine. I don't have ZS on my own machine, but if I do copy it over, I'll be able to improve it with dmenu)
Thanks, I was not aware of ZZ! I have :wq keymapped for this purpose but now that I know there is a built in way to do this I can get that keybind back.
haha, half past 2 in the morning
This is such a great tip, always wanted something like it, no need for the PDF only the 'notetaker' is very helpful, thanks for sharing
I find your videos refreshing, and your ideas are very creative, I wish I could have a little bit of your cleverness.
So I implemented it. Works like a charm. Thanks again.
But I want to share a little hiccup I faced. My terminal emulator of choice is Alacritty. When copying the i3config keybindings I kept the sequence of arguments for bringing up the floating terminal as suggested for termite. But Alacritty wouldn't open as a floating window. With xprop I figured out that the window title wouldn't change as expected. Reading the man page for Alacritty I finally noticed that the "-e" option has to be the last option of the command. So I changed the alacritty command as required and the window started floating. :)
Hope that helps anybody having the same issue.
can you give us the exact line you used?
thanks for figuring this out, I still can't get it to work tho.
would appreciate it if you could share the line you used.
I fucking love you man !!!! I was wondering about journal app exactly like this. I bow to the youtube algorithm that suggested me this video !!!🙇 I use markdown-preview to preview my markdown files. I am using kde and I have added a global shortcut. Its awesome !!!!❤
And you got another subscriber !! I love how you gently explain things. Cheers 🍻
very nice workflow! i use the almost same with org files and i love it
Nice workflow. Sucks that Markdown to PDF conversion isn't instantaneous. Those PDFs must take up some space on your Dropbox. Maybe using `cmark | htmlviewer` thing would be cool. Maybe MD to GROFF to PDF?
Yea, I could just pipe the MD straight into pandoc when I want to view them but I like storing the static files in dropbox so I can get to them from my phone if necessary. I have a 2 TB dropbox account anyway so It's not a problem in terms of space. I *could* set up a little webservice to generated the PDFs on request but then we're getting silly :D
I usually use glow to quickly read md
ever think about viewing your MD's in Obsidian? Its fully x-platform and I use dropbox to sync.
Is is just me, but that openning quote is so superrrrrrr
Are you planning on making a video about that slick fzf floating search window at 8:26 ?
ruclips.net/video/QeJkAs_PEQQ/видео.html
@@a_maxed_out_handle_of_30_chars thanks, great video
Yeah, I need to do another vim workflow video since my last one is pretty out of date now.
Ooooh, this is what I have been looking for since Nixcasts is MIA right now.
For those of you who did not successfully float the window using title, for me setting a class for the instance of the window worked:
for_window [class="notetaker_window"] floating enable
bindsym $mod+Shift+n exec --class notetaker_window -e
If you :wq for some reason the autocmd does not recognize the BufBritePost, I do not know if its because it closes too fast but it incapacitates the ability to do :wq and then read the last note, has anyone encountered this? do they know a solution? if so please respond to this comment
I am facing the similar issue, I think in my case filename variable does not receive any argument from autocmd BufWritePost.
How did i end up on this vim video? I don't even use vim! life works in mysterious ways. Great stuff though, gave me some ideas for my own note taking.
Glad it was helpful! I do discuss things beside vim on here. Mostly productivity stuff in general so it might be worth a sub if you're so inclined.
Hello! I loved your terminal! Where I can find this .bashrc?
Awesome stuff, this seems quite suitable for my use case. Any ideas on how to implement the floating window if one does not use i3, since I'm using macOS?
Sorry, I'm not a mac user but I imagine there is some way to trigger a terminal window in a certain position.
@@FunctionalIndustries Thank you for the reply. There is a way in nvim since it provides "nvim_create_buff()".
How do i get my terminal prompt looking like that?
I am HARD at work doing things
You have such a great videos! I demand MORE ;-)
Is that way to do the same with normal VIM?
Sorry for my stupid question but which is the mod key?
It's the key used to interface with the window manager. In my case it's bound to the windows key.
thank you
cant realy find the notetaker script in your dot files, perhaps you don't use it now? It was easy to copy though.
What Linux distro you are using?
What terminal you are using?
Plz, give your entire Linux setup.
It's Arch Linux.
I'm going to make a set up video at some point but theres not much to it.
Amazing, but can’t compile on mobile 😢 sticking with Joplin for now...
Nice capture system
Slight clarification perhaps: It's not just neovim. It's neovim + i3.
I'm guessing that I as a mac user can't use any of this, right?
Note: Still like the configuration you have here it's pretty cool.
Unfortunately, Macs are very locked down in terms of their customisation (this is main reason I don't use one) so you probably can't do exactly what I do but I hope you get some inspiration at least.
great tip, thanks!
Is this specific to nvim? Or can this be done with regular vim as well?
There's nothing neovim specific here. should work fine with regular vim.
What font are you using?
Cascadia in this video. I generally use Tamzen though but pixel fonts arent very good for videos.
@@FunctionalIndustries cool, thank you
How do I find your channel's avatar?
Hey, not sure if you changed it already, but a shebang like `#!/bin/sh` isn't really what you want to do. `/bin/sh` is the default shell that doesn't necessarily has to be POSIX compliant (like fish, for example). So, using bash inside a file with this shebang is probably wrong. I recommend you use `#!/usr/bin/env bash` instead, which will always use bash, regardless of where it is installed.
Hi, thanks for your comment but it's not quite right.
Firstly the scripts featured in this video have no bashisms at all. They aren't bash scripts, they are shell scripts so it's fine to use #!/bin/sh. Note that I don't use #!/bin/bash nor do I use any bash at all in this video.
Secondly !#/bin/sh doesn't point to the default user shell, it specifically points to a POSIX compliant (or at least compatible) shell on the system. If you change the symlink /bin/sh to point at fish you are going to have a bad time very quickly. Changing the user shell does *not* change /bin/sh.
Thirdly the !#/usr/bin/env bash hack is kinda silly when talking about POSIX compliance because POSIX doesn't specify the location of the env executable either so it's kinda arbitrary and mainly exists because of MacOS users. Also, using env will cause the script to use the first instance of that executable in the user's path which means it will run differently depending on who runs it. That might not matter for most things but it can definitely matter for system scripts.
Fourthly, kind of as aside, there's no real requirement to make personal shell scripts 100% portable (not that that's possible) across *NIX systems. This is not production code. I talk about this in more depth in the animated backgrounds video if you're interested.
Hope that helped.
Brilliant.
What OS are you using?? Arch??
Yes
Out of curiousity have you tried Org Mode much? Took me a while to learn, but no exaggeration, org mode has changed my life. *looks* like you use GTD, Org Mode is very much based on gtd. No judgement on how you're doing it, obviously, but recommend giving it a shot.
Also: expecting weekly videos as the norm now. ;)
Org mode is something i've avoided simply because my current system seems pretty well optimised and the switching cost is likely to be too high to be worth it. My systems are not *quite* GTD as described by David Allen but I do adhere to a lot of the principles he set out, yea.
I do have a couple more videos in the pipeline so theres at least a few more coming before i drop off a cliff again.
You would be much better off using `find` instead of `ls` when listing files in a directory, to avoid unexpected behaviours.
If I control the contents of the directory it's not really a concern. I mention the issue of parsing ls in my text snippets video.
Very interesting.... sounds a bit like a zettelkasten method in vim
zettelkasten.de/
en.wikipedia.org/wiki/Zettelkasten
Just missing inner links between the notes
So just like org mode but with a lot of extra steps
I prefer vim to Emacs but that's just personal preference. I'm sure Emacs is a very good option for some people.
I love the script you were not too proud of. Modified it slightly to use norg format instead of markdown and to create a symbolic link from the norg file to a txt file so that the txt file would be viewable on Google Drive:
#!/bin/sh
norgFilename="$HOME/Notes/ideas/$(date +%Y-%m-%d).norg"
textFilename="$HOME/Notes/ideas/$(date +%Y-%m-%d).txt"
if [ ! -f "$norgFilename" ]; then
echo "* $(date +'%A, %-d %B %Y')" > $norgFilename
fi
if [ ! -f "$textFilename" ]; then
ln $norgFilename $textFilename
fi
nvim -c "norm G2o" \
-c "norm Go** $(date +%H:%M)" \
-c "norm Go " \
-c "norm zz" \
-c "startinsert" $norgFilename