From 82b78bcbc6f110e7f67c39f673f9002d73121fc4 Mon Sep 17 00:00:00 2001 From: ucpr Date: Tue, 7 May 2024 05:25:01 +0900 Subject: [PATCH] add some plugins --- nvim/dpp.ts | 2 +- nvim/init.lua | 8 ++++-- nvim/tomls/cmp.toml | 37 +++++++++++++++++++++++++ nvim/tomls/dein_lazy.toml | 39 +++++++++++++++++++++++++++ nvim/tomls/{theme.toml => style.toml} | 17 ++++++++++++ 5 files changed, 100 insertions(+), 3 deletions(-) rename nvim/tomls/{theme.toml => style.toml} (79%) diff --git a/nvim/dpp.ts b/nvim/dpp.ts index bfe5c4a..22e804f 100644 --- a/nvim/dpp.ts +++ b/nvim/dpp.ts @@ -123,7 +123,7 @@ export class Config extends BaseConfig { "toml", "load", { - path: await fn.expand(args.denops, dotfilesDir + "tomls/theme.toml"), + path: await fn.expand(args.denops, dotfilesDir + "tomls/style.toml"), options: { lazy: true, }, diff --git a/nvim/init.lua b/nvim/init.lua index 2ff109f..9850ee9 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -112,7 +112,7 @@ for _, ext in ipairs(dpp_exts) do vim.opt.runtimepath:append(dpp_repo .. ext) end -vim.g["denops#debug"] = 1 -- note: cmdheight=0 のときはEnterで進めないといけない +vim.g["denops#debug"] = 1 -- note: cmdheight=0 のときはEnterで進めないといけない if dpp.load_state(dpp_base) then local denops_src = dpp_repo .. "github.com/vim-denops/denops.vim" @@ -121,7 +121,7 @@ if dpp.load_state(dpp_base) then local dpp_config = "$XDG_CONFIG_HOME/nvim/dpp.ts" vim.api.nvim_create_autocmd("User", { pattern = "DenopsReady", - callback = function () + callback = function() vim.notify("failed to load_state") dpp.make_state(dpp_base, dpp_config) end @@ -138,3 +138,7 @@ end vim.api.nvim_create_user_command('DppInstall', install, {}) vim.api.nvim_create_user_command('DppUpdate', update, {}) + +vim.cmd [[ + autocmd FileType go setl ts=4 sw=4 noet +]] diff --git a/nvim/tomls/cmp.toml b/nvim/tomls/cmp.toml index f970d50..009e386 100644 --- a/nvim/tomls/cmp.toml +++ b/nvim/tomls/cmp.toml @@ -543,3 +543,40 @@ lua_post_source = ''' end } ''' + +[[plugins]] +repo = 'stevearc/aerial.nvim' +on_event = 'VimEnter' +lua_post_source = ''' + require("aerial").setup({ + layout = { + -- These control the width of the aerial window. + -- They can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) + -- min_width and max_width can be a list of mixed types. + -- max_width = {40, 0.2} means "the lesser of 40 columns or 20% of total" + max_width = { 50, 0.2 }, + width = nil, + min_width = 30, + + -- key-value pairs of window-local options for aerial window (e.g. winhl) + win_opts = {}, + + -- Determines the default direction to open the aerial window. The 'prefer' + -- options will open the window in the other direction *if* there is a + -- different buffer in the way of the preferred direction + -- Enum: prefer_right, prefer_left, right, left, float + default_direction = "prefer_right", + + -- Determines where the aerial window will be opened + -- edge - open aerial at the far right/left of the editor + -- window - open aerial to the right/left of the current window + placement = "window", + + -- When the symbols change, resize the aerial window (within min/max constraints) to fit + resize_to_content = true, + + -- Preserve window size equality with (:help CTRL-W_=) + preserve_equality = false, + } + }) +''' diff --git a/nvim/tomls/dein_lazy.toml b/nvim/tomls/dein_lazy.toml index 7d8bdc6..f5e4c73 100644 --- a/nvim/tomls/dein_lazy.toml +++ b/nvim/tomls/dein_lazy.toml @@ -142,3 +142,42 @@ lua_add = ''' vim.g.enable_spelunker_vim = 1 vim.g.spelunker_check_type = 2 ''' + +[[plugins]] +repo = 'kevinhwang91/nvim-hlslens' +on_event = 'BufEnter' +lua_post_source = ''' + require('hlslens').setup({ + override_lens = function(render, posList, nearest, idx, relIdx) + local sfw = vim.v.searchforward == 1 + local indicator, text, chunks + local absRelIdx = math.abs(relIdx) + if absRelIdx > 1 then + indicator = ('%d%s'):format(absRelIdx, sfw ~= (relIdx > 1) and '▲' or '▼') + elseif absRelIdx == 1 then + indicator = sfw ~= (relIdx == 1) and '▲' or '▼' + else + indicator = '' + end + + local lnum, col = unpack(posList[idx]) + if nearest then + local cnt = #posList + if indicator ~= '' then + text = ('[%s %d/%d]'):format(indicator, idx, cnt) + else + text = ('[%d/%d]'):format(idx, cnt) + end + chunks = {{' '}, {text, 'HlSearchLensNear'}} + else + text = ('[%s %d]'):format(indicator, idx) + chunks = {{' '}, {text, 'HlSearchLens'}} + end + render.setVirt(0, lnum - 1, col - 1, chunks, nearest) + end + }) +''' + +[[plugins]] +repo = 'linrongbin16/gitlinker.nvim' +on_cmd = 'GitLink' diff --git a/nvim/tomls/theme.toml b/nvim/tomls/style.toml similarity index 79% rename from nvim/tomls/theme.toml rename to nvim/tomls/style.toml index 1091c27..cfa7bbf 100644 --- a/nvim/tomls/theme.toml +++ b/nvim/tomls/style.toml @@ -30,3 +30,20 @@ lua_source = ''' } require("onedark").load() ''' + +[[plugins]] +repo = 'shellRaining/hlchunk.nvim' +on_event = 'VimEnter' +lua_post_source = ''' + require("hlchunk").setup({ + indent = { + enable = false, + }, + line_num = { + enable = false, + }, + blank = { + enable = false, + }, + }) +''' -- knotmirror 0.0.1