質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Vim

VimとはUnix / Linux 系のOSに標準搭載されているターミナル上で動くテキストエディタです。

Lua

Luaは、汎用のスクリプト言語の一つで、 移植性が高く、高速な実行速度などの特徴を持ち 手続き型・オブジェクト指向言語としても利用可能で 関数型言語、データ駆動型の要素も併せ持っている言語です。

Q&A

0回答

519閲覧

nvim マクロに配色を設定する方法

退会済みユーザー

退会済みユーザー

総合スコア0

Vim

VimとはUnix / Linux 系のOSに標準搭載されているターミナル上で動くテキストエディタです。

Lua

Luaは、汎用のスクリプト言語の一つで、 移植性が高く、高速な実行速度などの特徴を持ち 手続き型・オブジェクト指向言語としても利用可能で 関数型言語、データ駆動型の要素も併せ持っている言語です。

0グッド

0クリップ

投稿2022/08/17 02:29

提示コードですが#define の色を変更したいのですが以下の提示コードのように色を直接変更しても色がかりません。
これはなぜでしょうか?

確認した事

treesitterとvscode.nvimが対応していることを確認

Github: https://github.com/Mofiqul/vscode.nvim

イメージ説明

利用ライブラリ

lua

1vim.cmd[[packadd packer.nvim]] 2require'packer'.startup(function() 3 use 'wbthomason/packer.nvim' -- パッケージマネージャー 4 use 'Mofiqul/vscode.nvim' -- テーマ 5-- use 'kyazdani42/nvim-web-devicons' -- アイコン画像 6 7 use 'nvim-treesitter/nvim-treesitter' -- シンタックスハイライト 8 use 'nvim-lualine/lualine.nvim' -- ステータスバー 9 10 ---------------- 自動補完 ---------------- 11 use 'neovim/nvim-lspconfig' 12 use 'williamboman/mason.nvim' 13 use 'hrsh7th/nvim-cmp' 14 use 'hrsh7th/cmp-nvim-lsp' 15 use 'hrsh7th/cmp-vsnip' 16 use 'hrsh7th/cmp-buffer' 17 use 'williamboman/mason-lspconfig.nvim' 18 use "hrsh7th/nvim-cmp" 19 use 'jose-elias-alvarez/null-ls.nvim' 20 use 'nvim-lua/plenary.nvim' 21 22 ---------------- ファイルツリー ---------------- 23 use 'kyazdani42/nvim-tree.lua' 24 use 'kyazdani42/nvim-web-devicons' 25 26 27end)
nvim-treesitter/lua/nvim-treesitter/highlight.lua

lua

