aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorfrosty <passedgoandgot200@disroot.org>2025-06-10 05:01:08 -0400
committerfrosty <passedgoandgot200@disroot.org>2025-06-10 05:01:08 -0400
commit210379b410fe40f877999bd68648af29465545d7 (patch)
tree912a8602034d15af56842e0d32529b58d1acd37e
parentc826b76870331099274ccc09b6ebbbcc166723ec (diff)
add new post and support codeblocks
-rw-r--r--content/about.md2
-rw-r--r--content/posts/neovim-without-plugins.md103
-rw-r--r--hugo.toml7
-rw-r--r--layouts/partials/footer.html2
-rw-r--r--themes/polaris/assets/css/style.css9
-rw-r--r--themes/polaris/layouts/_default/single.html8
6 files changed, 128 insertions, 3 deletions
diff --git a/content/about.md b/content/about.md
index 6e022f7..f1fabd6 100644
--- a/content/about.md
+++ b/content/about.md
@@ -5,5 +5,3 @@ title: "About"
Hi there, I'm frosty. I'm primarily interested in meteorology, systems administration, and photography; I also like to experiment with minimalistic software setups and unconventional workflows.
I don't consider myself a software developer, but I do write some code here and there. My favorite languages are C and Go, and I much prefer backend to frontend.
-
-Contact details will be added soon.
diff --git a/content/posts/neovim-without-plugins.md b/content/posts/neovim-without-plugins.md
new file mode 100644
index 0000000..8093729
--- /dev/null
+++ b/content/posts/neovim-without-plugins.md
@@ -0,0 +1,103 @@
+---
+title: "Neovim without plugins"
+date: "2025-06-04"
+---
+
+I use a Vi-like editor most of the time. Nowadays, it's Neovim purely because it's much faster than Vim in my experience, and it's pushing for new features out of the box instead of having to rely on many third-party plugins. Frankly, I don't care about Lua support, and I still try to use VimL where I can.
+
+Regardless, I wanted to showcase some of the features that people usually reach for plugins to achieve; who knows, it might come in handy.
+
+## Completion
+
+Do note, this says completion, not **auto-completion**. I often find auto-completion annoying, so I haven't bothered looking into how to achieve it. Though, you likely could do something with autocommands.
+
+Anyways, completion is a built in feature, and it's bound to `C-x` in insert mode, followed by another keybind. Take this snippet from the `ins-completion` section for reference:
+
+```txt {tabWidth=0}
+In Insert and Replace mode, there are several commands to complete part of a
+keyword or line that has been typed. This is useful if you are using
+complicated keywords (e.g., function names with capitals and underscores).
+
+Completion can be done for:
+
+1. Whole lines |i_CTRL-X_CTRL-L|
+2. keywords in the current file |i_CTRL-X_CTRL-N|
+3. keywords in 'dictionary' |i_CTRL-X_CTRL-K|
+4. keywords in 'thesaurus', thesaurus-style |i_CTRL-X_CTRL-T|
+5. keywords in the current and included files |i_CTRL-X_CTRL-I|
+6. tags |i_CTRL-X_CTRL-]|
+7. file names |i_CTRL-X_CTRL-F|
+8. definitions or macros |i_CTRL-X_CTRL-D|
+9. Vim command-line |i_CTRL-X_CTRL-V|
+10. User defined completion |i_CTRL-X_CTRL-U|
+11. omni completion |i_CTRL-X_CTRL-O|
+12. Spelling suggestions |i_CTRL-X_s|
+13. keywords in 'complete' |i_CTRL-N| |i_CTRL-P|
+```
+
+It's quite useful to use `C-x C-o` for `omnifunc` completion, which the built-in LSP client sets when enabled. Speaking of which...
+
+## LSP
+
+This is easier to set up than ever thanks to Neovim 0.11 adding `vim.lsp.config()`. Take this basic example of using gopls:
+
+Add the following to `lsp/gopls.lua`:
+
+```lua
+return {
+ cmd = { "gopls" },
+ root_markers = { ".git", "go.mod", "go.work" },
+ filetypes = { "go", "gomod", "gotmpl", "gowork" },
+}
+```
+
+Then, in `init.vim` you can tell Neovim to enable it conditionally:
+
+```vim
+if has('nvim-0.11')
+ if executable('gopls')
+ lua vim.lsp.enable('gopls')
+ endif
+endif
+```
+
+It's really simple, but it manages to work great with omnicompletion, and I haven't bothered to do much tweaking.
+
+## Fuzzy finding
+
+The number one plugin I see people reach for nowadays is likely [Telescope][telescope.nvim], and it seems like a great project. However, I don't find it very necessary. You can achieve the same good old behavior of [ctrlp.vim][ctrlp.vim] with just a few lines in your configuration!
+
+```vim
+set path+=**
+nnoremap <C-p> :e **/*
+```
+
+Okay, what are we doing here? First off, we're adding infinite recursion to our search path, so that all subdirectories of subdirectories are searched. Secondly, we bind the mighty `C-p` to our search. In practice, you'd enter: `<C-p>file.txt<Tab><CR>` to switch to another file. You can ignore certain directories from appearing by setting `wildignore`. For example:
+
+```vim
+set wildignore+=**/.git/**
+set wildignore+=**/build/**
+set wildignore+=**/node_modules/**
+```
+
+## Tree-sitter
+
+This is a very popular topic among Neovim users. I don't think it truly deserves all the hype it gets, but I do find it quite useful. I use it both on Neovim and Emacs. Anyways, there's a popular plugin for installing Tree-sitter parsers and activating them, but it's not necessary to use Tree-sitter.
+
+Firstly, the Tree-sitter parsers must be installed externally outside your editor environment. Some may find this annoying, but I think this is a positive, because I don't like my editor handling this for me. I have a package manager for a reason! It might take more work, but it feels much cleaner having it all in one place. I use Gentoo, and a few Tree-sitter parsers are packaged in the official repository. Though, I've packaged some in my personal overlay as well.
+
+Once they're installed, all you have to do is add an autocommand to start the Tree-sitter client. Preferably inside an autocommand group:
+
+```vim
+augroup StartTreesitter
+ autocmd!
+ autocmd FileType * lua pcall(vim.treesitter.start)
+augroup END
+```
+
+You may also want to wrap this inside a `has('nvim')` if you want to support Vim without errors. And that's it, you can play around with the syntax tree and get better highlighting.
+
+That's all I've got, but more may be added here in the future. This is my first informational post, so let me know what you think if you're so inclined.
+
+[telescope.nvim]: https://github.com/nvim-telescope/telescope.nvim
+[ctrlp.vim]: https://github.com/kien/ctrlp.vim
diff --git a/hugo.toml b/hugo.toml
index 2f9e374..ab68f5f 100644
--- a/hugo.toml
+++ b/hugo.toml
@@ -4,6 +4,13 @@ title = "frostyfalls"
theme = "polaris"
uglyURLs = true
minifyOutput = true
+enableGitInfo = true
+
+[frontmatter]
+lastmod = ["lastmod", ":git", "date", "publishDate"]
+
+[markup.highlight]
+style = "gruvbox"
[permalinks]
posts = "/:2006/:01/:02/:title/"
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index cc885ef..4da530a 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -3,3 +3,5 @@
<a href="https://creativecommons.org/publicdomain/zero/1.0/" rel="license"><img src="/img/badge/cc0.png" alt="CC0 1.0" class="badge"></a>
<a href="https://www.gentoo.org/"><img src="/img/badge/gentoo.png" alt="Gentoo" class="badge"></a>
<a href="https://www.vim.org/"><img src="/img/badge/vim.png" alt="Vim: the editor" class="badge"></a>
+<br>
+<br>
diff --git a/themes/polaris/assets/css/style.css b/themes/polaris/assets/css/style.css
index d5f0602..6f449a3 100644
--- a/themes/polaris/assets/css/style.css
+++ b/themes/polaris/assets/css/style.css
@@ -150,3 +150,12 @@ footer {
.badge {
image-rendering: crisp-edges;
}
+
+pre {
+ padding: 8px;
+ white-space: pre-wrap;
+}
+
+code {
+ font-size: 125%;
+}
diff --git a/themes/polaris/layouts/_default/single.html b/themes/polaris/layouts/_default/single.html
index ef44984..21b247d 100644
--- a/themes/polaris/layouts/_default/single.html
+++ b/themes/polaris/layouts/_default/single.html
@@ -1,5 +1,11 @@
{{ define "main" }}
<h1>{{ .Title }}</h1>
- {{ with .Date }}<p><em>Written {{ . | time.Format "Jan 02 2006" }}.</em></p>{{ end }}
+ {{ if (eq .Section "posts") }}
+ {{ with .Param "lastmod" }}
+<p>
+ <em>Last modified {{ . | time.Format "Jan 02 2006" }}.</em>
+</p>
+ {{ end }}
+ {{ end }}
{{ .Content }}
{{ end }}