My current init
Having worked though The Primeagen's example and added my own tweaks, my config is at here for *nix and here for Windows.
Note that vim.vm.stdpath("config") is the right way to get the config directory,
rather than just hardwiring ~/.config/nvim, especially if you use the new capability
of NVIM_APPNAME.
Following The Primeagen's Video
My current config derives mostly from The Primeagen's init.lua
with a few things brought in from my .vimrc. One thing is to use the sequence jkl (or JKL) instead of
escape to exit insert mode, as this requires far less finger movement and I have yet to need to explicitly
type jkl since using this definition. Another thing I picked up from Steve Losh's Learn Vimscript the Hard Way
is to disable the cursor keys in normal mode, forcing you to use hjkl instead. Having done this,
and got used to it, it's hard and awkward to go back to cursor keys.
There are a few things you need to do to get this working (or at least what I needed to do).
mkdir -p ~/.config/nvim
cd ~/.config/nvim
git clone https://github.com/ThePrimeagen/init.lua .
mkdir lua/mystuff
# put your own stuff in e.g. lua/mystuff/keys.lua
# edit init.lua to require your stuff too
now there are a few things that need installing.
You need to install Packer which is the package manager used here.
Linux/Mac
git clone --depth 1 https://github.com/wbthomason/packer.nvim\
~/.local/share/nvim/site/pack/packer/start/packer.nvim
Windows
git clone https://github.com/wbthomason/packer.nvim "$env:LOCALAPPDATA\nvim-data\site\pack\packer\start\packer.nvim"
Errors
Then when you launch nvim it will complain
a lot. You need to open lua/theprimeagen/packer.lua and run it with :so.
Then you should be able to :PackerUpdate (or :PackerSync, I'm not sure which,
so perhaps try both.)
You need rustup so that you can use cargo to install tree-sitter-cli
cargo install tree-sitter-cli
For the Typescript tree-sitter support, you need tsserver in your path.
I create a folder /usr/nvm which is writable by users in the group adm, and in there
create a npm project in which I install typescript, and symlink /usr/npm/bin to
/usr/npm/node_modules/.bin (and then use my .bashrc to put this in my path).
I think there are a couple of other things, but that's largely what you need to do.
Chad
So I've now decided to give Chad a go: update: having had a go and found
it doing all the frustrating trying-to-be-to-clever thing, sometimes inserting
closing brackets where there completely not wanted (e.g. ANSI sequences like <esc>[1m
it would insert a ] for me automatically, then when I inserted the correct
closing double quote, that would leave a spurious ] outside the quote and
the LSP autocomplete would choke. FFS I know what I'm typing, so don't Fing
try to type for me. I want an editor that quickly and efficiently does what
the F it is told, when the F it is told, and nothing else. End rant.
git clone https://github.com/NvChad/NvChad ~/.config/nvim --depth 1 && nvim
note that if you want to trash your config and start over, you must delete two directories
rm -r ~/.config/nvim ~/.local/share/nvim
if you forget ~/.local/share/nvim then bad things happen (I know, I tried, and
had a few minutes of head-scratching, though I simply created another user
from a template and tried there and it worked,
so I had to find where else needed cleaning up, and thankfully nvim is nicely
confined to .config/nvim and .local/**/nvim.)