feat: first commit

This commit is contained in:
doryan 2024-12-12 14:07:56 +04:00
parent 41c5b46733
commit 5604b29cdc
29 changed files with 890 additions and 157 deletions

View File

@ -1,6 +0,0 @@
column_width = 120
line_endings = "Unix"
indent_type = "Spaces"
indent_width = 2
quote_style = "AutoPreferDouble"
call_parentheses = "None"

View File

@ -1,16 +0,0 @@
-- This file needs to have same structure as nvconfig.lua
-- https://github.com/NvChad/ui/blob/v2.5/lua/nvconfig.lua
---@type ChadrcConfig
local M = {}
M.ui = {
theme = "onedark",
-- hl_override = {
-- Comment = { italic = true },
-- ["@comment"] = { italic = true },
-- },
}
return M

25
lua/config/lazy.lua Normal file
View File

@ -0,0 +1,25 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
require("lazy").setup({
spec = {
{ import = "plugins.core", },
{ import = "plugins.secondary", },
},
})

View File

@ -0,0 +1,5 @@
-- require'cmp'.setup {
-- sources = {
-- { name = 'nvim_lsp' }
-- }
-- }

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
}
)

View File

@ -0,0 +1,7 @@
require('nvim-ts-autotag').setup({
opts = {
enable_close = true,
enable_rename = true,
enable_close_on_slash = false
},
})

View File

@ -0,0 +1,27 @@
vim.opt.termguicolors = true
require("bufferline").setup({
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,
}
}
}
})

View File

@ -0,0 +1,12 @@
require("colorizer").setup {
filetypes = { "scss", "sass", "css", "html", "jsx", "tsx" },
user_default_options = {
css = true,
css_fn = true,
mode = "background",
tailwind = true,
sass = { enable = true, parsers = { "css" }, },
always_update = false
},
buftypes = {},
}

View File

@ -0,0 +1,43 @@
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-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,
})

99
lua/config/plugins/dap.lua Executable file
View File

@ -0,0 +1,99 @@
local dap = require('dap')
require("dap-vscode-js").setup({
debugger_path = "/.local/share/lunarvim/site/pack/lazy/opt/vscode-js-debug",
debugger_cmd = { "js-debug-adapter" },
adapters = { 'node-terminal' },
})
dap.configurations.cpp = {
{
name = "Launch file",
type = "codelldb",
request = "launch",
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
cwd = '${workspaceFolder}',
stopOnEntry = false,
},
}
dap.configurations.c = dap.configurations.cpp
dap.configurations.rust = dap.configurations.cpp
dap.adapters["pwa-node"] = {
type = "server",
host = "localhost",
port = "${port}",
executable = {
command = "node",
args = {os.getenv("HOME") .. "/.local/share/lvim/mason/packages/js-debug-adapter/js-debug/src/dapDebugServer.js", "${port}"},
}
}
dap.configurations.javascript = {
{
type = "pwa-node",
request = "launch",
name = "Launch file",
program = "${file}",
cwd = "${workspaceFolder}",
},
}
dap.adapters.chrome = {
type = "executable",
command = "node",
args = {os.getenv("HOME") .. "/.local/share/lvim/mason/packages/chrome-debug-adapter/out/src/chromeDebug.js"},
}
dap.adapters.firefox = {
type = 'executable',
command = 'node',
args = {os.getenv('HOME') .. '/.local/share/lvim/mason/packages/firefox-debug-adapter/dist/adapter.bundle.js'},
}
dap.configurations.typescriptreact = {
{
name = 'Next.js: debug server-side',
type = "pwa-node",
request = "launch",
runtimeExecutable = "npm",
runtimeArgs = { "run", "dev" },
cwd = "${workspaceFolder}",
},
{
name = "Next.js: debug client-side with chrome",
type = "chrome",
request = "launch",
url = "http://localhost:3000"
},
{
name = "Next.js: debug client-side with firefox",
type = "firefox",
request = "launch",
url = 'http://localhost:3000',
webRoot = '${workspaceFolder}',
firefoxExecutable = '/usr/bin/waterfox',
pathMappings = {
{
url = "webpack://_n_e/",
path = "${workspaceFolder}/"
}
},
},
}
dap.configurations.javascriptreact = dap.configurations.typescriptreact;
require("dapui").setup()
local dap, dapui = require("dap"), require("dapui")
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open({})
end
vim.keymap.set('n', '<leader>ui', require 'dapui'.toggle)

View File

@ -0,0 +1,30 @@
local sources = require("dropbar.sources")
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
}
}
}
}
)

