diff --git a/nvim/.config/nvim/after/queries/go/textobjects.scm b/nvim/.config/nvim/after/queries/go/textobjects.scm new file mode 100644 index 0000000..dc5a16e --- /dev/null +++ b/nvim/.config/nvim/after/queries/go/textobjects.scm @@ -0,0 +1,3 @@ +; extends +(function_declaration + name: (_) @function.name) diff --git a/nvim/.config/nvim/ftdetect/test.vim.old b/nvim/.config/nvim/ftdetect/test.vim.old new file mode 100644 index 0000000..553f93e --- /dev/null +++ b/nvim/.config/nvim/ftdetect/test.vim.old @@ -0,0 +1 @@ +autocmd BufNewFile,BufRead * if search('{{.\+}}', 'nw') | setlocal filetype=gotmpl | endif diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index 541173b..359da0e 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -1,3 +1,17 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "--single-branch", + "https://github.com/folke/lazy.nvim.git", + lazypath, + }) +end +vim.g.mapleader = "," +vim.opt.runtimepath:prepend(lazypath) +require("lazy").setup("plugins") require("custom") require("mappings") require("snips") @@ -38,6 +52,26 @@ require("nvim-treesitter.configs").setup({ }, }, textobjects = { + select = { + enable = true, + lookahead = true, + keymaps = { + ["af"] = "@function.outer", + ["if"] = "@function.inner", + ["ac"] = "@class.outer", + ["ic"] = { query = "@class.inner", desc = "Select inner" }, + ["as"] = { query = "@scope", query_group = "locals", desc = "Select language scop" }, + ["il"] = "@loop.inner", + ["al"] = "@loop.outer", + ["fn"] = { query = "@function.name", desc = "Select function name" }, + }, + selection_modes = { + ["@parameter.outer"] = "v", -- charwise + ["@function.outer"] = "V", -- linewise + ["@class.outer"] = "", -- blockwise + }, + include_surrounding_whitespace = false, + }, swap = { enable = true, swap_next = { @@ -47,57 +81,124 @@ require("nvim-treesitter.configs").setup({ ["A"] = "@parameter.inner", }, }, + move = { + enable = true, + set_jumps = true, + goto_next_start = { + ["]m"] = "@function.outer", + ["]]"] = { query = "@class.outer", desc = "Next class" }, + }, + goto_next_end = { + ["]M"] = "@function.outer", + ["]["] = "@class.outer", + }, + goto_previous_start = { + ["[m"] = "@function.outer", + ["[["] = { query = "@class.outer", desc = "Previous class" }, + }, + goto_previous_end = { + ["[M"] = "@function.outer", + ["[]"] = "@class.outer", + }, + }, lsp_interop = { enable = true, border = "none", floating_preview_opts = {}, - peek_definition_code = { - ["df"] = "@function.outer", - ["dF"] = "@class.outer", - }, + -- peek_definition_code = { + -- ["df"] = "@function.outer", + -- ["dF"] = "@class.outer", + -- }, }, }, }) +vim.filetype.add({ extension = { grlx = "grlx", mdx = "mdx" } }) local parser_config = require("nvim-treesitter.parsers").get_parser_configs() -parser_config.grlx = { +-- local ft_parser = require("nvim-treesitter.parsers").filetype_to_parsername +parser_config.gotmpl = { install_info = { - url = "~/Documents/code/work-oss/tree-sitter-grlx", + url = "https://github.com/ngalaiko/tree-sitter-go-template", files = { "src/parser.c" }, }, - filetype = "grlx", + filetype = "gotmpl", + used_by = { "gohtmltmpl", "gotexttmpl", "gotmpl", "yaml", "grlx" }, } -vim.filetype.add({ extension = { grlx = "grlx" } }) +vim.treesitter.language.register("markdown", "mdx") +-- local parser_config = require("nvim-treesitter.parsers").get_parser_configs() +-- parser_config.grlx = { +-- install_info = { +-- url = "~/Documents/code/work-oss/tree-sitter-grlx", +-- files = { "src/parser.c" }, +-- }, +-- filetype = "grlx", +-- } require("treesitter-context").setup() local function LoadCoverageOnEnter() if vim.fn.globpath(".", "coverage.out") ~= "" then require("coverage").load(true) + vim.api.nvim_create_user_command("GoCov", "!go tool cover -html coverage.out", {}) end end --- --- vim.api.nvim_create_autocmd("FileType", { --- group = vim.api.nvim_create_augroup("CoverageDisplayGroup", { clear = true }), --- pattern = { "go" }, --- callback = function() --- LoadCoverageOnEnter() --- end, --- }) --- -- --- vim.api.nvim_create_autocmd({ "BufWritePost" }, { --- group = vim.api.nvim_create_augroup("CoverageRun", { clear = true }), --- pattern = { "*_test.go" }, --- callback = function() --- local exit = os.execute("go test -coverprofile=coverage.out ./...") --- if exit == 0 then --- LoadCoverageOnEnter() --- end --- end, --- }) -vim.api.nvim_create_autocmd({ "BufRead, BufNewFile" }, { - pattern = { "*/ansible/*.yml" }, +vim.api.nvim_create_autocmd("FileType", { + group = vim.api.nvim_create_augroup("CoverageDisplayGroup", { clear = true }), + pattern = { "go" }, callback = function() - vim.api.nvim_buf_set_option(0, "filetype", "yaml.ansible") + LoadCoverageOnEnter() + end, +}) +-- Vars that hold buffer and window for testing +local buf = nil +local win = nil + +local function create_output_buffer() + if not buf or not vim.api.nvim_buf_is_valid(buf) then + buf = vim.api.nvim_create_buf(false, true) + vim.api.nvim_buf_set_option(buf, "bufhidden", "wipe") + end +end + +local function view_output() + if win and vim.api.nvim_win_is_valid(win) then + vim.api.nvim_win_close(win, true) + win = nil + else + if buf and vim.api.nvim_buf_is_valid(buf) then + vim.api.nvim_command("vsplit") + win = vim.api.nvim_get_current_win() + vim.api.nvim_win_set_buf(win, buf) + end + end +end + +vim.api.nvim_create_autocmd({ "BufWritePost" }, { + group = vim.api.nvim_create_augroup("CoverageRun", { clear = true }), + pattern = { "*_test.go" }, + callback = function() + create_output_buffer() + vim.api.nvim_create_user_command("ViewOutput", view_output, {}) + vim.fn.jobstart("go test -coverprofile=coverage.out", { + stdout_buffered = true, + on_exit = function(_, exit_code, _) + if exit_code == 0 then + require("coverage").load(true) + end + end, + on_stdout = function(_, data) + if data then + vim.api.nvim_buf_set_lines(buf, 0, -1, false, data) + end + end, + }) + end, +}) + +vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { + group = vim.api.nvim_create_augroup("SlsSelect", { clear = true }), + pattern = { "*/salt/*" }, + callback = function() + vim.cmd("set ft=sls") end, }) @@ -108,6 +209,16 @@ vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, { end, }) +vim.api.nvim_create_autocmd({ "TermOpen" }, { + pattern = { "term://*toggleterm*" }, + callback = function() + vim.opt_local.number = false + end, +}) + if vim.env.ZELLIJ ~= nil then vim.fn.system({ "zellij", "action", "switch-mode", "locked" }) end +vim.diagnostic.config({ + update_in_insert = false, +}) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 3d625f7..62ef183 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,55 +1,60 @@ { - "ChatGPT.nvim": { "branch": "main", "commit": "8191b4a1faea28483aa3a495d01ade3eb86409fe" }, + "ChatGPT.nvim": { "branch": "main", "commit": "48c59167beeb6ee0caa501c46cecc97b9be8571d" }, "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, - "LuaSnip": { "branch": "master", "commit": "ea7d7ea510c641c4f15042becd27f35b3e5b3c2b" }, - "ansible-vim": { "branch": "master", "commit": "93798e8c89c441d29d4678da0c0d5e1429eb43b0" }, + "LuaSnip": { "branch": "master", "commit": "118263867197a111717b5f13d954cd1ab8124387" }, + "ansible-vim": { "branch": "master", "commit": "afc739e505053a6143a1fc6cedac6fb4d7a1d4db" }, "cmp-git": { "branch": "main", "commit": "f900a4cf117300fdc3ba31d26f8b6223ccd9c574" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" }, "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, - "copilot-cmp": { "branch": "master", "commit": "11eb015fbf9f07ad1c72dbdc9d830ebac610b5cd" }, - "copilot.lua": { "branch": "master", "commit": "0fa30d6846aae1af1c94a9ead93fa7dcf8affbe6" }, - "crates.nvim": { "branch": "main", "commit": "d5caf28aba49e81ac4099426231f3cf3c151013a" }, - "dressing.nvim": { "branch": "master", "commit": "b1c7b70e1e0875243ed38f51fe7a61d08e11607e" }, - "friendly-snippets": { "branch": "main", "commit": "ebf6d6e83494cdd88a54a429340256f4dbb6a052" }, - "gitsigns.nvim": { "branch": "main", "commit": "d927caa075df63bf301d92f874efb72fd22fd3b4" }, - "gopher.nvim": { "branch": "main", "commit": "03cabf675ce129c28bd855969a3e569edcf63366" }, - "goto-preview": { "branch": "main", "commit": "84532db88f8ee272bcd1c07cda55884e23fd9087" }, - "harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" }, - "lazy.nvim": { "branch": "main", "commit": "2a9354c7d2368d78cbd5575a51a2af5bd8a6ad01" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, + "copilot.lua": { "branch": "master", "commit": "dcaaed5b58e6c2d395bca18d25d34e6384856722" }, + "crates.nvim": { "branch": "main", "commit": "81c6325b7f8875857ec09e5d24f3b6d7986f29e2" }, + "dressing.nvim": { "branch": "master", "commit": "8b7ae53d7f04f33be3439a441db8071c96092d19" }, + "friendly-snippets": { "branch": "main", "commit": "53d3df271d031c405255e99410628c26a8f0d2b0" }, + "gitsigns.nvim": { "branch": "main", "commit": "d195f0c35ced5174d3ecce1c4c8ebb3b5bc23fa9" }, + "gopher.nvim": { "branch": "main", "commit": "ac27f4b6794c872140fb205313d79ab166892fe9" }, + "goto-preview": { "branch": "main", "commit": "16ec236fabb40b2cebfe283b1d701338886462db" }, + "harpoon": { "branch": "master", "commit": "867e212ac153e793f95b316d1731f3ca1894625e" }, + "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, "lsp-inlayhints.nvim": { "branch": "main", "commit": "d981f65c9ae0b6062176f0accb9c151daeda6f16" }, - "lsp-trouble.nvim": { "branch": "main", "commit": "3f85d8ed30e97ceeddbbcf80224245d347053711" }, + "lsp-trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, "lspkind-nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, - "lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" }, - "nightfox.nvim": { "branch": "main", "commit": "a48f6d9a0273101df76eb25d2f5477baa277f935" }, - "noice.nvim": { "branch": "main", "commit": "74c2902146b080035beb19944baf6f014a954720" }, - "nui.nvim": { "branch": "main", "commit": "aa1b4c1e05983ff7debd2b4b2788651db099de2f" }, + "lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" }, + "nightfox.nvim": { "branch": "main", "commit": "fcf699bef2b2731c840a5746113c3dd31a9cb813" }, + "noice.nvim": { "branch": "main", "commit": "92433164e2f7118d4122c7674c3834d9511722ba" }, + "nui.nvim": { "branch": "main", "commit": "c9b4de623d19a85b353ff70d2ae9c77143abe69c" }, "null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" }, - "nvim-autopairs": { "branch": "master", "commit": "a52fc6eeec116746110b703381777c46d89d9e27" }, - "nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" }, - "nvim-coverage": { "branch": "main", "commit": "4634dfb00961a86948518c7e6f85737c24364308" }, + "nvim-autopairs": { "branch": "master", "commit": "9fd41181693dd4106b3e414a822bb6569924de81" }, + "nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" }, + "nvim-coverage": { "branch": "main", "commit": "cf4b5c61dfac977026a51a2bcad9173c272986ce" }, + "nvim-dap": { "branch": "master", "commit": "f0dca670fa059eb89dda8869a6310c804241345c" }, + "nvim-dap-go": { "branch": "main", "commit": "a5cc8dcad43f0732585d4793deb02a25c4afb766" }, + "nvim-dap-ui": { "branch": "master", "commit": "34160a7ce6072ef332f350ae1d4a6a501daf0159" }, "nvim-lastplace": { "branch": "main", "commit": "0bb6103c506315044872e0f84b1f736c4172bb20" }, - "nvim-lspconfig": { "branch": "master", "commit": "a27356f1ef9c11e1f459cc96a3fcac5c265e72d6" }, - "nvim-notify": { "branch": "master", "commit": "ea9c8ce7a37f2238f934e087c255758659948e0f" }, - "nvim-treesitter": { "branch": "master", "commit": "17b943e7c5cc2b2db3ac7b5720fbd42e75a00d8d" }, - "nvim-treesitter-context": { "branch": "master", "commit": "31692b26d76ff1f7c6e0ab51814dd55e7417e96c" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "bd103502252027434ec42f628d2dbf54821d4ce6" }, + "nvim-lint": { "branch": "master", "commit": "32f98300881f38f4e022391f240188fec42f74db" }, + "nvim-lspconfig": { "branch": "master", "commit": "9099871a7c7e1c16122e00d70208a2cd02078d80" }, + "nvim-treesitter": { "branch": "master", "commit": "454c3a9ba86f841dc3b5bb17d150a873a16b77b4" }, + "nvim-treesitter-context": { "branch": "master", "commit": "c9f2b429a1d63023f7a33b5404616f4cd2a109c5" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "ec1c5bdb3d87ac971749fa6c7dbc2b14884f1f6a" }, "nvim-ts-rainbow": { "branch": "master", "commit": "8312b513ce930e7669a1721befbe56f2e1853301" }, - "nvim-web-devicons": { "branch": "master", "commit": "bc11ee2498de2310de5776477dd9dce65d03b464" }, - "playground": { "branch": "master", "commit": "429f3e76cbb1c59fe000b690f7a5bea617b890c0" }, - "plenary.nvim": { "branch": "master", "commit": "0dbe561ae023f02c2fb772b879e905055b939ce3" }, + "nvim-web-devicons": { "branch": "master", "commit": "aff5f50b34754335a312c9b3dc5b245f605ce437" }, + "oil.nvim": { "branch": "master", "commit": "24027ed8d7f3ee5c38cfd713915e2e16d89e79b3" }, + "op.nvim": { "branch": "master", "commit": "52f530bb0fc2c0feceae22e134a36cd342493d85" }, + "pest.vim": { "branch": "master", "commit": "78a65344a89804ec86a0d025a3799f47c2331389" }, + "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, + "plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" }, "rust-tools.nvim": { "branch": "master", "commit": "0cc8adab23117783a0292a0c8a2fbed1005dc645" }, "salt-vim": { "branch": "master", "commit": "6ca9e3500cc39dd417b411435d58a1b720b331cc" }, - "telescope-file-browser.nvim": { "branch": "master", "commit": "ad7b637c72549713b9aaed7c4f9c79c62bcbdff0" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" }, - "telescope-luasnip.nvim": { "branch": "master", "commit": "849c4ee1951f34041a26744d2a88284545564ff0" }, - "telescope.nvim": { "branch": "master", "commit": "3fae9c1e14910e6669bb8ecbb473aba6a9e13b33" }, - "toggleterm.nvim": { "branch": "main", "commit": "b90a1381e9b5b8596f49070ee86c71db267ac868" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, + "telescope.nvim": { "branch": "master", "commit": "f336f8cfab38a82f9f00df380d28f0c2a572f862" }, + "toggleterm.nvim": { "branch": "main", "commit": "cbd041d91b90cd3c02df03fe6133208888f8e008" }, "tree-sitter-just": { "branch": "main", "commit": "4e5f5f3ff37b12a1bbf664eb3966b3019e924594" }, - "undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" }, - "vim-fugitive": { "branch": "master", "commit": "572c8510123cbde02e8a1dafcd376c98e1e13f43" }, - "vim-just": { "branch": "main", "commit": "927b41825b9cd07a40fc15b4c68635c4b36fa923" }, - "which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" } + "undotree": { "branch": "master", "commit": "36ff7abb6b60980338344982ad4cdf03f7961ecd" }, + "vim-fugitive": { "branch": "master", "commit": "59659093581aad2afacedc81f009ed6a4bfad275" }, + "vim-just": { "branch": "main", "commit": "61effac68ca42dbe515d488c4fef73035ce4f281" }, + "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }, + "zig.vim": { "branch": "master", "commit": "54c216e5306a5c3878a60596aacb94dca8652ab9" } } \ No newline at end of file diff --git a/nvim/.config/nvim/lua/custom/init.lua b/nvim/.config/nvim/lua/custom/init.lua index fbd7472..fb12286 100644 --- a/nvim/.config/nvim/lua/custom/init.lua +++ b/nvim/.config/nvim/lua/custom/init.lua @@ -1,12 +1,6 @@ -- Set variables require("custom.set") --- lazy.nvim -require("custom.plugins") - --- Set UI vars -require("custom.ui") - -- Set LSP vars require("custom.lsp") diff --git a/nvim/.config/nvim/lua/custom/lsp.lua b/nvim/.config/nvim/lua/custom/lsp.lua index 3668fcc..ae6bbd9 100644 --- a/nvim/.config/nvim/lua/custom/lsp.lua +++ b/nvim/.config/nvim/lua/custom/lsp.lua @@ -6,8 +6,23 @@ local cmp_autopairs = require("nvim-autopairs.completion.cmp") local luasnip = require("luasnip") -- require("luasnip.loaders.from_vscode").lazy_load() cmp.setup({ + sorting = { + priority_weight = 2, + comparators = { + require("copilot_cmp.comparators").prioritize, + cmp.config.compare.offset, + cmp.config.compare.exact, + cmp.config.compare.score, + cmp.config.compare.kind, + cmp.config.compare.sort_text, + cmp.config.compare.length, + cmp.config.compare.order, + }, + }, formatting = { - format = lspkind.cmp_format(), + format = lspkind.cmp_format({ + symbol_map = { Copilot = "" }, + }), }, snippet = { expand = function(args) @@ -44,14 +59,14 @@ cmp.setup({ end), }, sources = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "nvim_lsp_signature_help" }, - { name = "nvim_lsp_lua" }, - { name = "copilot" }, - { name = "luasnip" }, - { name = "crates" }, - { name = "buffer" }, - { name = "path" }, + { name = "copilot", group_index = 2 }, + { name = "nvim_lsp", group_index = 2 }, + { name = "nvim_lsp_signature_help", group_index = 2 }, + { name = "nvim_lsp_lua", group_index = 2 }, + { name = "luasnip", group_index = 2 }, + { name = "crates", group_index = 2 }, + { name = "buffer", group_index = 2 }, + { name = "path", group_index = 2 }, }), experimental = { ghost_text = true, @@ -72,11 +87,17 @@ require("cmp_git").setup() -- A table of servers used for setting up LSP local servers = { "ccls", + "ocamllsp", "bashls", "marksman", "pyright", "solc", "nixd", + "zls", + { + "grammarly", + exec = "grammarly-languageserver" + }, { "ansiblels", exec = "ansible-language-server" @@ -148,6 +169,7 @@ local servers = { analyses = { unusedparams = true, shadow = true, + structtag = false }, staticcheck = true, codelenses = { test = true }, @@ -236,6 +258,7 @@ vim.api.nvim_create_autocmd("LspAttach", { }) + require("rust-tools").setup(rust_opts) require("trouble").setup({}) diff --git a/nvim/.config/nvim/lua/custom/plugins.lua b/nvim/.config/nvim/lua/custom/plugins.lua index d7c8537..e69de29 100644 --- a/nvim/.config/nvim/lua/custom/plugins.lua +++ b/nvim/.config/nvim/lua/custom/plugins.lua @@ -1,242 +0,0 @@ -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "--single-branch", - "https://github.com/folke/lazy.nvim.git", - lazypath, - }) -end -vim.opt.runtimepath:prepend(lazypath) -local plugins = { - "neovim/nvim-lspconfig", - { - "rmagatti/goto-preview", - config = function() - require("goto-preview").setup({ default_mappings = true }) - end, - }, - { - "folke/lsp-trouble.nvim", - config = true, - dependencies = { "nvim-tree/nvim-web-devicons" }, - }, - "jose-elias-alvarez/null-ls.nvim", - { - "lvimuser/lsp-inlayhints.nvim", - config = true, - on = { "LspAttach" }, - }, - "simrat39/rust-tools.nvim", - { - "olexsmir/gopher.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-treesitter/nvim-treesitter", - }, - ft = "go", - build = function() - if not require("nvim-treesitter.parsers").has_parser("go") then - vim.cmd("TSInstall go") - end - end, - config = true, - }, - "onsails/lspkind-nvim", - { - "windwp/nvim-autopairs", - config = true, - }, - -- Filetype plugins - { - "pearofducks/ansible-vim", - ft = "ansible.yaml", - }, - { - "saltstack/salt-vim", - ft = "sls", - }, - { - "Saecki/crates.nvim", - event = "BufRead Cargo.toml", - dependencies = { "nvim-lua/plenary.nvim" }, - config = true, - }, - - -- nvim-cmp - { - "hrsh7th/nvim-cmp", - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-nvim-lua", - "hrsh7th/cmp-nvim-lsp-signature-help", - "hrsh7th/cmp-path", - "saadparwaiz1/cmp_luasnip", - "petertriho/cmp-git", - "nvim-lua/plenary.nvim", - }, - }, - { - "zbirenbaum/copilot.lua", - cmd = "Copilot", - event = "InsertEnter", - config = true, - }, - { - "zbirenbaum/copilot-cmp", - config = true, - }, - - -- Treesitter - { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - }, - "nvim-treesitter/nvim-treesitter-textobjects", - "mrjones2014/nvim-ts-rainbow", - { - "nvim-treesitter/playground", - dependencies = { "nvim-treesitter/nvim-treesitter" }, - build = ":TSInstall query", - }, - "nvim-treesitter/nvim-treesitter-context", - -- Snippets - { - "L3MON4D3/LuaSnip", - dependencies = { - "rafamadriz/friendly-snippets", - }, - config = function() - require("luasnip.loaders.from_vscode").lazy_load() - end, - }, - - -- Git - "tpope/vim-fugitive", - { - "lewis6991/gitsigns.nvim", - event = "BufReadPre", - config = true, - }, - -- UI - { - "EdenEast/nightfox.nvim", - config = function() - vim.cmd.colorscheme("carbonfox") - end, - }, - "nvim-lualine/lualine.nvim", - "stevearc/dressing.nvim", - - -- Code help - { - "numToStr/Comment.nvim", - config = true, - }, - { - "ThePrimeagen/harpoon", - opts = { - tabline = true, - }, - dependencies = { - { "nvim-lua/plenary.nvim" }, - }, - }, - - -- Telescope - { - "nvim-telescope/telescope.nvim", - cmd = "Telescope", - dependencies = { - "nvim-lua/plenary.nvim", - }, - init = function() - require("telescope").setup({ - extensions = { - file_browser = { - hijack_netrw = true, - }, - }, - }) - require("telescope").load_extension("fzf") - require("telescope").load_extension("harpoon") - require("telescope").load_extension("luasnip") - require("telescope").load_extension("file_browser") - end, - lazy = true, - }, - { - "nvim-telescope/telescope-fzf-native.nvim", - dependencies = { - { "nvim-telescope/telescope.nvim" }, - }, - build = "make", - }, - { - "nvim-telescope/telescope-file-browser.nvim", - dependencies = { - "nvim-telescope/telescope.nvim", - }, - lazy = true, - }, - { - "benfowler/telescope-luasnip.nvim", - dependencies = { - "nvim-telescope/telescope.nvim", - }, - lazy = true, - }, - { - "ethanholz/nvim-lastplace", - config = true, - }, - "mbbill/undotree", - { - "folke/which-key.nvim", - config = true, - }, - { - "andythigpen/nvim-coverage", - dependencies = "nvim-lua/plenary.nvim", - config = true, - }, - { - "IndianBoy42/tree-sitter-just", - config = true, - }, - "NoahTheDuke/vim-just", - { - "akinsho/toggleterm.nvim", - version = "*", - config = true, - }, - { - "jackMort/ChatGPT.nvim", - -- event = "VeryLazy", - cmd = { "ChatGPT", "ChatGPTActAs", "ChatGPTEditWithInstructions", "ChatpGPTRun" }, - opts = { - api_key_cmd = "op read op://personal-api-auth/ChatGPT/credential --no-newline", - }, - dependencies = { - "MunifTanjim/nui.nvim", - "nvim-lua/plenary.nvim", - "nvim-telescope/telescope.nvim", - }, - }, - { - "folke/noice.nvim", - event = "VeryLazy", - dependencies = { - "MunifTanjim/nui.nvim", - "rcarriga/nvim-notify", - }, - }, - -- { - -- "sourcegraph/sg.nvim", - -- dependencies = { "nvim-lua/plenary.nvim" }, - -- }, -} - -require("lazy").setup(plugins) diff --git a/nvim/.config/nvim/lua/custom/set.lua b/nvim/.config/nvim/lua/custom/set.lua index 68b2c08..0df893c 100644 --- a/nvim/.config/nvim/lua/custom/set.lua +++ b/nvim/.config/nvim/lua/custom/set.lua @@ -20,6 +20,7 @@ vim.opt.bg = "dark" vim.opt.spell = true -- Enables treesitter comment spelling vim.opt.termguicolors = true vim.opt.signcolumn = "yes" +vim.opt.filetype = "on" -- Persistent undos vim.opt.undofile = true diff --git a/nvim/.config/nvim/lua/custom/ui.lua b/nvim/.config/nvim/lua/custom/ui.lua deleted file mode 100644 index 2358123..0000000 --- a/nvim/.config/nvim/lua/custom/ui.lua +++ /dev/null @@ -1,65 +0,0 @@ -local ok, lualine = pcall(require, "lualine") -if ok then - local ho, harpoon_mark = pcall(require, "harpoon.mark") - local lualine_config = { - options = { - component_separators = { left = "|", right = "|" }, - section_separators = "", - }, - } - if ho then - local function hook() - local harpoon_number = harpoon_mark.get_index_of(vim.fn.bufname()) - if harpoon_number then - return "ﯠ " .. harpoon_number - else - return "ﯡ " - end - end - - lualine_config["sections"] = { - lualine_y = { - hook, - }, - } - - -- local lualine_config = { - -- sections = { - -- lualine_y = { - -- hook, - -- }, - -- }, - -- } - end - - lualine.setup(lualine_config) - - vim.opt.cmdheight = 0 - vim.opt.laststatus = 3 -end - -local noice_config = { - lsp = { - -- override markdown rendering so that **cmp** and other plugins use **Treesitter** - override = { - ["vim.lsp.util.convert_input_to_markdown_lines"] = true, - ["vim.lsp.util.stylize_markdown"] = true, - ["cmp.entry.get_documentation"] = true, - }, - }, - -- you can enable a preset for easier configuration - presets = { - bottom_search = true, -- use a classic bottom cmdline for search - command_palette = true, -- position the cmdline and popupmenu together - long_message_to_split = true, -- long messages will be sent to a split - inc_rename = false, -- enables an input dialog for inc-rename.nvim - lsp_doc_border = false, -- add a border to hover docs and signature help - }, - require("notify").setup({ - background_colour = "#1e222a", - render = "minimal", - stages = "static", - timeout = 5000, - }), -} -require("noice").setup(noice_config) diff --git a/nvim/.config/nvim/lua/mappings.lua b/nvim/.config/nvim/lua/mappings.lua index b01b5bd..78138a4 100644 --- a/nvim/.config/nvim/lua/mappings.lua +++ b/nvim/.config/nvim/lua/mappings.lua @@ -1,9 +1,9 @@ -- Map leader config -vim.g.mapleader = "," vim.cmd.timeoutlen = 0 local wk = require("which-key") local v = { mode = "v", noremap = "true" } local t = { mode = "t", noremap = "true" } +local t_n local Terminal = require("toggleterm.terminal").Terminal local gitui = Terminal:new({ @@ -45,9 +45,9 @@ vim.api.nvim_create_autocmd("LspAttach", { -- Register Go mappings vim.api.nvim_create_autocmd("FileType", { - pattern = { "*.go" }, + pattern = { "go" }, group = vim.api.nvim_create_augroup("UserGoConfig", {}), - callback = function(args) + callback = function() wk.register({ ["g"] = { t = { @@ -102,7 +102,6 @@ wk.register(vim.tbl_extend("force", harpoon_table, { b = { require("gitsigns").blame_line, "Blame Line" }, u = { gitui_toggle, "gitui toggle" }, }, - m = { require("harpoon.mark").add_file, "Harpoon Mark" }, p = { '"+p', "Paste from clipboard" }, q = { require("harpoon.ui").toggle_quick_menu, "Harpoon Quick Menu" }, u = { "UndotreeToggle", "UndoTreeToggle" }, @@ -117,7 +116,6 @@ wk.register(vim.tbl_extend("force", harpoon_table, { ["space"] = { c = { vim.cmd.cclose, "Close qf list" }, }, - [""] = { require("telescope").extensions.file_browser.file_browser, "Open file picker" }, })) wk.register({ [""] = { @@ -133,9 +131,3 @@ wk.register({ wk.register({ [""] = { "", "Exit terminal" }, }, t) --- -- Debugs --- map("n", "dt", require("dapui").toggle, opts) --- map("n", "tt", require("dap").toggle_breakpoint, opts) --- map("n", "", require("dap").continue, opts) --- map("n", "", require("dap").step_into, opts) --- map("n", "", require("dap").step_over, opts) diff --git a/nvim/.config/nvim/lua/plugins/ansible.lua b/nvim/.config/nvim/lua/plugins/ansible.lua new file mode 100644 index 0000000..b34abed --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/ansible.lua @@ -0,0 +1,6 @@ +return { + { + "pearofducks/ansible-vim", + ft = "ansible.yaml", + }, +} diff --git a/nvim/.config/nvim/lua/plugins/autopairs.lua b/nvim/.config/nvim/lua/plugins/autopairs.lua new file mode 100644 index 0000000..a57276b --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/autopairs.lua @@ -0,0 +1,6 @@ +return { + { + "windwp/nvim-autopairs", + config = true, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/copilot.lua b/nvim/.config/nvim/lua/plugins/copilot.lua new file mode 100644 index 0000000..4cfd88f --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/copilot.lua @@ -0,0 +1,18 @@ +return { + { + "zbirenbaum/copilot.lua", + cmd = "Copilot", + event = "InsertEnter", + config = function() + require("copilot").setup({ + suggestion = { enabled = false }, + panel = { enabled = false }, + }) + end, + }, + { + "zbirenbaum/copilot-cmp", + config = true, + after = { "copilot.lua" }, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/coverage.lua b/nvim/.config/nvim/lua/plugins/coverage.lua new file mode 100644 index 0000000..615e944 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/coverage.lua @@ -0,0 +1,8 @@ +return { + { + "andythigpen/nvim-coverage", + dependencies = { "nvim-lua/plenary.nvim", "EdenEast/nightfox.nvim" }, + lazy = true, + config = true, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/dap.lua b/nvim/.config/nvim/lua/plugins/dap.lua new file mode 100644 index 0000000..58a5ba9 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/dap.lua @@ -0,0 +1,39 @@ +return { + { + "mfussenegger/nvim-dap", + dependencies = { + "rcarriga/nvim-dap-ui", + "leoluz/nvim-dap-go", + "folke/which-key.nvim", + }, + ft = "go", + config = function() + require("dapui").setup() + require("dap-go").setup() + local wk = require("which-key") + wk.register({ + [""] = { + d = { + name = "Dap", + u = { require("dapui").toggle, "Toggle Dap UI" }, + b = { require("dap").toggle_breakpoint, "Toggle Breakpoint" }, + B = { + function() + require("dap").set_breakpoint(vim.fn.input("Breakpoint condition: ")) + end, + "Set Breakpoint with condition", + }, + t = { require("dap").terminate, "Terminate Dap" }, + }, + }, + [""] = { require("dap").continue, "Dap Continue" }, + + [""] = { require("dap").step_into, "Dap Step Into" }, + [""] = { require("dap").step_out, "Dap Step Out" }, + [""] = { require("dap").step_over, "Dap Step Over" }, + + [""] = { require("dap-go").debug_test, "Dap Go Test" }, + }) + end, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/git.lua b/nvim/.config/nvim/lua/plugins/git.lua new file mode 100644 index 0000000..f9e5500 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/git.lua @@ -0,0 +1,12 @@ +return { + -- Git + { + "tpope/vim-fugitive", + cmd = "Git", + }, + { + "lewis6991/gitsigns.nvim", + event = "BufReadPre", + config = true, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/harpoon.lua b/nvim/.config/nvim/lua/plugins/harpoon.lua new file mode 100644 index 0000000..da3deae --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/harpoon.lua @@ -0,0 +1,20 @@ +return { + { + "ThePrimeagen/harpoon", + opts = { + tabline = true, + }, + dependencies = { + { "nvim-lua/plenary.nvim" }, + }, + keys = { + { + "m", + function() + require("harpoon.mark").add_file() + end, + desc = "Harpoon Mark", + }, + }, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/init.lua b/nvim/.config/nvim/lua/plugins/init.lua new file mode 100644 index 0000000..6341018 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/init.lua @@ -0,0 +1,140 @@ +return { + { "neovim/nvim-lspconfig" }, + { + "rmagatti/goto-preview", + config = function() + require("goto-preview").setup({ default_mappings = true }) + end, + }, + { + "folke/lsp-trouble.nvim", + config = true, + dependencies = { "nvim-tree/nvim-web-devicons" }, + }, + "jose-elias-alvarez/null-ls.nvim", + { + "lvimuser/lsp-inlayhints.nvim", + config = true, + on = { "LspAttach" }, + }, + "simrat39/rust-tools.nvim", + { + "olexsmir/gopher.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + }, + ft = "go", + build = function() + if not require("nvim-treesitter.parsers").has_parser("go") then + vim.cmd("TSInstall go") + end + end, + config = true, + }, + "onsails/lspkind-nvim", + -- Filetype plugins + { + "Saecki/crates.nvim", + event = "BufRead Cargo.toml", + dependencies = { "nvim-lua/plenary.nvim" }, + config = true, + }, + "ziglang/zig.vim", + { + "pest-parser/pest.vim", + ft = "pest", + config = true, + }, + + -- nvim-cmp + { + "hrsh7th/nvim-cmp", + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-nvim-lua", + "hrsh7th/cmp-nvim-lsp-signature-help", + "hrsh7th/cmp-path", + "saadparwaiz1/cmp_luasnip", + "petertriho/cmp-git", + "nvim-lua/plenary.nvim", + }, + }, + + -- Treesitter + { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + }, + "nvim-treesitter/nvim-treesitter-textobjects", + "mrjones2014/nvim-ts-rainbow", + { + "nvim-treesitter/playground", + dependencies = { "nvim-treesitter/nvim-treesitter" }, + build = ":TSInstall query", + }, + "nvim-treesitter/nvim-treesitter-context", + -- Snippets + { + "L3MON4D3/LuaSnip", + dependencies = { + "rafamadriz/friendly-snippets", + }, + version = "v2.1", + build = "make install_jsregexp", + }, + -- UI + { + "EdenEast/nightfox.nvim", + config = function() + -- vim.cmd.colorscheme("carbonfox") + vim.cmd.colorscheme("terafox") + end, + }, + "stevearc/dressing.nvim", + + -- Code help + { + "numToStr/Comment.nvim", + config = true, + }, + + { + "ethanholz/nvim-lastplace", + config = true, + }, + "mbbill/undotree", + { + "folke/which-key.nvim", + config = true, + }, + { + "IndianBoy42/tree-sitter-just", + config = true, + }, + "NoahTheDuke/vim-just", + { + "akinsho/toggleterm.nvim", + version = "*", + config = true, + }, + { + "jackMort/ChatGPT.nvim", + -- event = "VeryLazy", + cmd = { "ChatGPT", "ChatGPTActAs", "ChatGPTEditWithInstructions", "ChatpGPTRun" }, + opts = { + api_key_cmd = "op read op://personal-api-auth/ChatGPT/credential --no-newline", + }, + dependencies = { + "MunifTanjim/nui.nvim", + "nvim-lua/plenary.nvim", + "nvim-telescope/telescope.nvim", + }, + }, + "mfussenegger/nvim-lint", + { + "mrjones2014/op.nvim", + build = "make install", + config = true, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/lualine.lua b/nvim/.config/nvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..da8d76d --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/lualine.lua @@ -0,0 +1,15 @@ +return { + { + "nvim-lualine/lualine.nvim", + config = function() + vim.opt.cmdheight = 0 + vim.opt.laststatus = 3 + require("lualine").setup({ + options = { + component_separators = { left = "|", right = "|" }, + section_separators = "", + }, + }) + end, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/noice.lua b/nvim/.config/nvim/lua/plugins/noice.lua new file mode 100644 index 0000000..c52bf30 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/noice.lua @@ -0,0 +1,31 @@ +return { + { + "folke/noice.nvim", + event = "VeryLazy", + dependencies = { + "MunifTanjim/nui.nvim", + }, + enabled = true, + opts = { + lsp = { + progress = { + throttle = 10000 / 30, + }, + -- override markdown rendering so that **cmp** and other plugins use **Treesitter** + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, + }, + }, + -- you can enable a preset for easier configuration + presets = { + bottom_search = true, -- use a classic bottom cmdline for search + command_palette = true, -- position the cmdline and popupmenu together + long_message_to_split = true, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = true, -- add a border to hover docs and signature help + }, + }, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/oil.lua b/nvim/.config/nvim/lua/plugins/oil.lua new file mode 100644 index 0000000..7cface9 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/oil.lua @@ -0,0 +1,5 @@ +return { + "stevearc/oil.nvim", + opts = {}, + dependencies = { "nvim-tree/nvim-web-devicons" }, +} diff --git a/nvim/.config/nvim/lua/plugins/salt.lua b/nvim/.config/nvim/lua/plugins/salt.lua new file mode 100644 index 0000000..4ff2fd8 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/salt.lua @@ -0,0 +1,6 @@ +return { + { + "saltstack/salt-vim", + ft = "sls", + }, +} diff --git a/nvim/.config/nvim/lua/plugins/telescope.lua b/nvim/.config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..1207ef2 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,22 @@ +return { + { + "nvim-telescope/telescope.nvim", + cmd = "Telescope", + dependencies = { + "nvim-lua/plenary.nvim", + }, + init = function() + require("telescope").setup({}) + require("telescope").load_extension("fzf") + require("telescope").load_extension("harpoon") + end, + lazy = true, + }, + { + "nvim-telescope/telescope-fzf-native.nvim", + dependencies = { + { "nvim-telescope/telescope.nvim" }, + }, + build = "make", + }, +} diff --git a/nvim/.config/nvim/lua/snips.lua b/nvim/.config/nvim/lua/snips.lua index 9586b3b..9249fcc 100644 --- a/nvim/.config/nvim/lua/snips.lua +++ b/nvim/.config/nvim/lua/snips.lua @@ -3,6 +3,7 @@ local helper = require("custom.helper") -- Snippet creator local s = ls.s local fmt = require("luasnip.extras.fmt").fmt +local rep = require("luasnip.extras").rep local i = ls.insert_node local f = ls.function_node @@ -105,6 +106,29 @@ ls.add_snippets("go", { s("jsc", fmt([[{} {} `json:"{}"`]], { i(1), i(2), json_convert(1) })), }) +ls.add_snippets("markdown", { + s( + "doc", + fmt( + [[ +## **{}** +{} +#### Parameters +| parameter | type | required | description | +|-----------|------|----------|-------------| +```yaml +{}: +``` + ]], + { i(1), i(2), rep(1) } + ) + ), +}) + +ls.add_snippets("markdown", { + s("lin", fmt([[| _{}_ | {} | {} | {} ]], { i(1), i(2), i(3), i(4) })), +}) + ls.add_snippets("c", { s("bis", fmt([[(Bi_Status_Fn({}) << {})]], { i(1), i(2) })), }) diff --git a/nvim/.config/nvim/queries/gotmpl/highlights.scm b/nvim/.config/nvim/queries/gotmpl/highlights.scm new file mode 100644 index 0000000..6f55737 --- /dev/null +++ b/nvim/.config/nvim/queries/gotmpl/highlights.scm @@ -0,0 +1,84 @@ +; Identifiers + +[ + (field) + (field_identifier) +] @property + +(variable) @variable + +; Function calls + +(function_call + function: (identifier) @function) + +(method_call + method: (selector_expression + field: (field_identifier) @method)) + +; Operators + +"|" @operator +":=" @operator + +; Builtin functions + +((identifier) @function.builtin + (#match? @function.builtin "^(and|call|html|index|slice|js|len|not|or|print|printf|println|urlquery|eq|ne|lt|ge|gt|ge)$")) + +; Delimiters + +"." @punctuation.delimiter +"," @punctuation.delimiter + +"{{" @punctuation.bracket +"}}" @punctuation.bracket +"{{-" @punctuation.bracket +"-}}" @punctuation.bracket +")" @punctuation.bracket +"(" @punctuation.bracket + +; Keywords + +[ + "else" + "else if" + "if" + "with" +] @conditional + +[ + "range" + "end" + "template" + "define" + "block" +] @keyword + +; Literals + +[ + (interpreted_string_literal) + (raw_string_literal) + (rune_literal) +] @string + +(escape_sequence) @string.special + +[ + (int_literal) + (float_literal) + (imaginary_literal) +] @number + +[ + (true) + (false) +] @boolean + +[ + (nil) +] @constant.builtin + +(comment) @comment +(ERROR) @error diff --git a/nvim/.config/nvim/queries/gotmpl/injections.scm b/nvim/.config/nvim/queries/gotmpl/injections.scm new file mode 100644 index 0000000..694efeb --- /dev/null +++ b/nvim/.config/nvim/queries/gotmpl/injections.scm @@ -0,0 +1 @@ +(text) @yaml diff --git a/nvim/.config/nvim/queries/grlx/highlights.scm b/nvim/.config/nvim/queries/grlx/highlights.scm new file mode 100644 index 0000000..6f55737 --- /dev/null +++ b/nvim/.config/nvim/queries/grlx/highlights.scm @@ -0,0 +1,84 @@ +; Identifiers + +[ + (field) + (field_identifier) +] @property + +(variable) @variable + +; Function calls + +(function_call + function: (identifier) @function) + +(method_call + method: (selector_expression + field: (field_identifier) @method)) + +; Operators + +"|" @operator +":=" @operator + +; Builtin functions + +((identifier) @function.builtin + (#match? @function.builtin "^(and|call|html|index|slice|js|len|not|or|print|printf|println|urlquery|eq|ne|lt|ge|gt|ge)$")) + +; Delimiters + +"." @punctuation.delimiter +"," @punctuation.delimiter + +"{{" @punctuation.bracket +"}}" @punctuation.bracket +"{{-" @punctuation.bracket +"-}}" @punctuation.bracket +")" @punctuation.bracket +"(" @punctuation.bracket + +; Keywords + +[ + "else" + "else if" + "if" + "with" +] @conditional + +[ + "range" + "end" + "template" + "define" + "block" +] @keyword + +; Literals + +[ + (interpreted_string_literal) + (raw_string_literal) + (rune_literal) +] @string + +(escape_sequence) @string.special + +[ + (int_literal) + (float_literal) + (imaginary_literal) +] @number + +[ + (true) + (false) +] @boolean + +[ + (nil) +] @constant.builtin + +(comment) @comment +(ERROR) @error diff --git a/nvim/.config/nvim/queries/grlx/injections.scm b/nvim/.config/nvim/queries/grlx/injections.scm new file mode 100644 index 0000000..694efeb --- /dev/null +++ b/nvim/.config/nvim/queries/grlx/injections.scm @@ -0,0 +1 @@ +(text) @yaml