Personal Development Environment #1
Personal Development Environment #1⌗
This will be more of an experience dump along with my notes from recent experiments with my development environment.
A bit of backstory… My typical day includes shelling into embedded systems, building in in docker containers, and working in virtual machines setup for specific toolchains. Working with cli text editors has been a bit of a crutch from growing up as a Windows user. They usually tend to just work, index my source and provide enough of the basics right out of the box. Working on embedded systems really requires a working knowledge of various command line tools to be proficient. I recently made the effort to get rid of the crutch, and there was definitely some crawling after falling over. Bright side so far, streamlined inputs and sped up repetitive tasks. The biggest difference has been the improvement to my RSI after a long day of not mousing.
This won’t be a full tutorial, there are plenty out there. Recording the struggles and pain points are beneficial since they tend to be the hard parts to solve.
Work setup⌗
The system I need to set up vim on is a VM of an older version of Ubuntu 16.04 with fixed dependencies. Normally I try and just grab it with the package manager so everything is handled. Ended up using the app image which comes precompiled.
The Basics⌗
- Download neovim
- Setup dot files
NeoVIM Directories⌗
Configs: ~/.config/nvim
Plugins: ~/.local/share/nvim/
Logs: ~/.cache/nvim
Download the app image
Update the permission on the file
sudo chmod a=rx nvim.appimage
Copy it to your bin dir
sudo cp /usr/bin/
Set neovim to run as default when typing vim
sudo update-alternatives --install /usr/bin/vim vim /usr/bin/nvim.appimage 60
sudo update-alternatives --config vim
Setup the config file
cd ~/.config
sudo mkdir nvim
vim init.lua
Add some configs to make sure it works
vim.bo.expandtab = true
vim.bo.shiftwidth = 4
vim.bo.softtabstop = 4
local keymap = vim.api.nvim_set_keymap
keymap('n', '<c-s>', ':w<CR>', {})
keymap('i', '<c-s>', '<Esc>:w<CR>a', {})
local opts = { noremap = true }
keymap('n', '<c-j>', '<c-w>j', opts)
keymap('n', '<c-h>', '<c-w>h', opts)
keymap('n', '<c-k>', '<c-w>k', opts)
keymap('n', '<c-l>', '<c-w>l', opts)
This concludes a barebones install of neovim.
Neovim has a ton of plugins allowing for deep customization From personal experience the farther I deviate from a vanilla distro experience the worse moving across systems becomes Working on embedded systems, or I am guessing devops this is a common scenario. I focused on creating a stable baseline experience without too much baggage.
Semi Basics⌗
-Setup package manager
-Setup treesitter - This is for syntax highlighting
-Setup an LSP - This allows for language context
-Setup nvim_cmp - Auto complete
-Setup telescope - Fuzzy finder
-Pin packages to a working version
-Backup dot files to git repo
Package Manager⌗
This handles updating and downloading plugins
I used packer
Treesitter⌗
Language parsing tool that generates metadata about your source files.
Provides syntax highlighting, indentation and folding.
Found the folding to be a bit troublesome, disabled it for now until I revisit it.
LSP⌗
Language Server Protocol
Provides auto completion options, goto definition, find references, diagnostics, etc.
I think the concept is awesome and tried like hell to get it working.
Unfortunately the tool chain at my job is unable to generate the needed compile_commands.json needed.
So I ended up using ctags for goto definition and a fuzzy finder for searching references.
If you are able to easily generate the needed meta data it should be worth diving into setting up an LSP.
Completion⌗
Auto completion Can pull from multiple sources (Great with an LSP setup)
Fuzzy Finder⌗
Allows searching and navigation from within your project dynamically. The github info page is misleading, ripgrep and fd are required. Run a :check_health telescope and install anything missing. This is my favorite plugin hands down.
Other Stuff⌗
Things still on the list to check out include:
Code formatters, Linters
Though some LSPs seem to take care of these things as well
My NeoVim Setup⌗
Backup dot files to git repo like I do
Recommended Source⌗
Thorough playlist and enough to get started with neovim -Neovim from Scratch https://youtube.com/playlist?list=PLhoH5vyxr6Qq41NFL4GvhFp-WLd5xzIzZ
To Do⌗
I still need to pin packages to a working version once the setup is stable. This also include building neovim from source or running the precompiled app image since its version is fixed. The last thing I want to deal with is IDE throwing errors while trying to work.