View File

@ -0,0 +1,67 @@
require("gitsigns").setup({
signs = {
add = {
text = "",
},
change = {
text = "",
},
delete = {
text = "",
},
topdelete = {
text = "",
},
changedelete = {
text = "",
},
},
signs_staged = {
add = {
text = "",
},
change = {
text = "",
},
delete = {
text = "",
},
topdelete = {
text = "",
},
changedelete = {
text = "",
},
},
signcolumn = true,
numhl = false,
linehl = false,
word_diff = false,
watch_gitdir = {
interval = 1000,
follow_files = true,
},
attach_to_untracked = true,
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame_opts = {
virt_text = true,
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
delay = 1000,
ignore_whitespace = false,
},
current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>",
sign_priority = 6,
status_formatter = nil, -- Use default
update_debounce = 200,
max_file_length = 40000,
preview_config = {
-- Options passed to nvim_open_win
border = "rounded",
style = "minimal",
relative = "cursor",
row = 0,
col = 1,
},
yadm = { enable = false },
})

View File

@ -0,0 +1,59 @@
require("lualine").setup({
options = {
icons_enabled = true,
theme = 'auto',
component_separators = { left = '', right = ''},
section_separators = { left = '', right = ''},
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = {},
always_divide_middle = true,
always_show_tabline = true,
globalstatus = true,
refresh = {
statusline = 100,
tabline = 100,
winbar = 100,
}
},
sections = {
lualine_a = {
{
function()
return ""
end,
padding = { left = 0, right = 0 },
color = {},
cond = nil,
},
},
lualine_b = {'branch'},
lualine_c = {'diff'},
lualine_x = {'encoding', 'filetype', 'diagnostics', 'lsp'},
lualine_y = {'progress'},
lualine_z = {'location'}
},
inactive_sections = {
lualine_a = {
{
function()
return ""
end,
padding = { left = 0, right = 0 },
color = {},
cond = nil,
},
},
lualine_b = {'branch'},
lualine_c = {'diff'},
lualine_x = {'encoding', 'filetype', 'diagnostics', 'lsp'},
lualine_y = {'progress'},
lualine_z = {'location'}
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {}
})

View File

@ -0,0 +1,22 @@
-- vscode format
require("luasnip.loaders.from_vscode").lazy_load { exclude = vim.g.vscode_snippets_exclude or {} }
require("luasnip.loaders.from_vscode").lazy_load { paths = vim.g.vscode_snippets_path or "" }
-- snipmate format
require("luasnip.loaders.from_snipmate").load()
require("luasnip.loaders.from_snipmate").lazy_load { paths = vim.g.snipmate_snippets_path or "" }
-- lua format
require("luasnip.loaders.from_lua").load()
require("luasnip.loaders.from_lua").lazy_load { paths = vim.g.lua_snippets_path or "" }
vim.api.nvim_create_autocmd("InsertLeave", {
callback = function()
if
require("luasnip").session.current_nodes[vim.api.nvim_get_current_buf()]
and not require("luasnip").session.jump_active
then
require("luasnip").unlink_current()
end
end,
})

View File

@ -0,0 +1,46 @@
local navic = require("nvim-navic")
navic.setup {
icons = {
File = "󰈙 ",
Module = "",
Namespace = "󰌗 ",
Package = "",
Class = "󰌗 ",
Method = "󰆧 ",
Property = "",
Field = "",
Constructor = "",
Enum = "󰕘",
Interface = "󰕘",
Function = "󰊕 ",
Variable = "󰆧 ",
Constant = "󰏿 ",
String = "󰀬 ",
Number = "󰎠 ",
Boolean = "",
Array = "󰅪 ",
Object = "󰅩 ",
Key = "󰌋 ",
Null = "󰟢 ",
EnumMember = "",
Struct = "󰌗 ",
Event = "",
Operator = "󰆕 ",
TypeParameter = "󰊄 ",
},
lsp = {
auto_attach = false,
preference = nil,
},
highlight = true,
seperator = '',
depth_limit = 0,
depth_limit_indicator = "..",
safe_output = true,
lazy_update_context = false,
click = false,
format_text = function(text)
return text
end,
}

View File

@ -0,0 +1,52 @@
vim.fn.sign_define("LspDiagnosticsSignError",
{text = "󰅙 ", texthl = "LspDiagnosticsSignError"})
vim.fn.sign_define("LspDiagnosticsSignWarning",
{text = "󱇎 ", texthl = "LspDiagnosticsSignWarning"})
vim.fn.sign_define("LspDiagnosticsSignInformation",
{text = "󰰄 ", texthl = "LspDiagnosticsSignInformation"})
vim.fn.sign_define("LspDiagnosticsSignHint",
{text = "󰐗 ", texthl = "LspDiagnosticsSignHint"})
require("neo-tree").setup({
close_if_last_window = false,
popup_border_style = "rounded",
enable_git_status = true,
enable_diagnostics = true,
open_files_do_not_replace_types = { "terminal", "trouble", "qf" },
sort_case_insensitive = false,
sort_function = nil ,
default_component_configs = {
indent = {
with_expanders = true,
},
icon = {
folder_closed = "󰉋",
folder_open = "󰝰",
folder_empty = "󰉖",
default = "*",
highlight = "NeoTreeFileIcon"
},
modified = {
symbol = "󰧞",
highlight = "NeoTreeModified",
},
name = {
trailing_slash = false,
use_git_status_colors = true,
highlight = "NeoTreeFileName",
},
git_status = {
symbols = {
added = "󰜄",
modified = "󰑕",
deleted = "󰅗",
renamed = "󰛂",
untracked = "󰞋",
ignored = "󰿠",
unstaged = "󰄱",
staged = "󰄵",
conflict = "",
}
},
},
})

View File

@ -0,0 +1,19 @@
require("noice").setup({
lsp = {
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
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
},
},
-- you can enable a preset for easier configuration
presets = {
bottom_search = true, -- use a classic bottom cmdline for search
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
},
})

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
})

