add: update config

This commit is contained in:
asep.komarudin 2024-04-18 07:17:54 +07:00
parent c651a8ca42
commit a81806cab8
15 changed files with 363 additions and 407 deletions

View file

@ -63,3 +63,12 @@ vim.api.nvim_create_autocmd("User", {
pcall(vim.cmd.AlphaRedraw)
end,
})
vim.api.nvim_create_autocmd({ "User" }, {
pattern = { "AlphaReady" },
callback = function()
vim.cmd([[
set laststatus=0 | autocmd BufUnload <buffer> set laststatus=3
]])
end,
})

View file

@ -1,11 +1,16 @@
return {
kind = {
Array = "",
Boolean = "",
-- Boolean = "",
Boolean = "󰨙 ",
Class = "",
Color = "",
Codeium = "󰘦 ",
Control = "",
Collapsed = "",
Constant = "",
Constructor = "",
Copilot = "",
Enum = "",
EnumMember = "",
Event = "",
@ -29,6 +34,7 @@ return {
Snippet = "",
String = "",
Struct = "",
TabNine = "󰏚 ",
Text = "",
TypeParameter = "",
Unit = "",
@ -143,6 +149,22 @@ return {
ft = "",
not_loaded = "",
},
folding = {
vert = "", -- alternatives │
fold = " ",
eob = " ", -- suppress ~ at EndOfBuffer
diff = "", -- alternatives = ⣿ ░ ─
msgsep = "",
foldopen = "",
foldsep = "",
foldclose = "",
plusBox = "󰜄",
plusSircle = "󰐙",
plus = "󰐕",
minusBox = "󰛲",
minusSircle = "󰍷",
minus = "󰍴",
},
diagnostics = {
BoldError = "",
Error = "",

View file

@ -1,186 +1,7 @@
local default_schemas = nil
local status_ok, jsonls_settings = pcall(require, "nlspsettings.jsonls")
if status_ok then
default_schemas = jsonls_settings.get_default_schemas()
end
local schemas = {
{
description = "TypeScript compiler configuration file",
fileMatch = {
"tsconfig.json",
"tsconfig.*.json",
},
url = "https://json.schemastore.org/tsconfig.json",
},
{
description = "Lerna config",
fileMatch = { "lerna.json" },
url = "https://json.schemastore.org/lerna.json",
},
{
description = "Babel configuration",
fileMatch = {
".babelrc.json",
".babelrc",
"babel.config.json",
},
url = "https://json.schemastore.org/babelrc.json",
},
{
description = "ESLint config",
fileMatch = {
".eslintrc.json",
".eslintrc",
},
url = "https://json.schemastore.org/eslintrc.json",
},
{
description = "Bucklescript config",
fileMatch = { "bsconfig.json" },
url = "https://raw.githubusercontent.com/rescript-lang/rescript-compiler/8.2.0/docs/docson/build-schema.json",
},
{
description = "Prettier config",
fileMatch = {
".prettierrc",
".prettierrc.json",
"prettier.config.json",
},
url = "https://json.schemastore.org/prettierrc",
},
{
description = "Vercel Now config",
fileMatch = { "now.json" },
url = "https://json.schemastore.org/now",
},
{
description = "Stylelint config",
fileMatch = {
".stylelintrc",
".stylelintrc.json",
"stylelint.config.json",
},
url = "https://json.schemastore.org/stylelintrc",
},
{
description = "A JSON schema for the ASP.NET LaunchSettings.json files",
fileMatch = { "launchsettings.json" },
url = "https://json.schemastore.org/launchsettings.json",
},
{
description = "Schema for CMake Presets",
fileMatch = {
"CMakePresets.json",
"CMakeUserPresets.json",
},
url = "https://raw.githubusercontent.com/Kitware/CMake/master/Help/manual/presets/schema.json",
},
{
description = "Configuration file as an alternative for configuring your repository in the settings page.",
fileMatch = {
".codeclimate.json",
},
url = "https://json.schemastore.org/codeclimate.json",
},
{
description = "LLVM compilation database",
fileMatch = {
"compile_commands.json",
},
url = "https://json.schemastore.org/compile-commands.json",
},
{
description = "Config file for Command Task Runner",
fileMatch = {
"commands.json",
},
url = "https://json.schemastore.org/commands.json",
},
{
description = "AWS CloudFormation provides a common language for you to describe and provision all the infrastructure resources in your cloud environment.",
fileMatch = {
"*.cf.json",
"cloudformation.json",
},
url = "https://raw.githubusercontent.com/awslabs/goformation/v5.2.9/schema/cloudformation.schema.json",
},
{
description = "The AWS Serverless Application Model (AWS SAM, previously known as Project Flourish) extends AWS CloudFormation to provide a simplified way of defining the Amazon API Gateway APIs, AWS Lambda functions, and Amazon DynamoDB tables needed by your serverless application.",
fileMatch = {
"serverless.template",
"*.sam.json",
"sam.json",
},
url = "https://raw.githubusercontent.com/awslabs/goformation/v5.2.9/schema/sam.schema.json",
},
{
description = "Json schema for properties json file for a GitHub Workflow template",
fileMatch = {
".github/workflow-templates/**.properties.json",
},
url = "https://json.schemastore.org/github-workflow-template-properties.json",
},
{
description = "golangci-lint configuration file",
fileMatch = {
".golangci.toml",
".golangci.json",
},
url = "https://json.schemastore.org/golangci-lint.json",
},
{
description = "JSON schema for the JSON Feed format",
fileMatch = {
"feed.json",
},
url = "https://json.schemastore.org/feed.json",
versions = {
["1"] = "https://json.schemastore.org/feed-1.json",
["1.1"] = "https://json.schemastore.org/feed.json",
},
},
{
description = "Packer template JSON configuration",
fileMatch = {
"packer.json",
},
url = "https://json.schemastore.org/packer.json",
},
{
description = "NPM configuration file",
fileMatch = {
"package.json",
},
url = "https://json.schemastore.org/package.json",
},
{
description = "JSON schema for Visual Studio component configuration files",
fileMatch = {
"*.vsconfig",
},
url = "https://json.schemastore.org/vsconfig.json",
},
{
description = "Resume json",
fileMatch = { "resume.json" },
url = "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
},
}
local function extend(tab1, tab2)
for _, value in ipairs(tab2 or {}) do
table.insert(tab1, value)
end
return tab1
end
local extended_schemas = extend(schemas, default_schemas)
local opts = {
return {
settings = {
json = {
schemas = extended_schemas,
schemas = require("schemastore").json.schemas(),
},
},
setup = {
@ -196,5 +17,3 @@ local opts = {
provideFormatter = false,
},
}
return opts

View file

@ -1,21 +1,37 @@
-- https://luals.github.io/wiki/settings/
return {
settings = {
Lua = {
format = {
enable = false,
},
diagnostics = {
globals = { "vim" },
globals = { "vim", "spec" },
},
runtime = {
version = "LuaJIT",
special = {
spec = "require",
},
},
workspace = {
checkThirdParty = false,
library = {
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
[vim.fn.stdpath("config") .. "/lua"] = true,
[vim.fn.expand("$VIMRUNTIME")] = true,
["${3rd}/busted/library"] = true,
["${3rd}/luassert/library"] = true,
["${3rd}/luv/library"] = true,
},
maxPreload = 5000,
preloadFileSize = 10000,
},
hint = {
enable = false,
arrayIndex = "Disable", -- "Enable" | "Auto" | "Disable"
await = true,
paramName = "Disable", -- "All" | "Literal" | "Disable"
paramType = true,
semicolon = "All", -- "All" | "SameLine" | "Disable"
setType = false,
},
telemetry = {
enable = false,
},
},
},

View file

@ -0,0 +1,25 @@
local opts = {
setup = {
root_dir = require("lspconfig.util").root_pattern("package.json", "vue.config.js")
or vim.loop.cwd()
or vim.fn.getcwd(),
init_options = {
config = {
vetur = {
completion = {
autoImport = true,
tagCasing = "kebab",
useScaffoldSnippets = true,
},
useWorkspaceDependencies = true,
validation = {
script = true,
style = true,
template = true,
},
},
},
},
},
}
return opts

View file

@ -0,0 +1,16 @@
local opts = {
settings = {
yaml = {
hover = true,
completion = true,
validate = true,
schemaStore = {
enable = true,
url = "https://www.schemastore.org/api/json/catalog.json",
},
schemas = require("schemastore").yaml.schemas(),
},
},
}
return opts

View file

@ -134,7 +134,10 @@ nvim_tree.setup({
git_clean = false,
no_buffer = false,
custom = { "node_modules", "\\.cache", "\\.git" },
exclude = {},
exclude = {
".gitignore",
".prettierignore",
},
},
filesystem_watchers = {
enable = true,
@ -146,7 +149,8 @@ nvim_tree.setup({
ignore = false,
show_on_dirs = true,
show_on_open_dirs = true,
timeout = 200,
disable_for_dirs = {},
timeout = 400,
},
actions = {
use_system_clipboard = true,
@ -201,7 +205,8 @@ nvim_tree.setup({
},
},
notify = {
threshold = vim.log.levels.INFO,
-- threshold = vim.log.levels.INFO,
threshold = vim.log.levels.ERROR,
},
log = {
enable = false,

View file

@ -64,6 +64,15 @@ vim.api.nvim_create_autocmd("User", {
pcall(vim.cmd.AlphaRedraw)
end,
})
vim.api.nvim_create_autocmd({ "User" }, {
pattern = { "AlphaReady" },
callback = function()
vim.cmd([[
set laststatus=0 | autocmd BufUnload <buffer> set laststatus=3
]])
end,
})
-- ignore filetypes in MRU
startify.mru_opts.ignore = function(path, ext)
return (string.find(path, "COMMIT_EDITMSG")) or (vim.tbl_contains(default_mru_ignore, ext))

View file

@ -137,6 +137,12 @@ material_icon.setup({
cterm_color = "220",
name = "cfm",
},
["cfc"] = {
icon = "",
color = "#507F89",
cterm_color = "220",
name = "cfc",
},
["png"] = {
icon = "󰋩",
color = "#3574f0",

View file

@ -110,27 +110,28 @@ function _CLOSE_ALL_BUFFER()
end
end
local icons = require("user.icons")
local setup = {
plugins = {
marks = true, -- shows a list of your marks on ' and `
registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
marks = false, -- shows a list of your marks on ' and `
registers = false, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
spelling = {
enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions
suggestions = 20, -- how many suggestions should be shown in the list?
},
enabled = true,
suggestions = 20,
}, -- use which-key for spelling hints
-- the presets plugin, adds help for a bunch of default keybindings in Neovim
-- No actual key bindings are created
presets = {
operators = false, -- adds help for operators like d, y, ... and registers them for motion / text object completion
motions = true, -- adds help for motions
text_objects = true, -- help for text objects triggered after entering an operator
windows = true, -- default bindings on <c-w>
nav = true, -- misc bindings to work with windows
z = true, -- bindings for folds, spelling and others prefixed with z
g = true, -- bindings for prefixed with g
operators = false, -- adds help for operators like d, y, ...
motions = false, -- adds help for motions
text_objects = false, -- help for text objects triggered after entering an operator
windows = false, -- default bindings on <c-w>
nav = false, -- misc bindings to work with windows
z = false, -- bindings for folds, spelling and others prefixed with z
g = false, -- bindings for prefixed with g
},
},
-- add operators that will trigger motion and text object completion
}, -- add operators that will trigger motion and text object completion
-- to enable all native operators, set the preset / operators plugin above
-- operators = { gc = "Comments" },
key_labels = {
@ -141,9 +142,9 @@ local setup = {
-- ["<tab>"] = "TAB",
},
icons = {
breadcrumb = "»", -- symbol used in the command line area that shows your active key combo
separator = "", -- symbol used between a key and it's label
group = "+", -- symbol prepended to a group
breadcrumb = icons.ui.DoubleChevronRight, -- symbol used in the command line area that shows your active key combo
separator = icons.ui.BoldArrowRight, -- symbol used between a key and it's label
group = icons.ui.Plus, -- symbol prepended to a group
},
popup_mappings = {
scroll_down = "<c-d>", -- binding to scroll down inside the popup
@ -151,9 +152,8 @@ local setup = {
},
window = {
border = "rounded", -- none, single, double, shadow
-- border = "none", -- none, single, double, shadow
position = "bottom", -- bottom, top
margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]
margin = { 1, 1, 1, 1 }, -- extra window margin [top, right, bottom, left]
padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left]
winblend = 0,
},
@ -166,6 +166,7 @@ local setup = {
ignore_missing = true, -- enable this to hide mappings for which you didn't specify a label
hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "call", "lua", "^:", "^ " }, -- hide mapping boilerplate
show_help = true, -- show help message on the command line when the popup is visible
show_keys = true, -- show the currently pressed key and its label as a message in the command line
triggers = "auto", -- automatically setup triggers
-- triggers = {"<leader>"} -- or specify a list manually
triggers_blacklist = {
@ -175,6 +176,12 @@ local setup = {
i = { "j", "k" },
v = { "j", "k" },
},
-- disable the WhichKey popup for certain buf types and file types.
-- Disabled by default for Telescope
disable = {
buftypes = {},
filetypes = { "TelescopePrompt" },
},
}
local opts = {
@ -236,7 +243,7 @@ local mappings = {
-- ["c"] = trasparant,
["a"] = { "<cmd>Alpha<cr>", "󰕮 Alpha" },
--["e"] = { "<cmd>NvimTreeToggle<cr>", "Explorer" },
["e"] = { "<cmd>NvimTreeToggle<cr>", "󰙅 Explorer" },
["e"] = { "<cmd>NvimTreeToggle<cr><cr>", "󰙅 Explorer" },
["w"] = { "<cmd>w!<CR>", "󰆓 Save" },
["q"] = { "<cmd>q!<CR>", "󰿅 Quit" },
-- ["c"] = { "<cmd>Bdelete!<CR>", "󰅗 Close Buffer" },
@ -273,7 +280,7 @@ local mappings = {
-- },
b = {
name = " Buffers",
name = "  Buffers",
-- show all buffers with telescope
b = {
"<cmd>lua require('telescope.builtin').buffers(require('telescope.themes').get_dropdown{previewer = false})<cr>",
@ -304,7 +311,7 @@ local mappings = {
},
g = {
name = " Git",
name = " Git",
g = { "<cmd>lua _LAZYGIT_TOGGLE()<CR>", "Lazygit" },
j = { "<cmd>lua require 'gitsigns'.next_hunk()<cr>", "Next Hunk" },
k = { "<cmd>lua require 'gitsigns'.prev_hunk()<cr>", "Prev Hunk" },
@ -327,7 +334,7 @@ local mappings = {
},
l = {
name = " LSP",
name = "  LSP",
a = { "<cmd>lua vim.lsp.buf.code_action()<cr>", "Code Action" },
d = {
"<cmd>Telescope diagnostics bufnr=0<cr>",
@ -358,7 +365,7 @@ local mappings = {
},
},
s = {
name = " Search",
name = "  Search",
b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
c = { "<cmd>Telescope colorscheme<cr>", "Colorscheme" },
h = { "<cmd>Telescope help_tags<cr>", "Find Help" },
@ -370,7 +377,7 @@ local mappings = {
},
t = {
name = " Terminal",
name = "  Terminal",
-- l = { "<cmd>lua _LIVE_SERVER()<cr>", "Live Server" },
l = { "<cmd>terminal live-server<cr>", "Live Server" },
P = { "<cmd>lua _NEWTAB_TOGGLE()<cr>", "Power Shell" },
@ -392,7 +399,7 @@ local mappings = {
j = { "<cmd>lua _SET_TAB_TITLE()<cr>", "Set Tab Title" },
},
r = {
name = " Run",
name = "  Run",
l = { "<cmd>edit term://live-server<cr>", "Live Server" },
s = {
'<cmd>autocmd bufwritepost [^_]*.sass,[^_]*.scss silent exec "!sass %:p %:r.css"<CR>',
@ -544,7 +551,7 @@ local mappings = {
-- },
d = debug_key,
z = {
name = "󱑠 Plugins(Lazy)",
name = " 󱑠 Plugins(Lazy)",
i = { "<cmd>Lazy install<cr>", "Install" },
s = { "<cmd>Lazy sync<cr>", "Sync" },
S = { "<cmd>Lazy clear<cr>", "Status" },