1 2function M.set_default_hlgroups() 3 local highlights = { 4 TSNone = { default = true }, 5 TSPunctDelimiter = { link = "Delimiter", default = true }, 6 TSPunctBracket = { link = "Delimiter", default = true }, 7 TSPunctSpecial = { link = "Delimiter", default = true }, 8 9 TSConstant = { link = "Constant", default = true }, 10 TSConstBuiltin = { link = "Special", default = true }, 11 TSConstMacro = { link = "Define", default = true }, 12 TSString = { link = "String", default = true }, 13 TSStringRegex = { link = "String", default = true }, 14 TSStringEscape = { link = "SpecialChar", default = true }, 15 TSStringSpecial = { link = "SpecialChar", default = true }, 16 TSCharacter = { link = "Character", default = true }, 17 TSCharacterSpecial = { link = "SpecialChar", default = true }, 18 TSNumber = { link = "Number", default = true }, 19 TSBoolean = { link = "Boolean", default = true }, 20 TSFloat = { link = "Float", default = true }, 21 TSFunction = { link = "Function", default = true }, 22 TSFunctionCall = { link = "TSFunction", default = true }, 23 TSFuncBuiltin = { link = "Special", default = true }, 24 25 TSFuncMacro = { link = "Macro", default = true },--------------------------------------------- 26 27 TSParameter = { link = "Identifier", default = true }, 28 TSParameterReference = { link = "TSParameter", default = true }, 29 TSMethod = { link = "Function", default = true }, 30 TSMethodCall = { link = "TSMethod", default = true }, 31 TSField = { link = "Identifier", default = true }, 32 TSProperty = { link = "Identifier", default = true }, 33 TSConstructor = { link = "Special", default = true }, 34 TSAnnotation = { link = "PreProc", default = true }, 35 TSAttribute = { link = "PreProc", default = true }, 36 TSNamespace = { link = "Include", default = true }, 37 TSSymbol = { link = "Identifier", default = true }, 38 39 .....省略 40 41 42hlmap["debug"] = "TSDebug" 43hlmap["define"] = "TSDefine" 44 45hlmap["error"] = "TSError" 46hlmap["exception"] = "TSException" 47 48hlmap["field"] = "TSField" 49 50hlmap["float"] = "TSFloat" 51 52hlmap["function"] = "TSFunction" 53hlmap["function.call"] = "TSFunctionCall" 54hlmap["function.builtin"] = "TSFuncBuiltin" 55hlmap["function.macro"] = "TSFuncMacro" 56 57hlmap["include"] = "TSInclude"------------------------------------ 58 59hlmap["keyword"] = "TSKeyword" 60hlmap["keyword.function"] = "TSKeywordFunction" 61hlmap["keyword.operator"] = "TSKeywordOperator" 62hlmap["keyword.return"] = "TSKeywordReturn" 63 64hlmap["label"] = "TSLabel" 65 66 67
theme.lua

lua

1 -- Treesitter 2 hl(0, 'TSError', { fg = c.vscRed, bg = 'NONE' }) 3 hl(0, 'TSPunctBracket', { fg = c.vscFront, bg = 'NONE' }) 4 hl(0, 'TSPunctSpecial', { fg = c.vscFront, bg = 'NONE' }) 5 hl(0, 'markdownTSPunctSpecial', { fg = isDark and c.vscBlue or c.vscYellowOrange, bold = true }) 6 hl(0, 'TSComment', { fg = c.vscGreen, bg = 'NONE', italic = opts.italic_comments }) 7 hl(0, 'TSConstant', { fg = c.vscYellow, bg = 'NONE' }) 8 hl(0, 'TSConstBuiltin', { fg = c.vscBlue, bg = 'NONE' }) 9----------------------------------------------------------------------------------- 10 --hl(0, 'TSConstMacro', { fg = c.vscBlueGreen, bg = 'NONE' }) 11 hl(0, 'TSConstMacro', { fg = c.vscPink, bg = 'NONE' }) 12----------------------------------------------------------------------------------- 13 14 hl(0, 'TSStringRegex', { fg = c.vscOrange, bg = 'NONE' }) 15 hl(0, 'TSString', { fg = c.vscOrange, bg = 'NONE' }) 16 hl(0, 'TSCharacter', { fg = c.vscOrange, bg = 'NONE' }) 17 hl(0, 'TSNumber', { fg = c.vscLightGreen, bg = 'NONE' }) 18 hl(0, 'TSBoolean', { fg = c.vscBlue, bg = 'NONE' }) 19 hl(0, 'TSFloat', { fg = c.vscLightGreen, bg = 'NONE' }) 20 hl(0, 'TSAnnotation', { fg = c.vscYellow, bg = 'NONE' }) 21 hl(0, 'TSAttribute', { fg = c.vscBlueGreen, bg = 'NONE' }) 22 hl(0, 'TSNamespace', { fg = c.vscBlueGreen, bg = 'NONE' }) 23 hl(0, 'TSFuncBuiltin', { fg = c.vscYellow, bg = 'NONE' }) 24 hl(0, 'TSFunction', { fg = c.vscYellow, bg = 'NONE' }) 25----------------------------------------------------------------------------------- 26 ---hl(0, 'TSFuncMacro', { fg = c.vscYellow, bg = 'NONE' }) 27 hl(0, 'TSFuncMacro', { fg = c.vscPink, bg = 'NONE' }) 28----------------------------------------------------------------------------------- 29 hl(0, 'TSParameter', { fg = c.vscLightBlue, bg = 'NONE' }) 30 hl(0, 'TSParameterReference', { fg = c.vscLightBlue, bg = 'NONE' }) 31 hl(0, 'TSMethod', { fg = c.vscYellow, bg = 'NONE' }) 32 hl(0, 'TSField', { fg = c.vscLightBlue, bg = 'NONE' }) 33 hl(0, 'TSProperty', { fg = c.vscLightBlue, bg = 'NONE' }) 34 hl(0, 'TSConstructor', { fg = c.vscBlueGreen, bg = 'NONE' }) 35 hl(0, 'TSConditional', { fg = c.vscPink, bg = 'NONE' }) 36 hl(0, 'TSRepeat', { fg = c.vscPink, bg = 'NONE' }) 37 hl(0, 'TSLabel', { fg = c.vscLightBlue, bg = 'NONE' }) 38 hl(0, 'TSKeyword', { fg = c.vscPink, bg = 'NONE' }) 39 hl(0, 'TSKeywordFunction', { fg = c.vscBlue, bg = 'NONE' })
colors.lua

lua

1 -- Syntax colors 2 vscGray = '#000000', 3 vscViolet = '#000080', 4 vscBlue = '#0000FF', 5 vscBlack = '#343434', 6 vscDarkBlue = '#007ACC', 7 vscLightBlue = '#0451A5', 8 vscGreen = '#008000', 9 vscBlueGreen = '#16825D', 10 vscLightGreen = '#098658', 11 vscRed = '#FF0000', 12 vscOrange = '#C72E0F', 13 vscLightRed = '#A31515', 14 vscYellowOrange = '#800000', 15 vscYellow = '#795E26', 16 17 vscPink = '#AF00DB',-----------------------------------------

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問