Connect Melzi V2 to Raspberry Pi gPIO

How to Hardware First, connect the Raspberry Pi to the Melzi board using GPIO pins. Use RX and TX pins from Raspberry Pi to TX and RX pins from Melzi board. In my case I used the pins 14 and 15, TX and RX respectively. Check pinout.xyz or run the command pinout in your Raspberry Pi terminal to check the pins. Don’t forget to connect the ground pin from Raspberry Pi to the ground pin from Melzi board. In my case I used the pin 9. ...

October 7, 2023

Neovim nvim-cmp copilot.vim integration using Tab

cmp.setup({ ... mapping = cmp.mapping.preset.insert({ ["<Tab>"] = cmp.mapping(function(fallback) local copilot_keys = vim.fn["copilot#Accept"]() if cmp.visible() then cmp.confirm({ select = true }) elseif copilot_keys ~= "" and type(copilot_keys) == "string" then vim.api.nvim_feedkeys(copilot_keys, "n", true) else fallback() end end, { "i", "s", }), }), ... })

July 1, 2022

Using Makefile to recompile only after changes

We can make use of Makefile features to only recompile our code when the source files changed. This can be achieved because make stats the file system to check whether the target is older than it’s dependencies. Makefile example all: main main: main.o gcc main.o -o main main.o: main.c gcc -c main.c The code above is a toy example. The name before the colon is our target and the name of the file generated by the command bellow it. The name or names after the colon are target’s dependencies. ...

May 22, 2022

Using Angular language server on older projects with Neovim's LSP client

If you’re using https://github.com/neovim/nvim-lspconfig Angular server in an older project, in my case one with version six, you’re probably facing many issues and having a bad experience. That may be due to a missing parameter on the server command. To fix this, try setting up the server like this: local languageServerPath = vim.fn.stdpath("config").."/languageserver" local cmd = {"ngserver", "--stdio", "--tsProbeLocations", languageServerPath , "--ngProbeLocations", languageServerPath, "--viewEngine"} lspconfig.angularls.setup{ on_attach = on_attach, capabilities = capabilities, cmd = cmd, on_new_config = function(new_config, new_root_dir) new_config.cmd = cmd end, } The key here is the --viewEngine argument, that maker the language service use it’s legacy configuration, rather than the newer, known as Angular Ivy. ...

August 16, 2021

Neovim configuration

This post provides the configuration files for a setup in lua and using Neovim’s built-in LSP client and a reasoning around those choices. All the configuration can be found here. This isn’t by any means a guide on how to do things, neither an example of good code. It just works™. init.lua There isn’t much to see here, just entry points for configuration files and a weird command atop. The later just makes gf navigate to the configuration file used as parameter inside require. It can safely be ignored. ...

August 10, 2021