I’m working on an ansible collection for setting up a workstation for myself. I’m using exa instead of ls, making bat available alongside cat, setting up neomvim etc. Neovim has some cool features for integrating with debugging tools but I have only made it works in a satisfactory way with Python and JavaScript. I’m probably going to remove JavaScript from the config and only use Neovim for Python development.
Because getting JavaScript in itself to work was an absolute pain. I thought that I – having done this already with Python – would be able to get JS and Go running more easily. No, JS was a pain and Go just fell apart. I’ll be using VS Code or JetBrains maybe for JavaScript, TypeScript and Go. This is no slight against Neovim. It’s amazing that you can make a terminal-based text editor work like an IDE at all but I’d argue that it needs to be assembled by the people making the integrations. It’s not viable to arrive at this kind of config by trial-and-error:
Plug 'mfussenegger/nvim-dap'
Plug 'nvim-telescope/telescope-dap.nvim'
Plug 'mxsdev/nvim-dap-vscode-js'
lua << EOF
local dap = require('dap')
dap.adapters.node2 = {
type = "executable",
name = "node-debug",
command = "node",
args= {"/home/cjp/.local/share/debuggers/vscode-js-debug/out/src/debugServerMain.js", "45635" }
}
dap.configurations.javascript = {
{
type = "pwa-node",
request = "launch",
name = "Launch file",
program = "${file}",
cwd = "${workspaceFolder}",
},
{
type = "pwa-node",
request = "attach",
name = "Attach",
processId = require'dap.utils'.pick_process,
cwd = "${workspaceFolder}",
}
}
EOF
lua << EOF
vim.g.markdown_fenced_languages = {
"ts=typescript"
}
EOF
So I’ll be using Neovim instead of vim from now on and even use it to write and debug Python code, but I think we’ll have to wait for Neovim to be a generally viable IDE.
Addendum:
OK, I hate to say it but VS Code is pretty damn good. Credit where credit is due.
VSCode: Jinja templates huh? There are extensions for that. Should I show which ones?
Me: Uh… Sure. … Okey, and I just click to install? Well… That was easy.
And even on my Intel i3 NUC that coughs blood when I watch YouTube videos at 1080p it’s pretty damned responsive. I might get tired of having to use the mouse eventually but there’s a lot of polish to like in VS Code.
Sidenote:
This works great for finding examples of how certain things are done in Ansible that I can’t quite remember:
/ho/cj$ grep -C 10 -h -R "join(" ansible/
[mariadb]
log-bin = ON
server-id = {{ inventory_hostname_short[-1] }}
log-basename = {{ inventory_hostname_short }}
{% if bootstrap %}
wsrep_cluster_address = gcomm://
{% else %}
wsrep_cluster_address = gcomm://{{ clusternodes|join(',') }}
{% endif %}
wsrep_cluster_name = {{cluster_name}}
binlog-format = ROW
default_storage_engine = InnoDB
innodb_autoinc_lock_mode = 2
wsrep_on = ON
wsrep_log_conflicts = ON
wsrep_node_address = {{ansible_facts["ens18"]["ipv4"]["address"]}}
wsrep_sst_receive_address = {{ansible_facts["ens18"]["ipv4"]["address"]}}