mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-21 00:25:47 +02:00
enc: lua format custem
This commit is contained in:
parent
65857a4226
commit
384c0b5768
68 changed files with 1450 additions and 1450 deletions
|
@ -1,4 +1,4 @@
|
|||
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
-- bootstrap lazy.nvim
|
||||
-- stylua: ignore
|
||||
|
@ -15,8 +15,8 @@ local icons = require("user.icons").ui
|
|||
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
vim.diagnostic.config { virtual_lines = false }
|
||||
require("lazy").setup {
|
||||
vim.diagnostic.config({ virtual_lines = false })
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
{ import = "plugins.themes" },
|
||||
{ import = "plugins" },
|
||||
|
@ -57,4 +57,4 @@ require("lazy").setup {
|
|||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
local transparent_mode = pcode.transparent_mode or 0
|
||||
if transparent_mode ~= nil then
|
||||
if transparent_mode == 1 then
|
||||
vim.cmd "TransparentDisable"
|
||||
vim.cmd "TransparentEnable"
|
||||
vim.cmd("TransparentDisable")
|
||||
vim.cmd("TransparentEnable")
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -12,7 +12,7 @@ local _get_folder_name = function()
|
|||
return " " .. str:lower():gsub("^%l", string.upper) .. " "
|
||||
end
|
||||
|
||||
local term_program = vim.fn.getenv "TERM_PROGRAM"
|
||||
local term_program = vim.fn.getenv("TERM_PROGRAM")
|
||||
if term_program == "WezTerm" then
|
||||
-- vim.cmd('silent !wezterm cli set-tab-title "' .. _get_folder_name() .. '"')
|
||||
-- create autocmd on insertEnter
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
local opts, _ = pcall(require, "user.options")
|
||||
if opts then
|
||||
require "user.options"
|
||||
require("user.options")
|
||||
end
|
||||
-- local key, _ = pcall(require, "user.keymaps")
|
||||
-- if key then
|
||||
|
@ -8,11 +8,11 @@ end
|
|||
-- end
|
||||
local cmd, _ = pcall(require, "user.autocommands")
|
||||
if cmd then
|
||||
require "user.autocommands"
|
||||
require("user.autocommands")
|
||||
end
|
||||
local onsave, _ = pcall(require, "user.format_onsave")
|
||||
if onsave then
|
||||
require "user.format_onsave"
|
||||
require("user.format_onsave")
|
||||
end
|
||||
vim.g.pcode_icons = require "user.icons"
|
||||
vim.g.pcode_icons = require("user.icons")
|
||||
return {}
|
||||
|
|
|
@ -5,7 +5,7 @@ return {
|
|||
lazy = true,
|
||||
event = "VimEnter",
|
||||
config = function()
|
||||
require "user.alpha"
|
||||
require("user.alpha")
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ return {
|
|||
dependencies = "neovim/nvim-lspconfig",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
require "user.breadcrumb"
|
||||
require "user.winbar"
|
||||
require("user.breadcrumb")
|
||||
require("user.winbar")
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ return {
|
|||
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
bufferline.setup {
|
||||
bufferline.setup({
|
||||
options = {
|
||||
color_icons = true,
|
||||
numbers = "none", -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string,
|
||||
|
@ -174,6 +174,6 @@ return {
|
|||
bg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -18,12 +18,12 @@ return {
|
|||
version = false, -- last release is way too old
|
||||
event = "InsertEnter",
|
||||
opts = function()
|
||||
local cmp = require "cmp"
|
||||
local luasnip = require "luasnip"
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
|
||||
local check_backspace = function()
|
||||
local col = vim.fn.col "." - 1
|
||||
return col == 0 or vim.fn.getline("."):sub(col, col):match "%s"
|
||||
local col = vim.fn.col(".") - 1
|
||||
return col == 0 or vim.fn.getline("."):sub(col, col):match("%s")
|
||||
end
|
||||
|
||||
return {
|
||||
|
@ -35,12 +35,12 @@ return {
|
|||
require("luasnip").lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert {
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<CR>"] = cmp.mapping.confirm { select = true }, -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
|
@ -69,14 +69,14 @@ return {
|
|||
"i",
|
||||
"s",
|
||||
}),
|
||||
},
|
||||
sources = cmp.config.sources {
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
{ name = "nvim_lua" },
|
||||
},
|
||||
}),
|
||||
formatting = {
|
||||
fields = { "kind", "abbr", "menu" },
|
||||
format = function(entry, vim_item)
|
||||
|
|
|
@ -14,11 +14,11 @@ if pcode.database then
|
|||
end,
|
||||
config = function()
|
||||
local function db_completion()
|
||||
require("cmp").setup.buffer {
|
||||
require("cmp").setup.buffer({
|
||||
sources = { { name = "vim-dadbod-completion" } },
|
||||
}
|
||||
})
|
||||
end
|
||||
vim.g.db_ui_save_location = vim.fn.stdpath "config" .. require("plenary.path").path.sep .. "db_ui"
|
||||
vim.g.db_ui_save_location = vim.fn.stdpath("config") .. require("plenary.path").path.sep .. "db_ui"
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = {
|
||||
|
|
|
@ -41,12 +41,12 @@ if fidget then
|
|||
tag = "legacy",
|
||||
event = "BufRead",
|
||||
config = function()
|
||||
require("fidget").setup {
|
||||
require("fidget").setup({
|
||||
window = {
|
||||
blend = 0,
|
||||
relative = "editor",
|
||||
},
|
||||
}
|
||||
})
|
||||
end,
|
||||
}
|
||||
elseif lualine then
|
||||
|
@ -57,7 +57,7 @@ elseif lualine then
|
|||
branch = "main",
|
||||
event = { "BufRead" },
|
||||
config = function()
|
||||
require("lsp-progress").setup {
|
||||
require("lsp-progress").setup({
|
||||
client_format = function(client_name, spinner, series_messages)
|
||||
return #series_messages > 0
|
||||
and (spinner .. " " .. ambilKataDariKiri(table.concat(series_messages, ", "), 4) .. "...")
|
||||
|
@ -69,7 +69,7 @@ elseif lualine then
|
|||
and (sign .. " " .. ambilKataDariKiri(table.concat(client_messages, " "), 4) .. "...")
|
||||
or sign
|
||||
end,
|
||||
}
|
||||
})
|
||||
end,
|
||||
}
|
||||
else
|
||||
|
|
|
@ -3,7 +3,7 @@ return {
|
|||
"nvim-lualine/lualine.nvim",
|
||||
event = { "InsertEnter", "BufRead", "BufNewFile" },
|
||||
config = function()
|
||||
local component = require "user.utils.lualine_component"
|
||||
local component = require("user.utils.lualine_component")
|
||||
local colors = component.colors
|
||||
|
||||
-- check config for theme
|
||||
|
@ -43,7 +43,7 @@ return {
|
|||
bubbles_theme = vim.fn.fnamemodify("auto", ":t")
|
||||
end
|
||||
|
||||
local gettheme = require "user.utils.lualine_template"
|
||||
local gettheme = require("user.utils.lualine_template")
|
||||
local theme_option = pcode.lualinetheme or "rounded"
|
||||
local theme = gettheme.rounded(bubbles_theme)
|
||||
if theme_option == "rounded" then
|
||||
|
@ -61,13 +61,13 @@ return {
|
|||
elseif theme_option == "default" then
|
||||
theme = {}
|
||||
end
|
||||
require("lualine").setup {
|
||||
require("lualine").setup({
|
||||
options = theme.options,
|
||||
sections = theme.sections,
|
||||
inactive_sections = theme.inactive_sections,
|
||||
tabline = theme.tabline,
|
||||
extensions = theme.extensions,
|
||||
}
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ if not vim.g.neovide and pcode.minianimate and true or false then
|
|||
opts = function()
|
||||
-- don't use animate when scrolling with the mouse
|
||||
local mouse_scrolled = false
|
||||
for _, scroll in ipairs { "Up", "Down" } do
|
||||
for _, scroll in ipairs({ "Up", "Down" }) do
|
||||
local key = "<ScrollWheel" .. scroll .. ">"
|
||||
vim.keymap.set({ "", "i" }, key, function()
|
||||
mouse_scrolled = true
|
||||
|
@ -16,14 +16,14 @@ if not vim.g.neovide and pcode.minianimate and true or false then
|
|||
end, { expr = true })
|
||||
end
|
||||
|
||||
local animate = require "mini.animate"
|
||||
local animate = require("mini.animate")
|
||||
return {
|
||||
resize = {
|
||||
timing = animate.gen_timing.linear { duration = 100, unit = "total" },
|
||||
timing = animate.gen_timing.linear({ duration = 100, unit = "total" }),
|
||||
},
|
||||
scroll = {
|
||||
timing = animate.gen_timing.linear { duration = 150, unit = "total" },
|
||||
subscroll = animate.gen_subscroll.equal {
|
||||
timing = animate.gen_timing.linear({ duration = 150, unit = "total" }),
|
||||
subscroll = animate.gen_subscroll.equal({
|
||||
predicate = function(total_scroll)
|
||||
if mouse_scrolled then
|
||||
mouse_scrolled = false
|
||||
|
@ -31,7 +31,7 @@ if not vim.g.neovide and pcode.minianimate and true or false then
|
|||
end
|
||||
return total_scroll > 1
|
||||
end,
|
||||
},
|
||||
}),
|
||||
},
|
||||
}
|
||||
end,
|
||||
|
|
|
@ -3,6 +3,6 @@ return {
|
|||
event = "VeryLazy",
|
||||
lazy = true,
|
||||
config = function()
|
||||
require("neoscroll").setup {}
|
||||
require("neoscroll").setup({})
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ return {
|
|||
{
|
||||
"<leader>un",
|
||||
function()
|
||||
require("notify").dismiss { silent = true, pending = true }
|
||||
require("notify").dismiss({ silent = true, pending = true })
|
||||
end,
|
||||
desc = "Delete all Notifications",
|
||||
},
|
||||
|
@ -22,10 +22,10 @@ return {
|
|||
},
|
||||
-- event = "BufWinEnter",
|
||||
config = function()
|
||||
local notify = require "notify"
|
||||
local notify = require("notify")
|
||||
-- this for transparency
|
||||
-- notify.setup { background_colour = "#000000", render = "compact" }
|
||||
notify.setup { render = "compact" }
|
||||
notify.setup({ render = "compact" })
|
||||
-- this overwrites the vim notify function
|
||||
vim.notify = notify.notify
|
||||
end,
|
||||
|
|
|
@ -210,7 +210,7 @@ return {
|
|||
},
|
||||
config = function(_, opts)
|
||||
require("nvim-tree").setup(opts)
|
||||
local api = require "nvim-tree.api"
|
||||
local api = require("nvim-tree.api")
|
||||
api.events.subscribe(api.events.Event.FileCreated, function(file)
|
||||
vim.cmd("edit " .. file.fname)
|
||||
end)
|
||||
|
|
|
@ -20,8 +20,8 @@ if pcode.nvimufo then
|
|||
{
|
||||
"luukvbaal/statuscol.nvim",
|
||||
config = function()
|
||||
local builtin = require "statuscol.builtin"
|
||||
require("statuscol").setup {
|
||||
local builtin = require("statuscol.builtin")
|
||||
require("statuscol").setup({
|
||||
setopt = true,
|
||||
relculright = true,
|
||||
segments = {
|
||||
|
@ -33,7 +33,7 @@ if pcode.nvimufo then
|
|||
},
|
||||
{ text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" },
|
||||
},
|
||||
}
|
||||
})
|
||||
end,
|
||||
},
|
||||
},
|
||||
|
@ -65,7 +65,7 @@ if pcode.nvimufo then
|
|||
-- these are "extra", change them as you like
|
||||
vim.keymap.set("n", "zR", require("ufo").openAllFolds)
|
||||
vim.keymap.set("n", "zM", require("ufo").closeAllFolds)
|
||||
vim.cmd("highlight FoldColumn guifg=" .. vim.fn.synIDattr(vim.fn.synIDtrans(vim.fn.hlID "Comment"), "fg"))
|
||||
vim.cmd("highlight FoldColumn guifg=" .. vim.fn.synIDattr(vim.fn.synIDtrans(vim.fn.hlID("Comment")), "fg"))
|
||||
-- start ini bagian code support comment dan import
|
||||
local ftMap = {
|
||||
vim = "indent",
|
||||
|
@ -75,7 +75,7 @@ if pcode.nvimufo then
|
|||
|
||||
local function customizeSelector(bufnr)
|
||||
local function handleFallbackException(err, providerName)
|
||||
if type(err) == "string" and err:match "UfoFallbackException" then
|
||||
if type(err) == "string" and err:match("UfoFallbackException") then
|
||||
return require("ufo").getFolds(bufnr, providerName)
|
||||
else
|
||||
return require("promise").reject(err)
|
||||
|
@ -92,7 +92,7 @@ if pcode.nvimufo then
|
|||
end)
|
||||
end
|
||||
|
||||
require("ufo").setup {
|
||||
require("ufo").setup({
|
||||
open_fold_hl_timeout = 150,
|
||||
close_fold_kinds_for_ft = {
|
||||
-- default = { "imports", "comment" },
|
||||
|
@ -127,21 +127,21 @@ if pcode.nvimufo then
|
|||
-- Memeriksa apakah baris awal dari fold adalah komentar
|
||||
local start_line = vim.api.nvim_buf_get_lines(0, lnum - 1, lnum, false)[1]
|
||||
-- cari comentar dengan awalan /* untuk generaal comment
|
||||
if start_line:find "^%s*%/%*" then
|
||||
if start_line:find("^%s*%/%*") then
|
||||
is_comment = true
|
||||
-- cara commentar dengan awalan <!-- untuk html
|
||||
elseif start_line:find "^%s*<!--" then
|
||||
elseif start_line:find("^%s*<!--") then
|
||||
is_comment = true
|
||||
-- cari comentar dengan awalan -- untuk lua
|
||||
elseif start_line:find "^%s*%-%-" then
|
||||
elseif start_line:find("^%s*%-%-") then
|
||||
is_comment = true
|
||||
end
|
||||
-- cek fold yang berawalan import
|
||||
if start_line:find "^%s*import" then
|
||||
if start_line:find("^%s*import") then
|
||||
is_import = true
|
||||
end
|
||||
-- cek fold dengan akhiran {
|
||||
if start_line:find "%s*{%s*$" then
|
||||
if start_line:find("%s*{%s*$") then
|
||||
is_bracket = true
|
||||
end
|
||||
if is_comment then
|
||||
|
@ -221,7 +221,7 @@ if pcode.nvimufo then
|
|||
end
|
||||
return result
|
||||
end,
|
||||
}
|
||||
})
|
||||
-- end bagian code support comment dan import
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = {
|
||||
|
|
|
@ -4,7 +4,7 @@ return {
|
|||
event = "BufRead",
|
||||
config = function()
|
||||
-- Modul ini berisi beberapa definisi default
|
||||
local rainbow_delimiters = require "rainbow-delimiters"
|
||||
local rainbow_delimiters = require("rainbow-delimiters")
|
||||
vim.g.rainbow_delimiters = {
|
||||
strategy = {
|
||||
[""] = rainbow_delimiters.strategy["global"],
|
||||
|
|
|
@ -22,7 +22,7 @@ return {
|
|||
only_sort_text = true,
|
||||
}
|
||||
end
|
||||
local actions = require "telescope.actions"
|
||||
local actions = require("telescope.actions")
|
||||
vim.g.theme_switcher_loaded = true
|
||||
return {
|
||||
defaults = {
|
||||
|
|
|
@ -25,7 +25,7 @@ if transparent then
|
|||
event = "BufWinEnter",
|
||||
cmd = { "TransparentToggle", "TransparentEnable", "TransparentDisable" },
|
||||
config = function()
|
||||
require("transparent").setup {
|
||||
require("transparent").setup({
|
||||
extra_groups = {
|
||||
"Normal",
|
||||
"NormalNC",
|
||||
|
@ -53,25 +53,25 @@ if transparent then
|
|||
-- disable lualine background color
|
||||
"LualineNormal",
|
||||
},
|
||||
}
|
||||
require("transparent").clear_prefix "BufferLine"
|
||||
})
|
||||
require("transparent").clear_prefix("BufferLine")
|
||||
-- clear prefix for which-key
|
||||
require("transparent").clear_prefix "WhichKey"
|
||||
require("transparent").clear_prefix("WhichKey")
|
||||
-- clear prefix for lazy.nvim
|
||||
require("transparent").clear_prefix "Lazy"
|
||||
require("transparent").clear_prefix("Lazy")
|
||||
-- clear prefix for NvimTree
|
||||
require("transparent").clear_prefix "NvimTree"
|
||||
require("transparent").clear_prefix("NvimTree")
|
||||
-- clear prefix for NeoTree
|
||||
require("transparent").clear_prefix "NeoTree"
|
||||
require("transparent").clear_prefix("NeoTree")
|
||||
-- clear prefix for Telescope
|
||||
require("transparent").clear_prefix "Telescope"
|
||||
require("transparent").clear_prefix "mason"
|
||||
require("transparent").clear_prefix("Telescope")
|
||||
require("transparent").clear_prefix("mason")
|
||||
if clear_lualine then
|
||||
-- clear prefix for Lualine
|
||||
require("transparent").clear_prefix "Lualine"
|
||||
require("transparent").clear_prefix("Lualine")
|
||||
-- create auto command to set transparent
|
||||
vim.cmd "TransparentDisable"
|
||||
vim.cmd "TransparentEnable"
|
||||
vim.cmd("TransparentDisable")
|
||||
vim.cmd("TransparentEnable")
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
|
|
@ -7,12 +7,12 @@ if pcode.columnline then
|
|||
opts = {},
|
||||
config = function()
|
||||
local icons = vim.g.pcode_icons
|
||||
require("virt-column").overwrite {
|
||||
require("virt-column").overwrite({
|
||||
exclude = {
|
||||
filetypes = { "help", "text", "markdown" },
|
||||
},
|
||||
char = icons.ui.LineMiddle,
|
||||
}
|
||||
})
|
||||
-- Mengatur colum color max 80 caracter
|
||||
vim.api.nvim_create_autocmd("BufWinEnter", {
|
||||
pattern = "*",
|
||||
|
|
|
@ -5,7 +5,7 @@ end
|
|||
local WELCOME_MESSAGE = [[
|
||||
Welcome to ChatGPT.
|
||||
]]
|
||||
chatgpt.setup {
|
||||
chatgpt.setup({
|
||||
welcome_message = WELCOME_MESSAGE, -- set to "" if you don't like the fancy godot robot
|
||||
loading_text = "loading",
|
||||
question_sign = "", -- you can use emoji if you want e.g. 🙂
|
||||
|
@ -73,4 +73,4 @@ chatgpt.setup {
|
|||
new_session = "<C-n>",
|
||||
cycle_windows = "<Tab>",
|
||||
},
|
||||
}
|
||||
})
|
||||
|
|
|
@ -8,5 +8,5 @@ end
|
|||
|
||||
local ok, _ = pcall(vim.cmd.colorscheme, colorscheme)
|
||||
if not ok then
|
||||
require "notify"("Colorscheme '" .. colorscheme .. "' not found!", "error")
|
||||
require("notify")("Colorscheme '" .. colorscheme .. "' not found!", "error")
|
||||
end
|
||||
|
|
|
@ -19,7 +19,7 @@ if data_board ~= nil then
|
|||
board = data_board
|
||||
end
|
||||
|
||||
local dashboard = require "alpha.themes.dashboard"
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
dashboard.section.header.val = board
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button("F", " Find file", ":Telescope find_files <CR>"),
|
||||
|
@ -62,8 +62,8 @@ vim.api.nvim_create_autocmd("User", {
|
|||
vim.api.nvim_create_autocmd({ "User" }, {
|
||||
pattern = { "AlphaReady" },
|
||||
callback = function()
|
||||
vim.cmd [[
|
||||
vim.cmd([[
|
||||
set laststatus=0 | autocmd BufUnload <buffer> set laststatus=3
|
||||
]]
|
||||
]])
|
||||
end,
|
||||
})
|
||||
|
|
|
@ -14,25 +14,25 @@ end
|
|||
if run == 1 then
|
||||
function FORMAT_FILTER(client)
|
||||
local filetype = vim.bo.filetype
|
||||
local n = require "null-ls"
|
||||
local s = require "null-ls.sources"
|
||||
local n = require("null-ls")
|
||||
local s = require("null-ls.sources")
|
||||
local method = n.methods.FORMATTING
|
||||
local available_formatters = s.get_available(filetype, method)
|
||||
|
||||
if #available_formatters > 0 then
|
||||
return client.name == "null-ls"
|
||||
elseif client.supports_method "textDocument/formatting" then
|
||||
elseif client.supports_method("textDocument/formatting") then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
vim.cmd [[
|
||||
vim.cmd([[
|
||||
augroup _lsp
|
||||
autocmd!
|
||||
" autocmd BufWritePre * lua vim.lsp.buf.format{timeout_ms =200, filter=format_filter}
|
||||
autocmd BufWritePre * lua vim.lsp.buf.format{timeout_ms=pcode.format_timeout_ms or 5000 ,filter=FORMAT_FILTER}
|
||||
augroup end
|
||||
]]
|
||||
]])
|
||||
end
|
||||
|
|
|
@ -9,11 +9,11 @@ function M.smart_quit()
|
|||
prompt = "You have unsaved changes. Quit anyway? (y/n) ",
|
||||
}, function(input)
|
||||
if input == "y" then
|
||||
vim.cmd "q!"
|
||||
vim.cmd("q!")
|
||||
end
|
||||
end)
|
||||
else
|
||||
vim.cmd "q!"
|
||||
vim.cmd("q!")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@ local opts = { noremap = true, silent = true }
|
|||
|
||||
function _LIVE_SERVER()
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local live_server = Terminal:new {
|
||||
local live_server = Terminal:new({
|
||||
cmd = "live-server",
|
||||
hidden = true,
|
||||
direction = "tab",
|
||||
}
|
||||
})
|
||||
live_server:toggle()
|
||||
end
|
||||
|
||||
|
@ -159,7 +159,7 @@ end
|
|||
-- if pcall(require, "dap") then
|
||||
-- modified function keys found with `showkey -a` in the terminal to get key code
|
||||
-- run `nvim -V3log +quit` and search through the "Terminal info" in the `log` file for the correct keyname
|
||||
if vim.fn.has "win32" == 0 then
|
||||
if vim.fn.has("win32") == 0 then
|
||||
map("n", "<F5>", function()
|
||||
require("dap").continue()
|
||||
end, "")
|
||||
|
|
|
@ -51,12 +51,12 @@ end
|
|||
|
||||
-- vim.opt.shortmess = "ilmnrx" -- flags to shorten vim messages, see :help 'shortmess'
|
||||
-- vim.o.winbar = "%{%v:lua.require'nvim-navic'.get_location()%}"
|
||||
vim.opt.shortmess:append "c" -- don't give |ins-completion-menu| messages
|
||||
vim.opt.iskeyword:append "-" -- hyphenated words recognized by searches
|
||||
vim.opt.formatoptions:remove { "t", "c", "q", "j" }
|
||||
vim.opt.shortmess:append("c") -- don't give |ins-completion-menu| messages
|
||||
vim.opt.iskeyword:append("-") -- hyphenated words recognized by searches
|
||||
vim.opt.formatoptions:remove({ "t", "c", "q", "j" })
|
||||
vim.opt.formatoptions = "croql"
|
||||
-- vim.opt.formatoptions:remove({ "c", "r", "o" }) -- don't insert the current comment leader automatically for auto-wrapping comments using 'textwidth', hitting <Enter> in insert mode, or hitting 'o' or 'O' in normal mode.
|
||||
vim.opt.runtimepath:remove "/usr/share/vim/vimfiles" -- separate vim plugins from neovim in case vim still in use
|
||||
vim.opt.runtimepath:remove("/usr/share/vim/vimfiles") -- separate vim plugins from neovim in case vim still in use
|
||||
-- config for blink cursor in normal, visual and insert mode
|
||||
-- vim.opt.guicursor = {
|
||||
-- "n-v-c:block-Cursor/lCursor-blinkwait1000-blinkon100-blinkoff100",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
local alpha = require "alpha"
|
||||
local startify = require "alpha.themes.startify"
|
||||
local alpha = require("alpha")
|
||||
local startify = require("alpha.themes.startify")
|
||||
local dash_model = {}
|
||||
dash_model = {
|
||||
[[ _ __ __ ]],
|
||||
|
@ -63,9 +63,9 @@ vim.api.nvim_create_autocmd("User", {
|
|||
vim.api.nvim_create_autocmd({ "User" }, {
|
||||
pattern = { "AlphaReady" },
|
||||
callback = function()
|
||||
vim.cmd [[
|
||||
vim.cmd([[
|
||||
set laststatus=0 | autocmd BufUnload <buffer> set laststatus=3
|
||||
]]
|
||||
]])
|
||||
end,
|
||||
})
|
||||
-- ignore filetypes in MRU
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
local hide_in_width = function()
|
||||
return vim.fn.winwidth(0) > 75
|
||||
end
|
||||
local icons = require "user.icons"
|
||||
local formatter = require "user.utils.formatter"
|
||||
local linter = require "user.utils.linter"
|
||||
local icons = require("user.icons")
|
||||
local formatter = require("user.utils.formatter")
|
||||
local linter = require("user.utils.linter")
|
||||
|
||||
local getLeftSubstring = function(word, length)
|
||||
if #word > length then
|
||||
|
@ -86,7 +86,7 @@ return {
|
|||
local buf_ft = vim.bo.filetype
|
||||
-- start register
|
||||
local buf_clients = {}
|
||||
buf_clients = vim.lsp.get_clients { bufnr = 0 }
|
||||
buf_clients = vim.lsp.get_clients({ bufnr = 0 })
|
||||
local buf_client_names = {}
|
||||
if next(buf_clients) == nil then
|
||||
-- TODO: clean up this if statement
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
local M = {}
|
||||
|
||||
local component = require "user.utils.lualine_component"
|
||||
local component = require("user.utils.lualine_component")
|
||||
local treesitter = component.treesitter
|
||||
local lsp_info = component.lsp_info
|
||||
local diagnostics = component.diagnostics
|
||||
|
|
|
@ -3,7 +3,7 @@ local M = {}
|
|||
-- for debug
|
||||
local debug_key = {}
|
||||
|
||||
if vim.fn.has "win32" == 0 then
|
||||
if vim.fn.has("win32") == 0 then
|
||||
debug_key = {
|
||||
name = " Debug",
|
||||
t = { "<cmd>lua require'dap'.toggle_breakpoint()<cr>", "Toggle Breakpoint" },
|
||||
|
@ -26,47 +26,47 @@ end
|
|||
|
||||
function M._LAZYGIT_TOGGLE()
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local lazygit = Terminal:new { cmd = "lazygit", hidden = true }
|
||||
local lazygit = Terminal:new({ cmd = "lazygit", hidden = true })
|
||||
lazygit:toggle()
|
||||
end
|
||||
|
||||
function M._NODE_TOGGLE()
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local node = Terminal:new { cmd = "node", hidden = true }
|
||||
local node = Terminal:new({ cmd = "node", hidden = true })
|
||||
node:toggle()
|
||||
end
|
||||
|
||||
function M._BTOP_TOGGLE()
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local htop = Terminal:new { cmd = "btop", hidden = true }
|
||||
local htop = Terminal:new({ cmd = "btop", hidden = true })
|
||||
htop:toggle()
|
||||
end
|
||||
|
||||
function M._PYTHON_TOGGLE()
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local python = Terminal:new { cmd = "python", hidden = true }
|
||||
local python = Terminal:new({ cmd = "python", hidden = true })
|
||||
python:toggle()
|
||||
end
|
||||
|
||||
function M._NEWTAB_TOGGLE()
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local pwsh = Terminal:new { cmd = "pwsh", hidden = true, direction = "tab" }
|
||||
local pwsh = Terminal:new({ cmd = "pwsh", hidden = true, direction = "tab" })
|
||||
pwsh:toggle()
|
||||
end
|
||||
|
||||
function M._OPEN_EXPLORER()
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local pwsh = Terminal:new { cmd = "explorer .", hidden = true, direction = "tab" }
|
||||
local pwsh = Terminal:new({ cmd = "explorer .", hidden = true, direction = "tab" })
|
||||
pwsh:toggle()
|
||||
end
|
||||
|
||||
function M._LIVE_SERVER()
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local live_server = Terminal:new {
|
||||
local live_server = Terminal:new({
|
||||
cmd = "live-server",
|
||||
hidden = true,
|
||||
direction = "tab",
|
||||
}
|
||||
})
|
||||
live_server:toggle()
|
||||
end
|
||||
|
||||
|
|
|
@ -30,9 +30,9 @@ local excludes = function()
|
|||
end
|
||||
|
||||
local get_filename = function()
|
||||
local filename = vim.fn.expand "%:t"
|
||||
local extension = vim.fn.expand "%:e"
|
||||
local f = require "user.functions"
|
||||
local filename = vim.fn.expand("%:t")
|
||||
local extension = vim.fn.expand("%:e")
|
||||
local f = require("user.functions")
|
||||
|
||||
if not f.isempty(filename) then
|
||||
local file_icon, hl_group = require("nvim-web-devicons").get_icon(filename, extension, { default = true })
|
||||
|
@ -102,7 +102,7 @@ local get_winbar = function()
|
|||
if excludes() then
|
||||
return
|
||||
end
|
||||
local f = require "user.functions"
|
||||
local f = require("user.functions")
|
||||
local value = get_filename()
|
||||
|
||||
local gps_added = false
|
||||
|
@ -114,7 +114,7 @@ local get_winbar = function()
|
|||
end
|
||||
end
|
||||
|
||||
if not f.isempty(value) and f.get_buf_option "mod" then
|
||||
if not f.isempty(value) and f.get_buf_option("mod") then
|
||||
-- TODO: replace with circle
|
||||
local mod = "%#LspCodeLens#" .. icons.ui.Circle .. "%*"
|
||||
if gps_added then
|
||||
|
@ -138,7 +138,7 @@ local get_winbar = function()
|
|||
end
|
||||
|
||||
vim.api.nvim_create_augroup("_winbar", {})
|
||||
if vim.fn.has "nvim-0.8" == 1 then
|
||||
if vim.fn.has("nvim-0.8") == 1 then
|
||||
vim.api.nvim_create_autocmd(
|
||||
{ "CursorHoldI", "CursorHold", "BufWinEnter", "BufFilePost", "InsertEnter", "BufWritePost", "TabClosed" },
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue