Skip to content

Commit

Permalink
Merge pull request #40 from TonyWu20/ayamir-main
Browse files Browse the repository at this point in the history
ayamir main
  • Loading branch information
TonyWu20 authored Apr 19, 2024
2 parents 1b17cef + 81eea71 commit dec90b6
Show file tree
Hide file tree
Showing 26 changed files with 251 additions and 243 deletions.
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ body:
attributes:
value: |
_Before reporting:_ Search [existing issues](https://github.com/ayamir/nvimdots/issues) and check the [FAQ](https://github.com/ayamir/nvimdots/wiki/Issues). Thank you for helping us improve!
> [!IMPORTANT]
> The `0.10` branch is intended for nightly neovim builds and is **not** stable. It typically harbors subtle issues scattered throughout. Therefore, refrain from submitting issues if you happen to encounter them. They will be closed directly unless a viable solution is proposed or included.
- type: checkboxes
id: is-latest-commit
attributes:
Expand Down
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/custom_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ body:
attributes:
value: |
_Before requesting:_ Make sure you've read through our [Wiki: Usage](https://github.com/ayamir/nvimdots/wiki/Usage) before you start to add things to nvimdots!
> [!IMPORTANT]
> The `0.10` branch is intended for nightly neovim builds and is **not** stable. It typically harbors subtle issues scattered throughout. Therefore, refrain from submitting issues if you happen to encounter them. They will be closed directly unless a viable solution is proposed or included.
- type: checkboxes
id: is-latest-commit
attributes:
Expand Down
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/lsp_issue_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ body:
attributes:
value: |
_Before reporting:_ Search [existing issues](https://github.com/ayamir/nvimdots/issues) and check the [FAQ](https://github.com/ayamir/nvimdots/wiki/Issues). Thank you for helping us improve!
> [!IMPORTANT]
> The `0.10` branch is intended for nightly neovim builds and is **not** stable. It typically harbors subtle issues scattered throughout. Therefore, refrain from submitting issues if you happen to encounter them. They will be closed directly unless a viable solution is proposed or included.
- type: checkboxes
id: is-latest-commit
attributes:
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ Branch info:

</div>

> [!IMPORTANT]
> The `0.10` branch is intended for nightly neovim builds and is **not** stable. It typically harbors subtle issues scattered throughout. Therefore, refrain from submitting issues if you happen to encounter them. They will be closed directly unless a viable solution is proposed or included.
We currently manage plugins using [lazy.nvim](https://github.com/folke/lazy.nvim).

Chinese introduction is [here](https://zhuanlan.zhihu.com/p/382092667).
Expand Down
129 changes: 65 additions & 64 deletions lazy-lock.json

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions lua/core/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ local function load_options()
encoding = "utf-8",
equalalways = false,
errorbells = true,
expandtab = true,
fileformats = "unix,mac,dos",
foldenable = true,
foldlevelstart = 99,
Expand Down Expand Up @@ -71,7 +70,6 @@ local function load_options()
signcolumn = "yes",
smartcase = true,
smarttab = true,
softtabstop = 4,
splitbelow = true,
splitkeep = "screen",
splitright = true,
Expand Down
2 changes: 1 addition & 1 deletion lua/core/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ settings["lsp_deps"] = {
"jsonls",
"lua_ls",
"pylsp",
-- "gopls",
"gopls",
}

-- Set the general-purpose servers that will be installed during bootstrap here.
Expand Down
6 changes: 5 additions & 1 deletion lua/keymap/completion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local map_cmd = bind.map_cmd
local map_callback = bind.map_callback

local plug_map = {
["n|<A-f>"] = map_cmd("<Cmd>FormatToggle<CR>"):with_noremap():with_desc("Formater: Toggle format on save"),
["n|<A-f>"] = map_cmd("<Cmd>FormatToggle<CR>"):with_noremap():with_desc("formatter: Toggle format on save"),
}
bind.nvim_load_mapping(plug_map)

Expand Down Expand Up @@ -50,6 +50,10 @@ function mapping.lsp(buf)
["n|gd"] = map_cr("Glance definitions"):with_silent():with_buffer(buf):with_desc("lsp: Preview definition"),
["n|gD"] = map_cr("Lspsaga goto_definition"):with_silent():with_buffer(buf):with_desc("lsp: Goto definition"),
["n|gh"] = map_cr("Glance references"):with_silent():with_buffer(buf):with_desc("lsp: Show reference"),
["n|gm"] = map_cr("Glance implementations")
:with_silent()
:with_buffer(buf)
:with_desc("lsp: Show implementation"),
["n|gci"] = map_cr("Lspsaga incoming_calls")
:with_silent()
:with_buffer(buf)
Expand Down
30 changes: 19 additions & 11 deletions lua/keymap/editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,28 +68,36 @@ local plug_map = {
["n|<C-j>"] = map_cu("SmartCursorMoveDown"):with_silent():with_noremap():with_desc("window: Focus down"),
["n|<C-k>"] = map_cu("SmartCursorMoveUp"):with_silent():with_noremap():with_desc("window: Focus up"),
["n|<C-l>"] = map_cu("SmartCursorMoveRight"):with_silent():with_noremap():with_desc("window: Focus right"),
["n|<leader>Wh"] = map_cu("SmartSwapLeft"):with_silent():with_noremap():with_desc("window: Move window to left"),
["n|<leader>Wj"] = map_cu("SmartSwapDown"):with_silent():with_noremap():with_desc("window: Move window to down"),
["n|<leader>Wk"] = map_cu("SmartSwapUp"):with_silent():with_noremap():with_desc("window: Move window to up"),
["n|<leader>Wl"] = map_cu("SmartSwapRight"):with_silent():with_noremap():with_desc("window: Move window to right"),
["n|<leader>Wh"] = map_cu("SmartSwapLeft"):with_silent():with_noremap():with_desc("window: Move window leftward"),
["n|<leader>Wj"] = map_cu("SmartSwapDown"):with_silent():with_noremap():with_desc("window: Move window downward"),
["n|<leader>Wk"] = map_cu("SmartSwapUp"):with_silent():with_noremap():with_desc("window: Move window upward"),
["n|<leader>Wl"] = map_cu("SmartSwapRight"):with_silent():with_noremap():with_desc("window: Move window rightward"),

-- Plugin: nvim-spectre
["n|<leader>Ss"] = map_cmd([[<Cmd>lua require("spectre").toggle()<CR>]])
["n|<leader>Ss"] = map_callback(function()
require("spectre").toggle()
end)
:with_silent()
:with_noremap()
:with_desc("editn: Toggle search&replace panel"),
["n|<leader>Sp"] = map_cmd([[<Cmd>lua require("spectre").open_visual({select_word=true})<CR>]])
:with_desc("editn: Toggle search & replace panel"),
["n|<leader>Sp"] = map_callback(function()
require("spectre").open_visual({ select_word = true })
end)
:with_silent()
:with_noremap()
:with_desc("editn: search&replace current word (project)"),
["v|<leader>Sp"] = map_cmd([[<Esc><Cmd>lua require("spectre").open_visual()<CR>]])
["v|<leader>Sp"] = map_callback(function()
require("spectre").open_visual()
end)
:with_silent()
:with_noremap()
:with_desc("edit: search&replace current word (project)"),
["n|<leader>Sf"] = map_cmd([[<Cmd>lua require("spectre").open_file_search({select_word=true})<CR>]])
:with_desc("edit: search & replace current word (project)"),
["n|<leader>Sf"] = map_callback(function()
require("spectre").open_file_search({ select_word = true })
end)
:with_silent()
:with_noremap()
:with_desc("editn: search&replace current word (file)"),
:with_desc("editn: search & replace current word (file)"),

-- Plugin: nvim-treehopper
["o|m"] = map_cu("lua require('tsht').nodes()"):with_silent():with_desc("jump: Operate across syntax tree"),
Expand Down
2 changes: 1 addition & 1 deletion lua/modules/configs/completion/mason-lspconfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ M.setup = function()
virtual_text = diagnostics_virtual_text and {
severity_limit = diagnostics_level,
} or false,
-- set update_in_insert to false bacause it was enabled by lspsaga
-- set update_in_insert to false because it was enabled by lspsaga
update_in_insert = false,
})

Expand Down
29 changes: 2 additions & 27 deletions lua/modules/configs/completion/neoconf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ local M = {}

M.setup = function()
require("modules.utils").load_plugin("neoconf", {
-- send new configuration to lsp clients when changing json settings
live_reload = true,
-- name of the local settings files
local_settings = ".neoconf.json",
-- name of the global settings file in your Neovim config directory
Expand All @@ -12,33 +14,6 @@ M.setup = function()
coc = true, -- global/local coc-settings.json
nlsp = true, -- global/local nlsp-settings.nvim json settings
},
-- send new configuration to lsp clients when changing json settings
live_reload = true,
-- set the filetype to jsonc for settings files, so you can use comments
-- make sure you have the jsonc treesitter parser installed!
filetype_jsonc = true,
plugins = {
-- configures lsp clients with settings in the following order:
-- - lua settings passed in lspconfig setup
-- - global json settings
-- - local json settings
lspconfig = {
enabled = true,
},
-- configures jsonls to get completion in .nvim.settings.json files
jsonls = {
enabled = true,
-- only show completion in json settings for configured lsp servers
configured_servers_only = true,
},
-- configures lua_ls to get completion of lspconfig server settings
lua_ls = {
-- by default, lua_ls annotations are only enabled in your neovim config directory
enabled_for_neovim_config = true,
-- explicitely enable adding annotations. Mostly relevant to put in your local .nvim.settings.json file
enabled = false,
},
},
})
end

Expand Down
48 changes: 41 additions & 7 deletions lua/modules/configs/completion/servers/gopls.lua
Original file line number Diff line number Diff line change
@@ -1,15 +1,49 @@
-- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/gopls.lua
return {
flags = { debounce_text_changes = 500 },
cmd = { "gopls", "-remote=auto" },
cmd = { "gopls", "-remote.debug=:0", "-remote=auto" },
filetypes = { "go", "gomod", "gosum", "gotmpl", "gohtmltmpl", "gotexttmpl" },
flags = { allow_incremental_sync = true, debounce_text_changes = 500 },
capabilities = {
textDocument = {
completion = {
contextSupport = true,
dynamicRegistration = true,
completionItem = {
commitCharactersSupport = true,
deprecatedSupport = true,
preselectSupport = true,
insertReplaceSupport = true,
labelDetailsSupport = true,
snippetSupport = true,
documentationFormat = { "markdown", "plaintext" },
resolveSupport = {
properties = {
"documentation",
"details",
"additionalTextEdits",
},
},
},
},
},
},
settings = {
gopls = {
staticcheck = true,
semanticTokens = true,
noSemanticString = true,
usePlaceholders = true,
analyses = {
nilness = true,
shadow = true,
unusedparams = true,
unusewrites = true,
completeUnimported = true,
symbolMatcher = "Fuzzy",
buildFlags = { "-tags", "integration" },
codelenses = {
generate = true,
gc_details = true,
test = true,
tidy = true,
vendor = true,
regenerate_cgo = true,
upgrade_dependency = true,
},
},
},
Expand Down
11 changes: 11 additions & 0 deletions lua/modules/configs/editor/align.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
return function()
require("modules.utils").load_plugin("mini.align", {
-- Whether to disable showing non-error feedback
silent = false,
-- Module mappings. Use `''` (empty string) to disable one.
mappings = {
start = "gea",
start_with_preview = "geA",
},
})
end
7 changes: 1 addition & 6 deletions lua/modules/configs/editor/local-highlight.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
return function()
require("modules.utils").load_plugin("local-highlight", {
file_types = nil,
hlgroup = "Search",
cw_hlgroup = nil,
-- Whether to display highlights in INSERT mode or not
hlgroup = "IlluminatedWordText",
insert_mode = false,
min_match_len = 1,
max_match_len = math.huge,
})
end
8 changes: 0 additions & 8 deletions lua/modules/configs/editor/mini-align.lua

This file was deleted.

92 changes: 0 additions & 92 deletions lua/modules/configs/editor/smart-splits.lua

This file was deleted.

14 changes: 14 additions & 0 deletions lua/modules/configs/editor/splits.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
return function()
require("modules.utils").load_plugin("smart-splits", {
-- Ignored buffer types (only while resizing)
ignored_buftypes = {
"nofile",
"quickfix",
"prompt",
},
-- Ignored filetypes (only while resizing)
ignored_filetypes = { "NvimTree" },
-- the default number of lines/columns to resize by at a time
default_amount = 3,
})
end
Loading

0 comments on commit dec90b6

Please sign in to comment.