V2 of my Neovim configuration.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

162 lines
5.5 KiB

# Neovim Configuration
2 years ago
2 years ago
![screenshot](screenshot.png)
This is V2 of my Vim configuration, designed for Neovim, broken out into
2 years ago
it's own repository for easier cloning without pulling down the entire
`essentials` repository.
I use the `nord` theme for both my terminal and Vim. You will need to adjust your theme and
1 year ago
airline according to your tastes in `plugins.lua` and `ui.lua`.
2 years ago
The V2 repo aims to take full advantage of asynchronous code and a modularized configuration to make
adaptation easier and the UI snappier. Additionally support for `tmux` has improved with this iteration
through the use of `vimux` and `vim-tmux-navigator`.
2 years ago
**If you are interested in the vimscript version** please refer to the [vimscript-final](https://git.xchg.sh/angrygoats/neovim-config/src/tag/vimscript-final) tag.
All future modifications will be done in lua.
2 years ago
## Requirements
1. [Neovim](https://github.com/neovim/neovim)
2. [vim-plug](https://github.com/junegunn/vim-plug) - You may need to install this even with the `autoload` directory.
3. [Monospaced Nerd Font](https://www.nerdfonts.com/font-downloads) - The `/font` directory has one I use.
4. `tmux`
2 years ago
## Updating
After running `git pull` you may need to run `:PlugInstall` and restart neovim to resolve any errors.
For Python editing:
1. [Neovim](https://github.com/neovim/neovim) compiled with Python support.
2. Python
3. `pip install neovim && pip3 install neovim` in your global environment.
2 years ago
## Structure
* `conf`: Contains all configuration related files.
1 year ago
* `plugins.lua`: General plugin definitions.
* `keybinds.lua`: General keybinds such as leader key, etc.
* `config.lua`: Dumping ground for general configurations.
* `ui.lua`: General UI configurations.
* `search.lua`: Search configurations (for example ctrl-p).
* `git.lua`: Fugitive configurations.
* `langs`: Language specific configurations and keybinds.
2 years ago
## Installation
```bash
cd .config
git clone git@git.xchg.sh:angrygoats/vim-config nvim
```
If you have added/changed plugins remember to `:PlugInstall` after saving. There currently
1 year ago
is no autodetect on a changed `plugins.lua`.
2 years ago
If you run into problems with pyenv on first start, insure that pyenv is installed and your pyenv
has at least one installation available. For example, run `pyenv install 3.9.1`.
2 years ago
## Language Support
Languages supported can be found in the `conf/langs` directory. To add more languages you can
2 years ago
create a file in the same form as those found in `conf/langs/` and place it in the `conf/langs/` folder.
It will be autoloaded.
The current loading script for languages does not check order before loading (so files can be loaded in
any order based on directory structure). However, if you followed the structure and put all your configs
in the correct files, those will be loaded *BEFORE* the languages and so you shouldn't run into (too many)
order issues. This may be patched in the future.
### Python
Pyenv support is added via [vim-pyenv](http://github.com/lambdalisue/vim-pyenv). `:PyenvActivate` can be used to
activate a given environment.
1 year ago
The file `conf/langs/python.lua` contains formatting code typical of a Python project (4 space indents, etc). If you
wish to adjust this you can do that here, or make modifications on a per-project basis.
2 years ago
## Other Notes
### Help
You can type `:help <name_of_package>` (for example `:help vim-pyenv`) to read the documentation.
### Tmux Navigation
With Tmux activated you can use
```
<ctrl-h> => Left
<ctrl-j> => Down
<ctrl-k> => Up
<ctrl-l> => Right
<ctrl-\> => Previous split
```
To move seamlessly between splits.
### Autocompletion
Autocompletion is provided by [asyncomplete.vim](https://github.com/prabirshrestha/asyncomplete.vim). Additionally
LSP-based autocompletion is installed.
Automatic popups are disabled. In order to see suggestions begin typing and then hit `<C-Space>` in insert mode.
Once in the popup you can use `<Tab>` and `<S-Tab>` to go up and down the suggestions.
### Default Leader
The default leader is the space key.
2 years ago
### Git
1 year ago
`vim-fugitive` is installed. Bindings can be found in `conf/keybinds.lua` and documentation can be found
2 years ago
[here](https://github.com/tpope/vim-fugitive).
The following binds are set to help development:
```
1 year ago
<Leader>gs :Git<CR>
<Leader>gd :Git diff<CR>
<Leader>gb :Git blame<CR>
<Leader>gc :Git commit<CR>
<Leader>gp :Git push<CR>
```
1 year ago
### Treesitter
Treesitter is installed as a plugin and syntax highlighting can be modified in `conf/lang/general.lua`.
You can add languages you would like there. Alternatively, auto-loading is enabled which should
handle most syntax highlighting cases.
2 years ago
### LSP
`vim-lsp` is installed with `vim-lsp-settings`. While editing a file that has a supported LSP server
you can type `LspInstallServer` to install the associated server. You can uninstall a server with
`:LspUninstallServer server-name`. You many need to restart your vim instance once the server is installed
to activate the LSP support.
### Org Mode
`vim-orgmode` is installed. The usage documentation can be found [here](https://github.com/jceb/vim-orgmode/blob/master/doc/orgguide.txt).
### Async Command Line
[Asyncrun.vim](https://github.com/skywind3000/asyncrun.vim) is installed. You can use this to run shell commands asynchronously.
To do this type `:AsyncRun <command>`.
### Search
[ctrlp](https://github.com/kien/ctrlp.vim) and [telescope](https://github.com/nvim-telescope/telescope.nvim)
are installed. The hotkeys are as follows:
```
<leader>ff find_files
<leader>fg live_grep
<leader>fb buffers
<leader>fh help_tags
<ctrl>p ctrlp search
```