mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-28 19:50:05 +02:00
Merge branch 'v2'
This commit is contained in:
commit
e9f5f863cf
36 changed files with 0 additions and 5313 deletions
|
@ -1,168 +0,0 @@
|
|||
return {
|
||||
"akinsho/bufferline.nvim",
|
||||
branch = "main",
|
||||
event = { "BufRead", "InsertEnter", "BufNewFile" },
|
||||
config = function()
|
||||
local status_ok, bufferline = pcall(require, "bufferline")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local icons = require("user.icons")
|
||||
local use_icons = true
|
||||
|
||||
-- get folder name from current directory
|
||||
local _get_folder_name = function()
|
||||
local str = vim.fn.fnamemodify(vim.fn.getcwd(), ":t")
|
||||
return " " .. icons.ui.ProjekFolder .. " " .. str:lower():gsub("^%l", string.upper) .. " "
|
||||
end
|
||||
|
||||
local function diagnostics_indicator(num, _, diagnostics, _)
|
||||
local result = {}
|
||||
local symbols = {
|
||||
error = icons.diagnostics.Error,
|
||||
warning = icons.diagnostics.Warning,
|
||||
info = icons.diagnostics.Information,
|
||||
}
|
||||
if not use_icons then
|
||||
return "(" .. num .. ")"
|
||||
end
|
||||
for name, count in pairs(diagnostics) do
|
||||
if symbols[name] and count > 0 then
|
||||
table.insert(result, symbols[name] .. " " .. count)
|
||||
end
|
||||
end
|
||||
result = table.concat(result, " ")
|
||||
return #result > 0 and result or ""
|
||||
end
|
||||
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
bufferline.setup({
|
||||
options = {
|
||||
color_icons = true,
|
||||
numbers = "none", -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string,
|
||||
close_command = function(bufnum)
|
||||
require("bufdelete").bufdelete(bufnum, true)
|
||||
end,
|
||||
right_mouse_command = function(bufnum)
|
||||
require("bufdelete").bufdelete(bufnum, true)
|
||||
end,
|
||||
-- close_command = "bdelete! %d",
|
||||
-- right_mouse_command = "bdelete! %d",
|
||||
left_mouse_command = "buffer %d",
|
||||
middle_mouse_command = nil,
|
||||
|
||||
indicator_icon = nil,
|
||||
indicator = { style = "icon", icon = icons.ui.BoldLineLeft },
|
||||
buffer_close_icon = icons.ui.Close,
|
||||
modified_icon = icons.ui.Circle,
|
||||
close_icon = icons.ui.BoldClose,
|
||||
left_trunc_marker = icons.ui.ArrowCircleLeft,
|
||||
right_trunc_marker = icons.ui.ArrowCircleRight,
|
||||
max_name_length = 30,
|
||||
max_prefix_length = 30,
|
||||
tab_size = 21,
|
||||
diagnostics = false, -- | "nvim_lsp" | "coc",
|
||||
diagnostics_update_in_insert = false,
|
||||
diagnostics_indicator = diagnostics_indicator,
|
||||
offsets = {
|
||||
{
|
||||
filetype = "NvimTree",
|
||||
text = _get_folder_name(),
|
||||
highlight = "Directory",
|
||||
text_align = "left",
|
||||
padding = 1,
|
||||
},
|
||||
{
|
||||
filetype = "neo-tree",
|
||||
text = _get_folder_name(),
|
||||
highlight = "Directory",
|
||||
text_align = "left",
|
||||
padding = 1,
|
||||
},
|
||||
},
|
||||
show_buffer_icons = true,
|
||||
show_buffer_close_icons = true,
|
||||
show_close_icon = true,
|
||||
show_tab_indicators = true,
|
||||
persist_buffer_sort = true, -- whether or not custom sorted buffers should persist
|
||||
separator_style = { "", "" }, -- | "thick" | "thin" | { 'any', 'any' },
|
||||
enforce_regular_tabs = true,
|
||||
always_show_bufferline = true,
|
||||
},
|
||||
highlights = {
|
||||
background = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "none", highlight = "TabLine" },
|
||||
},
|
||||
buffer_visible = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "none", highlight = "TabLine" },
|
||||
},
|
||||
close_button = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "none", highlight = "TabLine" },
|
||||
},
|
||||
close_button_visible = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "none", highlight = "TabLine" },
|
||||
},
|
||||
tab_selected = {
|
||||
fg = { attribute = "fg", highlight = "Normal" },
|
||||
bg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
tab = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
tab_close = {
|
||||
-- fg = {attribute='fg',highlight='LspDiagnosticsDefaultError'},
|
||||
fg = { attribute = "fg", highlight = "TabLineSel" },
|
||||
bg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
duplicate_selected = {
|
||||
fg = { attribute = "fg", highlight = "TabLineSel" },
|
||||
bg = { attribute = "bg", highlight = "TabLineSel" },
|
||||
underline = true,
|
||||
},
|
||||
duplicate_visible = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
underline = true,
|
||||
},
|
||||
duplicate = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
underline = true,
|
||||
},
|
||||
|
||||
modified = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
modified_selected = {
|
||||
fg = { attribute = "fg", highlight = "Normal" },
|
||||
bg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
modified_visible = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
|
||||
separator = {
|
||||
fg = { attribute = "bg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
separator_selected = {
|
||||
fg = { attribute = "bg", highlight = "Normal" },
|
||||
bg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
indicator_selected = {
|
||||
fg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" },
|
||||
bg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
|
@ -1,290 +0,0 @@
|
|||
return {
|
||||
-- {
|
||||
-- "nvim-lualine/lualine.nvim",
|
||||
-- event = "InsertEnter",
|
||||
-- config = function()
|
||||
-- local hide_in_width = function()
|
||||
-- return vim.fn.winwidth(0) > 80
|
||||
-- end
|
||||
-- local icons = require("user.icons")
|
||||
--
|
||||
-- local getLeftSubstring = function(word, length)
|
||||
-- if #word > length then
|
||||
-- return string.sub(word, 1, length) .. "..."
|
||||
-- else
|
||||
-- return word
|
||||
-- end
|
||||
-- end
|
||||
--
|
||||
-- -- start for lsp
|
||||
-- local list_registered_providers_names = function(filetype)
|
||||
-- local s = require("null-ls.sources")
|
||||
-- local available_sources = s.get_available(filetype)
|
||||
-- local registered = {}
|
||||
-- for _, source in ipairs(available_sources) do
|
||||
-- for method in pairs(source.methods) do
|
||||
-- registered[method] = registered[method] or {}
|
||||
-- table.insert(registered[method], source.name)
|
||||
-- end
|
||||
-- end
|
||||
-- return registered
|
||||
-- end
|
||||
--
|
||||
-- local null_ls = require("null-ls")
|
||||
-- -- for formatter
|
||||
-- local list_registered = function(filetype)
|
||||
-- local method = null_ls.methods.FORMATTING
|
||||
-- local registered_providers = list_registered_providers_names(filetype)
|
||||
-- return registered_providers[method] or {}
|
||||
-- end
|
||||
--
|
||||
-- --- for linter
|
||||
-- local alternative_methods = {
|
||||
-- null_ls.methods.DIAGNOSTICS,
|
||||
-- null_ls.methods.DIAGNOSTICS_ON_OPEN,
|
||||
-- null_ls.methods.DIAGNOSTICS_ON_SAVE,
|
||||
-- }
|
||||
--
|
||||
-- local linter_list_registered = function(filetype)
|
||||
-- local registered_providers = list_registered_providers_names(filetype)
|
||||
-- local providers_for_methods = vim.tbl_flatten(vim.tbl_map(function(m)
|
||||
-- return registered_providers[m] or {}
|
||||
-- end, alternative_methods))
|
||||
--
|
||||
-- return providers_for_methods
|
||||
-- end
|
||||
-- -- end for lsp
|
||||
--
|
||||
-- local lsp_info = {
|
||||
-- function()
|
||||
-- local msg = "LS Inactive"
|
||||
-- local buf_ft = vim.bo.filetype
|
||||
-- local clients = vim.lsp.get_active_clients()
|
||||
-- -- start register
|
||||
-- local buf_clients = vim.lsp.buf_get_clients()
|
||||
-- local buf_client_names = {}
|
||||
-- if next(buf_clients) == nil then
|
||||
-- -- TODO: clean up this if statement
|
||||
-- if type(msg) == "boolean" or #msg == 0 then
|
||||
-- return "LS Inactive"
|
||||
-- end
|
||||
-- return msg
|
||||
-- end
|
||||
-- -- add client
|
||||
-- for _, client in pairs(buf_clients) do
|
||||
-- if client.name ~= "null-ls" and client.name ~= "copilot" then
|
||||
-- table.insert(buf_client_names, client.name)
|
||||
-- end
|
||||
-- end
|
||||
-- -- add formatter
|
||||
-- local supported_formatters = list_registered(buf_ft)
|
||||
-- vim.list_extend(buf_client_names, supported_formatters)
|
||||
-- -- add linter
|
||||
-- local supported_linters = linter_list_registered(buf_ft)
|
||||
-- vim.list_extend(buf_client_names, supported_linters)
|
||||
-- -- decomple
|
||||
-- local unique_client_names = vim.fn.uniq(buf_client_names)
|
||||
-- local msg = table.concat(unique_client_names, ", ")
|
||||
-- return msg
|
||||
-- end,
|
||||
-- --icon = " ",
|
||||
-- icon = icons.ui.Gear .. "",
|
||||
-- padding = 1,
|
||||
-- }
|
||||
--
|
||||
-- local diagnostics = {
|
||||
-- "diagnostics",
|
||||
-- sources = { "nvim_diagnostic" },
|
||||
-- sections = { "error", "warn" },
|
||||
-- -- symbols = { error = " ", warn = " " },
|
||||
-- symbols = {
|
||||
-- error = icons.diagnostics.BoldError .. " ",
|
||||
-- warn = icons.diagnostics.BoldWarning .. " ",
|
||||
-- },
|
||||
-- colored = true,
|
||||
-- update_in_insert = false,
|
||||
-- always_visible = false,
|
||||
-- }
|
||||
--
|
||||
-- local diff = {
|
||||
-- "diff",
|
||||
-- colored = true,
|
||||
-- -- symbols = { added = " ", modified = " ", removed = " " }, -- changes diff symbols
|
||||
-- symbols = {
|
||||
-- added = icons.git.LineAdded .. " ",
|
||||
-- modified = icons.git.LineModified .. " ",
|
||||
-- removed = icons.git.LineRemoved .. " ",
|
||||
-- }, -- changes diff symbols
|
||||
-- cond = hide_in_width,
|
||||
-- }
|
||||
--
|
||||
-- local spaces = function()
|
||||
-- -- return " " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
|
||||
-- return icons.ui.Tab .. " " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
|
||||
-- end
|
||||
--
|
||||
-- local mode = {
|
||||
-- "mode",
|
||||
-- padding = 1,
|
||||
-- separator = { left = " " },
|
||||
-- -- right_padding = 3,
|
||||
-- fmt = function(str)
|
||||
-- return icons.ui.Neovim .. " " .. str
|
||||
-- end,
|
||||
-- }
|
||||
-- local branch = {
|
||||
-- "branch",
|
||||
-- padding = 1,
|
||||
-- }
|
||||
--
|
||||
-- local get_branch = function()
|
||||
-- if vim.b.gitsigns_head ~= nil then
|
||||
-- return icons.git.Branch2 .. " " .. getLeftSubstring(vim.b.gitsigns_head, 6)
|
||||
-- else
|
||||
-- return icons.git.Branch2 .. vim.fn.fnamemodify("", ":t")
|
||||
-- end
|
||||
-- end
|
||||
--
|
||||
-- local lsp_progress = {}
|
||||
-- local data_ok, lspprogress = pcall(require, "lsp-progress")
|
||||
-- if data_ok then
|
||||
-- lsp_progress = lspprogress.progress
|
||||
-- end
|
||||
-- -- stylua: ignore
|
||||
-- local colors = {
|
||||
-- blue = '#50fa7b',
|
||||
-- cyan = '#f1fa8c',
|
||||
-- black = '#1a1b26',
|
||||
-- black_transparant = 'none',
|
||||
-- white = '#c6c6c6',
|
||||
-- red = "#ff757f",
|
||||
-- skyblue_1 = '#bd93f9',
|
||||
-- grey = '#5f6a8e',
|
||||
-- yellow = "#ffb86c",
|
||||
-- fg_gutter = "#3b4261",
|
||||
-- green1 = "#bd93f9",
|
||||
-- }
|
||||
--
|
||||
-- -- check config for theme
|
||||
-- local set_theme
|
||||
-- local bubbles_theme = {}
|
||||
-- local data_exists, config = pcall(require, "core.config")
|
||||
-- if data_exists then
|
||||
-- if config.colorscheme ~= nil then
|
||||
-- local color = config.colorscheme
|
||||
-- switch(color, {
|
||||
-- ["tokyonight"] = function()
|
||||
-- set_theme = "auto"
|
||||
-- end,
|
||||
-- ["tokyonight-night"] = function()
|
||||
-- set_theme = "auto"
|
||||
-- end,
|
||||
-- ["tokyonight-storm"] = function()
|
||||
-- set_theme = "auto"
|
||||
-- end,
|
||||
-- ["tokyonight-day"] = function()
|
||||
-- set_theme = "auto"
|
||||
-- end,
|
||||
-- ["tokyonight-moon"] = function()
|
||||
-- set_theme = "auto"
|
||||
-- end,
|
||||
-- ["dracula"] = function()
|
||||
-- local clr = require("dracula").colors()
|
||||
-- colors.blue = clr.green
|
||||
-- colors.black = clr.black
|
||||
-- colors.cyan = clr.yellow
|
||||
-- set_theme = bubbles_theme
|
||||
-- end,
|
||||
-- default = function()
|
||||
-- set_theme = "auto"
|
||||
-- end,
|
||||
-- })
|
||||
-- end
|
||||
-- end
|
||||
--
|
||||
-- bubbles_theme = {
|
||||
-- normal = {
|
||||
-- a = { fg = colors.black, bg = colors.skyblue_1 },
|
||||
-- b = { fg = colors.white, bg = colors.grey },
|
||||
-- c = { fg = colors.white, bg = colors.black_transparant },
|
||||
-- },
|
||||
--
|
||||
-- insert = {
|
||||
-- a = { fg = colors.black, bg = colors.blue },
|
||||
-- b = { fg = colors.blue, bg = colors.grey },
|
||||
-- },
|
||||
-- visual = {
|
||||
-- a = { fg = colors.black, bg = colors.cyan },
|
||||
-- b = { fg = colors.cyan, bg = colors.grey },
|
||||
-- },
|
||||
-- replace = {
|
||||
-- a = { bg = colors.red, fg = colors.black },
|
||||
-- b = { bg = colors.fg_gutter, fg = colors.red },
|
||||
-- },
|
||||
-- command = {
|
||||
-- a = { bg = colors.yellow, fg = colors.black },
|
||||
-- b = { bg = colors.fg_gutter, fg = colors.yellow },
|
||||
-- },
|
||||
-- terminal = {
|
||||
-- a = { bg = colors.green1, fg = colors.black },
|
||||
-- b = { bg = colors.fg_gutter, fg = colors.green1 },
|
||||
-- },
|
||||
-- inactive = {
|
||||
-- a = { fg = colors.white, bg = colors.black_transparant },
|
||||
-- b = { fg = colors.white, bg = colors.black_transparant },
|
||||
-- c = { fg = colors.black, bg = colors.black_transparant },
|
||||
-- },
|
||||
-- }
|
||||
--
|
||||
-- if set_theme == "auto" then
|
||||
-- bubbles_theme = vim.fn.fnamemodify("auto", ":t")
|
||||
-- end
|
||||
--
|
||||
-- require("lualine").setup({
|
||||
-- options = {
|
||||
-- theme = bubbles_theme,
|
||||
-- -- theme = "auto",
|
||||
-- component_separators = { left = "", right = "" },
|
||||
-- section_separators = { left = "", right = "" },
|
||||
-- disabled_filetypes = {
|
||||
-- "TelescopePrompt",
|
||||
-- "packer",
|
||||
-- "alpha",
|
||||
-- "dashboard",
|
||||
-- "NvimTree",
|
||||
-- "Outline",
|
||||
-- "DressingInput",
|
||||
-- "toggleterm",
|
||||
-- "lazy",
|
||||
-- "mason",
|
||||
-- "neo-tree",
|
||||
-- "startuptime",
|
||||
-- },
|
||||
-- always_divide_middle = true,
|
||||
-- },
|
||||
-- sections = {
|
||||
-- lualine_a = {
|
||||
-- mode,
|
||||
-- },
|
||||
-- lualine_b = { get_branch },
|
||||
-- lualine_c = { lsp_info, diagnostics, lsp_progress },
|
||||
-- lualine_x = { diff, spaces, "filetype" },
|
||||
-- lualine_y = { "progress" },
|
||||
-- lualine_z = {
|
||||
-- { "location", separator = { right = " " }, padding = 1 },
|
||||
-- },
|
||||
-- },
|
||||
-- inactive_sections = {
|
||||
-- lualine_a = { "filename" },
|
||||
-- lualine_b = {},
|
||||
-- lualine_c = {},
|
||||
-- lualine_x = {},
|
||||
-- lualine_y = {},
|
||||
-- lualine_z = { "location" },
|
||||
-- },
|
||||
-- tabline = {},
|
||||
-- extensions = {},
|
||||
-- })
|
||||
-- end,
|
||||
-- },
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
-- Setup nvim-cmp.
|
||||
local status_ok, npairs = pcall(require, "nvim-autopairs")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
-- local Rule = require("nvim-autopairs.rule")
|
||||
|
||||
npairs.setup({
|
||||
check_ts = true,
|
||||
ts_config = {
|
||||
lua = { "string", "source" },
|
||||
javascript = { "string", "template_string" },
|
||||
java = false,
|
||||
},
|
||||
disable_filetype = { "TelescopePrompt", "spectre_panel" },
|
||||
fast_wrap = {
|
||||
map = "<M-e>",
|
||||
chars = { "{", "[", "(", '"', "'", "`" },
|
||||
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""),
|
||||
offset = 0, -- Offset from pattern match
|
||||
end_key = "$",
|
||||
keys = "qwertyuiopzxcvbnmasdfghjkl",
|
||||
check_comma = true,
|
||||
highlight = "PmenuSel",
|
||||
highlight_grey = "LineNr",
|
||||
},
|
||||
})
|
||||
|
||||
-- npairs.add_rules({
|
||||
-- Rule("/", ">"):with_pair(function(opts)
|
||||
-- local pair = opts.line:sub(opts.col, opts.col + 1)
|
||||
-- if (vim.bo.filetype == "jsx" or vim.bo.filetype == "tsx") and pair == "/" then
|
||||
-- return npairs.esc("/>") .. "<esc>i"
|
||||
-- end
|
||||
-- end),
|
||||
-- })
|
||||
-- If you want insert `(` after select function or method item
|
||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||
local cmp_status_ok, cmp = pcall(require, "cmp")
|
||||
if not cmp_status_ok then
|
||||
return
|
||||
end
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } }))
|
|
@ -1,10 +0,0 @@
|
|||
local status_ok, cfg = pcall(require, "nvim-treesitter.configs")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
cfg.setup({
|
||||
autotag = {
|
||||
enable = true,
|
||||
},
|
||||
})
|
|
@ -1,161 +0,0 @@
|
|||
local status_ok, bufferline = pcall(require, "bufferline")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local icons = require("user.icons")
|
||||
local use_icons = true
|
||||
|
||||
-- get folder name from current directory
|
||||
local _get_folder_name = function()
|
||||
local str = vim.fn.fnamemodify(vim.fn.getcwd(), ":t")
|
||||
return " " .. str:lower():gsub("^%l", string.upper) .. " "
|
||||
end
|
||||
|
||||
local function diagnostics_indicator(num, _, diagnostics, _)
|
||||
local result = {}
|
||||
local symbols = {
|
||||
error = icons.diagnostics.Error,
|
||||
warning = icons.diagnostics.Warning,
|
||||
info = icons.diagnostics.Information,
|
||||
}
|
||||
if not use_icons then
|
||||
return "(" .. num .. ")"
|
||||
end
|
||||
for name, count in pairs(diagnostics) do
|
||||
if symbols[name] and count > 0 then
|
||||
table.insert(result, symbols[name] .. " " .. count)
|
||||
end
|
||||
end
|
||||
result = table.concat(result, " ")
|
||||
return #result > 0 and result or ""
|
||||
end
|
||||
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
bufferline.setup({
|
||||
options = {
|
||||
color_icons = true,
|
||||
numbers = "none", -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string,
|
||||
close_command = function(bufnum)
|
||||
require("bufdelete").bufdelete(bufnum, true)
|
||||
end,
|
||||
right_mouse_command = function(bufnum)
|
||||
require("bufdelete").bufdelete(bufnum, true)
|
||||
end,
|
||||
-- close_command = "bdelete! %d",
|
||||
-- right_mouse_command = "bdelete! %d",
|
||||
left_mouse_command = "buffer %d",
|
||||
middle_mouse_command = nil,
|
||||
|
||||
indicator_icon = nil,
|
||||
indicator = { style = "icon", icon = icons.ui.BoldLineLeft },
|
||||
buffer_close_icon = icons.ui.Close,
|
||||
modified_icon = icons.ui.Circle,
|
||||
close_icon = icons.ui.BoldClose,
|
||||
left_trunc_marker = icons.ui.ArrowCircleLeft,
|
||||
right_trunc_marker = icons.ui.ArrowCircleRight,
|
||||
max_name_length = 30,
|
||||
max_prefix_length = 30,
|
||||
tab_size = 21,
|
||||
diagnostics = false, -- | "nvim_lsp" | "coc",
|
||||
diagnostics_update_in_insert = false,
|
||||
diagnostics_indicator = diagnostics_indicator,
|
||||
offsets = {
|
||||
{
|
||||
filetype = "NvimTree",
|
||||
text = _get_folder_name(),
|
||||
highlight = "Directory",
|
||||
text_align = "left",
|
||||
padding = 1,
|
||||
},
|
||||
{
|
||||
filetype = "neo-tree",
|
||||
text = _get_folder_name(),
|
||||
highlight = "Directory",
|
||||
text_align = "left",
|
||||
padding = 1,
|
||||
},
|
||||
},
|
||||
show_buffer_icons = true,
|
||||
show_buffer_close_icons = true,
|
||||
show_close_icon = true,
|
||||
show_tab_indicators = true,
|
||||
persist_buffer_sort = true, -- whether or not custom sorted buffers should persist
|
||||
separator_style = "thin", -- | "thick" | "thin" | { 'any', 'any' },
|
||||
enforce_regular_tabs = true,
|
||||
always_show_bufferline = true,
|
||||
},
|
||||
highlights = {
|
||||
background = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
buffer_visible = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
close_button = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
close_button_visible = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
tab_selected = {
|
||||
fg = { attribute = "fg", highlight = "Normal" },
|
||||
bg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
tab = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
tab_close = {
|
||||
-- fg = {attribute='fg',highlight='LspDiagnosticsDefaultError'},
|
||||
fg = { attribute = "fg", highlight = "TabLineSel" },
|
||||
bg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
duplicate_selected = {
|
||||
fg = { attribute = "fg", highlight = "TabLineSel" },
|
||||
bg = { attribute = "bg", highlight = "TabLineSel" },
|
||||
underline = true,
|
||||
},
|
||||
duplicate_visible = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
underline = true,
|
||||
},
|
||||
duplicate = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
underline = true,
|
||||
},
|
||||
|
||||
modified = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
modified_selected = {
|
||||
fg = { attribute = "fg", highlight = "Normal" },
|
||||
bg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
modified_visible = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
|
||||
separator = {
|
||||
fg = { attribute = "bg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
separator_selected = {
|
||||
fg = { attribute = "bg", highlight = "Normal" },
|
||||
bg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
indicator_selected = {
|
||||
fg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" },
|
||||
bg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
},
|
||||
})
|
|
@ -1,218 +0,0 @@
|
|||
local status_ok, bufferline = pcall(require, "bufferline")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local icons = require("user.icons")
|
||||
local use_icons = true
|
||||
|
||||
local function diagnostics_indicator(num, _, diagnostics, _)
|
||||
local result = {}
|
||||
local symbols = {
|
||||
error = icons.diagnostics.Error,
|
||||
warning = icons.diagnostics.Warning,
|
||||
info = icons.diagnostics.Information,
|
||||
}
|
||||
if not use_icons then
|
||||
return "(" .. num .. ")"
|
||||
end
|
||||
for name, count in pairs(diagnostics) do
|
||||
if symbols[name] and count > 0 then
|
||||
table.insert(result, symbols[name] .. " " .. count)
|
||||
end
|
||||
end
|
||||
result = table.concat(result, " ")
|
||||
return #result > 0 and result or ""
|
||||
end
|
||||
|
||||
bufferline.setup({
|
||||
options = {
|
||||
color_icons = true,
|
||||
numbers = "none", -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string,
|
||||
--close_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||
close_command = function(bufnum)
|
||||
require("bufdelete").bufdelete(bufnum, true)
|
||||
end,
|
||||
--right_mouse_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||
right_mouse_command = function(bufnum)
|
||||
require("bufdelete").bufdelete(bufnum, true)
|
||||
end,
|
||||
left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions"
|
||||
middle_mouse_command = nil, -- can be a string | function, see "Mouse actions"
|
||||
-- NOTE: this plugin is designed with this icon in mind,
|
||||
-- and so changing this is NOT recommended, this is intended
|
||||
-- as an escape hatch for people who cannot bear it for whatever reason
|
||||
indicator_icon = nil,
|
||||
indicator = { style = "icon", icon = "▎" },
|
||||
--buffer_close_icon = "",
|
||||
buffer_close_icon = icons.ui.Close,
|
||||
-- buffer_close_icon = '',
|
||||
-- modified_icon = "●",
|
||||
modified_icon = icons.ui.Circle,
|
||||
-- close_icon = "",
|
||||
close_icon = icons.ui.BoldClose,
|
||||
-- close_icon = '',
|
||||
--left_trunc_marker = "",
|
||||
left_trunc_marker = icons.ui.ArrowCircleLeft,
|
||||
--right_trunc_marker = "",
|
||||
right_trunc_marker = icons.ui.ArrowCircleRight,
|
||||
--- name_formatter can be used to change the buffer's label in the bufferline.
|
||||
--- Please note some names can/will break the
|
||||
--- bufferline so use this at your discretion knowing that it has
|
||||
--- some limitations that will *NOT* be fixed.
|
||||
-- name_formatter = function(buf) -- buf contains a "name", "path" and "bufnr"
|
||||
-- -- remove extension from markdown files for example
|
||||
-- if buf.name:match('%.md') then
|
||||
-- return vim.fn.fnamemodify(buf.name, ':t:r')
|
||||
-- end
|
||||
-- end,
|
||||
max_name_length = 30,
|
||||
max_prefix_length = 30, -- prefix used when a buffer is de-duplicated
|
||||
tab_size = 21,
|
||||
diagnostics = false, -- | "nvim_lsp" | "coc",
|
||||
diagnostics_update_in_insert = false,
|
||||
diagnostics_indicator = diagnostics_indicator,
|
||||
-- diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
||||
-- return "("..count..")"
|
||||
-- end,
|
||||
-- NOTE: this will be called a lot so don't do any heavy processing here
|
||||
-- custom_filter = function(buf_number)
|
||||
-- -- filter out filetypes you don't want to see
|
||||
-- if vim.bo[buf_number].filetype ~= "<i-dont-want-to-see-this>" then
|
||||
-- return true
|
||||
-- end
|
||||
-- -- filter out by buffer name
|
||||
-- if vim.fn.bufname(buf_number) ~= "<buffer-name-I-dont-want>" then
|
||||
-- return true
|
||||
-- end
|
||||
-- -- filter out based on arbitrary rules
|
||||
-- -- e.g. filter out vim wiki buffer from tabline in your work repo
|
||||
-- if vim.fn.getcwd() == "<work-repo>" and vim.bo[buf_number].filetype ~= "wiki" then
|
||||
-- return true
|
||||
-- end
|
||||
-- end,
|
||||
offsets = {
|
||||
{
|
||||
filetype = "NvimTree",
|
||||
text = "Explorer",
|
||||
highlight = "Directory",
|
||||
text_align = "left",
|
||||
padding = 1,
|
||||
},
|
||||
{
|
||||
filetype = "neo-tree",
|
||||
text = "Explorer",
|
||||
highlight = "Directory",
|
||||
text_align = "left",
|
||||
padding = 1,
|
||||
},
|
||||
},
|
||||
show_buffer_icons = true,
|
||||
show_buffer_close_icons = true,
|
||||
show_close_icon = true,
|
||||
show_tab_indicators = true,
|
||||
persist_buffer_sort = true, -- whether or not custom sorted buffers should persist
|
||||
-- can also be a table containing 2 custom separators
|
||||
-- [focused and unfocused]. eg: { '|', '|' }
|
||||
separator_style = "thin", -- | "thick" | "thin" | { 'any', 'any' },
|
||||
enforce_regular_tabs = true,
|
||||
always_show_bufferline = true,
|
||||
-- sort_by = 'id' | 'extension' | 'relative_directory' | 'directory' | 'tabs' | function(buffer_a, buffer_b)
|
||||
-- -- add custom logic
|
||||
-- return buffer_a.modified > buffer_b.modified
|
||||
-- end
|
||||
},
|
||||
highlights = {
|
||||
fill = {
|
||||
fg = { attribute = "fg", highlight = "#ff0000" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
background = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
|
||||
-- buffer_selected = {
|
||||
-- fg = {attribute='fg',highlight='#ff0000'},
|
||||
-- bg = {attribute='bg',highlight='#0000ff'},
|
||||
-- gui = 'none'
|
||||
-- },
|
||||
buffer_visible = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
|
||||
close_button = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
close_button_visible = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
-- close_button_selected = {
|
||||
-- fg = {attribute='fg',highlight='TabLineSel'},
|
||||
-- bg ={attribute='bg',highlight='TabLineSel'}
|
||||
-- },
|
||||
|
||||
tab_selected = {
|
||||
fg = { attribute = "fg", highlight = "Normal" },
|
||||
bg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
tab = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
tab_close = {
|
||||
-- fg = {attribute='fg',highlight='LspDiagnosticsDefaultError'},
|
||||
fg = { attribute = "fg", highlight = "TabLineSel" },
|
||||
bg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
|
||||
duplicate_selected = {
|
||||
fg = { attribute = "fg", highlight = "TabLineSel" },
|
||||
bg = { attribute = "bg", highlight = "TabLineSel" },
|
||||
underline = true,
|
||||
},
|
||||
duplicate_visible = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
underline = true,
|
||||
},
|
||||
duplicate = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
underline = true,
|
||||
},
|
||||
|
||||
modified = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
modified_selected = {
|
||||
fg = { attribute = "fg", highlight = "Normal" },
|
||||
bg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
modified_visible = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
|
||||
separator = {
|
||||
fg = { attribute = "bg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
separator_selected = {
|
||||
fg = { attribute = "bg", highlight = "Normal" },
|
||||
bg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
-- separator_visible = {
|
||||
-- fg = {attribute='bg',highlight='TabLine'},
|
||||
-- bg = {attribute='bg',highlight='TabLine'}
|
||||
-- },
|
||||
indicator_selected = {
|
||||
fg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" },
|
||||
bg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
},
|
||||
})
|
|
@ -1,37 +0,0 @@
|
|||
require("cmp").setup.cmdline({ "/", "?" }, {
|
||||
mapping = require("cmp").mapping.preset.cmdline({
|
||||
["<C-z>"] = {
|
||||
c = function()
|
||||
if require("cmp").visible() then
|
||||
require("cmp").select_next_item()
|
||||
else
|
||||
require("cmp").complete()
|
||||
end
|
||||
end,
|
||||
},
|
||||
["<C-e>"] = { c = require("cmp").mapping.abort() },
|
||||
["<C-y>"] = { c = require("cmp").mapping.confirm({ select = false }) },
|
||||
}),
|
||||
sources = require("cmp").config.sources({ { name = "buffer", keyword_length = 1 } }),
|
||||
})
|
||||
|
||||
require("cmp").setup.cmdline(":", {
|
||||
mapping = require("cmp").mapping.preset.cmdline({
|
||||
["<C-z>"] = {
|
||||
c = function()
|
||||
if require("cmp").visible() then
|
||||
require("cmp").select_next_item()
|
||||
else
|
||||
require("cmp").complete()
|
||||
end
|
||||
end,
|
||||
},
|
||||
["<C-e>"] = { c = require("cmp").mapping.abort() },
|
||||
["<C-y>"] = { c = require("cmp").mapping.confirm({ select = false }) },
|
||||
}),
|
||||
sources = require("cmp").config.sources({
|
||||
{ name = "path", keyword_length = 1 },
|
||||
}, {
|
||||
{ name = "cmdline", keyword_length = 1 },
|
||||
}),
|
||||
})
|
164
lua/user/cmp.lua
164
lua/user/cmp.lua
|
@ -1,164 +0,0 @@
|
|||
local cmp_status_ok, cmp = pcall(require, "cmp")
|
||||
if not cmp_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local snip_status_ok, luasnip = pcall(require, "luasnip")
|
||||
if not snip_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
require("luasnip/loaders/from_vscode").lazy_load()
|
||||
|
||||
local check_backspace = function()
|
||||
local col = vim.fn.col(".") - 1
|
||||
return col == 0 or vim.fn.getline("."):sub(col, col):match("%s")
|
||||
end
|
||||
|
||||
-- פּ ﯟ some other good icons
|
||||
-- local kind_icons = {
|
||||
-- Text = "",
|
||||
-- Method = "m",
|
||||
-- Function = "",
|
||||
-- Constructor = "",
|
||||
-- Field = "",
|
||||
-- Variable = "",
|
||||
-- Class = "",
|
||||
-- Interface = "",
|
||||
-- Module = "",
|
||||
-- Property = "",
|
||||
-- Unit = "",
|
||||
-- Value = "",
|
||||
-- Enum = "",
|
||||
-- Keyword = "",
|
||||
-- Snippet = "",
|
||||
-- Color = "",
|
||||
-- File = "",
|
||||
-- Reference = "",
|
||||
-- Folder = "",
|
||||
-- EnumMember = "",
|
||||
-- Constant = "",
|
||||
-- Struct = "",
|
||||
-- Event = "",
|
||||
-- Operator = "",
|
||||
-- TypeParameter = "",
|
||||
-- }
|
||||
-- find more here: https://www.nerdfonts.com/cheat-sheet
|
||||
local new_kind_icon = require("user.icons")
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body) -- For `luasnip` users.
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
["<Up>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }),
|
||||
["<Down>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }),
|
||||
["<C-k>"] = cmp.mapping.select_prev_item(),
|
||||
["<C-j>"] = cmp.mapping.select_next_item(),
|
||||
["<C-b>"] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }),
|
||||
["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }),
|
||||
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
|
||||
["<C-y>"] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
|
||||
["<C-e>"] = cmp.mapping({
|
||||
i = cmp.mapping.abort(),
|
||||
c = cmp.mapping.close(),
|
||||
}),
|
||||
-- Accept currently selected item. If none selected, `select` first item.
|
||||
-- Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expandable() then
|
||||
luasnip.expand()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
elseif check_backspace() then
|
||||
fallback()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, {
|
||||
"i",
|
||||
"s",
|
||||
}),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, {
|
||||
"i",
|
||||
"s",
|
||||
}),
|
||||
},
|
||||
formatting = {
|
||||
fields = { "kind", "abbr", "menu" },
|
||||
format = function(entry, vim_item)
|
||||
-- Kind icons
|
||||
-- vim_item.kind = string.format("%s", kind_icons[vim_item.kind])
|
||||
vim_item.kind = string.format("%s", new_kind_icon["kind"][vim_item.kind])
|
||||
-- vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind
|
||||
vim_item.menu = ({
|
||||
-- nvim_lsp = "[LSP]",
|
||||
-- luasnip = "[Snippet]",
|
||||
-- buffer = "[Buffer]",
|
||||
-- path = "[Path]",
|
||||
nvim_lsp = "(LSP)",
|
||||
luasnip = "(Snippet)",
|
||||
buffer = "(Buffer)",
|
||||
path = "(Path)",
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
end,
|
||||
},
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
},
|
||||
confirm_opts = {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = false,
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
-- documentation = {
|
||||
-- border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" },
|
||||
-- },
|
||||
},
|
||||
experimental = {
|
||||
ghost_text = false,
|
||||
native_menu = false,
|
||||
},
|
||||
})
|
||||
|
||||
-- for cmd line
|
||||
-- cmp.setup.cmdline("/", {
|
||||
-- mapping = cmp.mapping.preset.cmdline(),
|
||||
-- sources = {
|
||||
-- { name = "buffer" },
|
||||
-- },
|
||||
-- })
|
||||
--
|
||||
-- -- `:` cmdline setup.
|
||||
-- cmp.setup.cmdline(":", {
|
||||
-- mapping = cmp.mapping.preset.cmdline(),
|
||||
-- sources = cmp.config.sources({
|
||||
-- { name = "path" },
|
||||
-- }, {
|
||||
-- {
|
||||
-- name = "cmdline",
|
||||
-- option = {
|
||||
-- ignore_cmds = { "Man", "!" },
|
||||
-- },
|
||||
-- },
|
||||
-- }),
|
||||
-- })
|
|
@ -1,56 +0,0 @@
|
|||
local status_ok, code_runner = pcall(require, "code_runner")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local rfile = {
|
||||
java = "cd $dir && javac $fileName && java $fileNameWithoutExt",
|
||||
python = "python3 -u",
|
||||
--typescript = "deno run",
|
||||
typescript = "ts-node $dir/$fileName", -- npm install -g ts-node
|
||||
rust = "cd $dir && rustc $fileName && $dir/$fileNameWithoutExt",
|
||||
-- cpp="gcc $fileName -lstdc++ -o $fileNameWithoutExt && $fileNameWithoutExt"
|
||||
cpp = "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir/$fileNameWithoutExt",
|
||||
scss = "sass $dir/$fileName $dir/$fileNameWithoutExt.css",
|
||||
javascript = 'node "$dir/$fileName"',
|
||||
}
|
||||
|
||||
local data_exists, runscript = pcall(require, "core.config")
|
||||
if data_exists then
|
||||
if runscript.coderunner ~= nil then
|
||||
rfile = vim.tbl_deep_extend("force", runscript.coderunner, rfile)
|
||||
end
|
||||
end
|
||||
|
||||
code_runner.setup({
|
||||
-- put here the commands by filetype
|
||||
filetype = rfile,
|
||||
-- mode = "term",
|
||||
mode = "float",
|
||||
focus = true,
|
||||
startinsert = true,
|
||||
term = {
|
||||
--position = "vert",
|
||||
position = "bot",
|
||||
size = 50,
|
||||
},
|
||||
float = {
|
||||
-- Key that close the code_runner floating window
|
||||
close_key = "<ESC>",
|
||||
-- Window border (see ':h nvim_open_win')
|
||||
border = "rounded",
|
||||
|
||||
-- Num from `0 - 1` for measurements
|
||||
height = 0.8,
|
||||
width = 0.8,
|
||||
x = 0.5,
|
||||
y = 0.5,
|
||||
|
||||
-- Highlight group for floating window/border (see ':h winhl')
|
||||
border_hl = "FloatBorder",
|
||||
float_hl = "Normal",
|
||||
|
||||
-- Transparency (see ':h winblend')
|
||||
blend = 0,
|
||||
},
|
||||
})
|
|
@ -1,23 +0,0 @@
|
|||
local status_ok, colorizer_cfg = pcall(require, "colorizer")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
colorizer_cfg.setup({
|
||||
DEFAULT_OPTIONS = {
|
||||
RGB = true, -- #RGB hex codes
|
||||
RRGGBB = true, -- #RRGGBB hex codes
|
||||
names = true, -- "Name" codes like Blue
|
||||
RRGGBBAA = true, -- #RRGGBBAA hex codes
|
||||
rgb_fn = true, -- CSS rgb() and rgba() functions
|
||||
hsl_fn = true, -- CSS hsl() and hsla() functions
|
||||
css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
|
||||
css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn
|
||||
-- Available modes: foreground, background
|
||||
mode = "background", -- Set the display mode.
|
||||
},
|
||||
filetypes = {
|
||||
"*", -- Highlight all files, but customize some others.
|
||||
css = { rgb_fn = true }, -- Enable parsing rgb(...) functions in css.
|
||||
html = { names = false }, -- Disable parsing "names" like Blue or Gray
|
||||
},
|
||||
})
|
|
@ -1,33 +0,0 @@
|
|||
local status_ok, comment = pcall(require, "Comment")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
comment.setup({
|
||||
pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(),
|
||||
-- pre_hook = function(ctx)
|
||||
-- local U = require("Comment.utils")
|
||||
--
|
||||
-- local status_utils_ok, utils = pcall(require, "ts_context_commentstring.utils")
|
||||
-- if not status_utils_ok then
|
||||
-- return
|
||||
-- end
|
||||
|
||||
-- local location = nil
|
||||
-- if ctx.ctype == U.ctype.block then
|
||||
-- location = utils.get_cursor_location()
|
||||
-- elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then
|
||||
-- location = utils.get_visual_start_location()
|
||||
-- end
|
||||
|
||||
-- local status_internals_ok, internals = pcall(require, "ts_context_commentstring.internals")
|
||||
-- if not status_internals_ok then
|
||||
-- return
|
||||
-- end
|
||||
|
||||
-- return internals.calculate_commentstring({
|
||||
-- key = ctx.ctype == U.ctype.line and "__default" or "__multiline",
|
||||
-- location = location,
|
||||
-- })
|
||||
-- end,
|
||||
})
|
|
@ -1,20 +0,0 @@
|
|||
local status_ok, dressing = pcall(require, "dressing")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
dressing.setup({
|
||||
input = {
|
||||
title_pos = "center",
|
||||
relative = "editor",
|
||||
default_prompt = "➤ ",
|
||||
win_options = { winhighlight = "Normal:Normal,NormalNC:Normal" },
|
||||
prefer_width = 30,
|
||||
max_width = { 140, 0.9 },
|
||||
min_width = { 50, 0.2 },
|
||||
},
|
||||
select = {
|
||||
backend = { "telescope", "builtin" },
|
||||
builtin = { win_options = { winhighlight = "Normal:Normal,NormalNC:Normal" } },
|
||||
},
|
||||
})
|
|
@ -1,70 +0,0 @@
|
|||
local status_ok, gitsigns = pcall(require, "gitsigns")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
local icons = require("user.icons")
|
||||
|
||||
gitsigns.setup({
|
||||
signs = {
|
||||
add = {
|
||||
hl = "GitSignsAdd",
|
||||
text = icons.ui.BoldLineLeft,
|
||||
numhl = "GitSignsAddNr",
|
||||
linehl = "GitSignsAddLn",
|
||||
},
|
||||
change = {
|
||||
hl = "GitSignsChange",
|
||||
text = icons.ui.BoldLineLeft,
|
||||
numhl = "GitSignsChangeNr",
|
||||
linehl = "GitSignsChangeLn",
|
||||
},
|
||||
delete = {
|
||||
hl = "GitSignsDelete",
|
||||
text = icons.ui.Triangle,
|
||||
numhl = "GitSignsDeleteNr",
|
||||
linehl = "GitSignsDeleteLn",
|
||||
},
|
||||
topdelete = {
|
||||
hl = "GitSignsDelete",
|
||||
text = icons.ui.Triangle,
|
||||
numhl = "GitSignsDeleteNr",
|
||||
linehl = "GitSignsDeleteLn",
|
||||
},
|
||||
changedelete = {
|
||||
hl = "GitSignsChange",
|
||||
text = icons.ui.BoldLineLeft,
|
||||
numhl = "GitSignsChangeNr",
|
||||
linehl = "GitSignsChangeLn",
|
||||
},
|
||||
},
|
||||
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 },
|
||||
})
|
|
@ -1,160 +0,0 @@
|
|||
return {
|
||||
kind = {
|
||||
Array = "",
|
||||
Boolean = "",
|
||||
Class = "",
|
||||
Color = "",
|
||||
Constant = "",
|
||||
Constructor = "",
|
||||
Enum = "",
|
||||
EnumMember = "",
|
||||
Event = "",
|
||||
Field = "",
|
||||
File = "",
|
||||
Folder = "",
|
||||
Function = "",
|
||||
Interface = "",
|
||||
Key = "",
|
||||
Keyword = "",
|
||||
Method = "",
|
||||
Module = "",
|
||||
Namespace = "",
|
||||
Null = "",
|
||||
Number = "",
|
||||
Object = "",
|
||||
Operator = "",
|
||||
Package = "",
|
||||
Property = "",
|
||||
Reference = "",
|
||||
Snippet = "",
|
||||
String = "",
|
||||
Struct = "",
|
||||
Text = "",
|
||||
TypeParameter = "",
|
||||
Unit = "",
|
||||
Value = "",
|
||||
Variable = "",
|
||||
},
|
||||
git = {
|
||||
LineAdded = "",
|
||||
LineModified = "",
|
||||
LineRemoved = "",
|
||||
FileDeleted = "",
|
||||
FileIgnored = "◌",
|
||||
FileRenamed = "",
|
||||
FileStaged = "S",
|
||||
FileUnmerged = "",
|
||||
FileUnstaged = "",
|
||||
FileUntracked = "U",
|
||||
Diff = "",
|
||||
Repo = "",
|
||||
Octoface = "",
|
||||
Branch = "",
|
||||
},
|
||||
ui = {
|
||||
ArrowCircleDown = "",
|
||||
ArrowCircleLeft = "",
|
||||
ArrowCircleRight = "",
|
||||
ArrowCircleUp = "",
|
||||
BoldArrowDown = "",
|
||||
BoldArrowLeft = "",
|
||||
BoldArrowRight = "",
|
||||
BoldArrowUp = "",
|
||||
BoldClose = "",
|
||||
BoldDividerLeft = "",
|
||||
BoldDividerRight = "",
|
||||
BoldLineLeft = "▎",
|
||||
BookMark = "",
|
||||
BoxChecked = "",
|
||||
Bug = "",
|
||||
Stacks = "",
|
||||
Scopes = "",
|
||||
Watches = "",
|
||||
DebugConsole = "",
|
||||
Calendar = "",
|
||||
Check = "",
|
||||
ChevronRight = ">",
|
||||
ChevronShortDown = "",
|
||||
ChevronShortLeft = "",
|
||||
ChevronShortRight = "",
|
||||
ChevronShortUp = "",
|
||||
Circle = "",
|
||||
Dot = "",
|
||||
Close = "",
|
||||
CloudDownload = "",
|
||||
Code = "",
|
||||
Comment = "",
|
||||
Dashboard = "",
|
||||
DividerLeft = "",
|
||||
DividerRight = "",
|
||||
DoubleChevronRight = "»",
|
||||
Ellipsis = "",
|
||||
-- EmptyFolder = "",
|
||||
-- EmptyFolderOpen = "",
|
||||
EmptyFolder = "",
|
||||
EmptyFolderOpen = "",
|
||||
File = "",
|
||||
FileSymlink = "",
|
||||
Files = "",
|
||||
FindFile = "",
|
||||
FindText = "",
|
||||
Fire = "",
|
||||
-- Folder = "",
|
||||
-- FolderOpen = "",
|
||||
Folder = "",
|
||||
FolderOpen = "",
|
||||
FolderSymlink = "",
|
||||
Forward = "",
|
||||
Gear = "",
|
||||
History = "",
|
||||
Lightbulb = "",
|
||||
LineLeft = "▏",
|
||||
LineMiddle = "│",
|
||||
List = "",
|
||||
Lock = "",
|
||||
NewFile = "",
|
||||
Note = "",
|
||||
Package = "",
|
||||
Pencil = "",
|
||||
Plus = "",
|
||||
Project = "",
|
||||
Search = "",
|
||||
SignIn = "",
|
||||
SignOut = "",
|
||||
Tab = "",
|
||||
Table = "",
|
||||
Target = "",
|
||||
Telescope = "",
|
||||
Text = "",
|
||||
Tree = "",
|
||||
Triangle = "▸",
|
||||
TriangleShortArrowDown = "",
|
||||
TriangleShortArrowLeft = "",
|
||||
TriangleShortArrowRight = "",
|
||||
TriangleShortArrowUp = "",
|
||||
Neovim = "",
|
||||
},
|
||||
diagnostics = {
|
||||
BoldError = "",
|
||||
Error = "",
|
||||
BoldWarning = "",
|
||||
Warning = "",
|
||||
BoldInformation = "",
|
||||
Information = "",
|
||||
BoldQuestion = "",
|
||||
Question = "",
|
||||
BoldHint = "",
|
||||
Hint = "",
|
||||
Debug = "",
|
||||
Trace = "✎",
|
||||
},
|
||||
misc = {
|
||||
Robot = "ﮧ",
|
||||
Squirrel = "",
|
||||
Tag = "",
|
||||
Watch = "",
|
||||
Smiley = "",
|
||||
Package = "",
|
||||
CircuitBoard = "",
|
||||
},
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
require("indent-o-matic").setup({
|
||||
-- Global settings (optional, used as fallback)
|
||||
max_lines = 2048,
|
||||
standard_widths = { 2, 4, 8 },
|
||||
|
||||
-- Disable indent-o-matic for LISP files
|
||||
filetype_lisp = {
|
||||
max_lines = 0,
|
||||
},
|
||||
|
||||
-- Only detect 4 spaces and tabs for java
|
||||
filetype_java = {
|
||||
standard_widths = { 4 },
|
||||
},
|
||||
|
||||
-- Don't detect 8 spaces indentations inside files without a filetype
|
||||
filetype_ = {
|
||||
standard_widths = { 2, 4 },
|
||||
},
|
||||
})
|
|
@ -1,25 +0,0 @@
|
|||
local status_ok, indent_blankline = pcall(require, "ibl")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
local icons = require("user.icons")
|
||||
indent_blankline.setup({
|
||||
enabled = true,
|
||||
buftype_exclude = { "terminal", "nofile" },
|
||||
filetype_exclude = {
|
||||
"help",
|
||||
"startify",
|
||||
"dashboard",
|
||||
"lazy",
|
||||
"neogitstatus",
|
||||
"NvimTree",
|
||||
"Trouble",
|
||||
"text",
|
||||
},
|
||||
char = icons.ui.LineLeft,
|
||||
context_char = icons.ui.LineLeft,
|
||||
show_trailing_blankline_indent = false,
|
||||
show_first_indent_level = true,
|
||||
use_treesitter = true,
|
||||
show_current_context = true,
|
||||
})
|
|
@ -1,71 +0,0 @@
|
|||
local status_ok, indent_blankline = pcall(require, "ibl")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
vim.g.indent_blankline_buftype_exclude = { "terminal", "nofile" }
|
||||
vim.g.indent_blankline_filetype_exclude = {
|
||||
"help",
|
||||
"startify",
|
||||
"dashboard",
|
||||
"packer",
|
||||
"neogitstatus",
|
||||
"NvimTree",
|
||||
"Trouble",
|
||||
}
|
||||
vim.g.indentLine_enabled = 1
|
||||
-- vim.g.indent_blankline_char = "│"
|
||||
-- vim.g.indent_blankline_char = "▏"
|
||||
vim.g.indent_blankline_char = " "
|
||||
-- vim.g.indent_blankline_char = "▎"
|
||||
vim.g.indent_blankline_show_trailing_blankline_indent = false
|
||||
vim.g.indent_blankline_show_first_indent_level = true
|
||||
vim.g.indent_blankline_use_treesitter = true
|
||||
vim.g.indent_blankline_show_current_context = true
|
||||
vim.g.indent_blankline_context_patterns = {
|
||||
"class",
|
||||
"return",
|
||||
"function",
|
||||
"method",
|
||||
"^if",
|
||||
"^while",
|
||||
"jsx_element",
|
||||
"^for",
|
||||
"^object",
|
||||
"^table",
|
||||
"block",
|
||||
"arguments",
|
||||
"if_statement",
|
||||
"else_clause",
|
||||
"jsx_element",
|
||||
"jsx_self_closing_element",
|
||||
"try_statement",
|
||||
"catch_clause",
|
||||
"import_statement",
|
||||
"operation_type",
|
||||
}
|
||||
-- HACK: work-around for https://github.com/lukas-reineke/indent-blankline.nvim/issues/59
|
||||
vim.wo.colorcolumn = "99999"
|
||||
|
||||
-- vim.cmd [[highlight IndentBlanklineIndent1 guifg=#E06C75 gui=nocombine]]
|
||||
-- vim.cmd [[highlight IndentBlanklineIndent2 guifg=#E5C07B gui=nocombine]]
|
||||
-- vim.cmd [[highlight IndentBlanklineIndent3 guifg=#98C379 gui=nocombine]]
|
||||
-- vim.cmd [[highlight IndentBlanklineIndent4 guifg=#56B6C2 gui=nocombine]]
|
||||
-- vim.cmd [[highlight IndentBlanklineIndent5 guifg=#61AFEF gui=nocombine]]
|
||||
-- vim.cmd [[highlight IndentBlanklineIndent6 guifg=#C678DD gui=nocombine]]
|
||||
-- vim.opt.list = true
|
||||
-- vim.opt.listchars:append "space:⋅"
|
||||
-- vim.opt.listchars:append "space:"
|
||||
-- vim.opt.listchars:append "eol:↴"
|
||||
|
||||
indent_blankline.setup({
|
||||
-- show_end_of_line = true,
|
||||
-- space_char_blankline = " ",
|
||||
-- show_current_context = true,
|
||||
-- show_current_context_start = true,
|
||||
-- char_highlight_list = {
|
||||
-- "IndentBlanklineIndent1",
|
||||
-- "IndentBlanklineIndent2",
|
||||
-- "IndentBlanklineIndent3",
|
||||
-- },
|
||||
})
|
|
@ -1,83 +0,0 @@
|
|||
local servers = {
|
||||
"sumneko_lua",
|
||||
"cssls",
|
||||
"html",
|
||||
"tsserver",
|
||||
"pyright",
|
||||
"jsonls",
|
||||
"emmet_ls",
|
||||
}
|
||||
|
||||
local function idxOf(array, value)
|
||||
for i, v in ipairs(array) do
|
||||
if v == value then
|
||||
return i
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
local data_exists, custom_lsp = pcall(require, "core.config")
|
||||
if data_exists then
|
||||
for _, client in pairs(custom_lsp.register_lsp) do
|
||||
table.insert(servers, client)
|
||||
end
|
||||
end
|
||||
|
||||
local data_ok, unregis = pcall(require, "core.config")
|
||||
if data_ok then
|
||||
if unregis.unregister_lsp ~= nil then
|
||||
for _, unreg in pairs(unregis.unregister_lsp) do
|
||||
local my_index = idxOf(servers, unreg)
|
||||
if my_index ~= nil then
|
||||
table.remove(servers, my_index)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local settings = {
|
||||
ui = {
|
||||
border = "none",
|
||||
icons = {
|
||||
package_installed = "◍",
|
||||
package_pending = "◍",
|
||||
package_uninstalled = "◍",
|
||||
},
|
||||
},
|
||||
log_level = vim.log.levels.INFO,
|
||||
max_concurrent_installers = 4,
|
||||
}
|
||||
|
||||
require("mason").setup(settings)
|
||||
-- * buka remark ini jika akan menggunakan list serverrs diatas dan remark config dibawah
|
||||
-- require("mason-lspconfig").setup({
|
||||
-- ensure_installed = servers,
|
||||
-- automatic_installation = true,
|
||||
-- })
|
||||
--
|
||||
-- * buka remark ini jika ingin menjalankan dengan cara install dan remark config diatas (pilih satu)
|
||||
require("mason-lspconfig").setup()
|
||||
|
||||
local lspconfig_status_ok, lspconfig = pcall(require, "lspconfig")
|
||||
if not lspconfig_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local opts = {}
|
||||
|
||||
for _, server in pairs(servers) do
|
||||
opts = {
|
||||
on_attach = require("user.lsp.handlers").on_attach,
|
||||
capabilities = require("user.lsp.handlers").capabilities,
|
||||
}
|
||||
|
||||
server = vim.split(server, "@")[1]
|
||||
|
||||
local require_ok, conf_opts = pcall(require, "user.lsp.settings." .. server)
|
||||
if require_ok then
|
||||
opts = vim.tbl_deep_extend("force", conf_opts, opts)
|
||||
end
|
||||
|
||||
lspconfig[server].setup(opts)
|
||||
end
|
|
@ -1,68 +0,0 @@
|
|||
local keymap = vim.keymap.set
|
||||
-- Lsp finder find the symbol definition implement reference
|
||||
-- if there is no implement it will hide
|
||||
-- when you use action in finder like open vsplit then you can
|
||||
-- use <C-t> to jump back
|
||||
keymap("n", "gh", "<cmd>Lspsaga lsp_finder<CR>")
|
||||
|
||||
-- Code action
|
||||
keymap({ "n", "v" }, "<leader>ca", "<cmd>Lspsaga code_action<CR>")
|
||||
|
||||
-- Rename
|
||||
keymap("n", "gr", "<cmd>Lspsaga rename<CR>")
|
||||
|
||||
-- Rename word in whole project
|
||||
keymap("n", "gr", "<cmd>Lspsaga rename ++project<CR>")
|
||||
|
||||
-- Peek Definition
|
||||
-- you can edit the definition file in this float window
|
||||
-- also support open/vsplit/etc operation check definition_action_keys
|
||||
-- support tagstack C-t jump back
|
||||
keymap("n", "gd", "<cmd>Lspsaga peek_definition<CR>")
|
||||
|
||||
-- Go to Definition
|
||||
keymap("n", "gd", "<cmd>Lspsaga goto_definition<CR>")
|
||||
|
||||
-- Show line diagnostics you can pass argument ++unfocus to make
|
||||
-- show_line_diagnostics float window unfocus
|
||||
keymap("n", "<leader>sl", "<cmd>Lspsaga show_line_diagnostics<CR>")
|
||||
|
||||
-- Show cursor diagnostic
|
||||
-- also like show_line_diagnostics support pass ++unfocus
|
||||
keymap("n", "<leader>sc", "<cmd>Lspsaga show_cursor_diagnostics<CR>")
|
||||
|
||||
-- Show buffer diagnostic
|
||||
keymap("n", "<leader>sb", "<cmd>Lspsaga show_buf_diagnostics<CR>")
|
||||
|
||||
-- Diagnostic jump can use `<c-o>` to jump back
|
||||
keymap("n", "[e", "<cmd>Lspsaga diagnostic_jump_prev<CR>")
|
||||
keymap("n", "]e", "<cmd>Lspsaga diagnostic_jump_next<CR>")
|
||||
|
||||
-- Diagnostic jump with filter like Only jump to error
|
||||
keymap("n", "[E", function()
|
||||
require("lspsaga.diagnostic"):goto_prev({ severity = vim.diagnostic.severity.ERROR })
|
||||
end)
|
||||
keymap("n", "]E", function()
|
||||
require("lspsaga.diagnostic"):goto_next({ severity = vim.diagnostic.severity.ERROR })
|
||||
end)
|
||||
|
||||
-- Toggle Outline
|
||||
keymap("n", "<leader>o", "<cmd>Lspsaga outline<CR>")
|
||||
|
||||
-- Hover Doc
|
||||
-- if there has no hover will have a notify no information available
|
||||
-- to disable it just Lspsaga hover_doc ++quiet
|
||||
-- press twice it will jump into hover window
|
||||
keymap("n", "K", "<cmd>Lspsaga hover_doc<CR>")
|
||||
-- if you want keep hover window in right top you can use ++keep arg
|
||||
-- notice if you use hover with ++keep you press this keymap it will
|
||||
-- close the hover window .if you want jump to hover window must use
|
||||
-- wincmd command <C-w>w
|
||||
keymap("n", "K", "<cmd>Lspsaga hover_doc ++keep<CR>")
|
||||
|
||||
-- Callhierarchy
|
||||
keymap("n", "<Leader>ci", "<cmd>Lspsaga incoming_calls<CR>")
|
||||
keymap("n", "<Leader>co", "<cmd>Lspsaga outgoing_calls<CR>")
|
||||
|
||||
-- Float terminal
|
||||
keymap({ "n", "t" }, "<A-d>", "<cmd>Lspsaga term_toggle<CR>")
|
|
@ -1,163 +0,0 @@
|
|||
local status_ok, lualine = pcall(require, "lualine")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
local icons = require("user.icons")
|
||||
local hide_in_width = function()
|
||||
return vim.fn.winwidth(0) > 80
|
||||
end
|
||||
|
||||
local conditions = {
|
||||
buffer_not_empty = function()
|
||||
return vim.fn.empty(vim.fn.expand("%:t")) ~= 1
|
||||
end,
|
||||
hide_in_width = function()
|
||||
return vim.fn.winwidth(0) > 80
|
||||
end,
|
||||
check_git_workspace = function()
|
||||
local filepath = vim.fn.expand("%:p:h")
|
||||
local gitdir = vim.fn.finddir(".git", filepath .. ";")
|
||||
return gitdir and #gitdir > 0 and #gitdir < #filepath
|
||||
end,
|
||||
}
|
||||
|
||||
local diagnostics = {
|
||||
"diagnostics",
|
||||
sources = { "nvim_diagnostic" },
|
||||
sections = { "error", "warn" },
|
||||
-- symbols = { error = " ", warn = " " },
|
||||
symbols = {
|
||||
error = icons.diagnostics.BoldError .. " ",
|
||||
warn = icons.diagnostics.BoldWarning .. " ",
|
||||
},
|
||||
colored = true,
|
||||
update_in_insert = false,
|
||||
always_visible = false,
|
||||
}
|
||||
|
||||
local diff = {
|
||||
"diff",
|
||||
colored = true,
|
||||
-- symbols = { added = " ", modified = " ", removed = " " }, -- changes diff symbols
|
||||
symbols = {
|
||||
added = icons.git.LineAdded .. " ",
|
||||
modified = icons.git.LineModified .. " ",
|
||||
removed = icons.git.LineRemoved .. " ",
|
||||
}, -- changes diff symbols
|
||||
cond = hide_in_width,
|
||||
}
|
||||
|
||||
local mode = {
|
||||
"mode",
|
||||
fmt = function(str)
|
||||
return "-- " .. str .. " --"
|
||||
end,
|
||||
}
|
||||
|
||||
local filetype = {
|
||||
"filetype",
|
||||
icons_enabled = true,
|
||||
icon = nil,
|
||||
}
|
||||
|
||||
local branch = {
|
||||
"branch",
|
||||
icons_enabled = true,
|
||||
--icon = "",
|
||||
icon = icons.git.Branch,
|
||||
}
|
||||
|
||||
local location = {
|
||||
"location",
|
||||
padding = 0,
|
||||
}
|
||||
|
||||
-- cool function for progress
|
||||
local progress = function()
|
||||
local current_line = vim.fn.line(".")
|
||||
local total_lines = vim.fn.line("$")
|
||||
local chars = { "__", "▁▁", "▂▂", "▃▃", "▄▄", "▅▅", "▆▆", "▇▇", "██" }
|
||||
local line_ratio = current_line / total_lines
|
||||
local index = math.ceil(line_ratio * #chars)
|
||||
return chars[index]
|
||||
end
|
||||
|
||||
local spaces = function()
|
||||
-- return "->| " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
|
||||
return icons.ui.Tab .. " " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
|
||||
end
|
||||
|
||||
local file_name = {
|
||||
"filename",
|
||||
cond = conditions.buffer_not_empty,
|
||||
}
|
||||
|
||||
local lsp_info = {
|
||||
function()
|
||||
--local msg = "No Active Lsp"
|
||||
local msg = "LS Inactive"
|
||||
local buf_ft = vim.api.nvim_buf_get_option(0, "filetype")
|
||||
local clients = vim.lsp.get_active_clients()
|
||||
if next(clients) == nil then
|
||||
for i, name in ipairs(clients) do
|
||||
msg = msg .. " " .. name
|
||||
end
|
||||
return msg
|
||||
end
|
||||
for _, client in ipairs(clients) do
|
||||
local filetypes = client.config.filetypes
|
||||
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
|
||||
if msg == "LS Inactive" then
|
||||
msg = ""
|
||||
msg = msg .. client.name
|
||||
else
|
||||
msg = msg .. ", " .. client.name
|
||||
end
|
||||
end
|
||||
end
|
||||
return msg
|
||||
end,
|
||||
--icon = " ",
|
||||
icon = icons.ui.Gear .. "",
|
||||
}
|
||||
|
||||
lualine.setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = "auto",
|
||||
component_separators = { left = "", right = "" },
|
||||
section_separators = { left = "", right = "" },
|
||||
disabled_filetypes = {
|
||||
"TelescopePrompt",
|
||||
"packer",
|
||||
"alpha",
|
||||
"dashboard",
|
||||
"NvimTree",
|
||||
"Outline",
|
||||
"DressingInput",
|
||||
"toggleterm",
|
||||
"lazy",
|
||||
},
|
||||
always_divide_middle = true,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { branch },
|
||||
lualine_b = { mode },
|
||||
lualine_c = { diagnostics, lsp_info },
|
||||
-- lualine_c = { file_name, lsp_info },
|
||||
-- lualine_x = { "encoding", "fileformat", "filetype" },
|
||||
lualine_x = { diff, spaces, "encoding", filetype },
|
||||
lualine_y = { location },
|
||||
lualine_z = { progress },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "location" },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
extensions = {},
|
||||
})
|
|
@ -1,430 +0,0 @@
|
|||
local status_ok, lualine = pcall(require, "lualine")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
local icons = require("user.icons")
|
||||
local hide_in_width = function()
|
||||
return vim.fn.winwidth(0) > 80
|
||||
end
|
||||
|
||||
local conditions = {
|
||||
buffer_not_empty = function()
|
||||
return vim.fn.empty(vim.fn.expand("%:t")) ~= 1
|
||||
end,
|
||||
hide_in_width = function()
|
||||
return vim.fn.winwidth(0) > 80
|
||||
end,
|
||||
check_git_workspace = function()
|
||||
local filepath = vim.fn.expand("%:p:h")
|
||||
local gitdir = vim.fn.finddir(".git", filepath .. ";")
|
||||
return gitdir and #gitdir > 0 and #gitdir < #filepath
|
||||
end,
|
||||
}
|
||||
|
||||
local diagnostics = {
|
||||
"diagnostics",
|
||||
sources = { "nvim_diagnostic" },
|
||||
sections = { "error", "warn" },
|
||||
-- symbols = { error = " ", warn = " " },
|
||||
symbols = {
|
||||
error = icons.diagnostics.BoldError .. " ",
|
||||
warn = icons.diagnostics.BoldWarning .. " ",
|
||||
},
|
||||
colored = true,
|
||||
update_in_insert = false,
|
||||
always_visible = false,
|
||||
}
|
||||
|
||||
local diff = {
|
||||
"diff",
|
||||
colored = true,
|
||||
-- symbols = { added = " ", modified = " ", removed = " " }, -- changes diff symbols
|
||||
symbols = {
|
||||
added = icons.git.LineAdded .. " ",
|
||||
modified = icons.git.LineModified .. " ",
|
||||
removed = icons.git.LineRemoved .. " ",
|
||||
}, -- changes diff symbols
|
||||
cond = hide_in_width,
|
||||
}
|
||||
|
||||
-- for config style
|
||||
local component_separators = { left = "", right = "" }
|
||||
local section_separators = { left = "", right = "" }
|
||||
local icon_mode = ""
|
||||
local sts_mode = 0
|
||||
|
||||
local data_exists, custom_ui = pcall(require, "core.config")
|
||||
if data_exists then
|
||||
local ui_style = custom_ui.lualine_style
|
||||
if ui_style ~= nil then
|
||||
if custom_ui.lualine_style == 1 then
|
||||
component_separators = { left = "", right = "" }
|
||||
section_separators = { left = "", right = "" }
|
||||
elseif custom_ui.lualine_style == 2 then
|
||||
component_separators = { left = "", right = "" }
|
||||
section_separators = { left = " ", right = " " }
|
||||
elseif custom_ui.lualine_style == 3 then
|
||||
component_separators = { left = "", right = "" }
|
||||
section_separators = { left = "", right = "" }
|
||||
end
|
||||
end
|
||||
local ui_icon = custom_ui.status_icon
|
||||
if ui_icon ~= nil then
|
||||
if custom_ui.status_icon == 1 then
|
||||
icon_mode = " "
|
||||
sts_mode = 1
|
||||
elseif custom_ui.status_icon == 2 then
|
||||
icon_mode = " "
|
||||
sts_mode = 1
|
||||
end
|
||||
end
|
||||
local custom_style = custom_ui.custom_lualine
|
||||
if custom_style ~= nil and custom_style == true then
|
||||
local comp = custom_ui.component_separators
|
||||
local section = custom_ui.section_separators
|
||||
if comp ~= nil and section ~= nil then
|
||||
component_separators = comp
|
||||
section_separators = section
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local mode = {
|
||||
"mode",
|
||||
padding = 1,
|
||||
fmt = function(str)
|
||||
-- if str == "NORMAL" then
|
||||
-- str = "NOR"
|
||||
-- elseif str == "INSERT" then
|
||||
-- str = "INS"
|
||||
-- elseif str == "VISUAL" then
|
||||
-- str = "VIS"
|
||||
-- elseif str == "COMMAND" then
|
||||
-- str = "CMD"
|
||||
-- else
|
||||
-- str = str
|
||||
-- end
|
||||
|
||||
if sts_mode == 0 then
|
||||
-- return "--" .. str .. "--"
|
||||
return " " .. str
|
||||
else
|
||||
return icon_mode
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
local filetype = {
|
||||
"filetype",
|
||||
icons_enabled = true,
|
||||
icon = nil,
|
||||
}
|
||||
|
||||
local branch = {
|
||||
"branch",
|
||||
icons_enabled = true,
|
||||
--icon = "",
|
||||
icon = icons.git.Branch,
|
||||
padding = 1,
|
||||
}
|
||||
|
||||
local location = {
|
||||
"location",
|
||||
padding = 1,
|
||||
}
|
||||
|
||||
-- cool function for progress
|
||||
local progress = function()
|
||||
local current_line = vim.fn.line(".")
|
||||
local total_lines = vim.fn.line("$")
|
||||
local chars = { "__", "▁▁", "▂▂", "▃▃", "▄▄", "▅▅", "▆▆", "▇▇", "██" }
|
||||
local line_ratio = current_line / total_lines
|
||||
local index = math.ceil(line_ratio * #chars)
|
||||
return chars[index]
|
||||
end
|
||||
|
||||
local time = function()
|
||||
return " " .. os.date("%R")
|
||||
end
|
||||
|
||||
local spaces = function()
|
||||
-- return "->| " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
|
||||
return icons.ui.Tab .. " " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
|
||||
end
|
||||
|
||||
local file_name = {
|
||||
"filename",
|
||||
cond = conditions.buffer_not_empty,
|
||||
}
|
||||
|
||||
-- start for lsp
|
||||
local list_registered_providers_names = function(filetype)
|
||||
local s = require("null-ls.sources")
|
||||
local available_sources = s.get_available(filetype)
|
||||
local registered = {}
|
||||
for _, source in ipairs(available_sources) do
|
||||
for method in pairs(source.methods) do
|
||||
registered[method] = registered[method] or {}
|
||||
table.insert(registered[method], source.name)
|
||||
end
|
||||
end
|
||||
return registered
|
||||
end
|
||||
|
||||
local null_ls = require("null-ls")
|
||||
-- for formatter
|
||||
local list_registered = function(filetype)
|
||||
local method = null_ls.methods.FORMATTING
|
||||
local registered_providers = list_registered_providers_names(filetype)
|
||||
return registered_providers[method] or {}
|
||||
end
|
||||
|
||||
--- for linter
|
||||
local alternative_methods = {
|
||||
null_ls.methods.DIAGNOSTICS,
|
||||
null_ls.methods.DIAGNOSTICS_ON_OPEN,
|
||||
null_ls.methods.DIAGNOSTICS_ON_SAVE,
|
||||
}
|
||||
|
||||
local linter_list_registered = function(filetype)
|
||||
local registered_providers = list_registered_providers_names(filetype)
|
||||
local providers_for_methods = vim.tbl_flatten(vim.tbl_map(function(m)
|
||||
return registered_providers[m] or {}
|
||||
end, alternative_methods))
|
||||
|
||||
return providers_for_methods
|
||||
end
|
||||
-- end for lsp
|
||||
|
||||
local lsp_info = {
|
||||
function()
|
||||
--local msg = "No Active Lsp"
|
||||
local msg = "LS Inactive"
|
||||
-- local buf_ft = vim.api.nvim_buf_get_option(0, "filetype")
|
||||
local buf_ft = vim.bo.filetype
|
||||
local clients = vim.lsp.get_active_clients()
|
||||
-- start register
|
||||
local buf_clients = vim.lsp.buf_get_clients()
|
||||
local buf_client_names = {}
|
||||
if next(buf_clients) == nil then
|
||||
-- TODO: clean up this if statement
|
||||
if type(msg) == "boolean" or #msg == 0 then
|
||||
return "LS Inactive"
|
||||
end
|
||||
return msg
|
||||
end
|
||||
-- add client
|
||||
for _, client in pairs(buf_clients) do
|
||||
if client.name ~= "null-ls" and client.name ~= "copilot" then
|
||||
table.insert(buf_client_names, client.name)
|
||||
end
|
||||
end
|
||||
-- add formatter
|
||||
local supported_formatters = list_registered(buf_ft)
|
||||
vim.list_extend(buf_client_names, supported_formatters)
|
||||
-- add linter
|
||||
local supported_linters = linter_list_registered(buf_ft)
|
||||
vim.list_extend(buf_client_names, supported_linters)
|
||||
-- decomple
|
||||
local unique_client_names = vim.fn.uniq(buf_client_names)
|
||||
local msg = table.concat(unique_client_names, ", ")
|
||||
return msg
|
||||
end,
|
||||
--icon = " ",
|
||||
icon = icons.ui.Gear .. "",
|
||||
padding = 1,
|
||||
}
|
||||
local lsp_progress = {}
|
||||
local data_exists, lspprogress = pcall(require, "lsp-progress")
|
||||
if data_exists then
|
||||
lsp_progress = lspprogress.progress
|
||||
end
|
||||
|
||||
local clear_lualine = require("core.config").clear_lualine
|
||||
if clear_lualine ~= nil then
|
||||
if clear_lualine == 1 then
|
||||
lualine.setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = "auto",
|
||||
component_separators = { left = "", right = "" },
|
||||
section_separators = { left = "", right = "" },
|
||||
disabled_filetypes = {
|
||||
"TelescopePrompt",
|
||||
"packer",
|
||||
"alpha",
|
||||
"dashboard",
|
||||
"NvimTree",
|
||||
"Outline",
|
||||
"DressingInput",
|
||||
"toggleterm",
|
||||
"lazy",
|
||||
"mason",
|
||||
"neo-tree",
|
||||
},
|
||||
always_divide_middle = true,
|
||||
},
|
||||
|
||||
sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = { mode, branch },
|
||||
lualine_c = { lsp_info, diagnostics, lsp_progress },
|
||||
-- lualine_c = { file_name, lsp_info },
|
||||
-- lualine_x = { "encoding", "fileformat", "filetype" },
|
||||
-- lualine_x = { diff, spaces, "encoding", filetype },
|
||||
lualine_x = { diff, spaces, filetype },
|
||||
lualine_y = { location, time },
|
||||
--[[ lualine_z = { progress }, ]]
|
||||
lualine_z = {},
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "location" },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
extensions = {},
|
||||
})
|
||||
else
|
||||
lualine.setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = "auto",
|
||||
component_separators = component_separators,
|
||||
section_separators = section_separators,
|
||||
disabled_filetypes = {
|
||||
"TelescopePrompt",
|
||||
"packer",
|
||||
"alpha",
|
||||
"dashboard",
|
||||
"NvimTree",
|
||||
"Outline",
|
||||
"DressingInput",
|
||||
"toggleterm",
|
||||
"lazy",
|
||||
"mason",
|
||||
"neo-tree",
|
||||
},
|
||||
always_divide_middle = true,
|
||||
},
|
||||
|
||||
sections = {
|
||||
lualine_a = { mode },
|
||||
lualine_b = { branch },
|
||||
lualine_c = { lsp_info, diagnostics, lsp_progress },
|
||||
-- lualine_c = { file_name, lsp_info },
|
||||
-- lualine_x = { "encoding", "fileformat", "filetype" },
|
||||
-- lualine_x = { diff, spaces, "encoding", filetype },
|
||||
lualine_x = { diff, spaces, filetype },
|
||||
lualine_y = { location },
|
||||
--[[ lualine_z = { progress }, ]]
|
||||
lualine_z = { time },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "location" },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
extensions = {},
|
||||
})
|
||||
end
|
||||
else
|
||||
lualine.setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = "auto",
|
||||
component_separators = component_separators,
|
||||
section_separators = section_separators,
|
||||
disabled_filetypes = {
|
||||
"TelescopePrompt",
|
||||
"packer",
|
||||
"alpha",
|
||||
"dashboard",
|
||||
"NvimTree",
|
||||
"Outline",
|
||||
"DressingInput",
|
||||
"toggleterm",
|
||||
"lazy",
|
||||
"mason",
|
||||
"neo-tree",
|
||||
},
|
||||
always_divide_middle = true,
|
||||
},
|
||||
|
||||
sections = {
|
||||
lualine_a = { mode },
|
||||
lualine_b = { branch },
|
||||
lualine_c = { lsp_info, diagnostics, lsp_progress },
|
||||
-- lualine_c = { file_name, lsp_info },
|
||||
-- lualine_x = { "encoding", "fileformat", "filetype" },
|
||||
-- lualine_x = { diff, spaces, "encoding", filetype },
|
||||
lualine_x = { diff, spaces, filetype },
|
||||
lualine_y = { location },
|
||||
--[[ lualine_z = { progress }, ]]
|
||||
lualine_z = { time },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "location" },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
extensions = {},
|
||||
})
|
||||
end
|
||||
|
||||
-- lualine.setup({
|
||||
-- options = {
|
||||
-- icons_enabled = true,
|
||||
-- theme = "auto",
|
||||
-- component_separators = component_separators,
|
||||
-- section_separators = section_separators,
|
||||
-- disabled_filetypes = {
|
||||
-- "TelescopePrompt",
|
||||
-- "packer",
|
||||
-- "alpha",
|
||||
-- "dashboard",
|
||||
-- "NvimTree",
|
||||
-- "Outline",
|
||||
-- "DressingInput",
|
||||
-- "toggleterm",
|
||||
-- "lazy",
|
||||
-- "mason",
|
||||
-- "neo-tree",
|
||||
-- },
|
||||
-- always_divide_middle = true,
|
||||
-- },
|
||||
--
|
||||
-- sections = {
|
||||
-- lualine_a = { mode },
|
||||
-- lualine_b = { branch },
|
||||
-- lualine_c = { lsp_info, diagnostics, lsp_progress },
|
||||
-- -- lualine_c = { file_name, lsp_info },
|
||||
-- -- lualine_x = { "encoding", "fileformat", "filetype" },
|
||||
-- -- lualine_x = { diff, spaces, "encoding", filetype },
|
||||
-- lualine_x = { diff, spaces, filetype },
|
||||
-- lualine_y = { location },
|
||||
-- --[[ lualine_z = { progress }, ]]
|
||||
-- lualine_z = { time },
|
||||
-- },
|
||||
-- inactive_sections = {
|
||||
-- lualine_a = {},
|
||||
-- lualine_b = {},
|
||||
-- lualine_c = { "filename" },
|
||||
-- lualine_x = { "location" },
|
||||
-- lualine_y = {},
|
||||
-- lualine_z = {},
|
||||
-- },
|
||||
-- tabline = {},
|
||||
-- extensions = {},
|
||||
-- })
|
|
@ -1,5 +0,0 @@
|
|||
local status_ok, neoscroll = pcall(require, "neoscroll")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
neoscroll.setup()
|
|
@ -1,231 +0,0 @@
|
|||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
-- set termguicolors to enable highlight groups
|
||||
vim.opt.termguicolors = true
|
||||
local status_ok, nvim_tree = pcall(require, "nvim-tree")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local icons = require("user.icons")
|
||||
nvim_tree.setup({
|
||||
auto_reload_on_write = false,
|
||||
disable_netrw = false,
|
||||
hijack_cursor = false,
|
||||
hijack_netrw = true,
|
||||
hijack_unnamed_buffer_when_opening = false,
|
||||
sort_by = "name",
|
||||
root_dirs = {},
|
||||
prefer_startup_root = false,
|
||||
sync_root_with_cwd = true,
|
||||
reload_on_bufenter = false,
|
||||
respect_buf_cwd = false,
|
||||
on_attach = "default",
|
||||
select_prompts = false,
|
||||
view = {
|
||||
adaptive_size = false,
|
||||
centralize_selection = true,
|
||||
width = 30,
|
||||
side = "left",
|
||||
preserve_window_proportions = false,
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
signcolumn = "yes",
|
||||
float = {
|
||||
enable = false,
|
||||
quit_on_focus_loss = true,
|
||||
open_win_config = {
|
||||
relative = "editor",
|
||||
border = "rounded",
|
||||
width = 30,
|
||||
height = 30,
|
||||
row = 1,
|
||||
col = 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
renderer = {
|
||||
add_trailing = false,
|
||||
group_empty = false,
|
||||
highlight_git = true,
|
||||
full_name = false,
|
||||
highlight_opened_files = "none",
|
||||
-- root_folder_label = ":t",
|
||||
root_folder_label = false,
|
||||
indent_width = 2,
|
||||
indent_markers = {
|
||||
enable = true,
|
||||
inline_arrows = true,
|
||||
icons = {
|
||||
corner = "└",
|
||||
edge = "│",
|
||||
item = "│",
|
||||
none = " ",
|
||||
},
|
||||
},
|
||||
icons = {
|
||||
webdev_colors = true,
|
||||
git_placement = "before",
|
||||
padding = " ",
|
||||
symlink_arrow = " ➛ ",
|
||||
show = {
|
||||
file = true,
|
||||
folder = true,
|
||||
folder_arrow = true,
|
||||
git = true,
|
||||
},
|
||||
glyphs = {
|
||||
default = icons.ui.Text,
|
||||
symlink = icons.ui.FileSymlink,
|
||||
bookmark = icons.ui.BookMark,
|
||||
folder = {
|
||||
-- arrow_closed = icons.ui.TriangleShortArrowRight,
|
||||
arrow_closed = icons.ui.ChevronShortRight,
|
||||
-- arrow_open = icons.ui.TriangleShortArrowDown,
|
||||
arrow_open = icons.ui.ChevronShortDown,
|
||||
default = icons.ui.Folder,
|
||||
open = icons.ui.FolderOpen,
|
||||
empty = icons.ui.EmptyFolder,
|
||||
empty_open = icons.ui.EmptyFolderOpen,
|
||||
symlink = icons.ui.FolderSymlink,
|
||||
symlink_open = icons.ui.FolderOpen,
|
||||
},
|
||||
git = {
|
||||
unstaged = icons.git.FileUnstaged,
|
||||
staged = icons.git.FileStaged,
|
||||
unmerged = icons.git.FileUnmerged,
|
||||
renamed = icons.git.FileRenamed,
|
||||
untracked = icons.git.FileUntracked,
|
||||
deleted = icons.git.FileDeleted,
|
||||
ignored = icons.git.FileIgnored,
|
||||
},
|
||||
},
|
||||
},
|
||||
special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md" },
|
||||
symlink_destination = true,
|
||||
},
|
||||
hijack_directories = {
|
||||
enable = false,
|
||||
auto_open = true,
|
||||
},
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
debounce_delay = 15,
|
||||
update_root = true,
|
||||
ignore_list = {},
|
||||
},
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
show_on_dirs = false,
|
||||
show_on_open_dirs = true,
|
||||
debounce_delay = 50,
|
||||
severity = {
|
||||
min = vim.diagnostic.severity.HINT,
|
||||
max = vim.diagnostic.severity.ERROR,
|
||||
},
|
||||
icons = {
|
||||
hint = icons.diagnostics.BoldHint,
|
||||
info = icons.diagnostics.BoldInformation,
|
||||
warning = icons.diagnostics.BoldWarning,
|
||||
error = icons.diagnostics.BoldError,
|
||||
},
|
||||
},
|
||||
filters = {
|
||||
dotfiles = false,
|
||||
git_clean = false,
|
||||
no_buffer = false,
|
||||
custom = { "node_modules", "\\.cache", "\\.git" },
|
||||
exclude = {
|
||||
".gitignore",
|
||||
".prettierignore",
|
||||
},
|
||||
},
|
||||
filesystem_watchers = {
|
||||
enable = true,
|
||||
debounce_delay = 50,
|
||||
ignore_dirs = {},
|
||||
},
|
||||
git = {
|
||||
enable = true,
|
||||
ignore = false,
|
||||
show_on_dirs = true,
|
||||
show_on_open_dirs = true,
|
||||
disable_for_dirs = {},
|
||||
timeout = 400,
|
||||
},
|
||||
actions = {
|
||||
use_system_clipboard = true,
|
||||
change_dir = {
|
||||
enable = true,
|
||||
global = false,
|
||||
restrict_above_cwd = false,
|
||||
},
|
||||
expand_all = {
|
||||
max_folder_discovery = 300,
|
||||
exclude = {},
|
||||
},
|
||||
file_popup = {
|
||||
open_win_config = {
|
||||
col = 1,
|
||||
row = 1,
|
||||
relative = "cursor",
|
||||
border = "shadow",
|
||||
style = "minimal",
|
||||
},
|
||||
},
|
||||
open_file = {
|
||||
quit_on_open = false,
|
||||
resize_window = false,
|
||||
window_picker = {
|
||||
enable = true,
|
||||
picker = "default",
|
||||
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
|
||||
exclude = {
|
||||
filetype = { "notify", "lazy", "qf", "diff", "fugitive", "fugitiveblame" },
|
||||
buftype = { "nofile", "terminal", "help" },
|
||||
},
|
||||
},
|
||||
},
|
||||
remove_file = {
|
||||
close_window = true,
|
||||
},
|
||||
},
|
||||
trash = {
|
||||
cmd = "trash",
|
||||
require_confirm = true,
|
||||
},
|
||||
live_filter = {
|
||||
prefix = "[FILTER]: ",
|
||||
always_show_folders = true,
|
||||
},
|
||||
tab = {
|
||||
sync = {
|
||||
open = false,
|
||||
close = false,
|
||||
ignore = {},
|
||||
},
|
||||
},
|
||||
notify = {
|
||||
threshold = vim.log.levels.INFO,
|
||||
-- threshold = vim.log.levels.ERROR,
|
||||
},
|
||||
log = {
|
||||
enable = false,
|
||||
truncate = false,
|
||||
types = {
|
||||
all = false,
|
||||
config = false,
|
||||
copy_paste = false,
|
||||
dev = false,
|
||||
diagnostics = false,
|
||||
git = false,
|
||||
profile = false,
|
||||
watcher = false,
|
||||
},
|
||||
},
|
||||
system_open = {
|
||||
cmd = nil,
|
||||
args = {},
|
||||
},
|
||||
})
|
|
@ -1,9 +0,0 @@
|
|||
local status_ok, scrollview = pcall(require, "scrollview")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
scrollview.setup({
|
||||
bg = "LightCyan",
|
||||
ctermbg = 160,
|
||||
})
|
||||
vim.g.scrollview_excluded_filetypes = { "NvimTree", "vista_kind", "Outline", "neo-tree" }
|
|
@ -1,58 +0,0 @@
|
|||
-- This file is automatically loaded by plugins.config
|
||||
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
local opt = vim.opt
|
||||
opt.autowrite = true -- Enable auto write
|
||||
opt.clipboard = "unnamedplus" -- Sync with system clipboard
|
||||
opt.completeopt = "menu,menuone,noselect"
|
||||
opt.conceallevel = 3 -- Hide * markup for bold and italic
|
||||
opt.confirm = true -- Confirm to save changes before exiting modified buffer
|
||||
opt.cursorline = true -- Enable highlighting of the current line
|
||||
opt.expandtab = true -- Use spaces instead of tabs
|
||||
opt.formatoptions = "jcroqlnt" -- tcqj
|
||||
opt.grepformat = "%f:%l:%c:%m"
|
||||
opt.grepprg = "rg --vimgrep"
|
||||
opt.ignorecase = true -- Ignore case
|
||||
opt.inccommand = "nosplit" -- preview incremental substitute
|
||||
opt.laststatus = 0
|
||||
opt.list = true -- Show some invisible characters (tabs...
|
||||
opt.mouse = "a" -- Enable mouse mode
|
||||
opt.number = true -- Print line number
|
||||
opt.pumblend = 10 -- Popup blend
|
||||
opt.pumheight = 10 -- Maximum number of entries in a popup
|
||||
opt.relativenumber = true -- Relative line numbers
|
||||
opt.scrolloff = 4 -- Lines of context
|
||||
opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" }
|
||||
opt.shiftround = true -- Round indent
|
||||
opt.shiftwidth = 2 -- Size of an indent
|
||||
opt.shortmess:append({ W = true, I = true, c = true })
|
||||
opt.showmode = false -- Dont show mode since we have a statusline
|
||||
opt.sidescrolloff = 8 -- Columns of context
|
||||
opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
|
||||
opt.smartcase = true -- Don't ignore case with capitals
|
||||
opt.smartindent = true -- Insert indents automatically
|
||||
opt.spelllang = { "en" }
|
||||
opt.splitbelow = true -- Put new windows below current
|
||||
opt.splitright = true -- Put new windows right of current
|
||||
opt.tabstop = 2 -- Number of spaces tabs count for
|
||||
opt.termguicolors = true -- True color support
|
||||
opt.timeoutlen = 300
|
||||
opt.undofile = true
|
||||
opt.undolevels = 10000
|
||||
opt.updatetime = 200 -- Save swap file and trigger CursorHold
|
||||
opt.wildmode = "longest:full,full" -- Command-line completion mode
|
||||
opt.winminwidth = 5 -- Minimum window width
|
||||
opt.wrap = false -- Disable line wrap
|
||||
|
||||
opt.laststatus = 3 -- globalstatus
|
||||
opt.cmdheight = 0 -- hide command line unless needed
|
||||
|
||||
if vim.fn.has("nvim-0.9.0") == 1 then
|
||||
opt.splitkeep = "screen"
|
||||
opt.shortmess:append({ C = true })
|
||||
end
|
||||
|
||||
-- Fix markdown indentation settings
|
||||
vim.g.markdown_recommended_style = 0
|
|
@ -1,48 +0,0 @@
|
|||
local status_ok, project = pcall(require, "project_nvim")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
project.setup({
|
||||
---@usage set to false to disable project.nvim.
|
||||
--- This is on by default since it's currently the expected behavior.
|
||||
active = true,
|
||||
|
||||
on_config_done = nil,
|
||||
|
||||
---@usage set to true to disable setting the current-woriking directory
|
||||
--- Manual mode doesn't automatically change your root directory, so you have
|
||||
--- the option to manually do so using `:ProjectRoot` command.
|
||||
manual_mode = false,
|
||||
|
||||
---@usage Methods of detecting the root directory
|
||||
--- Allowed values: **"lsp"** uses the native neovim lsp
|
||||
--- **"pattern"** uses vim-rooter like glob pattern matching. Here
|
||||
--- order matters: if one is not detected, the other is used as fallback. You
|
||||
--- can also delete or rearangne the detection methods.
|
||||
-- detection_methods = { "lsp", "pattern" }, -- NOTE: lsp detection will get annoying with multiple langs in one project
|
||||
detection_methods = { "pattern" },
|
||||
|
||||
---@usage patterns used to detect root dir, when **"pattern"** is in detection_methods
|
||||
patterns = { ".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json" ,"main*" },
|
||||
|
||||
---@ Show hidden files in telescope when searching for files in a project
|
||||
show_hidden = false,
|
||||
|
||||
---@usage When set to false, you will get a message when project.nvim changes your directory.
|
||||
-- When set to false, you will get a message when project.nvim changes your directory.
|
||||
silent_chdir = true,
|
||||
|
||||
---@usage list of lsp client names to ignore when using **lsp** detection. eg: { "efm", ... }
|
||||
ignore_lsp = {},
|
||||
|
||||
---@type string
|
||||
---@usage path to store the project history for use in telescope
|
||||
datapath = vim.fn.stdpath("data"),
|
||||
})
|
||||
|
||||
local tele_status_ok, telescope = pcall(require, "telescope")
|
||||
if not tele_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
telescope.load_extension('projects')
|
|
@ -1,18 +0,0 @@
|
|||
local status_ok, smart_splits = pcall(require, "smart-splits")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
smart_splits.setup({
|
||||
ignored_filetypes = {
|
||||
"nofile",
|
||||
"quickfix",
|
||||
"qf",
|
||||
"prompt",
|
||||
},
|
||||
ignored_buftypes = { "nofile" },
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<C-Left>", require("smart-splits").resize_left)
|
||||
vim.keymap.set("n", "<C-Down>", require("smart-splits").resize_down)
|
||||
vim.keymap.set("n", "<C-Up", require("smart-splits").resize_up)
|
||||
vim.keymap.set("n", "<C-Right>", require("smart-splits").resize_right)
|
|
@ -1,27 +0,0 @@
|
|||
vim.schedule(function()
|
||||
require("cmp_tabnine.config").setup({
|
||||
ignored_file_types = {
|
||||
["aerial"] = true,
|
||||
["checkhealth"] = true,
|
||||
["dap-repl"] = true,
|
||||
["dapui_breakpoints"] = true,
|
||||
["dapui_console"] = true,
|
||||
["dapui_hover"] = true,
|
||||
["dapui_scopes"] = true,
|
||||
["dapui_stacks"] = true,
|
||||
["dapui_watches"] = true,
|
||||
["DressingInput"] = true,
|
||||
["DressingSelect"] = true,
|
||||
["fern"] = true,
|
||||
["lazy"] = true,
|
||||
["lspinfo"] = true,
|
||||
["mason"] = true,
|
||||
["nerdterm"] = true,
|
||||
["noice"] = true,
|
||||
["notify"] = true,
|
||||
["null-ls-info"] = true,
|
||||
["qf"] = true,
|
||||
["TelescopePrompt"] = true,
|
||||
},
|
||||
})
|
||||
end)
|
|
@ -1,170 +0,0 @@
|
|||
local status_ok, telescope = pcall(require, "telescope")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
vim.g.theme_switcher_loaded = true
|
||||
|
||||
local options = {
|
||||
defaults = {
|
||||
vimgrep_arguments = {
|
||||
"rg",
|
||||
"-L",
|
||||
"--color=never",
|
||||
"--no-heading",
|
||||
"--with-filename",
|
||||
"--line-number",
|
||||
"--column",
|
||||
"--smart-case",
|
||||
},
|
||||
prompt_prefix = " ",
|
||||
selection_caret = " ",
|
||||
entry_prefix = " ",
|
||||
initial_mode = "insert",
|
||||
selection_strategy = "reset",
|
||||
sorting_strategy = "ascending",
|
||||
layout_strategy = "horizontal",
|
||||
layout_config = {
|
||||
horizontal = {
|
||||
prompt_position = "top",
|
||||
preview_width = 0.55,
|
||||
results_width = 0.8,
|
||||
},
|
||||
vertical = {
|
||||
mirror = false,
|
||||
},
|
||||
width = 0.87,
|
||||
height = 0.80,
|
||||
preview_cutoff = 120,
|
||||
},
|
||||
file_sorter = require("telescope.sorters").get_fuzzy_file,
|
||||
file_ignore_patterns = { "node_modules" },
|
||||
generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter,
|
||||
path_display = { "smart" },
|
||||
winblend = 0,
|
||||
border = {},
|
||||
borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" },
|
||||
color_devicons = true,
|
||||
set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil,
|
||||
file_previewer = require("telescope.previewers").vim_buffer_cat.new,
|
||||
grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new,
|
||||
qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new,
|
||||
-- Developer configurations: Not meant for general override
|
||||
buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker,
|
||||
mappings = {
|
||||
n = { ["q"] = require("telescope.actions").close },
|
||||
},
|
||||
},
|
||||
|
||||
extensions_list = { "themes", "terms" },
|
||||
|
||||
pickers = {
|
||||
find_files = {
|
||||
hidden = true,
|
||||
},
|
||||
live_grep = {
|
||||
--@usage don't include the filename in the search results
|
||||
only_sort_text = true,
|
||||
},
|
||||
grep_string = {
|
||||
only_sort_text = true,
|
||||
},
|
||||
buffers = {
|
||||
initial_mode = "normal",
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-d>"] = actions.delete_buffer,
|
||||
},
|
||||
n = {
|
||||
["dd"] = actions.delete_buffer,
|
||||
},
|
||||
},
|
||||
},
|
||||
planets = {
|
||||
show_pluto = true,
|
||||
show_moon = true,
|
||||
},
|
||||
git_files = {
|
||||
hidden = true,
|
||||
show_untracked = true,
|
||||
},
|
||||
colorscheme = {
|
||||
enable_preview = true,
|
||||
},
|
||||
},
|
||||
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-n>"] = actions.cycle_history_next,
|
||||
["<C-p>"] = actions.cycle_history_prev,
|
||||
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
|
||||
["<C-c>"] = actions.close,
|
||||
|
||||
["<Down>"] = actions.move_selection_next,
|
||||
["<Up>"] = actions.move_selection_previous,
|
||||
|
||||
["<CR>"] = actions.select_default,
|
||||
["<C-x>"] = actions.select_horizontal,
|
||||
["<C-v>"] = actions.select_vertical,
|
||||
["<C-t>"] = actions.select_tab,
|
||||
|
||||
["<C-u>"] = actions.preview_scrolling_up,
|
||||
["<C-d>"] = actions.preview_scrolling_down,
|
||||
|
||||
["<PageUp>"] = actions.results_scrolling_up,
|
||||
["<PageDown>"] = actions.results_scrolling_down,
|
||||
|
||||
["<Tab>"] = actions.toggle_selection + actions.move_selection_worse,
|
||||
["<S-Tab>"] = actions.toggle_selection + actions.move_selection_better,
|
||||
["<C-q>"] = actions.send_to_qflist + actions.open_qflist,
|
||||
["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
["<C-l>"] = actions.complete_tag,
|
||||
["<C-_>"] = actions.which_key, -- keys from pressing <C-/>
|
||||
},
|
||||
|
||||
n = {
|
||||
["<esc>"] = actions.close,
|
||||
["<CR>"] = actions.select_default,
|
||||
["<C-x>"] = actions.select_horizontal,
|
||||
["<C-v>"] = actions.select_vertical,
|
||||
["<C-t>"] = actions.select_tab,
|
||||
|
||||
["<Tab>"] = actions.toggle_selection + actions.move_selection_worse,
|
||||
["<S-Tab>"] = actions.toggle_selection + actions.move_selection_better,
|
||||
["<C-q>"] = actions.send_to_qflist + actions.open_qflist,
|
||||
["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
|
||||
["j"] = actions.move_selection_next,
|
||||
["k"] = actions.move_selection_previous,
|
||||
["H"] = actions.move_to_top,
|
||||
["M"] = actions.move_to_middle,
|
||||
["L"] = actions.move_to_bottom,
|
||||
|
||||
["<Down>"] = actions.move_selection_next,
|
||||
["<Up>"] = actions.move_selection_previous,
|
||||
["gg"] = actions.move_to_top,
|
||||
["G"] = actions.move_to_bottom,
|
||||
|
||||
["<C-u>"] = actions.preview_scrolling_up,
|
||||
["<C-d>"] = actions.preview_scrolling_down,
|
||||
|
||||
["<PageUp>"] = actions.results_scrolling_up,
|
||||
["<PageDown>"] = actions.results_scrolling_down,
|
||||
|
||||
["?"] = actions.which_key,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
telescope.setup(options)
|
||||
|
||||
-- load extensions
|
||||
pcall(function()
|
||||
for _, ext in ipairs(options.extensions_list) do
|
||||
telescope.load_extension(ext)
|
||||
end
|
||||
end)
|
|
@ -1,97 +0,0 @@
|
|||
local status_ok, telescope = pcall(require, "telescope")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
|
||||
-- prompt_prefix = " ",
|
||||
prompt_prefix = " ",
|
||||
selection_caret = " ",
|
||||
path_display = { "smart" },
|
||||
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-n>"] = actions.cycle_history_next,
|
||||
["<C-p>"] = actions.cycle_history_prev,
|
||||
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
|
||||
["<C-c>"] = actions.close,
|
||||
|
||||
["<Down>"] = actions.move_selection_next,
|
||||
["<Up>"] = actions.move_selection_previous,
|
||||
|
||||
["<CR>"] = actions.select_default,
|
||||
["<C-x>"] = actions.select_horizontal,
|
||||
["<C-v>"] = actions.select_vertical,
|
||||
["<C-t>"] = actions.select_tab,
|
||||
|
||||
["<C-u>"] = actions.preview_scrolling_up,
|
||||
["<C-d>"] = actions.preview_scrolling_down,
|
||||
|
||||
["<PageUp>"] = actions.results_scrolling_up,
|
||||
["<PageDown>"] = actions.results_scrolling_down,
|
||||
|
||||
["<Tab>"] = actions.toggle_selection + actions.move_selection_worse,
|
||||
["<S-Tab>"] = actions.toggle_selection + actions.move_selection_better,
|
||||
["<C-q>"] = actions.send_to_qflist + actions.open_qflist,
|
||||
["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
["<C-l>"] = actions.complete_tag,
|
||||
["<C-_>"] = actions.which_key, -- keys from pressing <C-/>
|
||||
},
|
||||
|
||||
n = {
|
||||
["<esc>"] = actions.close,
|
||||
["<CR>"] = actions.select_default,
|
||||
["<C-x>"] = actions.select_horizontal,
|
||||
["<C-v>"] = actions.select_vertical,
|
||||
["<C-t>"] = actions.select_tab,
|
||||
|
||||
["<Tab>"] = actions.toggle_selection + actions.move_selection_worse,
|
||||
["<S-Tab>"] = actions.toggle_selection + actions.move_selection_better,
|
||||
["<C-q>"] = actions.send_to_qflist + actions.open_qflist,
|
||||
["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
|
||||
["j"] = actions.move_selection_next,
|
||||
["k"] = actions.move_selection_previous,
|
||||
["H"] = actions.move_to_top,
|
||||
["M"] = actions.move_to_middle,
|
||||
["L"] = actions.move_to_bottom,
|
||||
|
||||
["<Down>"] = actions.move_selection_next,
|
||||
["<Up>"] = actions.move_selection_previous,
|
||||
["gg"] = actions.move_to_top,
|
||||
["G"] = actions.move_to_bottom,
|
||||
|
||||
["<C-u>"] = actions.preview_scrolling_up,
|
||||
["<C-d>"] = actions.preview_scrolling_down,
|
||||
|
||||
["<PageUp>"] = actions.results_scrolling_up,
|
||||
["<PageDown>"] = actions.results_scrolling_down,
|
||||
|
||||
["?"] = actions.which_key,
|
||||
},
|
||||
},
|
||||
},
|
||||
pickers = {
|
||||
-- Default configuration for builtin pickers goes here:
|
||||
-- picker_name = {
|
||||
-- picker_config_key = value,
|
||||
-- ...
|
||||
-- }
|
||||
-- Now the picker_config_key will be applied every time you call this
|
||||
-- builtin picker
|
||||
},
|
||||
extensions = {
|
||||
-- Your extension configuration goes here:
|
||||
-- extension_name = {
|
||||
-- extension_config_key = value,
|
||||
-- }
|
||||
-- please take a look at the readme of the extension you want to configure
|
||||
},
|
||||
})
|
|
@ -1,70 +0,0 @@
|
|||
local status_ok, toggleterm = pcall(require, "toggleterm")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
toggleterm.setup({
|
||||
size = 20,
|
||||
open_mapping = [[<c-\>]],
|
||||
hide_numbers = true,
|
||||
shade_filetypes = {},
|
||||
shade_terminals = true,
|
||||
shading_factor = 2,
|
||||
start_in_insert = true,
|
||||
insert_mappings = true,
|
||||
persist_size = true,
|
||||
direction = "float",
|
||||
close_on_exit = true,
|
||||
shell = vim.o.shell,
|
||||
float_opts = {
|
||||
border = "curved",
|
||||
winblend = 0,
|
||||
highlights = {
|
||||
border = "Normal",
|
||||
background = "Normal",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
function _G.set_terminal_keymaps()
|
||||
local opts = { noremap = true }
|
||||
vim.api.nvim_buf_set_keymap(0, "t", "<esc>", [[<C-\><C-n>]], opts)
|
||||
vim.api.nvim_buf_set_keymap(0, "t", "jk", [[<C-\><C-n>]], opts)
|
||||
vim.api.nvim_buf_set_keymap(0, "t", "<C-h>", [[<C-\><C-n><C-W>h]], opts)
|
||||
vim.api.nvim_buf_set_keymap(0, "t", "<C-j>", [[<C-\><C-n><C-W>j]], opts)
|
||||
vim.api.nvim_buf_set_keymap(0, "t", "<C-k>", [[<C-\><C-n><C-W>k]], opts)
|
||||
vim.api.nvim_buf_set_keymap(0, "t", "<C-l>", [[<C-\><C-n><C-W>l]], opts)
|
||||
end
|
||||
|
||||
vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()")
|
||||
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local lazygit = Terminal:new({ cmd = "lazygit", hidden = true })
|
||||
|
||||
function _LAZYGIT_TOGGLE()
|
||||
lazygit:toggle()
|
||||
end
|
||||
|
||||
local node = Terminal:new({ cmd = "node", hidden = true })
|
||||
|
||||
function _NODE_TOGGLE()
|
||||
node:toggle()
|
||||
end
|
||||
|
||||
local ncdu = Terminal:new({ cmd = "ncdu", hidden = true })
|
||||
|
||||
function _NCDU_TOGGLE()
|
||||
ncdu:toggle()
|
||||
end
|
||||
|
||||
local htop = Terminal:new({ cmd = "htop", hidden = true })
|
||||
|
||||
function _HTOP_TOGGLE()
|
||||
htop:toggle()
|
||||
end
|
||||
|
||||
local python = Terminal:new({ cmd = "python", hidden = true })
|
||||
|
||||
function _PYTHON_TOGGLE()
|
||||
python:toggle()
|
||||
end
|
|
@ -1,56 +0,0 @@
|
|||
local status_ok, configs = pcall(require, "nvim-treesitter.configs")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
configs.setup({
|
||||
ensure_installed = {
|
||||
-- "bash",
|
||||
-- "html",
|
||||
-- "c",
|
||||
"javascript",
|
||||
"json",
|
||||
"lua",
|
||||
-- "python",
|
||||
-- "typescript",
|
||||
-- "tsx",
|
||||
-- "css",
|
||||
-- "rust",
|
||||
-- "java",
|
||||
-- "yaml",
|
||||
-- "markdown",
|
||||
-- "markdown_inline",
|
||||
}, -- one of "all" or a list of languages
|
||||
ignore_install = { "phpdoc" }, -- List of parsers to ignore installing
|
||||
highlight = {
|
||||
enable = true, -- false will disable the whole extension
|
||||
disable = { "css" }, -- list of language that will be disabled
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
autopairs = {
|
||||
enable = true,
|
||||
},
|
||||
indent = { enable = true, disable = { "python", "css" } },
|
||||
context_commentstring = {
|
||||
enable = true,
|
||||
enable_autocmd = false,
|
||||
config = {
|
||||
-- Languages that have a single comment style
|
||||
typescript = "// %s",
|
||||
css = "/* %s */",
|
||||
scss = "/* %s */",
|
||||
html = "<!-- %s -->",
|
||||
svelte = "<!-- %s -->",
|
||||
vue = "<!-- %s -->",
|
||||
json = "",
|
||||
},
|
||||
},
|
||||
autotag = { enable = true },
|
||||
incremental_selection = { enable = true },
|
||||
rainbow = {
|
||||
enable = true,
|
||||
disable = { "html" },
|
||||
extended_mode = false,
|
||||
max_file_lines = nil,
|
||||
},
|
||||
})
|
|
@ -1,42 +0,0 @@
|
|||
local status_ok, configs = pcall(require, "nvim-treesitter.configs")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
configs.setup({
|
||||
ensure_installed = {
|
||||
"lua",
|
||||
"vim",
|
||||
},
|
||||
ignore_install = { "phpdoc" }, -- List of parsers to ignore installing
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = { "css" }, -- list of language that will be disabled
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
context_commentstring = {
|
||||
enable = true,
|
||||
enable_autocmd = false,
|
||||
config = {
|
||||
-- Languages that have a single comment style
|
||||
typescript = "// %s",
|
||||
css = "/* %s */",
|
||||
scss = "/* %s */",
|
||||
html = "<!-- %s -->",
|
||||
svelte = "<!-- %s -->",
|
||||
vue = "<!-- %s -->",
|
||||
json = "",
|
||||
},
|
||||
},
|
||||
rainbow = {
|
||||
enable = true,
|
||||
disable = { "html" },
|
||||
equery = 'rainbow-parens',
|
||||
strategy = require('ts-rainbow').strategy.global,
|
||||
},
|
||||
autotag = { enable = true },
|
||||
incremental_selection = { enable = true },
|
||||
indent = { enable = true, disable = { "python", "css" } },
|
||||
autopairs = {
|
||||
enable = true,
|
||||
},
|
||||
})
|
|
@ -1,509 +0,0 @@
|
|||
local web_devicons_ok, web_devicons = pcall(require, "nvim-web-devicons")
|
||||
if not web_devicons_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local material_icon_ok, material_icon = pcall(require, "nvim-material-icon")
|
||||
if not material_icon_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local prettier_icon = ""
|
||||
material_icon.setup({
|
||||
override = {
|
||||
["mjs"] = {
|
||||
icon = "",
|
||||
color = "#f2c55c",
|
||||
cterm_color = "220",
|
||||
name = "Mjs",
|
||||
},
|
||||
["js"] = {
|
||||
icon = "",
|
||||
color = "#f2c55c",
|
||||
cterm_color = "220",
|
||||
name = "javascript",
|
||||
},
|
||||
["ts"] = {
|
||||
icon = "",
|
||||
color = "#548af7",
|
||||
cterm_color = "220",
|
||||
name = "ts",
|
||||
},
|
||||
["jsx"] = {
|
||||
icon = "",
|
||||
color = "#61dafb",
|
||||
cterm_color = "220",
|
||||
name = "jsx",
|
||||
},
|
||||
["tsx"] = {
|
||||
icon = "",
|
||||
color = "#3699ff",
|
||||
cterm_color = "220",
|
||||
name = "Tsx",
|
||||
},
|
||||
["svg"] = {
|
||||
icon = "",
|
||||
color = "#FDB03A",
|
||||
cterm_color = "220",
|
||||
name = "svg",
|
||||
},
|
||||
["prisma"] = {
|
||||
icon = "",
|
||||
color = "#0FBFCF",
|
||||
cterm_color = "220",
|
||||
name = "prisma",
|
||||
},
|
||||
["json"] = {
|
||||
icon = "",
|
||||
color = "#f16421",
|
||||
cterm_color = "220",
|
||||
name = "json",
|
||||
},
|
||||
["map"] = {
|
||||
icon = "",
|
||||
color = "#748e54",
|
||||
cterm_color = "220",
|
||||
name = "map",
|
||||
},
|
||||
["svelte"] = {
|
||||
icon = "",
|
||||
color = "#ef510b",
|
||||
cterm_color = "220",
|
||||
name = "svelte",
|
||||
},
|
||||
["yaml"] = {
|
||||
icon = "",
|
||||
color = "#ef510b",
|
||||
cterm_color = "220",
|
||||
name = "yaml",
|
||||
},
|
||||
["vsix"] = {
|
||||
icon = "",
|
||||
color = "#30A2FF",
|
||||
cterm_color = "220",
|
||||
name = "vsix",
|
||||
},
|
||||
["class"] = {
|
||||
icon = "",
|
||||
color = "#1e88e5",
|
||||
cterm_color = "220",
|
||||
name = "JavaClass",
|
||||
},
|
||||
["java"] = {
|
||||
icon = "",
|
||||
color = "#ef510b",
|
||||
cterm_color = "220",
|
||||
name = "JavaFile",
|
||||
},
|
||||
["gradle"] = {
|
||||
icon = "",
|
||||
color = "#9C9C9C",
|
||||
cterm_color = "220",
|
||||
name = "GradleFile",
|
||||
},
|
||||
["mod"] = {
|
||||
icon = "",
|
||||
color = "#C5362B",
|
||||
cterm_color = "220",
|
||||
name = "gomod",
|
||||
},
|
||||
["blade.php"] = {
|
||||
icon = "",
|
||||
color = "#ef510b",
|
||||
cterm_color = "220",
|
||||
name = "bladephp",
|
||||
},
|
||||
["7z"] = {
|
||||
icon = "",
|
||||
color = "#9C9C9C",
|
||||
cterm_color = "220",
|
||||
name = "7z",
|
||||
},
|
||||
["zip"] = {
|
||||
icon = "",
|
||||
color = "#9C9C9C",
|
||||
cterm_color = "220",
|
||||
name = "zip",
|
||||
},
|
||||
["rar"] = {
|
||||
icon = "",
|
||||
color = "#9C9C9C",
|
||||
cterm_color = "220",
|
||||
name = "rar",
|
||||
},
|
||||
["cfm"] = {
|
||||
icon = "",
|
||||
color = "#507F89",
|
||||
cterm_color = "220",
|
||||
name = "cfm",
|
||||
},
|
||||
["cfc"] = {
|
||||
icon = "",
|
||||
color = "#507F89",
|
||||
cterm_color = "220",
|
||||
name = "cfc",
|
||||
},
|
||||
["png"] = {
|
||||
icon = "",
|
||||
color = "#3574f0",
|
||||
cterm_color = "220",
|
||||
name = "Png",
|
||||
},
|
||||
["jpg"] = {
|
||||
icon = "",
|
||||
color = "#3574f0",
|
||||
cterm_color = "220",
|
||||
name = "jpg",
|
||||
},
|
||||
["jpeg"] = {
|
||||
icon = "",
|
||||
color = "#88C057",
|
||||
cterm_color = "220",
|
||||
name = "jpeg",
|
||||
},
|
||||
["csv"] = {
|
||||
icon = "",
|
||||
color = "#57965c",
|
||||
cterm_color = "220",
|
||||
name = "csv",
|
||||
},
|
||||
["sql"] = {
|
||||
icon = "",
|
||||
color = "#b589ec",
|
||||
cterm_color = "220",
|
||||
name = "sqlfile",
|
||||
},
|
||||
["php"] = {
|
||||
icon = "",
|
||||
color = "#b589ec",
|
||||
cterm_color = "220",
|
||||
name = "phpfile",
|
||||
},
|
||||
["mp4"] = {
|
||||
icon = "",
|
||||
color = "#FC6411",
|
||||
cterm_color = "220",
|
||||
name = "mp4file",
|
||||
},
|
||||
["md"] = {
|
||||
icon = "",
|
||||
color = "#42a5f5",
|
||||
cterm_color = "220",
|
||||
name = "markdown",
|
||||
},
|
||||
["sh"] = {
|
||||
icon = "",
|
||||
color = "#ef510b",
|
||||
cterm_color = "220",
|
||||
name = "README_file",
|
||||
},
|
||||
["pdf"] = {
|
||||
icon = "",
|
||||
color = "#ef510b",
|
||||
cterm_color = "220",
|
||||
name = "pdffile",
|
||||
},
|
||||
["xlsx"] = {
|
||||
icon = "",
|
||||
color = "#349C42",
|
||||
cterm_color = "220",
|
||||
name = "xlsxfile",
|
||||
},
|
||||
["xls"] = {
|
||||
icon = "",
|
||||
color = "#349C42",
|
||||
cterm_color = "220",
|
||||
name = "xlsfile",
|
||||
},
|
||||
-- ["go"] = {
|
||||
-- icon = "",
|
||||
-- color = "#0FBFCF",
|
||||
-- cterm_color = "220",
|
||||
-- name = "go",
|
||||
-- },
|
||||
},
|
||||
color_icons = true,
|
||||
default = true,
|
||||
})
|
||||
|
||||
web_devicons.setup({
|
||||
override = material_icon.get_icons(),
|
||||
override_by_filename = {
|
||||
["artisan"] = {
|
||||
icon = "",
|
||||
color = "#ef510b",
|
||||
cterm_color = "240",
|
||||
name = "artisan",
|
||||
},
|
||||
["vite.config.ts"] = {
|
||||
icon = "",
|
||||
color = "#ffab00",
|
||||
cterm_color = "240",
|
||||
name = "viteconfigts",
|
||||
},
|
||||
["vite.config.js"] = {
|
||||
icon = "",
|
||||
color = "#ffab00",
|
||||
cterm_color = "240",
|
||||
name = "viteconfigjs",
|
||||
},
|
||||
[".releaserc"] = {
|
||||
icon = "",
|
||||
color = "#9C9C9C",
|
||||
cterm_color = "240",
|
||||
name = "releaserc",
|
||||
},
|
||||
[".profile"] = {
|
||||
icon = "",
|
||||
color = "#9C9C9C",
|
||||
cterm_color = "240",
|
||||
name = "profiledata",
|
||||
},
|
||||
[".eslint_d"] = {
|
||||
icon = "",
|
||||
color = "#4930bd",
|
||||
cterm_color = "240",
|
||||
name = "eslintd",
|
||||
},
|
||||
[".eslintrc.cjs"] = {
|
||||
icon = "",
|
||||
color = "#4930bd",
|
||||
cterm_color = "240",
|
||||
name = "eslintrccjs",
|
||||
},
|
||||
[".htaccess"] = {
|
||||
icon = "",
|
||||
color = "#C63C17",
|
||||
cterm_color = "240",
|
||||
name = "htaccess",
|
||||
},
|
||||
["pom.xml"] = {
|
||||
icon = "",
|
||||
color = "#C63C17",
|
||||
cterm_color = "240",
|
||||
name = "pomxml",
|
||||
},
|
||||
[".huskyrc"] = {
|
||||
icon = "",
|
||||
color = "#ffffff",
|
||||
cterm_color = "240",
|
||||
name = "huskyrc",
|
||||
},
|
||||
[".prettierrc"] = {
|
||||
icon = prettier_icon,
|
||||
color = "#ea5e5e",
|
||||
cterm_color = "240",
|
||||
name = "prettierrc",
|
||||
},
|
||||
[".prettierrc.json"] = {
|
||||
icon = prettier_icon,
|
||||
color = "#ea5e5e",
|
||||
cterm_color = "240",
|
||||
name = "prettierrcjson",
|
||||
},
|
||||
[".prettierd"] = {
|
||||
icon = prettier_icon,
|
||||
color = "#ea5e5e",
|
||||
cterm_color = "240",
|
||||
name = "prettierd",
|
||||
},
|
||||
[".vscodeignore"] = {
|
||||
icon = "",
|
||||
color = "#30A2FF",
|
||||
cterm_color = "240",
|
||||
name = "vscodeignore",
|
||||
},
|
||||
[".vsixmanifest"] = {
|
||||
icon = "",
|
||||
color = "#30A2FF",
|
||||
cterm_color = "240",
|
||||
name = "vsixmanifest",
|
||||
},
|
||||
[".prettierignore"] = {
|
||||
icon = prettier_icon,
|
||||
color = "#ea5e5e",
|
||||
cterm_color = "240",
|
||||
name = "prettierignore",
|
||||
},
|
||||
[".sequelizerc"] = {
|
||||
icon = "",
|
||||
color = "#397883",
|
||||
cterm_color = "220",
|
||||
name = "sequelizerc",
|
||||
},
|
||||
["pre-commit"] = {
|
||||
icon = "",
|
||||
color = "#75e4b3",
|
||||
cterm_color = "240",
|
||||
name = "pre",
|
||||
},
|
||||
["yarn.lock"] = {
|
||||
icon = "",
|
||||
color = "#ea5e5e",
|
||||
cterm_color = "240",
|
||||
name = "yarnlock",
|
||||
},
|
||||
["yarn-error.log"] = {
|
||||
icon = "",
|
||||
color = "#3d85c6",
|
||||
cterm_color = "240",
|
||||
name = "yarnerror",
|
||||
},
|
||||
[".eslintrc.json"] = {
|
||||
icon = "",
|
||||
color = "#4746a8",
|
||||
cterm_color = "240",
|
||||
name = "eslintrc",
|
||||
},
|
||||
[".eslintrc.js"] = {
|
||||
icon = "",
|
||||
color = "#4746a8",
|
||||
cterm_color = "240",
|
||||
name = "eslintrcjs",
|
||||
},
|
||||
[".eslintignore"] = {
|
||||
icon = "",
|
||||
color = "#4746a8",
|
||||
cterm_color = "240",
|
||||
name = "eslintignore",
|
||||
},
|
||||
["jest.config.js"] = {
|
||||
icon = "",
|
||||
color = "#e37575",
|
||||
cterm_color = "220",
|
||||
name = "jestconfig",
|
||||
},
|
||||
["cname"] = {
|
||||
icon = "",
|
||||
color = "#e37575",
|
||||
cterm_color = "220",
|
||||
name = "cname",
|
||||
},
|
||||
[".nvmrc"] = {
|
||||
icon = "",
|
||||
color = "#E8274B",
|
||||
cterm_color = "220",
|
||||
name = "nvmrc",
|
||||
},
|
||||
[".yarnrc"] = {
|
||||
icon = "",
|
||||
color = "#3d85c6",
|
||||
cterm_color = "240",
|
||||
name = "yarnrc",
|
||||
},
|
||||
[".git-blame-ignore-revs"] = {
|
||||
icon = "",
|
||||
color = "#F14C28",
|
||||
cterm_color = "220",
|
||||
name = "gitblameignorerevs",
|
||||
},
|
||||
[".gitmodules"] = {
|
||||
icon = "",
|
||||
color = "#0c343d",
|
||||
cterm_color = "220",
|
||||
name = "gitmodules",
|
||||
},
|
||||
[".mailmap"] = {
|
||||
icon = "",
|
||||
color = "#a0d0d0",
|
||||
cterm_color = "220",
|
||||
name = "mailmap",
|
||||
},
|
||||
[".vscode-test.js"] = {
|
||||
icon = "",
|
||||
color = "#206ba3",
|
||||
cterm_color = "220",
|
||||
name = "vscodetest",
|
||||
},
|
||||
[".mention-bot"] = {
|
||||
icon = "",
|
||||
color = "#ffffff",
|
||||
cterm_color = "220",
|
||||
name = "mentionbot",
|
||||
},
|
||||
[".project"] = {
|
||||
icon = "",
|
||||
color = "#5881b1",
|
||||
cterm_color = "220",
|
||||
name = "project",
|
||||
},
|
||||
["gradlew"] = {
|
||||
icon = "",
|
||||
color = "#9C9C9C",
|
||||
cterm_color = "220",
|
||||
name = "gradlewFile",
|
||||
},
|
||||
[".classpath"] = {
|
||||
icon = "",
|
||||
color = "#9C9C9C",
|
||||
cterm_color = "220",
|
||||
name = "gradlewFile",
|
||||
},
|
||||
["dockerfile-development"] = {
|
||||
icon = "",
|
||||
color = "#0087c9",
|
||||
cterm_color = "220",
|
||||
name = "gradlewFile-development",
|
||||
},
|
||||
["dockerfile-staging"] = {
|
||||
icon = "",
|
||||
color = "#0087c9",
|
||||
cterm_color = "220",
|
||||
name = "gradlewFile-staging",
|
||||
},
|
||||
["nodemon.json"] = {
|
||||
icon = "",
|
||||
color = "#76d04b",
|
||||
cterm_color = "220",
|
||||
name = "nodemonjson",
|
||||
},
|
||||
["webpack.config.js"] = {
|
||||
icon = "",
|
||||
color = "#8ED6FB",
|
||||
cterm_color = "220",
|
||||
name = "webpackconfigjs",
|
||||
},
|
||||
["package.json"] = {
|
||||
icon = "",
|
||||
color = "#8ED6FB",
|
||||
cterm_color = "220",
|
||||
name = "packagejson",
|
||||
},
|
||||
["package-lock.json"] = {
|
||||
icon = "",
|
||||
color = "#cc0000",
|
||||
cterm_color = "220",
|
||||
name = "packagelockjson",
|
||||
},
|
||||
[".gitignore"] = {
|
||||
icon = "",
|
||||
color = "#8ED6FB",
|
||||
cterm_color = "220",
|
||||
name = "gitignore",
|
||||
},
|
||||
["tsconfig.json"] = {
|
||||
icon = "",
|
||||
color = "#519aba",
|
||||
cterm_color = "74",
|
||||
name = "TSConfig",
|
||||
},
|
||||
["jsconfig.json"] = {
|
||||
icon = "",
|
||||
color = "#f2c55c",
|
||||
cterm_color = "220",
|
||||
name = "JSConfig",
|
||||
},
|
||||
[".gitlab-ci.yml"] = {
|
||||
icon = "",
|
||||
color = "#F14C28",
|
||||
cterm_color = "220",
|
||||
name = "gitlabciyaml",
|
||||
},
|
||||
[".env_example"] = {
|
||||
icon = "",
|
||||
color = "#faf743",
|
||||
cterm_color = "227",
|
||||
name = "Envexample",
|
||||
},
|
||||
},
|
||||
})
|
File diff suppressed because it is too large
Load diff
|
@ -1,17 +0,0 @@
|
|||
local status_ok, yanky = pcall(require, "yanky")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
yanky.setup({
|
||||
ring = {
|
||||
history_length = 50,
|
||||
storage = "memory",
|
||||
},
|
||||
preserve_cursor_position = {
|
||||
enabled = false,
|
||||
},
|
||||
})
|
||||
|
||||
-- cycle through the yank history, only work after paste
|
||||
vim.keymap.set("n", "[y", "<Plug>(YankyCycleForward)")
|
||||
vim.keymap.set("n", "]y", "<Plug>(YankyCycleBackward)")
|
Loading…
Add table
Add a link
Reference in a new issue