NeoVim IDE config based on LazyVim starter template.
Using standard DAP, LSP and tree-sitter providing near identical capabilities to VSCode/Codium.
Tested mainly with PHP and secondarily with Python.
- High contrast white theme
lua/plugins/theme.lua
- Treesitter-context
lua/plugins/treesitter-context.lua
- PHP Intelephense LSP with k&r formatting option
lua/plugins/lsp.lua
(for WP code style) - VSCode nvim plugin aware DAP setup
init.lua
git clone https://github.com/jasalt/nvim.git ~/.config/nvim
nvim
Run :checkhealth
command to see possible issues with configuration.
# ~/.tmux.conf
set -sg escape-time 10
set-option -g focus-events on
# True color settings
set -g default-terminal "screen-256color"
set -ag terminal-overrides ",$TERM:Tc"
Custom font icons may not load with messed up locale configuration. Running tmux
with -u
flag can help as temporary fix eg. tmux -u a
.
Zig compiler (https://ziglang.org/download/) is easy to install to path, but for some tree-sitter parsers that fail compiling with it, they can be compiled elsewhere and moved to nvim install path eg. with extracted release archive in nvim-linux64/lib/nvim/parser/
.
Eg. rsync -av ~/.local/share/nvim/lazy/nvim-treesitter/parser/twig.so <hostname>:~/bin/nvim-linux64/lib/nvim/parser/
.
Nvim should be started in WordPress root folder so that LSP finds all definitions etc.
Afterwards sidebar tree view root can be adjusted with .
to hide unnecessary files.
Default breakpoints on exceptions, errors etc. can be modified in init.lua
by setting dap.defaults.php.exception_breakpoints
value.
Debugging PHP backend code (WordPress plugin) serving data to a HTMX front-end view. Server runs on VVV Vagrant development VM.
HTMXPress live search demo with "t" typed into live search box
Request intercepted by XDebug with step-debugging, interactive evaluation etc:
Space is the <leader>
key and regular VIM motions are otherwise expected, mostly following LazyVim starter config bindings.
| Go To Definition | gd | | Delete buffer | bd |
| Add Breakpoint | db | F5 | | Start Debugger (continue) | dc | | | Stop on all (default) | dA | | | Stop on all but notify | da | | | Stop on none but breakpoint | d0 | | | Show / Hide DAP UI | du | |
| Toggle folder tree view | e | | Disable indent on save | uf |
Made by NeoVim novice, includes mindlessly copy pasted code from various source. Refer to LazyVim docs and discussions etc to understand the overall structure better.
Readme, repo commit messages and some parts of code included are written with Emacs.
More notes while figuring this out on LazyVim discussions.
- how to eval configuration functions during runtime?
- fix indenting issues