diff options
Diffstat (limited to 'content')
-rw-r--r-- | content/_index.md | 3 | ||||
-rw-r--r-- | content/posts/hello-world.md | 11 | ||||
-rw-r--r-- | content/posts/neovim-is-usable-without-plugins.md | 90 | ||||
-rw-r--r-- | content/posts/neovim-without-plugins.md | 103 | ||||
-rw-r--r-- | content/todo.md | 8 |
5 files changed, 96 insertions, 119 deletions
diff --git a/content/_index.md b/content/_index.md index 9fbbd0c..592065d 100644 --- a/content/_index.md +++ b/content/_index.md @@ -1,3 +1,4 @@ -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. +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'm also a sucker for low-bandwidth, simple to navigate, content-rich websites. 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. + diff --git a/content/posts/hello-world.md b/content/posts/hello-world.md deleted file mode 100644 index f80d9fe..0000000 --- a/content/posts/hello-world.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "Hello, World!" -date: "2025-05-19" ---- - -Hello and welcome! This is an introduction to my website. For the time being, you can read more [about me][about], or check up on what's up with me [right now][now]. - -That's all I've got at the moment, see you soon! - -[about]: /about.html -[now]: /now.html diff --git a/content/posts/neovim-is-usable-without-plugins.md b/content/posts/neovim-is-usable-without-plugins.md new file mode 100644 index 0000000..0fadb18 --- /dev/null +++ b/content/posts/neovim-is-usable-without-plugins.md @@ -0,0 +1,90 @@ +--- +title: "(Neo)vim is usable without plugins" +date: "2025-06-17" +--- + +Vim and Neovim are extremely powerful editors, but despite having lots of features built-in, many folk reach for third-party plugins quite easily. Here are a few common features that may be found of use which are built in to the editor. + +## Completion (Vim) + +Completion functions are all prefixed with `C-x` in insert mode. Take this snippet from the `ins-completion` help 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| +``` + +Highlights are omni completion - often tied to LSP, spelling suggestions, and file names. + +## LSP (Neovim) + +This is easier to set up than ever thanks to Neovim v0.11 adding `vim.lsp.Config`. + +For starters, a configuration file for each language server must be created. Below is an example of one for `gopls`: + +```lua +return { + cmd = { "gopls" }, + root_markers = { ".git", "go.mod", "go.work" }, + filetypes = { "go", "gomod", "gotmpl", "gowork" }, +} +``` + +Then, just enable the server: + +```vim +if has('nvim-0.11') + if executable('gopls') + lua vim.lsp.enable('gopls') + endif +endif +``` + +See the [Neovim docs](https://neovim.io/doc/user/lsp.html#vim.lsp.Config) for more information. + +## Fuzzy Finding (Vim) + +This is self-explanatory. Vim has recursive search support, along with wildcards. + +```vim +" Include subdirectories in search path +set path+=** + +" Add exclusions from recursive searches +set wildignore+=**/.git/**,**/build/**,**/node_modules/** + +" Bind a key for searching +nnoremap <C-p> :e **/* +``` + +## Tree-sitter (Neovim) + +Tree-sitter parsers must be installed with an external package manager, ideally the one your operating system already uses. + +Other than that, Neovim should start Tree-sitter with just the below code: + +```vim +if has('nvim') + augroup StartTreesitter + autocmd! + autocmd FileType * lua pcall(vim.treesitter.start) + augroup END +endif +``` diff --git a/content/posts/neovim-without-plugins.md b/content/posts/neovim-without-plugins.md deleted file mode 100644 index 8093729..0000000 --- a/content/posts/neovim-without-plugins.md +++ /dev/null @@ -1,103 +0,0 @@ ---- -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/content/todo.md b/content/todo.md index 06444aa..a46d8a2 100644 --- a/content/todo.md +++ b/content/todo.md @@ -1,10 +1,10 @@ --- -title: "Todo" +title: "TODO" subtext: "Oh boy, will this ever get filled out?" --- This is more of a meta page to list out tasks related to the website that need to be done. -* [ ] Create proper favicon and other image-related branding. -* [ ] Flesh out the RSS XML (prototype is up). -* [ ] Apply for small-size website clubs, after optimizing assets such as the fonts and images. +* Create favicon and other image-related branding. +* Separate content into categories other than "posts." +* Manually template feed XMLs. |