View File

@ -0,0 +1,19 @@
local prettier = require("prettier")
prettier.setup({
bin = 'prettier',
filetypes = {
"css",
"graphql",
"html",
"javascript",
"javascriptreact",
"json",
"less",
"markdown",
"scss",
"typescript",
"typescriptreact",
"yaml",
},
})

View File

@ -0,0 +1,8 @@
require'nvim-treesitter.configs'.setup {
ensure_installed = { 'rust', 'c', 'lua', 'tsx', 'javascript', 'typescript' },
sync_install = false,
auto_install = true,
highlight = {
enable = true,
}
}

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',
}
})

View File

@ -1,15 +0,0 @@
local options = {
formatters_by_ft = {
lua = { "stylua" },
-- css = { "prettier" },
-- html = { "prettier" },
},
-- format_on_save = {
-- -- These options will be passed to conform.format()
-- timeout_ms = 500,
-- lsp_fallback = true,
-- },
}
require("conform").setup(options)

View File

@ -1,47 +0,0 @@
return {
defaults = { lazy = true },
install = { colorscheme = { "nvchad" } },
ui = {
icons = {
ft = "",
lazy = "󰂠 ",
loaded = "",
not_loaded = "",
},
},
performance = {
rtp = {
disabled_plugins = {
"2html_plugin",
"tohtml",
"getscript",
"getscriptPlugin",
"gzip",
"logipat",
"netrw",
"netrwPlugin",
"netrwSettings",
"netrwFileHandlers",
"matchit",
"tar",
"tarPlugin",
"rrhelper",
"spellfile_plugin",
"vimball",
"vimballPlugin",
"zip",
"zipPlugin",
"tutor",
"rplugin",
"syntax",
"synmenu",
"optwin",
"compiler",
"bugreport",
"ftplugin",
},
},
},
}

View File

@ -1,23 +0,0 @@
-- EXAMPLE
local on_attach = require("nvchad.configs.lspconfig").on_attach
local on_init = require("nvchad.configs.lspconfig").on_init
local capabilities = require("nvchad.configs.lspconfig").capabilities
local lspconfig = require "lspconfig"
local servers = { "html", "cssls" }
-- lsps with default config
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = on_attach,
on_init = on_init,
capabilities = capabilities,
}
end
-- typescript
lspconfig.tsserver.setup {
on_attach = on_attach,
on_init = on_init,
capabilities = capabilities,
}

View File

