Edit page Nwiz
[wiki.git] / Nwiz
1 == nwiz ==
2
3 === What's this? ===
4
5 Neovim has no shortage of powerful plugins for programmers, but it's a fast moving ecosystem.
6 Picking the right combination of plugins and configuring them as an integrated development
7 environment is still far from trivial. I also reviewed a number of GUIs and "super plugins"
8 which aim to be a complete IDE, but all of them had maturity and usability issues.
9
10 My goal is using Neovim as a productive and unintrusive IDE for C, C++, Rust and Python.
11 I curated a short list of well-maintained plugins that take advantage of Neovim's built-in
12 IDE components:
13
14  * Language Server Protocol, for semantic completion
15  * Treesitter, for semantic syntax highlighting
16  * Virtual text, for inline diagnostics
17  * Floating windows, for inline help and function parameter assistance
18
19 The plugin ecosystem is still maturing, but over time the amount of Lua scripting required
20 to piece together a functional IDE seems to be going down. Ideally, you wouldn't have
21 to learn Lua to edit your Neovim config.
22
23 ** I want a programmer's editor, not become an editor's programmer! **
24
25 === Features ===
26
27  * Quick open files
28  * Semantic completion
29    * Configures language servers for C/C++, Rust, Python
30    * Adding more languages made easy by lspconfig
31  * Inline diagnostics and hints
32
33
34 === Installation ===
35
36 To get started, download nwiz.lua to Neovim's plugin dir so it will be autoloaded at startup:
37
38 {{{
39  curl https://codewiz.org/pub/dotfiles/nwiz.lua -o ~/.config/nvim/plugin/nwiz.lua
40 }}}
41
42 Everything is in a single file for ease of installation and to remind me to keep it short and simple.
43
44 I'm also sharing my generic .vimrc, which doesn't use Lua and works with both Neovim and Vim 9:
45
46 {{{
47  curl https://codewiz.org/pub/dotfiles/vimrc
48 }}}
49
50 Rather than overwrite your existing ##~./vimrc##, you might want to review and take some of my settings
51 for syntax highlighting and smart indentation.
52
53
54 === Packer ====
55
56 On first run, Packer (the plugin manager) will bootstrap itself and install all plugins.
57 There's a good chance this will fail the first time due to the asynchronous nature of PackerSync
58 (patches welcome!)
59
60 Any time you edit the list of plugins, run ##:PackerSync## to install, uninstall & update them. Easy!
61
62 === Language Servers ===
63
64 Neovim 0.7 comes with a built-in LSP client. The official [[https://github.com/neovim/nvim-lspconfig | nvim-lspconfig]]
65 plugin abstracts the details of spawning the correct Language Server for a multitude of filetypes.
66
67 Download and installation of language servers can be managed automatically by
68 [[https://github.com/williamboman/nvim-lsp-installer | nvim-lsp-installer]], but I find that it's
69 simpler (and much safer!) to install the already packaged ones from Linux distro. This also ensures
70 that they stay aligned with the system toolchain.
71
72  * Rust: rust-analyzer
73  * C++: clangd
74  * Python: python-lsp-server (which uses mypy, pylint, autopep8...)
75
76 === Treesitter syntax parsers ===
77
78 Install the ones you like from this list: https://github.com/nvim-treesitter/nvim-treesitter#supported-languages
79
80 For instance, I installed these:
81
82 {{{
83 :TSInstall cpp rust lua python bash vim
84 }}}
85
86 You can refresh your parsers at any time with ##:TSUpdate##
87
88 === Semantic completion ===
89
90 Just press TAB!
91
92 TODO: docs for [[https://github.com/hrsh7th/nvim-cmp#readme | cmp-nvim]]
93
94
95 === Finding and opening files ===
96
97 TODO: docs for [[https://github.com/nvim-telescope/telescope.nvim | telescope.nvim]]
98
99 === Realtime diagnostics and hints ===
100
101 TODO: document