This commit is contained in:
2025-01-04 22:31:25 -05:00
parent ba3c3fa5bc
commit 25a5b7d180
3 changed files with 14 additions and 31 deletions

View File

@@ -1,23 +1,17 @@
local fn = vim.fn
-- Function to add keyword highlighting
local function keywordsadd(keywords)
local pattern = "\\<\\(" .. table.concat(keywords, "\\|") .. "\\)\\>"
fn.matchadd("Keyword", pattern)
end
fn.matchadd("Comment", ";;.*")
local function setup_highlight_groups()
vim.api.nvim_set_hl(0, "ftl_Keyword", { link = "Keyword" })
vim.api.nvim_set_hl(0, "ftl_String", { link = "String" })
vim.api.nvim_set_hl(0, "ftl_Comment", { link = "Comment" })
vim.api.nvim_set_hl(0, "ftl_Number", { link = "Number" })
end
fn.matchadd("Number", "\\v[-+]?[0-9]+") -- Matches integers
fn.matchadd("Float", "\\v[-+]?[0-9]*\\.[0-9]+") -- Matches floats
setup_highlight_groups()
fn.matchadd("String", '".*"')
fn.matchadd("Type", "\\v\\<\\(int|string\\)\\>")
-- Add custom highlights
keywordsadd { "if", "else", "while", "for", "SYSCALL", "exit" }
fn.matchadd("ftl_Keyword", "\\<\\(if\\|else\\|while\\|for\\|SYSCALL\\|exit\\)\\>")
fn.matchadd("ftl_String", [["\zs[^"]*\ze"]])
fn.matchadd("ftl_Comment", [[;;.*]])
fn.matchadd("ftl_Number", [[\v<\d+>]])
fn.matchadd(
"Operator",
"\\v(\\+\\+|--|==|!=|<=|>=|<|>|\\|\\||&&|!|~|\\^|\\||&|=|<<|>>|\\+=|-=|\\*=|/=|%=|<<=|>>=|&=|\\|=|\\^=|\\+|-|\\*|/|%)"
)
fn.matchadd("Keyword", "SYSCALL")
fn.matchadd("Function", "exit")

View File

@@ -17,12 +17,13 @@
"mini.ai": { "branch": "main", "commit": "ebb04799794a7f94628153991e6334c3304961b8" },
"nvim-cmp": { "branch": "main", "commit": "b555203ce4bd7ff6192e759af3362f9d217e8c89" },
"nvim-lspconfig": { "branch": "master", "commit": "8b15a1a597a59f4f5306fad9adfe99454feab743" },
"nvim-treesitter": { "branch": "master", "commit": "fae21737be2846a04ae06a41d70b7fc8ad4bf9eb" },
"nvim-web-devicons": { "branch": "master", "commit": "63f552a7f59badc6e6b6d22e603150f0d5abebb7" },
"oil.nvim": { "branch": "master", "commit": "ba858b662599eab8ef1cba9ab745afded99cb180" },
"paint.nvim": { "branch": "main", "commit": "ef6f717a8669619ebbd098fb72f85115d64c6c92" },
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
"rose-pine": { "branch": "main", "commit": "91548dca53b36dbb9d36c10f114385f759731be1" },
"snacks.nvim": { "branch": "main", "commit": "98df370703b3c47a297988f3e55ce99628639590" },
"telescope-fzy-native.nvim": { "branch": "master", "commit": "282f069504515eec762ab6d6c89903377252bf5b" },
"telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" },
"tokyonight.nvim": { "branch": "main", "commit": "45d22cf0e1b93476d3b6d362d720412b3d34465c" },
"vim-fugitive": { "branch": "master", "commit": "fcb4db52e7f65b95705aa58f0f2df1312c1f2df2" },

View File

@@ -22,18 +22,6 @@ return {
},
}
-- vim.api.nvim_create_autocmd("FileType", {
-- pattern = "oil",
-- callback = function()
-- vim.api.nvim_buf_set_keymap(0, "n", function()
-- local cursor_line = vim.api.nvim_get_current_line()
-- if string.sub(cursor_line, -1) == "/" then
-- vim.cmd("silent! cd " .. cursor_line)
-- end
-- end, { noremap = true, silent = true })
-- end,
-- })
-- File navigation split with Oil
vim.api.nvim_create_user_command("Pick", function()
local origin_buf = vim.fn.bufnr()