vim on nixre.net https://www.nixre.net/tags/vim/ Recent content in vim on nixre.net Hugo -- gohugo.io en-us Sun, 29 May 2022 07:37:05 +0100 n(eo)vim https://www.nixre.net/blog/vim2nvim/ Sun, 22 May 2022 07:42:43 +0100 https://www.nixre.net/blog/vim2nvim/ A few days ago I decided to try out neovim in my everyday-life workflows. I know about neovim since quite a while. Also I know about a few technical advantages compared to vim but over long time it was always the same: I installed neovim I used it a few times that day and maybe the next day I started to forget to run nvim instead of vim and… found myself using vim again since then I have a week of vacation and this time I want to make serious change and integrate neovim into my daily life for while. Update Lastmod Using vim https://www.nixre.net/blog/vim-update-lastmod/ Sun, 01 May 2022 10:28:05 +0100 https://www.nixre.net/blog/vim-update-lastmod/ I think it is very important to add date information about articles’ creation time and modification time. There are various ways to do this. I usually prefer when this be done automatically by my favorite editor and so I wrote a short function: function! LastMod() if expand('%:p:h') =~ 'path/to/my/hugo-website/www.nixre.net/content' let l:cursorpos = winsaveview() let l:timestamp = strftime('%Y-%m-%dT%H:%M:%S+02:00') silent! exe ':%s/^\(lastmod:\).*$/\1 ' . expand(l:timestamp) . '/' call winrestview(l:cursorpos) endif endfunction The markdown sources are inside the content folder of my hugo website and the expand('%:p:h') of the file that is currently loaded into the buffer will show the absolute path to the directory that contains the file.