@ -1,10 +1,52 @@
require "nvchad.mappings"
-- add yours here
local map = vim.keymap.set local map = vim.keymap.set
map("n", ";", ":", { desc = "CMD enter command mode" }) map("n", ";", ":", { desc = "CMD enter command mode" })
map("i", "jk", "<ESC>")
-- map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>") map("i", "<C-h>", "<Left>", { desc = "move left" })
map("i", "<C-l>", "<Right>", { desc = "move right" })
map("i", "<C-j>", "<Down>", { desc = "move down" })
map("i", "<C-k>", "<Up>", { desc = "move up" })
map("n", "<C-h>", "<C-w>h", { desc = "switch window left" })
map("n", "<C-l>", "<C-w>l", { desc = "switch window right" })
map("n", "<C-j>", "<C-w>j", { desc = "switch window down" })
map("n", "<C-k>", "<C-w>k", { desc = "switch window up" })
map("n", "<C-n>", "<cmd>NeoTreeShowToggle<CR>", { desc = "nvimtree toggle window" })
map("n", "<C-A-l>", "<cmd>BufferLineMoveNext<cr>", { desc = "move buffer to right" })
map("n", "<C-A-J>", "<cmd>BufferLineMovePrev<cr>", { desc = "move buffer to left" })
map("n", "<Tab>", "<cmd>BufferLineCycleNext<cr>", { desc = "switch to next buffer" })
map("n", "<S-Tab>", "<cmd>BufferLineCyclePrev<cr>", { desc = "switch to prev buffer" })
map("n", "<F9>", "<cmd>DapContinue<cr>")
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>")
map("n", "<", "<cmd><gv<cr>")
map("n", ">", "<cmd>>gv<cr>")
map("n", "<leader>dr", "<cmd> DapContinue <cr>", { desc = "Continue debug" } )
map("n", "do", function()
require("dapui").open()
end, { desc = "Open DAP ui" })
map("n", "dc", function()
require("dapui").close()
end, { desc = "Start or continue debug" })
map("n", "dt", function()
require("dapui").toggle()
end, { desc = "Toggle DAP ui" })
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>")

View File

@ -1,6 +0,0 @@
require "nvchad.options"
-- add yours here!
-- local o = vim.o
-- o.cursorlineopt ='both' -- to enable cursorline!

175
lua/plugins/core/init.lua Normal file
View File

@ -0,0 +1,175 @@
return {
{
'nvim-lua/popup.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",
},
{
'folke/noice.nvim',
},
{
"kyazdani42/nvim-web-devicons"
},
{
'NvChad/nvim-colorizer.lua',
},
{
'numToStr/Comment.nvim'
},
{
"L3MON4D3/LuaSnip",
lazy = true,
},
{
"folke/neodev.nvim", opts = {}
},
{
"nvim-treesitter/nvim-treesitter",
},
{
'fgheng/winbar.nvim'
},
{
"Bekaboo/dropbar.nvim",
},
{
"vague2k/huez.nvim",
},
{
"neovim/nvim-lspconfig",
dependencies = { "williamboman/mason-lspconfig.nvim", },
},
{
"mfussenegger/nvim-dap",
event = "VeryLazy",
},
{
"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
},
{
"nvim-telescope/telescope.nvim",
},
{
"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,
},
}

View File

@ -1,38 +0,0 @@
return {
{
"stevearc/conform.nvim",
-- event = 'BufWritePre', -- uncomment for format on save
config = function()
require "configs.conform"
end,
},
-- These are some examples, uncomment them if you want to see them work!
-- {
-- "neovim/nvim-lspconfig",
-- config = function()
-- require("nvchad.configs.lspconfig").defaults()
-- require "configs.lspconfig"
-- end,
-- },
--
-- {
-- "williamboman/mason.nvim",
-- opts = {
-- ensure_installed = {
-- "lua-language-server", "stylua",
-- "html-lsp", "css-lsp" , "prettier"
-- },
-- },
-- },
--
-- {
-- "nvim-treesitter/nvim-treesitter",
-- opts = {
-- ensure_installed = {
-- "vim", "lua", "vimdoc",
-- "html", "css"
-- },
-- },
-- },
}

View File

@ -0,0 +1,50 @@
return {
{
"goolord/alpha-nvim",
config = function ()
require'alpha'.setup(require'alpha.themes.dashboard'.config)
end
},
{
"kaarmu/typst.vim",
lazy = true,
},
{
'MunifTanjim/prettier.nvim',
lazy = true,
},
{
"savq/melange-nvim"
},
{
"mlaursen/vim-react-snippets",
lazy = true,
},
{
"windwp/nvim-ts-autotag",
lazy = true,
},
{
"lukas-reineke/indent-blankline.nvim"
},
{
"mxsdev/nvim-dap-vscode-js",
lazy = true,
},
{
"windwp/nvim-autopairs",
lazy = true,
event = "InsertEnter",
config = true
},
{
"microsoft/vscode-js-debug",
lazy = true,
build = "npm install --legacy-peer-deps && npx gulp vsDebugServerBundle && mv dist out"
},
{
"mrcjkb/rustaceanvim",
version = '^4', -- Recommended
lazy = false, -- This plugin is already lazy
},
}