Neovim or vim on m1 MacBookPro

For years I was a die hard user of vi. It was my goto editor of choice. Simple, yet powerful, if you knew some of the commands and understood its basics. Without fail it was available on all the unix and linux servers. In short, it did the job.Screen Shot 2021-12-13 at 9.38.38 am

Yet as IDEs advanced, it missed some of the features that I really liked when programming, such as code completion and syntax error highlighting.

It was the reason, I started to use Atom and then, after overcoming my anti-Microsoft believes, Visual Studio code.

These features, are now available via LSP (Language Server Protocol) for Vim and NeoVIM. Ironically LSP was developed by Microsoft for Visual Studio Code and is now an open standard.

So the question, was should I try using NeoVIM or just stick with VIM? I’d looked at NeoVIM briefly a while back and didn’t really understand what the difference was. NeoVIM was a rewrite focusing specifically on APIs, extensibility and as being a drop in replacement for vi/VIM. I didn’t understand what the advantage was to me as a general user.

To that end, I thought I’d set both up, via googling and see what the difference were.

Now before you start this yourself. Be aware, that configuring and tweaking everything to your liking, can be time consuming. Then you have to remember what you did and leverage that an on going basis – so every machine will need to be setup the same.

It can make you very productive but just think of that initial learning curve.

What I learnt through the process is, besides the different configuration files, is that there is now feature parity for the most part between the two editors. A few features like neovim telescope are unique to neovim only.

I setup vim and then decided to try NeoVIM. So my setup for NeoVIM is a superset of the VIM configuration. I simply had learnt more and put it to use when I setup NeoVIM.

For now I’ve decided to go with NeoVIM and have Vim available as a fallback. Such that I aliased vim to nvim with alias vim="nvim".

For both I used a plugin manager vim-plug.

The plugins I’ve installed for neovim are:

My configuration is still a little fluid. If you’ve got some tips, please leave them in the comments. What have you chosen? What did you like or dislike about a plugin?

My Apple Silicon Development Machine Setup Pt1

neofetch-mbp16

Homebrew is your best friend to help you setup your new MacBookPro for development. Install homebrew first by following the installation instructions on the homepage.

Its often easier to use brew install <something> then to maintain everything separately.

Yes I still like to use a terminal and the command line at times.

Things I’ve setup are:

  • iTerm2 – is a replacement for the standard Terminal program
  • Oh My ZSH – its used to manage zsh configurations and comes with a tonne of helpers
  • powerlevel10k – is a Zsh theme, that is fast and configurable
  • neofetch – it displays information about your system
  • miniforge – is a minimal conda installer specific to condo-forge that works with Apple Silicon
  • rust-lang – is a programming language with a set of development tools. Toolchain management occurs with rustup. Whilst that can be installed via homebrew, I choose the native install from the installation instructions
  • Visual Studio Code – is a code editor. There now is a Mac Universal build as well as if you go hunting an Apple Silicon only one under alt-downloads
  • XQuartz – if you intend to log into linux servers and display X screens this is a must. It has native Apple Silicon support now

Oh My Zsh

OhMyZsh has a lot of plugins. The ones I’ve selected are
plugins=(zsh-autosuggestions zsh-syntax-highlighting git extract z rustup cargo rust macos history)

Zsh-autosuggestions install and zsh-syntax-highlighting were installed per the instructions for oh-my-zsh

Powerlevel 10k

Make sure you select to install the recommended nerd font MesloLGS-NF. Its give you all the icons on the command line. If you install Powerlevel 10K under iTerm2 it’ll update the font settings by default. You may need to manually adjust under Terminal.

Miniforge

I was originally going to just use the default anaconda installer. However that uses Rosetta. Miniforge has native support for Apple Silicon. I installed it using brew install miniforge but there is an Apple Silicon native installer under the download sections.

Still need to determine if the python installation is running under rosetta or is a native Apple Silicon app. However by using homebrew, it its not at some point soon it will be updated.

The main thing I want working is jupyterlab notebooks. This can be done with conda install jupyerlab.

Don’t forget to run conda init zsh for it to automatically update your .zshrc file. Afterwards you’ll also notice that powerlevel10k will display your current conda environment.

ssh

I hate typing in passwords and in general setup ssh and copy ids about.

First you need to generate a ssh key ssh-keygen -t ecdsa -b 521 and then use ssh-copy-id <user>@<hostname>. Afterwards you should be able to log into your linux servers. This worked for me on Ubuntu 20.04.

Other tools

Of course I setup Xcode. Homebrew will automatically install the Xcode command line tools.

I use Trello, https://simplenote.com, Github Desktop, Blender and Unreal Engine.

Playing around and trying out different things, I managed in an afternoon to set my new MacBookPro up to how I basically like it. Some more tweaking over time and I’ve yet to tweak vim.

Really looking forward to seeing how I can leverage the M1 Max chip in my projects to do with OpenCV and deep learning. That’ll be another post in the future.