Installation in Neovim
Our packages not only has coc-nasm
for coc.nvim, but we also has
who5673-nasn
for Lazy.nvim Plugin Manager.
To install who5673-nasm
, please do the steps like this instructions:
Step 1. Install who5673-nasm
using Neovim configurations
You may need to make some new directories and files if you do not have.
$HOME/.config/nvim/lua/plugins/init.lua or $HOME/.config/nvim/lua/plugins/who5673-nasm.lua
Lua
Copy
return {
"Who5673/who5673-nasm",
dependencies = {
"L3MON4D3/LuaSnip",
"hrsh7th/nvim-cmp"
},
ft = "nasm",
lazy = true,
},
Step 2. Configure cmp.lua for who5673-nasm
I do not want to instruct you how to install nvim-cmp
as it is not my own plugin.
However, to make sure you have configured my plugin, reading this script is recommended.
$HOME/.config/nvim/lua/plugins/cmp.lua
Lua
Copy
return {
{
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
"L3MON4D3/LuaSnip",
"saadparwaiz1/cmp_luasnip",
"hrsh7th/cmp-path",
"hrsh7th/cmp-nvim-lsp",
},
enabled = true, -- Very important! Lazyvim may disable this plugin when we download it.
config = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
sources = {
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "path" },
{ name = "nasm_registers" },
{ name = "nasm_instructions" },
},
mapping = cmp.mapping.preset.insert({
["<Tab>"] = cmp.mapping.select_next_item(),
["<S-Tab>"] = cmp.mapping.select_prev_item(),
["<CR>"] = cmp.mapping.confirm({ select = true }),
["<C-Space>"] = cmp.mapping.complete(),
}),
})
end,
},
}
Setup your first program using our plugins
Exit Neovim or set the filetype into Netwide Assembler filetype
Vimscript
Copy
:set ft=nasm
or if you want to create a new file, execute:
sh Shell
Copy
nvim main.nasm
Compile your first NASM program into a binary
Please go to this page for setting up