Skip to content

Commit

Permalink
Merge pull request #28 from TonyWu20/ayamir-main
Browse files Browse the repository at this point in the history
ayamir main
  • Loading branch information
TonyWu20 authored Oct 21, 2023
2 parents 7b71e10 + f907935 commit 66b13aa
Show file tree
Hide file tree
Showing 17 changed files with 218 additions and 132 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/update_lockfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
./scripts/install.sh
nvim --headless "+Lazy! update" +qa
cp -pv "${HOME}/.config/nvim/lazy-lock.json" .
- uses: stefanzweifel/git-auto-commit-action@v4
- uses: stefanzweifel/git-auto-commit-action@v5
if: ${{ steps.check_lockfile.outputs.files_exists == 'true' && env.NEW_COMMIT_COUNT > 0 }}
with:
commit_message: "chore(lockfile): auto update lazy-lock.json"
Expand Down
68 changes: 48 additions & 20 deletions lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"LuaSnip": {
"branch": "master",
"commit": "c5fb16a934892086d4ba01bac48b77c65435025e"
"commit": "480b032f6708573334f4437d3f83307d143f1a72"
},
"accelerated-jk.nvim": {
"branch": "main",
Expand Down Expand Up @@ -93,7 +93,7 @@
},
"crates.nvim": {
"branch": "main",
"commit": "db629b5cfb2aa8de9e44efb795657297ee95ca91"
"commit": "04a06cee3fb9c584de4f5481eb4080bd6c759336"
},
"csv.vim": {
"branch": "master",
Expand All @@ -109,7 +109,7 @@
},
"focus.nvim": {
"branch": "master",
"commit": "a994282f957840ee3419ad62a36be9d4e155560c"
"commit": "40fee169fa502eb0b87bcaa0f8e2af051326ed14"
},
"friendly-snippets": {
"branch": "main",
Expand All @@ -121,7 +121,7 @@
},
"gitsigns.nvim": {
"branch": "main",
"commit": "bce4576a9047085a528c479a7fe1e2f6b787b6c1"
"commit": "bdeba1cec3faddd89146690c10b9a87949c0ee66"
},
"glance.nvim": {
"branch": "master",
Expand All @@ -133,19 +133,27 @@
},
"indent-blankline.nvim": {
"branch": "master",
"commit": "9637670896b68805430e2f72cf5d16be5b97a22a"
"commit": "12f4fffcfca59816267b5a364f19f986c8d14040"
},
"knap": {
"branch": "main",
"commit": "503010f541696e99ed5c62f658620e546cebf8b0"
},
"lazy.nvim": {
"branch": "main",
"commit": "2a9354c7d2368d78cbd5575a51a2af5bd8a6ad01"
"commit": "7ca3bdb566c3ba4492f2d22b37c2c9e26f09470f"
},
"lsp-format-modifications.nvim": {
"branch": "main",
"commit": "006d4cd88f4f09fdc4375fcb75dd5b7d981a723b"
},
"lsp_signature.nvim": {
"branch": "master",
"commit": "46ab0c1fe34aed7e442cc7b747d99197cc0ccf31"
},
"lspsaga.nvim": {
"branch": "main",
"commit": "14f0c87db4c52d0b9e92d8c1a1fece10a00f6f91"
"commit": "b7873e556a5451c5febc0d46ba80767b2beea49e"
},
"lualine.nvim": {
"branch": "master",
Expand Down Expand Up @@ -205,7 +213,7 @@
},
"nvim-lspconfig": {
"branch": "master",
"commit": "4266f9bb36b4fb09edd19b67d95043cf7ff88ddf"
"commit": "c7077400d004c1a424d210af76ce198250db72fd"
},
"nvim-notify": {
"branch": "master",
Expand All @@ -217,19 +225,19 @@
},
"nvim-tree.lua": {
"branch": "master",
"commit": "a3aa3b47eac8b6289f028743bef4ce9eb0f6782e"
"commit": "934469b9b6df369e198fb3016969e56393b0dc07"
},
"nvim-treehopper": {
"branch": "master",
"commit": "5a28bff46c05d28bdb4bcaef67e046eb915a9390"
},
"nvim-treesitter": {
"branch": "master",
"commit": "b7f2dd5dfbd24a1239844e15637b637b990df164"
"commit": "cb139d880bcf9b3a6f29f2bd088a7491d1662918"
},
"nvim-treesitter-context": {
"branch": "master",
"commit": "b6c763db8cc486215ba96e0a67418848a710ab25"
"commit": "44d270e9d1647088de596a2e04fdc806a50cd838"
},
"nvim-treesitter-textobjects": {
"branch": "master",
Expand All @@ -245,7 +253,11 @@
},
"nvim-web-devicons": {
"branch": "master",
"commit": "973ab742f143a796a779af4d786ec409116a0d87"
"commit": "45d0237c427baba8cd05e0ab26d30e2ee58c2c82"
},
"obsidian.nvim": {
"branch": "main",
"commit": "52c06a056c62cc38a461cde603842af8a533bf63"
},
"paint.nvim": {
"branch": "main",
Expand All @@ -265,7 +277,7 @@
},
"rainbow-delimiters.nvim": {
"branch": "master",
"commit": "9cbd3dc409af1f5531778ccd1ea6bce668241f39"
"commit": "6b9fc617ad52f25372d1855e049cae3af348bc09"
},
"rust-tools.nvim": {
"branch": "master",
Expand All @@ -283,10 +295,6 @@
"branch": "main",
"commit": "2743e412bbe21c9d73954c403d01e8de7377890d"
},
"sqlite.lua": {
"branch": "master",
"commit": "b7e28c8463254c46a8e61c52d27d6a2040492fc3"
},
"suda.vim": {
"branch": "master",
"commit": "8b0fc3711760195aba104e2d190cff9af8267052"
Expand All @@ -299,6 +307,10 @@
"branch": "master",
"commit": "0d275c8d25f32457e67b5c66d6ae43f26a61bce5"
},
"telescope-bibtex.nvim": {
"branch": "master",
"commit": "e4dcf64d351db23b14be3563190cf68d5cd49e90"
},
"telescope-frecency.nvim": {
"branch": "master",
"commit": "eaaabc90ed082b84a2e9b0ce4ab8c6753b7c50f9"
Expand All @@ -321,11 +333,11 @@
},
"telescope.nvim": {
"branch": "master",
"commit": "40c8d2fc2b729dd442eda093cf8c9496d6e23732"
"commit": "84d53dfdbefbdf84e861a288abc71ef8ccafd04e"
},
"toggleterm.nvim": {
"branch": "main",
"commit": "0427b908ebefcb3701c7f2cfbdafa37d11afe71a"
"commit": "61e8ad370d4da5d84c77e31671027bc094ac06ca"
},
"trouble.nvim": {
"branch": "main",
Expand All @@ -339,13 +351,29 @@
"branch": "master",
"commit": "12dd6316974f71ce333e360c0260b4e1f81169c3"
},
"vim-fugitive": {
"branch": "master",
"commit": "99db68d9b3304580bd383da7aaee05c7a954a344"
},
"vim-go": {
"branch": "master",
"commit": "a2e59981a2d965bed9f4052fa15a08d2ee2f8040"
},
"vim-illuminate": {
"branch": "master",
"commit": "1b5d70332a51a1de05f281069851865a2bb1e6d7"
},
"vim-matchup": {
"branch": "master",
"commit": "6dbe108230c7dbbf00555b7d4d9f6a891837ef07"
},
"vim-pencil": {
"branch": "master",
"commit": "6d70438a8886eaf933c38a7a43a61adb0a7815ed"
},
"vimtex": {
"branch": "master",
"commit": "877de3ba5de5f766e5bfa1c3fb0d2ecfcd18f868"
"commit": "d08da8034bab1fae423bd36aa606ee3012cf2833"
},
"which-key.nvim": {
"branch": "main",
Expand Down
8 changes: 4 additions & 4 deletions lua/core/mapping.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ local core_map = {
["n|<C-l>"] = map_cmd("<C-w>l"):with_noremap():with_desc("window: Focus right"),
["n|<C-j>"] = map_cmd("<C-w>j"):with_noremap():with_desc("window: Focus down"),
["n|<C-k>"] = map_cmd("<C-w>k"):with_noremap():with_desc("window: Focus up"),
["t|<C-h>"] = map_cmd("<Cmd>wincmd h<CR>"):with_silent():with_noremap():with_desc("window: Focus left"),
["t|<C-l>"] = map_cmd("<Cmd>wincmd l<CR>"):with_silent():with_noremap():with_desc("window: Focus right"),
["t|<C-j>"] = map_cmd("<Cmd>wincmd j<CR>"):with_silent():with_noremap():with_desc("window: Focus down"),
["t|<C-k>"] = map_cmd("<Cmd>wincmd k<CR>"):with_silent():with_noremap():with_desc("window: Focus up"),
["t|<C-w>h"] = map_cmd("<Cmd>wincmd h<CR>"):with_silent():with_noremap():with_desc("window: Focus left"),
["t|<C-w>l"] = map_cmd("<Cmd>wincmd l<CR>"):with_silent():with_noremap():with_desc("window: Focus right"),
["t|<C-w>j"] = map_cmd("<Cmd>wincmd j<CR>"):with_silent():with_noremap():with_desc("window: Focus down"),
["t|<C-w>k"] = map_cmd("<Cmd>wincmd k<CR>"):with_silent():with_noremap():with_desc("window: Focus up"),
["n|<A-[>"] = map_cr("vertical resize -5"):with_silent():with_desc("window: Resize -5 vertically"),
["n|<A-]>"] = map_cr("vertical resize +5"):with_silent():with_desc("window: Resize +5 vertically"),
["n|<A-;>"] = map_cr("resize -2"):with_silent():with_desc("window: Resize -2 horizontally"),
Expand Down
11 changes: 0 additions & 11 deletions lua/core/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,6 @@ local function load_options()
vim.g.python3_host_prog = use_if_defined(vim.g.python3_host_prog, "python3")
end

-- custom sqlite3 provider
local sqlite_clib_path = os.getenv("SQLITE_CLIB_PATH")
if not isempty(sqlite_clib_path) then
-- Try environment variable first
vim.g.sqlite_clib_path = sqlite_clib_path
elseif global.is_windows then
-- Fix sqlite3 missing-lib issue on Windows
-- Download the DLLs form https://www.sqlite.org/download.html
vim.g.sqlite_clib_path = global.home .. "/Documents/sqlite-dll-win64-x64-3400200/sqlite3.dll"
end

for name, value in pairs(require("modules.utils").extend_config(global_local, "user.options")) do
vim.o[name] = value
end
Expand Down
2 changes: 1 addition & 1 deletion lua/core/pack.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function Lazy:load_plugins()
";%s;%s;%s",
modules_dir .. "/configs/?.lua",
modules_dir .. "/configs/?/init.lua",
user_config_dir
user_config_dir .. "/?.lua"
)
end

Expand Down
29 changes: 19 additions & 10 deletions lua/core/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ local settings = {}
---@type boolean
settings["use_ssh"] = true

-- Set it to false if you don't use copilot
---@type boolean
settings["use_copilot"] = true

-- Set it to false if there are no need to format on save.
---@type boolean
settings["format_on_save"] = true
Expand All @@ -12,9 +16,22 @@ settings["format_on_save"] = true
---@type boolean
settings["format_notify"] = true

-- Set it to false if you don't use copilot
-- Set it to true if you prefer formatting ONLY the *changed lines* as defined by your version control system.
-- NOTE: This entry will only be respected if:
-- > The buffer to be formatted is under version control (Git or Mercurial);
-- > Any of the server attached to that buffer supports |DocumentRangeFormattingProvider| server capability.
-- Otherwise Neovim would fall back to format the whole buffer, and a warning will be issued.
---@type boolean
settings["use_copilot"] = true
settings["format_modifications_only"] = false

-- Set the format disabled directories here, files under these dirs won't be formatted on save.
--- NOTE: Directories may contain regular expressions (grammar: vim). |regexp|
--- NOTE: Directories are automatically normalized. |vim.fs.normalize()|
---@type string[]
settings["format_disabled_dirs"] = {
-- Example
"~/format_disabled_dir",
}

-- Set it to false if diagnostics virtual text is annoying.
-- If disabled, you may browse lsp diagnostics using trouble.nvim (press `gt` to toggle it).
Expand All @@ -28,14 +45,6 @@ settings["diagnostics_virtual_text"] = true
---@type "Error"|"Warning"|"Information"|"Hint"
settings["diagnostics_level"] = "Hint"

-- Set the format disabled directories here, files under these dirs won't be formatted on save.
--- NOTE: Directories may contain regular expressions (grammar: vim). |regexp|
--- NOTE: Directories are automatically normalized. |vim.fs.normalize()|
---@type string[]
settings["format_disabled_dirs"] = {
"~/format_disabled_dir",
}

-- Set the plugins to disable here.
-- Example: "Some-User/A-Repo"
---@type string[]
Expand Down
11 changes: 4 additions & 7 deletions lua/keymap/tool.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ local plug_map = {
-- Plugin: toggleterm
["t|<Esc><Esc>"] = map_cmd([[<C-\><C-n>]]):with_noremap():with_silent(), -- switch to normal mode in terminal.
["t|jk"] = map_cmd([[<C-\><C-n>]]):with_noremap():with_silent(), -- switch to normal mode in terminal.
["n|<C-\\>"] = map_cr([[execute v:count . "ToggleTerm direction=horizontal"]])
["n|<C-\\>"] = map_cr("ToggleTerm direction=horizontal")
:with_noremap()
:with_silent()
:with_desc("terminal: Toggle horizontal"),
Expand All @@ -32,7 +32,7 @@ local plug_map = {
:with_silent()
:with_desc("terminal: Toggle horizontal"),
["t|<C-\\>"] = map_cmd("<Cmd>ToggleTerm<CR>"):with_noremap():with_silent():with_desc("terminal: Toggle horizontal"),
["n|<A-\\>"] = map_cr([[execute v:count . "ToggleTerm direction=vertical"]])
["n|<A-\\>"] = map_cr("ToggleTerm direction=vertical")
:with_noremap()
:with_silent()
:with_desc("terminal: Toggle vertical"),
Expand All @@ -41,7 +41,7 @@ local plug_map = {
:with_silent()
:with_desc("terminal: Toggle vertical"),
["t|<A-\\>"] = map_cmd("<Cmd>ToggleTerm<CR>"):with_noremap():with_silent():with_desc("terminal: Toggle vertical"),
["n|<F5>"] = map_cr([[execute v:count . "ToggleTerm direction=vertical"]])
["n|<F5>"] = map_cr("ToggleTerm direction=vertical")
:with_noremap()
:with_silent()
:with_desc("terminal: Toggle vertical"),
Expand All @@ -50,10 +50,7 @@ local plug_map = {
:with_silent()
:with_desc("terminal: Toggle vertical"),
["t|<F5>"] = map_cmd("<Cmd>ToggleTerm<CR>"):with_noremap():with_silent():with_desc("terminal: Toggle vertical"),
["n|<A-d>"] = map_cr([[execute v:count . "ToggleTerm direction=float"]])
:with_noremap()
:with_silent()
:with_desc("terminal: Toggle float"),
["n|<A-d>"] = map_cr("ToggleTerm direction=float"):with_noremap():with_silent():with_desc("terminal: Toggle float"),
["i|<A-d>"] = map_cmd("<Esc><Cmd>ToggleTerm direction=float<CR>")
:with_noremap()
:with_silent()
Expand Down
15 changes: 15 additions & 0 deletions lua/modules/configs/completion/formatting.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local settings = require("core.settings")
local disabled_workspaces = settings.format_disabled_dirs
local format_on_save = settings.format_on_save
local format_notify = settings.format_notify
local format_modifications_only = settings.format_modifications_only
local server_formatting_block_list = settings.server_formatting_block_list

vim.api.nvim_create_user_command("FormatToggle", function()
Expand Down Expand Up @@ -155,7 +156,21 @@ function M.format(opts)
{ title = "LSP Formatter Warning" }
)
return
elseif
format_modifications_only
and require("lsp-format-modifications").format_modifications(client, bufnr).success
then
if format_notify then
vim.notify(
string.format("[LSP] Format changed lines successfully with %s!", client.name),
vim.log.levels.INFO,
{ title = "LSP Range Format Success" }
)
end
return
end

-- Fall back to format the whole buffer (even if partial formatting failed)
local params = vim.lsp.util.make_formatting_params(opts.formatting_options)
local result, err = client.request_sync("textDocument/formatting", params, timeout_ms, bufnr)
if result and result.result then
Expand Down
1 change: 0 additions & 1 deletion lua/modules/configs/editor/bigfile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ return function()
filesize = 1, -- size of the file in MiB
pattern = { "*" }, -- autocmd pattern
features = { -- features to disable
"indent_blankline",
"lsp",
"illuminate",
"treesitter",
Expand Down
1 change: 1 addition & 0 deletions lua/modules/configs/tool/telescope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ return function()
case_mode = "smart_case",
},
frecency = {
use_sqlite = false,
show_scores = true,
show_unindexed = true,
ignore_patterns = { "*.git/*", "*/tmp/*" },
Expand Down
4 changes: 2 additions & 2 deletions lua/modules/configs/ui/catppuccin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ return function()
MasonNormal = { link = "NormalFloat" },

-- For indent-blankline
IndentBlanklineChar = { fg = cp.surface0 },
IndentBlanklineContextChar = { fg = cp.surface2, style = { "bold" } },
IblIndent = { fg = cp.surface0 },
IblScope = { fg = cp.surface2, style = { "bold" } },

-- For nvim-cmp and wilder.nvim
Pmenu = { fg = cp.overlay2, bg = transparent_background and cp.none or cp.base },
Expand Down
Loading

0 comments on commit 66b13aa

Please sign in to comment.