Compare commits

..
18 Commits
Author SHA1 Message Date
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
22 changed files with 407 additions and 663 deletions

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
.neoconf.json
.stylua.toml
lazy-lock.json
+9 -34
View File
@@ -1,51 +1,26 @@
local vanila_vim_autostart_commands = { vim.cmd("set number")
"set number",
"set clipboard=unnamedplus",
"set nowrap",
"set shiftwidth=4",
"set tabstop=4",
}
vim.opt.fillchars = { eob = " " }
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("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.autocommand")
require("config.plugins.bufferline") require("config.plugins.bufferline")
require("config.plugins.colorizer") require("config.plugins.colorizer")
require("config.plugins.comment") require("config.plugins.comment")
require("config.plugins.dap") require("config.plugins.dap")
require("config.plugins.dropbar")
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("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.winbar")
require("huez").setup({}) 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")
+13
View File
@@ -0,0 +1,13 @@
vim.api.nvim_create_autocmd(
{
"BufNewFile",
"BufRead",
},
{
pattern = "*.typ",
callback = function()
local buf = vim.api.nvim_get_current_buf()
vim.api.nvim_buf_set_option(buf, "filetype", "typst")
end
}
)
-95
View File
@@ -1,95 +0,0 @@
local cmp = require "cmp"
local kind_icons = {
Text = "",
Method = "󰆧",
Function = "󰊕",
Constructor = "",
Field = "",
Variable = "",
Class = "",
Interface = "",
Module = "",
Property = "󰜢",
Unit = "",
Value = "󰎠",
Enum = "",
Keyword = "󰌋",
Snippet = "",
Color = "󰏘",
File = "󰈙",
Reference = "",
Folder = "󰉋",
EnumMember = "",
Constant = "󰏿",
Struct = "",
Event = "",
Operator = "󰆕",
TypeParameter = "󰅲",
}
cmp.setup{
completion = { completeopt = "menu,menuone" },
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
formatting = {
format = function(entry, vim_item)
-- Kind icons
vim_item.kind = string.format('\t%s %s\t', kind_icons[vim_item.kind], vim_item.kind) -- This concatenates the icons with the name of the item kind
-- Source
vim_item.menu = ({
buffer = "[Buffer]",
nvim_lsp = "[LSP]",
luasnip = "[LuaSnip]",
nvim_lua = "[Lua]",
latex_symbols = "[LaTeX]",
})[entry.source.name]
return vim_item
end
},
mapping = {
["<C-p>"] = cmp.mapping.select_prev_item(),
["<C-n>"] = cmp.mapping.select_next_item(),
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.close(),
["<CR>"] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Insert,
select = true,
},
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif require("luasnip").expand_or_jumpable() then
require("luasnip").expand_or_jump()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif require("luasnip").jumpable(-1) then
require("luasnip").jump(-1)
else
fallback()
end
end, { "i", "s" }),
},
sources = {
{ name = "nvim_lsp" },
{ name = "buffer" },
{ name = "path" },
},
}
+23 -85
View File
@@ -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 },
},
}) })
+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, 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,
}) })
-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',
},
},
},
}
+29 -3
View File
@@ -1,4 +1,30 @@
require('dropbar').setup() local sources = require("dropbar.sources")
vim.ui.select = require('dropbar.utils.menu').select
vim.api.nvim_set_hl(0, 'DropBarMenuHoverEntry', { link = 'PmenuExtraSel' })
local function get_hl_color(group, attr)
return vim.fn.synIDattr(vim.fn.synIDtrans(vim.fn.hlID(group)), attr)
end
vim.cmd [[hi WinBar guisp=#665c54 guibg=#313131]]
vim.cmd [[hi WinBarNC guisp=#665c54 guibg=#313131]]
require("dropbar").setup(
{
bar = {
sources = {
{
get_symbols = function(buf, win, cursor)
local symbols = sources.path.get_symbols(buf, win, cursor)
for _, symbol in ipairs(symbols) do
local icon_fg = get_hl_color(symbol.icon_hl, "fg#")
local icon_string = ""
vim.cmd(icon_string)
end
return symbols
end
}
}
}
}
)
+42 -23
View File
@@ -1,31 +1,49 @@
require('gitsigns').setup { require("gitsigns").setup({
signs = { signs = {
add = { text = '┃' }, add = {
change = { text = '┃' }, text = " ┃",
delete = { text = '' }, },
topdelete = { text = '' }, change = {
changedelete = { text = '┃' }, text = " ┃",
untracked = { text = ' ' }, },
delete = {
text = "",
},
topdelete = {
text = "",
},
changedelete = {
text = " ┃",
},
}, },
signs_staged = { signs_staged = {
add = { text = '┃' }, add = {
change = { text = '┃' }, text = " ┃",
delete = { text = '' }, },
topdelete = { text = '' }, change = {
changedelete = { text = '┃' }, text = " ┃",
untracked = { text = ' ' }, },
delete = {
text = "",
},
topdelete = {
text = "",
},
changedelete = {
text = " ┃",
},
}, },
signcolumn = true, signcolumn = true,
numhl = false, numhl = false,
linehl = false, linehl = false,
word_diff = false, word_diff = false,
watch_gitdir = { watch_gitdir = {
interval = 1000, interval = 1000,
follow_files = true, follow_files = true,
}, },
attach_to_untracked = true, attach_to_untracked = true,
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame_opts = { current_line_blame_opts = {
virt_text = true, virt_text = true,
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
delay = 1000, delay = 1000,
@@ -37,12 +55,13 @@ require('gitsigns').setup {
update_debounce = 200, update_debounce = 200,
max_file_length = 40000, max_file_length = 40000,
preview_config = { preview_config = {
-- Options passed to nvim_open_win -- Options passed to nvim_open_win
border = "rounded", border = "rounded",
style = "minimal", style = "minimal",
relative = "cursor", relative = "cursor",
row = 0, row = 0,
vcol = 1, col = 1,
}, },
yadm = { enable = false }, yadm = { enable = false },
} })
-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,
},
},
}
})
-5
View File
@@ -1,5 +0,0 @@
local signs = { Error = "", Warn = "", Hint = "󱩎 ", Info = "" }
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
end
+1 -2
View File
@@ -30,7 +30,7 @@ navic.setup {
TypeParameter = "󰊄 ", TypeParameter = "󰊄 ",
}, },
lsp = { lsp = {
auto_attach = true, auto_attach = false,
preference = nil, preference = nil,
}, },
highlight = true, highlight = true,
@@ -44,4 +44,3 @@ navic.setup {
return text return text
end, end,
} }
+4
View File
@@ -1,15 +1,19 @@
require("noice").setup({ require("noice").setup({
lsp = { lsp = {
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
override = { override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true, ["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true, ["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp ["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp
}, },
}, },
-- you can enable a preset for easier configuration
presets = { presets = {
bottom_search = true, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false, -- add a border to hover docs and signature help 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
})
-37
View File
@@ -1,37 +0,0 @@
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)
end,
settings = {
['rust-analyzer'] = {
assist = {
importEnforceGranularity = true,
importPrefix = "create"
},
cargo = { allFeatures = true },
checkOnSave = {
-- default: `cargo check`
command = "clippy",
allFeatures = true
},
inlayHints = {
lifetimeElisionHints = {
enable = true,
useParameterNames = true
}
}
}
}
}
}
+36
View File
@@ -0,0 +1,36 @@
require('winbar').setup({
enabled = true,
show_file_path = true,
show_symbols = true,
colors = {
path = '', -- You can customize colors like #c946fd
file_name = '',
symbols = '',
},
icons = {
file_icon_default = '',
seperator = '',
editor_state = '●',
lock_icon = '',
},
exclude_filetype = {
'help',
'startify',
'dashboard',
'packer',
'neo-tree',
'neogitstatus',
'NvimTree',
'Trouble',
'alpha',
'lir',
'Outline',
'spectre_panel',
'toggleterm',
'qf',
}
})
-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 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>")
+173 -150
View File
@@ -1,152 +1,175 @@
return { return {
{ {
'simrat39/inlay-hints.nvim', 'nvim-lua/popup.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", 'folke/noice.nvim',
}, },
{ {
"SmiteshP/nvim-navic", "kyazdani42/nvim-web-devicons"
}, },
{ {
"kyazdani42/nvim-web-devicons" 'NvChad/nvim-colorizer.lua',
}, },
{ {
'NvChad/nvim-colorizer.lua', 'numToStr/Comment.nvim'
}, },
{ {
'numToStr/Comment.nvim' "L3MON4D3/LuaSnip",
}, lazy = true,
{ },
"nvim-treesitter/nvim-treesitter", {
}, "folke/neodev.nvim", opts = {}
{ },
"catppuccin/nvim" {
}, "nvim-treesitter/nvim-treesitter",
{ },
"vague2k/huez.nvim", {
}, 'fgheng/winbar.nvim'
{ },
"nvim-telescope/telescope.nvim", {
}, "Bekaboo/dropbar.nvim",
{ },
"williamboman/mason-lspconfig.nvim", {
}, "vague2k/huez.nvim",
{ },
"neovim/nvim-lspconfig", {
}, "neovim/nvim-lspconfig",
{ dependencies = { "williamboman/mason-lspconfig.nvim", },
"mfussenegger/nvim-dap", },
event = "VeryLazy", {
}, "mfussenegger/nvim-dap",
{ event = "VeryLazy",
"L3MON4D3/LuaSnip", },
lazy = true, {
}, "nvim-neo-tree/neo-tree.nvim",
{ branch = "v2.x",
'folke/lazydev.nvim', dependencies = {
ft = "lua", "nvim-lua/plenary.nvim",
}, "nvim-tree/nvim-web-devicons",
{ "MunifTanjim/nui.nvim",
'Bekaboo/dropbar.nvim', },
dependencies = { },
'nvim-telescope/telescope-fzf-native.nvim', {
build = 'make' "williamboman/mason.nvim",
}, opts = {
config = function() ensure_installed = {
local dropbar_api = require('dropbar.api') "eslint-lsp",
vim.keymap.set('n', '<Leader>;', dropbar_api.pick, { desc = 'Pick symbols in winbar' }) "js-debug-adapter",
vim.keymap.set('n', '[;', dropbar_api.goto_context_start, { desc = 'Go to start of current context' }) "prettier",
vim.keymap.set('n', '];', dropbar_api.select_next_context, { desc = 'Select next context' }) "tinymist",
end "typescript-language-server",
}, }
{ }
"folke/noice.nvim", },
event = "VeryLazy", {
dependencies = { "rcarriga/nvim-dap-ui",
"MunifTanjim/nui.nvim", dependencies = {
"rcarriga/nvim-notify", "nvim-neotest/nvim-nio",
}, "mfussenegger/nvim-dap",
}, },
{ event = "VeryLazy",
"nvim-neo-tree/neo-tree.nvim", config = function()
branch = "v2.x", require("dapui").setup()
dependencies = { end
"nvim-lua/plenary.nvim", },
"nvim-tree/nvim-web-devicons", {
"MunifTanjim/nui.nvim", "nvim-telescope/telescope.nvim",
}, },
}, {
{ "hrsh7th/nvim-cmp",
"williamboman/mason.nvim", event = "InsertEnter",
opts = { dependencies = {
ensure_installed = { {
"eslint-lsp", "L3MON4D3/LuaSnip",
"js-debug-adapter", dependencies = "rafamadriz/friendly-snippets",
"prettier", opts = { history = true, updateevents = "TextChanged,TextChangedI" },
"tinymist", config = function(_, opts)
"typescript-language-server", require("luasnip").config.set_config(opts)
} require "config.plugins.luasnip"
} end,
}, },
{ {
"rcarriga/nvim-dap-ui", "saadparwaiz1/cmp_luasnip",
dependencies = { "hrsh7th/cmp-nvim-lua",
"nvim-neotest/nvim-nio", "hrsh7th/cmp-nvim-lsp",
"mfussenegger/nvim-dap", "hrsh7th/cmp-buffer",
}, "hrsh7th/cmp-path",
event = "VeryLazy", },
config = function() },
require("dapui").setup() },
end {
}, 'kevinhwang91/nvim-ufo',
{ lazy = true,
"hrsh7th/nvim-cmp", config = function(_, opts)
event = "InsertEnter", local handler = function(virtText, lnum, endLnum, width, truncate)
dependencies = { local newVirtText = {}
{ local totalLines = vim.api.nvim_buf_line_count(0)
"L3MON4D3/LuaSnip", local foldedLines = endLnum - lnum
dependencies = "rafamadriz/friendly-snippets", local suffix = ("  %d %d%%"):format(foldedLines, foldedLines / totalLines * 100)
opts = { history = true, updateevents = "TextChanged,TextChangedI" }, local sufWidth = vim.fn.strdisplaywidth(suffix)
config = function(_, opts) local targetWidth = width - sufWidth
require("luasnip").config.set_config(opts) local curWidth = 0
require "config.plugins.luasnip" for _, chunk in ipairs(virtText) do
end, local chunkText = chunk[1]
}, local chunkWidth = vim.fn.strdisplaywidth(chunkText)
{ if targetWidth > curWidth + chunkWidth then
"saadparwaiz1/cmp_luasnip", table.insert(newVirtText, chunk)
"hrsh7th/cmp-nvim-lua", else
"hrsh7th/cmp-nvim-lsp", chunkText = truncate(chunkText, targetWidth - curWidth)
"hrsh7th/cmp-buffer", local hlGroup = chunk[2]
"hrsh7th/cmp-path", 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 { 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" },
}, },
} }