## My current init Having worked though The Primeagen's example and added my own tweaks, my config is at [here for *nix](https://github.com/johnallsup/my_nvim2) and [here for Windows](https://github.com/ChalisqueNetworkOrganisation/my_nvim2win). 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](https://github.com/ThePrimeagen/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](https://learnvimscriptthehardway.stevelosh.com/) 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). ```bash 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](https://github.com/wbthomason/packer.nvim) which is the package manager used here. #### Linux/Mac ```bash 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](https://rustup.rs/) so that you can use cargo to install `tree-sitter-cli` ```bash cargo install tree-sitter-cli ``` For the [Typescript](/lang/ts) 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 `[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.** ```bash 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 ```bash 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](/linux/admin/Clone-User) 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`.)