Skip to content

Commit

Permalink
feat: add get_cursor_highlight_color
Browse files Browse the repository at this point in the history
  • Loading branch information
fcying committed Feb 5, 2025
1 parent 12f3470 commit 82747c5
Show file tree
Hide file tree
Showing 11 changed files with 223 additions and 60 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
run: |
mkdir ~/publish
wget -qOnvim.tgz "https://github.com/neovim/neovim/releases/download/stable/nvim-linux64.tar.gz"
wget -qOnvim.tgz "https://github.com/neovim/neovim/releases/download/stable/nvim-linux-x86_64.tar.gz"
tar xzf nvim.tgz
sudo cp -rf ./nvim-linux64/* /usr/local
sudo cp -rf ./nvim-linux-x86_64/* /usr/local
nvim --version
- uses: actions/checkout@v4
Expand Down
15 changes: 2 additions & 13 deletions etc/ctags
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,10 @@
--exclude=[lL]ib
--exclude=[lL]ibs

--regex-vim=/(.*)\{\{\{/\1/k,key/
--regex-c=/(.*)\{\{\{/\1/f,key/
--regex-c=/(.*)\{\{\{/\1/k,key/
--langmap=sh:+(*bashrc)(*zshrc)(*shrc.local)(*.zsh)
--regex-sh=/(.*)\{\{\{/\1/k,key/
--regex-lua=/(.*)\{\{\{/\1/k,key/
--regex-yaml=/(.*)\{\{\{/\1/k,key/
--langdef=toml
--langmap=toml:.toml
--regex-toml=/(.*)\{\{\{/\1/k,key/

#--langmap=vim:+(*vimrc*)
#--regex-vim=/(.*)\{\{\{/\1/mk,mykey/
#--regex-c=/(.*)\{\{\{/\1/mk,mykey/
#--langmap=sh:+(*bashrc)(*zshrc)(*shrc.local)(*.zsh)
#--regex-sh=/(.*)\{\{\{/\1/mk,mykey/
#--regex-lua=/(.*)\{\{\{/\1/mk,mykey/
#--regex-yaml=/(.*)\{\{\{/\1/mk,mykey/
#--regex-toml=/(.*)\{\{\{/\1/mk,mykey/
--regex-go=/(.*)\{\{\{/\1/k,key/
3 changes: 3 additions & 0 deletions etc/init_conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ if [[ $app == "ln" ]]; then
mkdir -p ~/.config/tig
ln -sfv $PWD/tigrc ~/.config/tig/config

mkdir -p ~/.ctags.d
ln -sfv $PWD/ctags ~/.ctags.d/global.ctags

ln -sfv $PWD/.clangd ~/
ln -sfv $PWD/.clang-format ~/

Expand Down
5 changes: 5 additions & 0 deletions init.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
vim.g.mapleader = " "
vim.g.maplocalleader = " "
vim.g.is_wsl = vim.fn.isdirectory("/mnt/c")
vim.g.is_win = vim.fn.has("win32")
vim.g.is_tmux = vim.fn.exists("$TMUX")
vim.g.path_separator = vim.g.is_win == 1 and "\\" or "/"

-- FIXME: bug in 0.10.3
vim.hl = vim.highlight

---@return string
function _G.join_paths(...)
local result = table.concat({ ... }, vim.g.path_separator)
Expand Down
9 changes: 9 additions & 0 deletions lua/ascii_logo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,14 @@ M.neovim1 = {
[[]],
}

M.neovim2 = [[
███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗
████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║
██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║
██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║
██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║
╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
]]


return M
3 changes: 3 additions & 0 deletions lua/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ function configs.lua()
end,
settings = {
Lua = {
semantic = {
enable = true,
},
workspace = {
checkThirdParty = false,
library = {
Expand Down
3 changes: 0 additions & 3 deletions lua/option.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ local g, opt, fn = vim.g, vim.opt, vim.fn
local util = require("util")
local map = util.map

g.mapleader = " "
g.maplocalleader = " "

g.has_rg = fn.executable("rg")
g.has_go = fn.executable("go")

Expand Down
65 changes: 35 additions & 30 deletions lua/plugins/blink.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,59 +6,64 @@ local opts = {
end,
keymap = {
preset = "enter",
["<C-l>"] = { "show", "show_documentation", "hide_documentation" },
["<C-space>"] = {},
["<S-Tab>"] = { "select_prev", "snippet_backward", "fallback" },
["<C-e>"] = { "show", "hide", "show_documentation", "hide_documentation" },
["<S-Tab>"] = { "select_prev", "snippet_forward", "fallback" },
["<Tab>"] = { "select_next", "snippet_forward", "fallback" },
["<C-u>"] = { "scroll_documentation_up", "fallback" },
["<C-d>"] = { "scroll_documentation_down", "fallback" },
cmdline = {
["<Tab>"] = { "select_next", "fallback" },
["<S-Tab>"] = { "select_prev", "fallback" },
["<C-n>"] = { "select_next", "fallback" },
["<C-p>"] = { "select_prev", "fallback" },
},
},
completion = {
accept = { auto_brackets = { enabled = false }, },
documentation = { auto_show = true, auto_show_delay_ms = 500 },
ghost_text = { enabled = true },
list = {
selection = {
preselect = function(ctx) return ctx.mode ~= "cmdline" end,
auto_insert = function(ctx) return ctx.mode == "cmdline" end
},
},
trigger = {
-- show_on_trigger_character = true,
show_on_x_blocked_trigger_characters = { "'", '"', "(", "{" },
},
},
signature = {
enabled = true,
window = {
border = "rounded",
},
},
snippets = {
-- expand = function(snippet) vim.snippet.expand(snippet) end,
-- active = function(filter) return vim.snippet.active(filter) end,
-- jump = function(direction) vim.snippet.jump(direction) end,
expand = function(snippet) require("luasnip").lsp_expand(snippet) end,
expand = function(snippet)
require("luasnip").lsp_expand(snippet)
end,
active = function(filter)
if filter and filter.direction then
require("luasnip").jumpable(filter.direction)
return require("luasnip").locally_jumpable()
end
return require("luasnip").in_snippet()
end,
jump = function(direction) require("luasnip").jump(direction) end,
jump = function(direction)
require("luasnip").jump(direction)
end,
},
sources = {
default = { "lsp", "path", "luasnip", "buffer", "lazydev", "dictionary" },
cmdline = {},
-- cmdline = {},
default = { "lsp", "path", "snippets", "buffer", "lazydev", "dictionary" },
providers = {
lsp = { min_keyword_length = 0, },
lazydev = { name = "LazyDev", module = "lazydev.integrations.blink", fallbacks = { "lsp" } },
luasnip = {
name = "luasnip",
module = "blink.compat.source",
score_offset = -3,
min_keyword_length = 2,
opts = {
use_show_condition = false,
show_autosnippets = true,
},
},
snippets = {
name = "Snippets",
module = "blink.cmp.sources.snippets",
score_offset = -3,
min_keyword_length = 2,
opts = {
friendly_snippets = true,
search_paths = { vim.g.config_dir .. "/snippets" },
global_snippets = { "all" },
extended_filetypes = {},
ignored_filetypes = {},
},
},
buffer = { min_keyword_length = 2, },
dictionary = {
name = "dictionary",
module = "blink.compat.source",
Expand Down
44 changes: 33 additions & 11 deletions lua/plugins/colorscheme.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,55 @@ return {
{
"maxmx03/solarized.nvim",
lazy = true,
-- FIXME: new version change light theme
commit = "3a19787",
---@type solarized.config
opts = {
highlights = function(c)
palette = "solarized", -- solarized (default) | selenized
---@diagnostic disable-next-line: unused-local
on_colors = function(colors, color)
return {
SpecialKey = { fg = c.red, reverse = false },
}
end,
on_highlights = function(c, _)
---@type solarized.highlights
return {
Empty = {},
["@lsp.type.enumMember"] = { link = "Constant" },
["@lsp.type.macro"] = { link = "Macro" },
["@lsp.type.parameter"] = { fg = c.base0, italic = true },
["@lsp.type.namespace"] = { link = "Empty" },
["@keyword.directive"] = { link = "PreProc" },
["@keyword.directive.define"] = { link = "Define" },
Keyword = { fg = c.green },
Identifier = { fg = c.base0 },
Identifier = { fg = c.base00 },
Constant = { fg = c.violet },
Comment = { italic = true },
Number = { fg = c.magenta },
Visual = { bg = c.mix_base01, standout = false, fg = "NONE" },
Search = { fg = c.yellow, reverse = true },
DashboardHeader = { fg = c.base0 },
TelescopeSelection = { bg = c.mix_base01 },
}
end
}
end,
},
config = function(_, opts)
vim.o.termguicolors = true
require("solarized").setup(opts)
end
},
{ "sainnhe/everforest", lazy = true },
{
"rose-pine/neovim",
name = "rose-pine",
lazy = true,
opts = {
variant = "auto", -- auto, main, moon, or dawn
variant = "auto", -- auto, main, moon, or dawn
dark_variant = "main", -- main, moon, or dawn
dim_inactive_windows = false,
extend_background_behind_borders = true,

enable = {
terminal = true,
legacy_highlights = true, -- Improve compatibility for previous versions of Neovim
migrations = true, -- Handle deprecated options automatically
migrations = true, -- Handle deprecated options automatically
},

styles = {
Expand All @@ -46,5 +67,6 @@ return {
},
},
},
{ "projekt0n/github-nvim-theme", lazy = true }
{ "projekt0n/github-nvim-theme", lazy = true },
{ "sainnhe/everforest", lazy = true },
}
18 changes: 17 additions & 1 deletion lua/plugins/snacks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,23 @@ return {
notification = {
wo = { wrap = true } -- Wrap notifications
}
}
},
-- dashboard = {
-- preset = {
-- header = require("ascii_logo").neovim2,
-- ---@type snacks.dashboard.Item[]
-- keys = {
-- { icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" },
-- { icon = " ", key = "ff", desc = "Find File", action = "lua require('util').find_file()" },
-- { icon = " ", key = "f/", desc = "Find Text", action = "lua require('util').live_grep()" },
-- { icon = " ", key = "fm", desc = "Recent Files", action = "Telescope oldfiles" },
-- { icon = " ", key = "c", desc = "Config", action = ":lua Snacks.dashboard.pick('files', {cwd = vim.fn.stdpath('config')})" },
-- { icon = " ", key = "s", desc = "Restore Session", section = "session" },
-- { icon = "󰒲 ", key = "l", desc = "Lazy", action = ":Lazy", enabled = package.loaded.lazy ~= nil },
-- { icon = " ", key = "q", desc = "Quit", action = ":qa" },
-- },
-- }
-- },
},
init = function()
vim.api.nvim_create_autocmd("User", {
Expand Down
Loading

0 comments on commit 82747c5

Please sign in to comment.