Quickly Edit Posts
Recently I automated starting new posts with a python script. Today I want to
work on the next part that is editing those posts quickly.
Automating my Post Starter [1]
Check out this post about setting up my posts with python π
Enter Bash # [2]
For the process of editing a post I just need to open the file in vim quickly.
I dont need much in the way of parsing and setting up the frontmatter. I think
this is a simple job for a bash script and fzf.
- change to the root of my blog
- fuzzy find the post
- open it with vim
- change back to the directory I was in
bash function # [3]
For this I am going to go with a bash function. This is partly due to being
able to track where I was and get back. Also the line with nvim will run fzf
everytime you source your ~/.alias file which is not what we want.
Lets setup the boilerplate. Its going to create a function called ep
"edit post", track our current directory, create a sub function _ep. Then
call that function and cd back to where...