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