From 4a45d062d094a8bfca3e0120ad73d35b7259feee Mon Sep 17 00:00:00 2001 From: Leslie Kerman Date: Mon, 31 Oct 2022 17:06:19 +0800 Subject: [PATCH] Add decorated scrollbar --- lua/configs/treesitter.lua | 22 +++++------ lua/core/init.lua | 1 + lua/core/plugins.lua | 3 ++ lua/core/theme.lua | 4 +- syntax/shark.vim | 81 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 98 insertions(+), 13 deletions(-) create mode 100644 syntax/shark.vim diff --git a/lua/configs/treesitter.lua b/lua/configs/treesitter.lua index 85e05b5..b4eb8b9 100644 --- a/lua/configs/treesitter.lua +++ b/lua/configs/treesitter.lua @@ -1,16 +1,16 @@ local M = {} function M.config() - -- nvim-treesitter config - require 'nvim-treesitter.configs'.setup { - -- ensure_installed = "maintained", -- for installing all maintained parsers - ensure_installed = { "c", "cpp", "rust", "lua" }, -- for installing specific parsers - sync_install = true, -- install synchronously - ignore_install = {}, -- parsers to not install - highlight = { - enable = true, - additional_vim_regex_highlighting = false, -- disable standard vim highlighting - }, - } + -- nvim-treesitter config + require 'nvim-treesitter.configs'.setup { + -- ensure_installed = "maintained", -- for installing all maintained parsers + ensure_installed = { "c", "cpp", "rust", "lua" }, -- for installing specific parsers + sync_install = true, -- install synchronously + ignore_install = {}, -- parsers to not install + highlight = { + enable = true, + additional_vim_regex_highlighting = false, -- disable standard vim highlighting + }, + } end return M diff --git a/lua/core/init.lua b/lua/core/init.lua index 8b063d8..4d81fce 100644 --- a/lua/core/init.lua +++ b/lua/core/init.lua @@ -52,6 +52,7 @@ require('image').setup { -- Load plugin configs -- plugins without extra configs are configured directly here require("impatient") +require('satellite').setup() require("configs.autocomplete").config() require("configs.symbols_outline").config() diff --git a/lua/core/plugins.lua b/lua/core/plugins.lua index 481d4ee..4703e56 100644 --- a/lua/core/plugins.lua +++ b/lua/core/plugins.lua @@ -83,4 +83,7 @@ return require('packer').startup(function() -- ascii image use 'samodostal/image.nvim' + -- decorated scrollbar + use 'lewis6991/satellite.nvim' + end) diff --git a/lua/core/theme.lua b/lua/core/theme.lua index 980af38..5875de6 100644 --- a/lua/core/theme.lua +++ b/lua/core/theme.lua @@ -46,7 +46,7 @@ --vim.cmd("colorscheme kanagawa") -- edge -vim.g.edge_style = 'aura' -- neon, aura +vim.g.edge_style = 'neon' -- neon, aura vim.g.edge_better_performance = 1 vim.cmd("colorscheme edge") @@ -56,4 +56,4 @@ vim.cmd("colorscheme edge") -- oxocarbon -- vim.cmd("colorscheme oxocarbon-lua") -vim.cmd("set background=light") +vim.cmd("set background=dark") diff --git a/syntax/shark.vim b/syntax/shark.vim new file mode 100644 index 0000000..8dac4b3 --- /dev/null +++ b/syntax/shark.vim @@ -0,0 +1,81 @@ +" Vim syntax file +" Language: Shark +" Maintainer: leslie255 +" Latest Revision: 2022-10-22 + +if exists("b:current_syntax") + finish +endif + +syn case match +syn keyword sharkKeyword alias allow break case continue copy else enum extern for if import in local loop return static switch typedef while +syn keyword sharkBool true false +syn keyword sharkPreProc elif else end endif ifpin include macro pin asm +syn keyword sharkTypeNames u8 u16 u32 u64 i8 i16 i32 i64 usize isize f32 f64 none + +""" Stolen from C +syn case ignore +syn match sharkNumbers display transparent "\<\d\|\.\d" contains=sharkNumber,sharkFloat,sharkOctalError,sharkOctal +" Same, but without octal error (for comments) +syn match sharkNumbersCom display contained transparent "\<\d\|\.\d" contains=sharkNumber,sharkFloat,sharkOctal +syn match sharkNumber display contained "\d\+\%(u\=l\{0,2}\|ll\=u\)\>" +"hex number +syn match sharkNumber display contained "0x\x\+\%(u\=l\{0,2}\|ll\=u\)\>" +" Flag the first zero of an octal number as something special +syn match sharkOctal display contained "0\o\+\%(u\=l\{0,2}\|ll\=u\)\>" contains=sharkOctalZero +syn match sharkOctalZero display contained "\<0" +"floating point number, with dot, optional exponent +syn match sharkFloat display contained "\d\+\.\d*\%(e[-+]\=\d\+\)\=[fl]\=" +"floating point number, starting with a dot, optional exponent +syn match sharkFloat display contained "\.\d\+\%(e[-+]\=\d\+\)\=[fl]\=\>" +"floating point number, without dot, with exponent +syn match sharkFloat display contained "\d\+e[-+]\=\d\+[fl]\=\>" + +" A comment can contain cString, cCharacter and cNumber. +" But a "*/" inside a cString in a cComment DOES end the comment! So we +" need to use a special type of cString: cCommentString, which also ends on +" "*/", and sees a "*" at the start of the line as comment again. +" Unfortunately this doesn't very well work for // type of comments :-( +syn match sharkCommentSkip contained "^\s*\*\%($\|\s\+\)" +syn region sharkCommentString contained start=+L\=\\\@