Compare commits

..
28 Commits
Author SHA1 Message Date
doryan 079ea655e0 feat: update init.lua 2024-12-13 15:31:34 +04:00
doryan 7b0855cb23 feat(rust): add rustaceanvim config 2024-12-13 15:31:21 +04:00
doryan 5471764258 fix(navic): activate lsp auto_attach 2024-12-13 15:30:55 +04:00
doryan ef9e0a50b9 feat(diag): add lsp diagnostic config 2024-12-13 15:29:11 +04:00
doryan bb64365d25 feat(gitsigns): cosmetics update gitsign config 2024-12-13 15:28:39 +04:00
doryan ec99f601a0 feat(dropbar): add default config (needed to fix) 2024-12-13 15:28:02 +04:00
doryan dfd0917f9a feat(autocmp): add autocomplete 2024-12-13 15:27:16 +04:00
doryan f7a98dcb28 feat: temporary remove 2024-12-13 15:26:25 +04:00
doryan 90bafafb4c feat: remove redundant plugins and temporary remove noice.nvim 2024-12-13 15:26:14 +04:00
doryan 660dcc4b1e feat: remove redundant plugins 2024-12-13 15:24:04 +04:00
doryan cf07a38ecf feat: first commit 2024-12-12 14:08:11 +04:00
doryan 9a2464e2d7 feat: first commit 2024-12-12 14:08:03 +04:00
doryan 5604b29cdc feat: first commit 2024-12-12 14:07:56 +04:00
Sidhanth Rathod 41c5b46733 update nvconfig url 2024-06-23 19:48:36 +05:30
Sidhanth Rathod aad624221a Add UNLICENSE 2024-04-15 07:50:17 +05:30
Sidhanth Rathod 2730bbd210 Delete README.md 2024-04-15 06:44:23 +05:30
Sidhanth Rathod 3da16ca21b Delete LICENSE
as it is useless
2024-04-15 06:44:03 +05:30
Sidhanth Rathod d801a059ef Merge pull request #12 from sullrich84/patch-1
add missing comma
2024-03-26 15:17:59 +05:30
Sebastian Ullrich 260c70c958 add missing comma 2024-03-26 10:44:58 +01:00
Sidhanth Rathod 6a612b80f8 Merge pull request #11 from segyges/fix-init.lua
Update init.lua
2024-03-25 06:49:07 +05:30
segyges 330861bd93 Update init.lua
Fix typos in init.lua
2024-03-24 11:45:42 -05:00
Sidhanth Rathod 813f95e06e add note about nvconfig in chadrc 2024-03-23 11:49:07 +05:30
Sidhanth Rathod 94dc47f8bb add note in plugins file 2024-03-22 18:11:04 +05:30
siduck 70f66adb59 rm useless mapping 2024-03-18 06:41:03 +05:30
siduck 726248c2f3 add nvchad_types & .stylua.toml 2024-03-18 06:34:01 +05:30
siduck 9d47133ba1 update nvchad branch 2024-03-09 21:36:02 +05:30
siduck aa13916e94 add starter config files 2024-03-09 21:33:44 +05:30
Sidhanth Rathod 45a1b2c9a8 Initial commit 2024-03-09 21:32:32 +05:30
16 changed files with 301 additions and 536 deletions

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
.neoconf.json
.stylua.toml
lazy-lock.json
+8 -26
View File
@@ -1,22 +1,17 @@
local vanila_vim_autostart_commands = {
"set number",
"set clipboard=unnamedplus",
"set nowrap",
"set shiftwidth=4",
"set tabstop=4",
"set nowrap"
}
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)
end
if vim.lsp.inlay_hint then
vim.lsp.inlay_hint.enable(true, { 0 })
end
require("config.lazy")
require("mappings")
require("config.plugins.acmp")
require("config.plugins.autotag")
require("config.plugins.autocomplete")
@@ -25,27 +20,14 @@ require("config.plugins.colorizer")
require("config.plugins.comment")
require("config.plugins.dap")
require("config.plugins.gitsigns")
require("config.plugins.ibl")
require("config.plugins.hover_actions")
require("config.plugins.lsp_config")
require("config.plugins.lsp_diagnostic")
require("ibl").setup()
require("config.plugins.lualine")
require("config.plugins.navic")
require("config.plugins.noice")
require("config.plugins.navic")
require("toggleterm").setup()
require("config.plugins.treesitter")
require("config.plugins.neotree")
require("config.plugins.nvimufo")
require("config.plugins.prettier")
require("config.plugins.rustaceanvim")
require("huez").setup({})
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")
+23 -85
View File
@@ -1,89 +1,27 @@
vim.opt.termguicolors = true
local utils = require("config.utils.bufferline")
require("bufferline").setup({
highlights = {
background = {
italic = false,
},
buffer_selected = {
bold = true,
},
},
options = {
themable = true,
get_element_icon = nil,
show_duplicate_prefix = true,
duplicates_across_groups = true,
auto_toggle_bufferline = true,
move_wraps_at_ends = false,
groups = { items = {}, options = { toggle_hidden_on_enter = true } },
mode = "buffers",
numbers = "none",
close_command = function(bufnr)
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 },
},
highlights = {
background = {
italic = false,
},
buffer_selected = {
bold = true,
},
},
options = {
mode = "buffers",
persist_buffer_sort = true,
enforce_regular_tabs = false,
always_show_bufferline = false,
offsets = {
{
filetype = "NeoTree",
text = "File Explorer",
highlight = "Directory",
separator = true,
}
}
}
})
+35 -2
View File
@@ -1,10 +1,43 @@
require('Comment').setup({
require("Comment").setup({
---Add a space b/w comment and the line
padding = true,
---Whether the cursor should stay at its position
sticky = true,
---Lines to be ignored while (un)comment
ignore = nil,
---LHS of toggle mappings in NORMAL mode
toggler = {
---Line-comment toggle keymap
line = '<leader>/',
---Block-comment toggle keymap
block = '<leader>/',
},
---LHS of operator-pending mappings in NORMAL and VISUAL mode
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,
})
-31
View File
@@ -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',
},
},
},
}
+10 -4
View File
@@ -1,4 +1,10 @@
require('dropbar').setup()
vim.ui.select = require('dropbar.utils.menu').select
vim.api.nvim_set_hl(0, 'DropBarMenuHoverEntry', { link = 'PmenuExtraSel' })
vim.api.nvim_create_autocmd({ 'BufReadPost', 'BufNewFile', 'BufWritePost' }, {
once = true,
group = vim.api.nvim_create_augroup('DropBarSetup', {}),
callback = function()
if vim.g.loaded_dropbar then
return
end
require('dropbar').setup()
end,
})
-14
View File
@@ -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
}
-5
View File
@@ -1,5 +0,0 @@
require("ibl").setup({
exclude = {
filetypes = { "dashboard" },
}
})
-50
View File
@@ -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,
},
},
}
})
-15
View File
@@ -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
},
})
+28
View File
@@ -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
})
+8 -27
View File
@@ -1,37 +1,18 @@
local navic = require("nvim-navic")
vim.g.rustaceanvim = {
tools = {
autoSetHints = true,
inlay_hints = {
show_parameter_hints = true,
parameter_hints_prefix = "in: ", -- "<- "
other_hints_prefix = "out: " -- "=> "
}
},
server = {
on_attach = function(client, bufnr)
navic.attach(client, bufnr)
navic.attach(client, bufnr)
end,
filetypes = {"rust"},
settings = {
-- rust-analyzer language server configuration
['rust-analyzer'] = {
assist = {
importEnforceGranularity = true,
importPrefix = "create"
cargo = {
allFeatures = true,
},
cargo = { allFeatures = true },
checkOnSave = {
-- default: `cargo check`
command = "clippy",
allFeatures = true
},
inlayHints = {
lifetimeElisionHints = {
enable = true,
useParameterNames = true
}
}
}
}
}
},
},
},
}
-95
View File
@@ -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
View File
@@ -1,6 +1,4 @@
local map = vim.keymap.set
local bl_utils = require("config.utils.bufferline")
local hover = require "hover"
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", "m,", "<cmd>RustLsp moveItem down<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", "<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", "<leader>c", function(bufnr)
bl_utils.buf_kill("bd", bufnr, true)
end)
map("n", "<leader>dr", "<cmd> DapContinue <cr>", { desc = "Continue debug" })
map("n", "<leader>dr", "<cmd> DapContinue <cr>", { desc = "Continue debug" } )
map("n", "do", function()
require("dapui").open()
require("dapui").open()
end, { desc = "Open DAP ui" })
map("n", "dc", function()
require("dapui").close()
require("dapui").close()
end, { desc = "Start or continue debug" })
map("n", "dt", function()
require("dapui").toggle()
require("dapui").toggle()
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>an", "<cmd>set norelativenumber<cr>")
map("n", "tt", "<cmd>ToggleTerm<cr>")
map("n", "<C-{>", "<cmd>foldopen<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
View File
@@ -1,152 +1,177 @@
return {
{
'simrat39/inlay-hints.nvim',
},
{
"LunarVim/breadcrumbs.nvim",
},
{
"akinsho/bufferline.nvim",
},
{
"lewis6991/gitsigns.nvim"
},
{
"lewis6991/hover.nvim",
},
{
"nvim-lualine/lualine.nvim",
},
{
"akinsho/toggleterm.nvim",
},
{
"windwp/nvim-autopairs",
},
{
'kevinhwang91/promise-async',
},
{
'theHamsta/nvim-dap-virtual-text',
},
{
"hrsh7th/cmp-nvim-lsp",
},
{
"SmiteshP/nvim-navic",
},
{
"kyazdani42/nvim-web-devicons"
},
{
'NvChad/nvim-colorizer.lua',
},
{
'numToStr/Comment.nvim'
},
{
"nvim-treesitter/nvim-treesitter",
},
{
"catppuccin/nvim"
},
{
"vague2k/huez.nvim",
},
{
"nvim-telescope/telescope.nvim",
},
{
"williamboman/mason-lspconfig.nvim",
},
{
"neovim/nvim-lspconfig",
},
{
"mfussenegger/nvim-dap",
event = "VeryLazy",
},
{
"L3MON4D3/LuaSnip",
lazy = true,
},
{
'folke/lazydev.nvim',
ft = "lua",
},
{
'Bekaboo/dropbar.nvim',
dependencies = {
'nvim-telescope/telescope-fzf-native.nvim',
build = 'make'
},
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' })
vim.keymap.set('n', '];', dropbar_api.select_next_context, { desc = 'Select next context' })
end
},
{
"folke/noice.nvim",
event = "VeryLazy",
dependencies = {
"MunifTanjim/nui.nvim",
"rcarriga/nvim-notify",
},
},
{
"nvim-neo-tree/neo-tree.nvim",
branch = "v2.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
},
},
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"eslint-lsp",
"js-debug-adapter",
"prettier",
"tinymist",
"typescript-language-server",
}
}
},
{
"rcarriga/nvim-dap-ui",
dependencies = {
"nvim-neotest/nvim-nio",
"mfussenegger/nvim-dap",
},
event = "VeryLazy",
config = function()
require("dapui").setup()
end
},
{
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
{
"L3MON4D3/LuaSnip",
dependencies = "rafamadriz/friendly-snippets",
opts = { history = true, updateevents = "TextChanged,TextChangedI" },
config = function(_, opts)
require("luasnip").config.set_config(opts)
require "config.plugins.luasnip"
end,
},
{
"saadparwaiz1/cmp_luasnip",
"hrsh7th/cmp-nvim-lua",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
},
},
},
{
"LunarVim/breadcrumbs.nvim",
},
{
"akinsho/bufferline.nvim",
},
{
"lewis6991/gitsigns.nvim"
},
{
"nvim-lualine/lualine.nvim",
},
{
"akinsho/toggleterm.nvim",
},
{
"windwp/nvim-autopairs",
},
{
'kevinhwang91/promise-async',
},
{
'theHamsta/nvim-dap-virtual-text',
},
{
"hrsh7th/cmp-nvim-lsp",
},
{
"SmiteshP/nvim-navic",
},
{
"kyazdani42/nvim-web-devicons"
},
{
'NvChad/nvim-colorizer.lua',
},
{
'numToStr/Comment.nvim'
},
{
"nvim-treesitter/nvim-treesitter",
},
{
"vague2k/huez.nvim",
},
{
"nvim-telescope/telescope.nvim",
},
{
"neovim/nvim-lspconfig",
dependencies = { "williamboman/mason-lspconfig.nvim", },
},
{
"mfussenegger/nvim-dap",
event = "VeryLazy",
},
{
"L3MON4D3/LuaSnip",
lazy = true,
},
{
'Bekaboo/dropbar.nvim',
-- optional, but required for fuzzy finder support
dependencies = {
'nvim-telescope/telescope-fzf-native.nvim',
build = 'make'
},
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' })
vim.keymap.set('n', '];', dropbar_api.select_next_context, { desc = 'Select next context' })
end
},
{
"nvim-neo-tree/neo-tree.nvim",
branch = "v2.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
},
},
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"eslint-lsp",
"js-debug-adapter",
"prettier",
"tinymist",
"typescript-language-server",
}
}
},
{
"rcarriga/nvim-dap-ui",
dependencies = {
"nvim-neotest/nvim-nio",
"mfussenegger/nvim-dap",
},
event = "VeryLazy",
config = function()
require("dapui").setup()
end
},
{
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
{
"L3MON4D3/LuaSnip",
dependencies = "rafamadriz/friendly-snippets",
opts = { history = true, updateevents = "TextChanged,TextChangedI" },
config = function(_, opts)
require("luasnip").config.set_config(opts)
require "config.plugins.luasnip"
end,
},
{
"saadparwaiz1/cmp_luasnip",
"hrsh7th/cmp-nvim-lua",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
},
},
},
{
'kevinhwang91/nvim-ufo',
lazy = true,
config = function(_, opts)
local handler = function(virtText, lnum, endLnum, width, truncate)
local newVirtText = {}
local totalLines = vim.api.nvim_buf_line_count(0)
local foldedLines = endLnum - lnum
local suffix = ("  %d %d%%"):format(foldedLines, foldedLines / totalLines * 100)
local sufWidth = vim.fn.strdisplaywidth(suffix)
local targetWidth = width - sufWidth
local curWidth = 0
for _, chunk in ipairs(virtText) do
local chunkText = chunk[1]
local chunkWidth = vim.fn.strdisplaywidth(chunkText)
if targetWidth > curWidth + chunkWidth then
table.insert(newVirtText, chunk)
else
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,
},
}
+5 -5
View File
@@ -1,8 +1,9 @@
return {
{
'nvimdev/dashboard-nvim',
event = 'VimEnter',
dependencies = { { 'nvim-tree/nvim-web-devicons' } }
"goolord/alpha-nvim",
config = function ()
require'alpha'.setup(require'alpha.themes.dashboard'.config)
end
},
{
"kaarmu/typst.vim",
@@ -44,7 +45,6 @@ return {
{
"mrcjkb/rustaceanvim",
version = '^4', -- Recommended
lazy = false, -- This plugin is already lazy
ft = { "rust" },
lazy = false, -- This plugin is already lazy
},
}