Compare commits
28
Commits
canary
..
079ea655e0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
079ea655e0 | ||
|
|
7b0855cb23 | ||
|
|
5471764258 | ||
|
|
ef9e0a50b9 | ||
|
|
bb64365d25 | ||
|
|
ec99f601a0 | ||
|
|
dfd0917f9a | ||
|
|
f7a98dcb28 | ||
|
|
90bafafb4c | ||
|
|
660dcc4b1e | ||
|
|
cf07a38ecf | ||
|
|
9a2464e2d7 | ||
|
|
5604b29cdc | ||
|
|
41c5b46733 | ||
|
|
aad624221a | ||
|
|
2730bbd210 | ||
|
|
3da16ca21b | ||
|
|
d801a059ef | ||
|
|
260c70c958 | ||
|
|
6a612b80f8 | ||
|
|
330861bd93 | ||
|
|
813f95e06e | ||
|
|
94dc47f8bb | ||
|
|
70f66adb59 | ||
|
|
726248c2f3 | ||
|
|
9d47133ba1 | ||
|
|
aa13916e94 | ||
|
|
45a1b2c9a8 |
No files matched your search
@@ -0,0 +1,3 @@
|
|||||||
|
.neoconf.json
|
||||||
|
.stylua.toml
|
||||||
|
lazy-lock.json
|
||||||
@@ -1,22 +1,17 @@
|
|||||||
local vanila_vim_autostart_commands = {
|
local vanila_vim_autostart_commands = {
|
||||||
"set number",
|
"set number",
|
||||||
"set clipboard=unnamedplus",
|
"set clipboard=unnamedplus",
|
||||||
"set nowrap",
|
"set nowrap"
|
||||||
"set shiftwidth=4",
|
|
||||||
"set tabstop=4",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.opt.fillchars = { eob = " " }
|
|
||||||
|
|
||||||
for _, cmd in pairs(vanila_vim_autostart_commands) do
|
for _, cmd in pairs(vanila_vim_autostart_commands) do
|
||||||
vim.cmd(cmd)
|
vim.cmd(cmd)
|
||||||
end
|
end
|
||||||
|
|
||||||
if vim.lsp.inlay_hint then
|
|
||||||
vim.lsp.inlay_hint.enable(true, { 0 })
|
|
||||||
end
|
|
||||||
|
|
||||||
require("config.lazy")
|
require("config.lazy")
|
||||||
|
|
||||||
|
require("mappings")
|
||||||
|
|
||||||
require("config.plugins.acmp")
|
require("config.plugins.acmp")
|
||||||
require("config.plugins.autotag")
|
require("config.plugins.autotag")
|
||||||
require("config.plugins.autocomplete")
|
require("config.plugins.autocomplete")
|
||||||
@@ -25,27 +20,14 @@ require("config.plugins.colorizer")
|
|||||||
require("config.plugins.comment")
|
require("config.plugins.comment")
|
||||||
require("config.plugins.dap")
|
require("config.plugins.dap")
|
||||||
require("config.plugins.gitsigns")
|
require("config.plugins.gitsigns")
|
||||||
require("config.plugins.ibl")
|
require("ibl").setup()
|
||||||
require("config.plugins.hover_actions")
|
|
||||||
require("config.plugins.lsp_config")
|
|
||||||
require("config.plugins.lsp_diagnostic")
|
|
||||||
require("config.plugins.lualine")
|
require("config.plugins.lualine")
|
||||||
require("config.plugins.navic")
|
require("config.plugins.navic")
|
||||||
require("config.plugins.noice")
|
|
||||||
require("toggleterm").setup()
|
require("toggleterm").setup()
|
||||||
require("config.plugins.treesitter")
|
require("config.plugins.treesitter")
|
||||||
require("config.plugins.neotree")
|
require("config.plugins.neotree")
|
||||||
|
require("config.plugins.nvimufo")
|
||||||
require("config.plugins.prettier")
|
require("config.plugins.prettier")
|
||||||
require("config.plugins.rustaceanvim")
|
require("config.plugins.rustaceanvim")
|
||||||
require("huez").setup({})
|
require("huez").setup({})
|
||||||
require("config.plugins.dropbar")
|
require("config.plugins.dropbar")
|
||||||
require("config.plugins.dashboard")
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
|
||||||
buffer = buffer,
|
|
||||||
callback = function()
|
|
||||||
vim.lsp.buf.format { async = false }
|
|
||||||
end
|
|
||||||
})
|
|
||||||
|
|
||||||
require("mappings")
|
|
||||||
@@ -1,89 +1,27 @@
|
|||||||
vim.opt.termguicolors = true
|
vim.opt.termguicolors = true
|
||||||
|
|
||||||
local utils = require("config.utils.bufferline")
|
|
||||||
|
|
||||||
require("bufferline").setup({
|
require("bufferline").setup({
|
||||||
highlights = {
|
highlights = {
|
||||||
background = {
|
background = {
|
||||||
italic = false,
|
italic = false,
|
||||||
},
|
},
|
||||||
buffer_selected = {
|
buffer_selected = {
|
||||||
bold = true,
|
bold = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
options = {
|
options = {
|
||||||
themable = true,
|
mode = "buffers",
|
||||||
get_element_icon = nil,
|
persist_buffer_sort = true,
|
||||||
show_duplicate_prefix = true,
|
enforce_regular_tabs = false,
|
||||||
duplicates_across_groups = true,
|
always_show_bufferline = false,
|
||||||
auto_toggle_bufferline = true,
|
offsets = {
|
||||||
move_wraps_at_ends = false,
|
{
|
||||||
groups = { items = {}, options = { toggle_hidden_on_enter = true } },
|
filetype = "NeoTree",
|
||||||
mode = "buffers",
|
text = "File Explorer",
|
||||||
numbers = "none",
|
highlight = "Directory",
|
||||||
close_command = function(bufnr)
|
separator = true,
|
||||||
utils.buf_kill("bd", bufnr, false)
|
}
|
||||||
end,
|
}
|
||||||
right_mouse_command = "vert sbuffer %d",
|
}
|
||||||
left_mouse_command = "buffer %d",
|
|
||||||
middle_mouse_command = nil,
|
|
||||||
name_formatter = function(buf)
|
|
||||||
if buf.name:match "%.md" then
|
|
||||||
return vim.fn.fnamemodify(buf.name, ":t:r")
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
max_name_length = 18,
|
|
||||||
max_prefix_length = 15,
|
|
||||||
truncate_names = true,
|
|
||||||
tab_size = 18,
|
|
||||||
diagnostics = "nvim_lsp",
|
|
||||||
diagnostics_update_in_insert = false,
|
|
||||||
custom_filter = utils.custom_filter,
|
|
||||||
offsets = {
|
|
||||||
{
|
|
||||||
filetype = "undotree",
|
|
||||||
text = "Undotree",
|
|
||||||
highlight = "PanelHeading",
|
|
||||||
padding = 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
filetype = "NvimTree",
|
|
||||||
text = "Explorer",
|
|
||||||
highlight = "PanelHeading",
|
|
||||||
padding = 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
filetype = "DiffviewFiles",
|
|
||||||
text = "Diff View",
|
|
||||||
highlight = "PanelHeading",
|
|
||||||
padding = 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
filetype = "flutterToolsOutline",
|
|
||||||
text = "Flutter Outline",
|
|
||||||
highlight = "PanelHeading",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
filetype = "lazy",
|
|
||||||
text = "Lazy",
|
|
||||||
highlight = "PanelHeading",
|
|
||||||
padding = 1,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
color_icons = true,
|
|
||||||
show_close_icon = false,
|
|
||||||
show_tab_indicators = true,
|
|
||||||
persist_buffer_sort = true,
|
|
||||||
separator_style = "thin",
|
|
||||||
enforce_regular_tabs = false,
|
|
||||||
always_show_bufferline = false,
|
|
||||||
hover = {
|
|
||||||
enabled = false,
|
|
||||||
delay = 200,
|
|
||||||
reveal = { "close" },
|
|
||||||
},
|
|
||||||
sort_by = "id",
|
|
||||||
debug = { logging = false },
|
|
||||||
},
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -1,10 +1,43 @@
|
|||||||
require('Comment').setup({
|
require("Comment").setup({
|
||||||
|
---Add a space b/w comment and the line
|
||||||
padding = true,
|
padding = true,
|
||||||
|
---Whether the cursor should stay at its position
|
||||||
sticky = true,
|
sticky = true,
|
||||||
|
---Lines to be ignored while (un)comment
|
||||||
|
ignore = nil,
|
||||||
|
---LHS of toggle mappings in NORMAL mode
|
||||||
toggler = {
|
toggler = {
|
||||||
|
---Line-comment toggle keymap
|
||||||
line = '<leader>/',
|
line = '<leader>/',
|
||||||
|
---Block-comment toggle keymap
|
||||||
|
block = '<leader>/',
|
||||||
},
|
},
|
||||||
|
---LHS of operator-pending mappings in NORMAL and VISUAL mode
|
||||||
opleader = {
|
opleader = {
|
||||||
line = '<leader>/',
|
---Line-comment keymap
|
||||||
|
line = 'gc',
|
||||||
|
---Block-comment keymap
|
||||||
|
block = 'gb',
|
||||||
},
|
},
|
||||||
|
---LHS of extra mappings
|
||||||
|
extra = {
|
||||||
|
---Add comment on the line above
|
||||||
|
above = 'gcO',
|
||||||
|
---Add comment on the line below
|
||||||
|
below = 'gco',
|
||||||
|
---Add comment at the end of line
|
||||||
|
eol = 'gcA',
|
||||||
|
},
|
||||||
|
---Enable keybindings
|
||||||
|
---NOTE: If given `false` then the plugin won't create any mappings
|
||||||
|
mappings = {
|
||||||
|
---Operator-pending mapping; `gcc` `gbc` `gc[count]{motion}` `gb[count]{motion}`
|
||||||
|
basic = true,
|
||||||
|
---Extra mapping; `gco`, `gcO`, `gcA`
|
||||||
|
extra = true,
|
||||||
|
},
|
||||||
|
---Function to call before (un)comment
|
||||||
|
pre_hook = nil,
|
||||||
|
---Function to call after (un)comment
|
||||||
|
post_hook = nil,
|
||||||
})
|
})
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
require('dashboard').setup {
|
|
||||||
theme = 'hyper',
|
|
||||||
config = {
|
|
||||||
week_header = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
shortcut = {
|
|
||||||
{ desc = ' Update', group = '@property', action = 'Lazy update', key = 'u' },
|
|
||||||
{
|
|
||||||
icon = ' ',
|
|
||||||
icon_hl = '@variable',
|
|
||||||
desc = 'Files',
|
|
||||||
group = 'Label',
|
|
||||||
action = 'Telescope find_files',
|
|
||||||
key = 'f',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
desc = ' Apps',
|
|
||||||
group = 'DiagnosticHint',
|
|
||||||
action = 'Telescope app',
|
|
||||||
key = 'a',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
desc = ' dotfiles',
|
|
||||||
group = 'Number',
|
|
||||||
action = 'Telescope dotfiles',
|
|
||||||
key = 'd',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,10 @@
|
|||||||
require('dropbar').setup()
|
vim.api.nvim_create_autocmd({ 'BufReadPost', 'BufNewFile', 'BufWritePost' }, {
|
||||||
vim.ui.select = require('dropbar.utils.menu').select
|
once = true,
|
||||||
vim.api.nvim_set_hl(0, 'DropBarMenuHoverEntry', { link = 'PmenuExtraSel' })
|
group = vim.api.nvim_create_augroup('DropBarSetup', {}),
|
||||||
|
callback = function()
|
||||||
|
if vim.g.loaded_dropbar then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
require('dropbar').setup()
|
||||||
|
end,
|
||||||
|
})
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
require("hover").setup {
|
|
||||||
init = function()
|
|
||||||
require("hover.providers.lsp")
|
|
||||||
end,
|
|
||||||
preview_opts = {
|
|
||||||
border = 'single'
|
|
||||||
},
|
|
||||||
preview_window = false,
|
|
||||||
title = true,
|
|
||||||
mouse_providers = {
|
|
||||||
'LSP'
|
|
||||||
},
|
|
||||||
mouse_delay = 1000
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
require("ibl").setup({
|
|
||||||
exclude = {
|
|
||||||
filetypes = { "dashboard" },
|
|
||||||
}
|
|
||||||
})
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
local lspconfig = require("lspconfig")
|
|
||||||
|
|
||||||
lspconfig.lua_ls.setup({
|
|
||||||
settings = {
|
|
||||||
Lua = {
|
|
||||||
hint = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
lspconfig.eslint.setup({
|
|
||||||
settings = {
|
|
||||||
codeActionOnSave = {
|
|
||||||
enable = true,
|
|
||||||
mode = "all",
|
|
||||||
},
|
|
||||||
format = true,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
lspconfig.ts_ls.setup({
|
|
||||||
settings = {
|
|
||||||
typescript = {
|
|
||||||
inlayHints = {
|
|
||||||
includeInlayParameterNameHints = "all", -- 'none' | 'literals' | 'all'
|
|
||||||
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
|
|
||||||
includeInlayFunctionParameterTypeHints = true,
|
|
||||||
includeInlayVariableTypeHints = true,
|
|
||||||
includeInlayVariableTypeHintsWhenTypeMatchesName = false,
|
|
||||||
includeInlayPropertyDeclarationTypeHints = true,
|
|
||||||
includeInlayFunctionLikeReturnTypeHints = true,
|
|
||||||
includeInlayEnumMemberValueHints = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
javascript = {
|
|
||||||
inlayHints = {
|
|
||||||
includeInlayParameterNameHints = "all", -- 'none' | 'literals' | 'all'
|
|
||||||
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
|
|
||||||
includeInlayVariableTypeHints = true,
|
|
||||||
includeInlayFunctionParameterTypeHints = true,
|
|
||||||
includeInlayVariableTypeHintsWhenTypeMatchesName = false,
|
|
||||||
includeInlayPropertyDeclarationTypeHints = true,
|
|
||||||
includeInlayFunctionLikeReturnTypeHints = true,
|
|
||||||
includeInlayEnumMemberValueHints = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
})
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
require("noice").setup({
|
|
||||||
lsp = {
|
|
||||||
override = {
|
|
||||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
|
||||||
["vim.lsp.util.stylize_markdown"] = true,
|
|
||||||
["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp
|
|
||||||
},
|
|
||||||
},
|
|
||||||
presets = {
|
|
||||||
command_palette = true, -- position the cmdline and popupmenu together
|
|
||||||
long_message_to_split = true, -- long messages will be sent to a split
|
|
||||||
inc_rename = false, -- enables an input dialog for inc-rename.nvim
|
|
||||||
lsp_doc_border = false, -- add a border to hover docs and signature help
|
|
||||||
},
|
|
||||||
})
|
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
vim.o.foldcolumn = "auto:9"
|
||||||
|
vim.o.foldlevel = 99
|
||||||
|
vim.o.foldlevelstart = 99
|
||||||
|
vim.o.foldenable = true
|
||||||
|
vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep:│,foldclose:]]
|
||||||
|
|
||||||
|
vim.keymap.set('n', 'zR', require('ufo').openAllFolds)
|
||||||
|
vim.keymap.set('n', 'zM', require('ufo').closeAllFolds)
|
||||||
|
|
||||||
|
require('ufo').setup({
|
||||||
|
open_fold_hl_timeout = 400,
|
||||||
|
close_fold_kinds = { "imports", "comment" },
|
||||||
|
preview = {
|
||||||
|
win_config = {
|
||||||
|
border = { "", "─", "", "", "", "─", "", "" },
|
||||||
|
winblend = 0,
|
||||||
|
},
|
||||||
|
mappings = {
|
||||||
|
scrollU = "<C-u>",
|
||||||
|
scrollD = "<C-d>",
|
||||||
|
jumpTop = "[",
|
||||||
|
jumpBot = "]",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
provider_selector = function(bufnr, filetype, buftype)
|
||||||
|
return {'treesitter', 'indent'}
|
||||||
|
end
|
||||||
|
})
|
||||||
@@ -1,37 +1,18 @@
|
|||||||
local navic = require("nvim-navic")
|
local navic = require("nvim-navic")
|
||||||
|
|
||||||
vim.g.rustaceanvim = {
|
vim.g.rustaceanvim = {
|
||||||
tools = {
|
|
||||||
autoSetHints = true,
|
|
||||||
inlay_hints = {
|
|
||||||
show_parameter_hints = true,
|
|
||||||
parameter_hints_prefix = "in: ", -- "<- "
|
|
||||||
other_hints_prefix = "out: " -- "=> "
|
|
||||||
}
|
|
||||||
},
|
|
||||||
server = {
|
server = {
|
||||||
on_attach = function(client, bufnr)
|
on_attach = function(client, bufnr)
|
||||||
navic.attach(client, bufnr)
|
navic.attach(client, bufnr)
|
||||||
end,
|
end,
|
||||||
|
filetypes = {"rust"},
|
||||||
settings = {
|
settings = {
|
||||||
|
-- rust-analyzer language server configuration
|
||||||
['rust-analyzer'] = {
|
['rust-analyzer'] = {
|
||||||
assist = {
|
cargo = {
|
||||||
importEnforceGranularity = true,
|
allFeatures = true,
|
||||||
importPrefix = "create"
|
|
||||||
},
|
},
|
||||||
cargo = { allFeatures = true },
|
},
|
||||||
checkOnSave = {
|
},
|
||||||
-- default: `cargo check`
|
},
|
||||||
command = "clippy",
|
|
||||||
allFeatures = true
|
|
||||||
},
|
|
||||||
inlayHints = {
|
|
||||||
lifetimeElisionHints = {
|
|
||||||
enable = true,
|
|
||||||
useParameterNames = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,95 +0,0 @@
|
|||||||
local Utils = {}
|
|
||||||
|
|
||||||
function Utils.is_ft(b, ft)
|
|
||||||
return vim.bo[b].filetype == ft
|
|
||||||
end
|
|
||||||
|
|
||||||
function Utils.custom_filter(buf, buf_nums)
|
|
||||||
local logs = vim.tbl_filter(function(b)
|
|
||||||
return Utils.is_ft(b, "log")
|
|
||||||
end, buf_nums or {})
|
|
||||||
if vim.tbl_isempty(logs) then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
local tab_num = vim.fn.tabpagenr()
|
|
||||||
local last_tab = vim.fn.tabpagenr "$"
|
|
||||||
local is_log = Utils.is_ft(buf, "log")
|
|
||||||
if last_tab == 1 then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
-- only show log buffers in secondary tabs
|
|
||||||
return (tab_num == last_tab and is_log) or (tab_num ~= last_tab and not is_log)
|
|
||||||
end
|
|
||||||
|
|
||||||
function Utils.buf_kill(kill_command, bufnr, force)
|
|
||||||
local bo = vim.bo
|
|
||||||
local api = vim.api
|
|
||||||
local fmt = string.format
|
|
||||||
local fn = vim.fn
|
|
||||||
|
|
||||||
if bufnr == 0 or bufnr == nil then
|
|
||||||
bufnr = api.nvim_get_current_buf()
|
|
||||||
end
|
|
||||||
|
|
||||||
local bufname = api.nvim_buf_get_name(bufnr)
|
|
||||||
|
|
||||||
if not force then
|
|
||||||
local choice
|
|
||||||
if bo[bufnr].modified then
|
|
||||||
choice = fn.confirm(fmt([[Save changes to "%s"?]], bufname), "&Yes\n&No\n&Cancel")
|
|
||||||
if choice == 1 then
|
|
||||||
vim.api.nvim_buf_call(bufnr, function()
|
|
||||||
vim.cmd("w")
|
|
||||||
end)
|
|
||||||
elseif choice == 2 then
|
|
||||||
force = true
|
|
||||||
else
|
|
||||||
return
|
|
||||||
end
|
|
||||||
elseif api.nvim_get_option_value("buftype", { buf = 0 }) == "terminal" then
|
|
||||||
choice = fn.confirm(fmt([[Close "%s"?]], bufname), "&Yes\n&No\n&Cancel")
|
|
||||||
if choice == 1 then
|
|
||||||
force = true
|
|
||||||
else
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Get list of windows IDs with the buffer to close
|
|
||||||
local windows = vim.tbl_filter(function(win)
|
|
||||||
return api.nvim_win_get_buf(win) == bufnr
|
|
||||||
end, api.nvim_list_wins())
|
|
||||||
|
|
||||||
if force then
|
|
||||||
kill_command = kill_command .. "!"
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Get list of active buffers
|
|
||||||
local buffers = vim.tbl_filter(function(buf)
|
|
||||||
return api.nvim_buf_is_valid(buf) and bo[buf].buflisted
|
|
||||||
end, api.nvim_list_bufs())
|
|
||||||
|
|
||||||
-- If there is only one buffer (which has to be the current one), vim will
|
|
||||||
-- create a new buffer on :bd.
|
|
||||||
-- For more than one buffer, pick the previous buffer (wrapping around if necessary)
|
|
||||||
if #buffers > 1 and #windows > 0 then
|
|
||||||
for i, v in ipairs(buffers) do
|
|
||||||
if v == bufnr then
|
|
||||||
local prev_buf_idx = i == 1 and #buffers or (i - 1)
|
|
||||||
local prev_buffer = buffers[prev_buf_idx]
|
|
||||||
for _, win in ipairs(windows) do
|
|
||||||
api.nvim_win_set_buf(win, prev_buffer)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Check if buffer still exists, to ensure the target buffer wasn't killed
|
|
||||||
-- due to options like bufhidden=wipe.
|
|
||||||
if api.nvim_buf_is_valid(bufnr) and bo[bufnr].buflisted then
|
|
||||||
vim.cmd(string.format("%s %d", kill_command, bufnr))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return Utils
|
|
||||||
+6
-27
@@ -1,6 +1,4 @@
|
|||||||
local map = vim.keymap.set
|
local map = vim.keymap.set
|
||||||
local bl_utils = require("config.utils.bufferline")
|
|
||||||
local hover = require "hover"
|
|
||||||
|
|
||||||
map("n", ";", ":", { desc = "CMD enter command mode" })
|
map("n", ";", ":", { desc = "CMD enter command mode" })
|
||||||
|
|
||||||
@@ -27,6 +25,7 @@ map("n", "<F5>", "<cmd>DapToggleBreakpoint<cr>")
|
|||||||
map("n", "mk", "<cmd>RustLsp moveItem upcr>")
|
map("n", "mk", "<cmd>RustLsp moveItem upcr>")
|
||||||
map("n", "m,", "<cmd>RustLsp moveItem down<cr>")
|
map("n", "m,", "<cmd>RustLsp moveItem down<cr>")
|
||||||
map("n", "rs", "<cmd>RustLsp run<cr>")
|
map("n", "rs", "<cmd>RustLsp run<cr>")
|
||||||
|
map("n", "hh", "<cmd>RustLsp hover actions<cr>")
|
||||||
map("n", "ca", "<cmd>RustLsp codeAction<cr>")
|
map("n", "ca", "<cmd>RustLsp codeAction<cr>")
|
||||||
map("n", "<C-s>", "<cmd>w!<cr>")
|
map("n", "<C-s>", "<cmd>w!<cr>")
|
||||||
map("i", "<C-s>", "<cmd>w!<cr>")
|
map("i", "<C-s>", "<cmd>w!<cr>")
|
||||||
@@ -34,40 +33,20 @@ map("i", "<C-s>", "<cmd>w!<cr>")
|
|||||||
map("n", "<", "<cmd><gv<cr>")
|
map("n", "<", "<cmd><gv<cr>")
|
||||||
map("n", ">", "<cmd>>gv<cr>")
|
map("n", ">", "<cmd>>gv<cr>")
|
||||||
|
|
||||||
map("n", "<leader>c", function(bufnr)
|
map("n", "<leader>dr", "<cmd> DapContinue <cr>", { desc = "Continue debug" } )
|
||||||
bl_utils.buf_kill("bd", bufnr, true)
|
|
||||||
end)
|
|
||||||
|
|
||||||
map("n", "<leader>dr", "<cmd> DapContinue <cr>", { desc = "Continue debug" })
|
|
||||||
|
|
||||||
map("n", "do", function()
|
map("n", "do", function()
|
||||||
require("dapui").open()
|
require("dapui").open()
|
||||||
end, { desc = "Open DAP ui" })
|
end, { desc = "Open DAP ui" })
|
||||||
map("n", "dc", function()
|
map("n", "dc", function()
|
||||||
require("dapui").close()
|
require("dapui").close()
|
||||||
end, { desc = "Start or continue debug" })
|
end, { desc = "Start or continue debug" })
|
||||||
map("n", "dt", function()
|
map("n", "dt", function()
|
||||||
require("dapui").toggle()
|
require("dapui").toggle()
|
||||||
end, { desc = "Toggle DAP ui" })
|
end, { desc = "Toggle DAP ui" })
|
||||||
|
|
||||||
map("n", "<A-j>", "<cmd>m .+1<CR>==")
|
|
||||||
map("n", "<A-k>", "<cmd>m .-2<CR>==")
|
|
||||||
map("i", "<A-j>", "<Esc><cmd>m .+1<CR>==gi")
|
|
||||||
map("i", "<A-k>", "<Esc><cmd>m .-2<CR>==gi")
|
|
||||||
|
|
||||||
map("n", "<C-Up>", "<cmd>resize -2<CR>")
|
|
||||||
map("n", "<C-Down>", "<cmd>resize +2<CR>")
|
|
||||||
map("n", "<C-Right>", "<cmd>vertical resize -2<CR>")
|
|
||||||
map("n", "<C-Left>", "<cmd>vertical resize +2<CR>")
|
|
||||||
|
|
||||||
map("n", "<leader>an", "<cmd>set norelativenumber<cr>")
|
|
||||||
map("n", "<leader>rn", "<cmd>set relativenumber<cr>")
|
map("n", "<leader>rn", "<cmd>set relativenumber<cr>")
|
||||||
|
map("n", "<leader>an", "<cmd>set norelativenumber<cr>")
|
||||||
map("n", "tt", "<cmd>ToggleTerm<cr>")
|
map("n", "tt", "<cmd>ToggleTerm<cr>")
|
||||||
map("n", "<C-{>", "<cmd>foldopen<cr>")
|
map("n", "<C-{>", "<cmd>foldopen<cr>")
|
||||||
map("n", "<C-}>", "<cmd>foldclose<cr>")
|
map("n", "<C-}>", "<cmd>foldclose<cr>")
|
||||||
|
|
||||||
map("n", "hh", hover.hover)
|
|
||||||
map("n", "hs", hover.hover_select)
|
|
||||||
|
|
||||||
map("n", "vs", "<cmd> vsplit <cr>")
|
|
||||||
map("n", "ss", "<cmd> split <cr>")
|
|
||||||
+175
-150
@@ -1,152 +1,177 @@
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
'simrat39/inlay-hints.nvim',
|
"LunarVim/breadcrumbs.nvim",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"LunarVim/breadcrumbs.nvim",
|
"akinsho/bufferline.nvim",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"akinsho/bufferline.nvim",
|
"lewis6991/gitsigns.nvim"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"lewis6991/gitsigns.nvim"
|
"nvim-lualine/lualine.nvim",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"lewis6991/hover.nvim",
|
"akinsho/toggleterm.nvim",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nvim-lualine/lualine.nvim",
|
"windwp/nvim-autopairs",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"akinsho/toggleterm.nvim",
|
'kevinhwang91/promise-async',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"windwp/nvim-autopairs",
|
'theHamsta/nvim-dap-virtual-text',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'kevinhwang91/promise-async',
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'theHamsta/nvim-dap-virtual-text',
|
"SmiteshP/nvim-navic",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
"kyazdani42/nvim-web-devicons"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"SmiteshP/nvim-navic",
|
'NvChad/nvim-colorizer.lua',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kyazdani42/nvim-web-devicons"
|
'numToStr/Comment.nvim'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'NvChad/nvim-colorizer.lua',
|
"nvim-treesitter/nvim-treesitter",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'numToStr/Comment.nvim'
|
"vague2k/huez.nvim",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-telescope/telescope.nvim",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"catppuccin/nvim"
|
"neovim/nvim-lspconfig",
|
||||||
},
|
dependencies = { "williamboman/mason-lspconfig.nvim", },
|
||||||
{
|
},
|
||||||
"vague2k/huez.nvim",
|
{
|
||||||
},
|
"mfussenegger/nvim-dap",
|
||||||
{
|
event = "VeryLazy",
|
||||||
"nvim-telescope/telescope.nvim",
|
},
|
||||||
},
|
{
|
||||||
{
|
"L3MON4D3/LuaSnip",
|
||||||
"williamboman/mason-lspconfig.nvim",
|
lazy = true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
'Bekaboo/dropbar.nvim',
|
||||||
},
|
-- optional, but required for fuzzy finder support
|
||||||
{
|
dependencies = {
|
||||||
"mfussenegger/nvim-dap",
|
'nvim-telescope/telescope-fzf-native.nvim',
|
||||||
event = "VeryLazy",
|
build = 'make'
|
||||||
},
|
},
|
||||||
{
|
config = function()
|
||||||
"L3MON4D3/LuaSnip",
|
local dropbar_api = require('dropbar.api')
|
||||||
lazy = true,
|
vim.keymap.set('n', '<Leader>;', dropbar_api.pick, { desc = 'Pick symbols in winbar' })
|
||||||
},
|
vim.keymap.set('n', '[;', dropbar_api.goto_context_start, { desc = 'Go to start of current context' })
|
||||||
{
|
vim.keymap.set('n', '];', dropbar_api.select_next_context, { desc = 'Select next context' })
|
||||||
'folke/lazydev.nvim',
|
end
|
||||||
ft = "lua",
|
},
|
||||||
},
|
{
|
||||||
{
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
'Bekaboo/dropbar.nvim',
|
branch = "v2.x",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
'nvim-telescope/telescope-fzf-native.nvim',
|
"nvim-lua/plenary.nvim",
|
||||||
build = 'make'
|
"nvim-tree/nvim-web-devicons",
|
||||||
},
|
"MunifTanjim/nui.nvim",
|
||||||
config = function()
|
},
|
||||||
local dropbar_api = require('dropbar.api')
|
},
|
||||||
vim.keymap.set('n', '<Leader>;', dropbar_api.pick, { desc = 'Pick symbols in winbar' })
|
{
|
||||||
vim.keymap.set('n', '[;', dropbar_api.goto_context_start, { desc = 'Go to start of current context' })
|
"williamboman/mason.nvim",
|
||||||
vim.keymap.set('n', '];', dropbar_api.select_next_context, { desc = 'Select next context' })
|
opts = {
|
||||||
end
|
ensure_installed = {
|
||||||
},
|
"eslint-lsp",
|
||||||
{
|
"js-debug-adapter",
|
||||||
"folke/noice.nvim",
|
"prettier",
|
||||||
event = "VeryLazy",
|
"tinymist",
|
||||||
dependencies = {
|
"typescript-language-server",
|
||||||
"MunifTanjim/nui.nvim",
|
}
|
||||||
"rcarriga/nvim-notify",
|
}
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
{
|
"rcarriga/nvim-dap-ui",
|
||||||
"nvim-neo-tree/neo-tree.nvim",
|
dependencies = {
|
||||||
branch = "v2.x",
|
"nvim-neotest/nvim-nio",
|
||||||
dependencies = {
|
"mfussenegger/nvim-dap",
|
||||||
"nvim-lua/plenary.nvim",
|
},
|
||||||
"nvim-tree/nvim-web-devicons",
|
event = "VeryLazy",
|
||||||
"MunifTanjim/nui.nvim",
|
config = function()
|
||||||
},
|
require("dapui").setup()
|
||||||
},
|
end
|
||||||
{
|
},
|
||||||
"williamboman/mason.nvim",
|
{
|
||||||
opts = {
|
"hrsh7th/nvim-cmp",
|
||||||
ensure_installed = {
|
event = "InsertEnter",
|
||||||
"eslint-lsp",
|
dependencies = {
|
||||||
"js-debug-adapter",
|
{
|
||||||
"prettier",
|
"L3MON4D3/LuaSnip",
|
||||||
"tinymist",
|
dependencies = "rafamadriz/friendly-snippets",
|
||||||
"typescript-language-server",
|
opts = { history = true, updateevents = "TextChanged,TextChangedI" },
|
||||||
}
|
config = function(_, opts)
|
||||||
}
|
require("luasnip").config.set_config(opts)
|
||||||
},
|
require "config.plugins.luasnip"
|
||||||
{
|
end,
|
||||||
"rcarriga/nvim-dap-ui",
|
},
|
||||||
dependencies = {
|
{
|
||||||
"nvim-neotest/nvim-nio",
|
"saadparwaiz1/cmp_luasnip",
|
||||||
"mfussenegger/nvim-dap",
|
"hrsh7th/cmp-nvim-lua",
|
||||||
},
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
event = "VeryLazy",
|
"hrsh7th/cmp-buffer",
|
||||||
config = function()
|
"hrsh7th/cmp-path",
|
||||||
require("dapui").setup()
|
},
|
||||||
end
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"hrsh7th/nvim-cmp",
|
'kevinhwang91/nvim-ufo',
|
||||||
event = "InsertEnter",
|
lazy = true,
|
||||||
dependencies = {
|
config = function(_, opts)
|
||||||
{
|
local handler = function(virtText, lnum, endLnum, width, truncate)
|
||||||
"L3MON4D3/LuaSnip",
|
local newVirtText = {}
|
||||||
dependencies = "rafamadriz/friendly-snippets",
|
local totalLines = vim.api.nvim_buf_line_count(0)
|
||||||
opts = { history = true, updateevents = "TextChanged,TextChangedI" },
|
local foldedLines = endLnum - lnum
|
||||||
config = function(_, opts)
|
local suffix = (" %d %d%%"):format(foldedLines, foldedLines / totalLines * 100)
|
||||||
require("luasnip").config.set_config(opts)
|
local sufWidth = vim.fn.strdisplaywidth(suffix)
|
||||||
require "config.plugins.luasnip"
|
local targetWidth = width - sufWidth
|
||||||
end,
|
local curWidth = 0
|
||||||
},
|
for _, chunk in ipairs(virtText) do
|
||||||
{
|
local chunkText = chunk[1]
|
||||||
"saadparwaiz1/cmp_luasnip",
|
local chunkWidth = vim.fn.strdisplaywidth(chunkText)
|
||||||
"hrsh7th/cmp-nvim-lua",
|
if targetWidth > curWidth + chunkWidth then
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
table.insert(newVirtText, chunk)
|
||||||
"hrsh7th/cmp-buffer",
|
else
|
||||||
"hrsh7th/cmp-path",
|
chunkText = truncate(chunkText, targetWidth - curWidth)
|
||||||
},
|
local hlGroup = chunk[2]
|
||||||
},
|
table.insert(newVirtText, { chunkText, hlGroup })
|
||||||
},
|
chunkWidth = vim.fn.strdisplaywidth(chunkText)
|
||||||
|
-- str width returned from truncate() may less than 2nd argument, need padding
|
||||||
|
if curWidth + chunkWidth < targetWidth then
|
||||||
|
suffix = suffix .. (" "):rep(targetWidth - curWidth - chunkWidth)
|
||||||
|
end
|
||||||
|
break
|
||||||
|
end
|
||||||
|
curWidth = curWidth + chunkWidth
|
||||||
|
end
|
||||||
|
local rAlignAppndx =
|
||||||
|
math.max(math.min(vim.opt.textwidth["_value"], width - 1) - curWidth - sufWidth, 0)
|
||||||
|
suffix = (" "):rep(rAlignAppndx) .. suffix
|
||||||
|
table.insert(newVirtText, { suffix, "MoreMsg" })
|
||||||
|
return newVirtText
|
||||||
|
end
|
||||||
|
opts["fold_virt_text_handler"] = handler
|
||||||
|
require("ufo").setup(opts)
|
||||||
|
vim.keymap.set("n", "K", function()
|
||||||
|
local winid = require("ufo").peekFoldedLinesUnderCursor()
|
||||||
|
if not winid then
|
||||||
|
-- vim.lsp.buf.hover()
|
||||||
|
vim.cmd [[ Lspsaga hover_doc ]]
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
'nvimdev/dashboard-nvim',
|
"goolord/alpha-nvim",
|
||||||
event = 'VimEnter',
|
config = function ()
|
||||||
dependencies = { { 'nvim-tree/nvim-web-devicons' } }
|
require'alpha'.setup(require'alpha.themes.dashboard'.config)
|
||||||
|
end
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kaarmu/typst.vim",
|
"kaarmu/typst.vim",
|
||||||
@@ -44,7 +45,6 @@ return {
|
|||||||
{
|
{
|
||||||
"mrcjkb/rustaceanvim",
|
"mrcjkb/rustaceanvim",
|
||||||
version = '^4', -- Recommended
|
version = '^4', -- Recommended
|
||||||
lazy = false, -- This plugin is already lazy
|
lazy = false, -- This plugin is already lazy
|
||||||
ft = { "rust" },
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user