diff --git a/lazy-lock.json b/lazy-lock.json index a387e4b..5e3eb56 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,6 +1,6 @@ { "Comment.nvim": { "branch": "master", "commit": "e51f2b142d88bb666dcaa77d93a07f4b419aca70" }, - "LuaSnip": { "branch": "master", "commit": "8ae1dedd988eb56441b7858bd1e8554dfadaa46d" }, + "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, "alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" }, "bufdelete.nvim": { "branch": "master", "commit": "f6bcea78afb3060b198125256f897040538bcb81" }, "bufferline.nvim": { "branch": "main", "commit": "64e2c5def50dfd6b6f14d96a45fa3d815a4a1eef" }, @@ -13,7 +13,7 @@ "codeium.vim": { "branch": "main", "commit": "76790ba8d1b8b3287f72366ea5f55c1d76e6114e" }, "dressing.nvim": { "branch": "master", "commit": "42d767b04c50a6966c9633e3968bc65c0c2f2bfc" }, "friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" }, - "gitsigns.nvim": { "branch": "main", "commit": "6ef8c54fb526bf3a0bc4efb0b2fe8e6d9a7daed2" }, + "gitsigns.nvim": { "branch": "main", "commit": "52f8da33cc0cadbf1164c4a91c8bfd6895533d67" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, "lazy.nvim": { "branch": "main", "commit": "bef521ac89c8d423f9d092e37b58e8af0c099309" }, "lsp-progress.nvim": { "branch": "main", "commit": "83b16a9791fa788c0a7ca90374118ed15d2c09ed" }, @@ -36,7 +36,7 @@ "nvim-tree.lua": { "branch": "master", "commit": "ddd1d6eb21c45433bdc65cc8015f2457998f2bf2" }, "nvim-treesitter": { "branch": "master", "commit": "f197a15b0d1e8d555263af20add51450e5aaa1f0" }, "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, - "nvim-ts-context-commentstring": { "branch": "main", "commit": "734ebad31c81c6198dfe102aa23280937c937c42" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "a6382f744f584bbf71d0a563af789af7190aabda" }, "nvim-ts-rainbow2": { "branch": "master", "commit": "b3120cd5ae9ca524af9cb602f41e12e301fa985f" }, "nvim-ufo": { "branch": "main", "commit": "a5390706f510d39951dd581f6d2a972741b3fa26" }, "nvim-web-devicons": { "branch": "master", "commit": "a55b801b7ef5719ca25692c3a0a5447fdfb692ed" }, @@ -45,7 +45,7 @@ "promise-async": { "branch": "main", "commit": "38a4575da9497326badd3995e768b4ccf0bb153e" }, "smart-splits.nvim": { "branch": "master", "commit": "f6fcb79527872e9330c554915af2ca511c388390" }, "statuscol.nvim": { "branch": "main", "commit": "d954893262a57a92e46edd87de67e2b3fe72305e" }, - "telescope.nvim": { "branch": "master", "commit": "4d4ade7f2b8f403e8816ca50c05ed16e259b21fb" }, + "telescope.nvim": { "branch": "master", "commit": "d00d9df48c00d8682c14c2b5da78bda7ef06b939" }, "toggleterm.nvim": { "branch": "main", "commit": "193786e0371e3286d3bc9aa0079da1cd41beaa62" }, "vim-illuminate": { "branch": "master", "commit": "305bf07b919ac526deb5193280379e2f8b599926" }, "vim-startuptime": { "branch": "master", "commit": "97a88e688482a09c3c4b777d07b509b328a5ec29" }, diff --git a/lua/custom/autocmd.lua b/lua/custom/autocmd.lua index dd09e3d..cb51ab3 100644 --- a/lua/custom/autocmd.lua +++ b/lua/custom/autocmd.lua @@ -1,33 +1,44 @@ local transparent_mode = require("core.config").transparent_mode if transparent_mode ~= nil then - if transparent_mode == 1 then - vim.cmd("TransparentDisable") - vim.cmd("TransparentEnable") - end + if transparent_mode == 1 then + vim.cmd("TransparentDisable") + vim.cmd("TransparentEnable") + end end -- 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) .. " " + local str = vim.fn.fnamemodify(vim.fn.getcwd(), ":t") + return " " .. str:lower():gsub("^%l", string.upper) .. " " end 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 - vim.api.nvim_create_autocmd("BufRead", { - group = vim.api.nvim_create_augroup("BufRead", { clear = true }), - command = 'silent !wezterm cli set-tab-title "' .. _get_folder_name() .. '"', - desc = "Set Folder Name", - }) + -- vim.cmd('silent !wezterm cli set-tab-title "' .. _get_folder_name() .. '"') + -- create autocmd on insertEnter + vim.api.nvim_create_autocmd("BufRead", { + group = vim.api.nvim_create_augroup("BufRead", { clear = true }), + command = 'silent !wezterm cli set-tab-title "' .. _get_folder_name() .. '"', + desc = "Set Folder Name", + }) end vim.api.nvim_create_autocmd("ExitPre", { - group = vim.api.nvim_create_augroup("Exit", { clear = true }), - command = - "set guicursor=n-v-c:block,i-ci-ve:ver25,r-cr:hor20,o:hor50,a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor,sm:block-blinkwait175-blinkoff150-blinkon175,a:ver90", - desc = "Set cursor back to beam when leaving Neovim.", + group = vim.api.nvim_create_augroup("Exit", { clear = true }), + command = "set guicursor=n-v-c:block,i-ci-ve:ver25,r-cr:hor20,o:hor50,a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor,sm:block-blinkwait175-blinkoff150-blinkon175,a:ver90", + desc = "Set cursor back to beam when leaving Neovim.", +}) + +vim.api.nvim_create_autocmd("FileType", { + pattern = { + "NvimTree", + "lazy", + "mason", + }, + callback = function() + require("ufo").detach() + vim.opt_local.foldenable = false + end, }) -- config for vim-visual-multi color selection diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 08a6749..d8764c7 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -1,153 +1,153 @@ local icons = require("user.icons") return { - --- masukan plugin tambahan disini - -- { - -- "folke/trouble.nvim", - -- event = "BufRead", - -- cmd = { "TroubleToggle", "Trouble" }, - -- opts = { use_diagnostic_signs = true }, - -- keys = { - -- { - -- "xx", - -- "TroubleToggle document_diagnostics", - -- desc = "Document Diagnostics (Trouble)", - -- }, - -- { - -- "xX", - -- "TroubleToggle workspace_diagnostics", - -- desc = "Workspace Diagnostics (Trouble)", - -- }, - -- }, - -- }, - -- { - -- "echasnovski/mini.indentscope", - -- version = false, -- wait till new 0.7.0 release to put it back on semver - -- event = "BufReadPre", - -- opts = { - -- -- symbol = "▏", - -- -- symbol = "│", - -- symbol = icons.ui.LineMiddle, - -- options = { try_as_border = true }, - -- }, - -- config = function(_, opts) - -- vim.api.nvim_create_autocmd("FileType", { - -- pattern = { "help", "alpha", "dashboard", "NvimTree", "Trouble", "lazy", "mason" }, - -- callback = function() - -- vim.b.miniindentscope_disable = true - -- end, - -- }) - -- require("mini.indentscope").setup(opts) - -- end, - -- }, - { - "hrsh7th/cmp-nvim-lua", - enabled = false, - }, - -- { - -- "gbprod/yanky.nvim", - -- event = "BufReadPre", - -- config = function() - -- require("user.yanky") - -- end, - -- }, - -- { - -- "is0n/jaq-nvim", - -- event = "BufRead", - -- config = function() - -- require("user.jaq") - -- end, - -- }, - -- better todo coloring and icon - -- { - -- "folke/todo-comments.nvim", - -- event = { "BufReadPost", "BufNewFile" }, - -- config = function() - -- require("todo-comments").setup() - -- end, - -- }, - -- mini scrollview - -- { - -- "karb94/neoscroll.nvim", - -- event = "BufRead", - -- config = function() - -- require("user.neoscroll") - -- end, - -- }, + --- masukan plugin tambahan disini + -- { + -- "folke/trouble.nvim", + -- event = "BufRead", + -- cmd = { "TroubleToggle", "Trouble" }, + -- opts = { use_diagnostic_signs = true }, + -- keys = { + -- { + -- "xx", + -- "TroubleToggle document_diagnostics", + -- desc = "Document Diagnostics (Trouble)", + -- }, + -- { + -- "xX", + -- "TroubleToggle workspace_diagnostics", + -- desc = "Workspace Diagnostics (Trouble)", + -- }, + -- }, + -- }, + -- { + -- "echasnovski/mini.indentscope", + -- version = false, -- wait till new 0.7.0 release to put it back on semver + -- event = "BufReadPre", + -- opts = { + -- -- symbol = "▏", + -- -- symbol = "│", + -- symbol = icons.ui.LineMiddle, + -- options = { try_as_border = true }, + -- }, + -- config = function(_, opts) + -- vim.api.nvim_create_autocmd("FileType", { + -- pattern = { "help", "alpha", "dashboard", "NvimTree", "Trouble", "lazy", "mason" }, + -- callback = function() + -- vim.b.miniindentscope_disable = true + -- end, + -- }) + -- require("mini.indentscope").setup(opts) + -- end, + -- }, + { + "hrsh7th/cmp-nvim-lua", + enabled = false, + }, + -- { + -- "gbprod/yanky.nvim", + -- event = "BufReadPre", + -- config = function() + -- require("user.yanky") + -- end, + -- }, + -- { + -- "is0n/jaq-nvim", + -- event = "BufRead", + -- config = function() + -- require("user.jaq") + -- end, + -- }, + -- better todo coloring and icon + -- { + -- "folke/todo-comments.nvim", + -- event = { "BufReadPost", "BufNewFile" }, + -- config = function() + -- require("todo-comments").setup() + -- end, + -- }, + -- mini scrollview + -- { + -- "karb94/neoscroll.nvim", + -- event = "BufRead", + -- config = function() + -- require("user.neoscroll") + -- end, + -- }, - -- { "ahmedkhalf/project.nvim", commit = "628de7e433dd503e782831fe150bb750e56e55d6", event = "VeryLazy" }, -- - -- additional plugins - -- makes some plugins dot-repeatable like leap - -- { "tpope/vim-repeat", event = "VeryLazy" }, - -- better diagnostics list and others - -- for markdown preview - -- make sure already install npm and yarn - -- { - -- "iamcco/markdown-preview.nvim", - -- event = "VeryLazy", - -- build = "cd app && npm install", - -- init = function() - -- vim.g.mkdp_filetypes = { "markdown" } - -- end, - -- ft = { "markdown" }, - -- cmd = { "MarkdownPreview", "MarkdownPreviewStop", "MarkdownPreviewToggle" }, - -- }, - -- for codeGPT - -- { - -- "jackMort/ChatGPT.nvim", - -- dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim" }, - -- lazy = true, - -- event = "VeryLazy", - -- -- opts = function() - -- -- require("user.chat_gpt") - -- -- end, - -- }, - -- indent detection - -- { - -- "Darazaki/indent-o-matic", - -- event = "VeryLazy", - -- opt = true, - -- cmd = { "IndentOMatic" }, - -- config = function() - -- require("user.indent-o-matic") - -- end, - -- }, - -- Khusus Projek laravel baru di buka - -- { - -- "adalessa/laravel.nvim", - -- dependencies = { - -- "nvim-telescope/telescope.nvim", - -- }, - -- cmd = { "Sail", "Artisan", "Composer" }, - -- keys = { - -- { "pa", ":Artisan" }, - -- }, - -- config = function() - -- require("laravel").setup() - -- require("telescope").load_extension("laravel") - -- end, - -- }, - -- -- - -- { - -- "barrett-ruth/live-server.nvim", - -- build = "yarn global add live-server", - -- config = true, - -- init = function() - -- require("live-server").setup({ - -- -- Arguments passed to live-server via `vim.fn.jobstart()` - -- -- Run `live-server --help` to see list of available options - -- -- For example, to use port 7000 and browser firefox: - -- args = { "--port=7000", "--browser=firefox" }, - -- --args = {}, - -- }) - -- end, - -- }, - -- for install lsp tidak support mason - -- { - -- "williamboman/nvim-lsp-installer", - -- event = "BufRead", - -- lazy = true, - -- config = function() - -- require("user.lsp.config") - -- end, - -- }, + -- { "ahmedkhalf/project.nvim", commit = "628de7e433dd503e782831fe150bb750e56e55d6", event = "VeryLazy" }, -- + -- additional plugins + -- makes some plugins dot-repeatable like leap + -- { "tpope/vim-repeat", event = "VeryLazy" }, + -- better diagnostics list and others + -- for markdown preview + -- make sure already install npm and yarn + -- { + -- "iamcco/markdown-preview.nvim", + -- event = "VeryLazy", + -- build = "cd app && npm install", + -- init = function() + -- vim.g.mkdp_filetypes = { "markdown" } + -- end, + -- ft = { "markdown" }, + -- cmd = { "MarkdownPreview", "MarkdownPreviewStop", "MarkdownPreviewToggle" }, + -- }, + -- for codeGPT + -- { + -- "jackMort/ChatGPT.nvim", + -- dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim" }, + -- lazy = true, + -- event = "VeryLazy", + -- -- opts = function() + -- -- require("user.chat_gpt") + -- -- end, + -- }, + -- indent detection + -- { + -- "Darazaki/indent-o-matic", + -- event = "VeryLazy", + -- opt = true, + -- cmd = { "IndentOMatic" }, + -- config = function() + -- require("user.indent-o-matic") + -- end, + -- }, + -- Khusus Projek laravel baru di buka + -- { + -- "adalessa/laravel.nvim", + -- dependencies = { + -- "nvim-telescope/telescope.nvim", + -- }, + -- cmd = { "Sail", "Artisan", "Composer" }, + -- keys = { + -- { "pa", ":Artisan" }, + -- }, + -- config = function() + -- require("laravel").setup() + -- require("telescope").load_extension("laravel") + -- end, + -- }, + -- -- + -- { + -- "barrett-ruth/live-server.nvim", + -- build = "yarn global add live-server", + -- config = true, + -- init = function() + -- require("live-server").setup({ + -- -- Arguments passed to live-server via `vim.fn.jobstart()` + -- -- Run `live-server --help` to see list of available options + -- -- For example, to use port 7000 and browser firefox: + -- args = { "--port=7000", "--browser=firefox" }, + -- --args = {}, + -- }) + -- end, + -- }, + -- for install lsp tidak support mason + -- { + -- "williamboman/nvim-lsp-installer", + -- event = "BufRead", + -- lazy = true, + -- config = function() + -- require("user.lsp.config") + -- end, + -- }, } diff --git a/lua/custom/plugins/lualine_backup.lua b/lua/custom/plugins/lualine_backup.lua index 08f1289..964148c 100644 --- a/lua/custom/plugins/lualine_backup.lua +++ b/lua/custom/plugins/lualine_backup.lua @@ -8,6 +8,14 @@ return { 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") @@ -131,7 +139,7 @@ return { local get_branch = function() if vim.b.gitsigns_head ~= nil then - return icons.git.Branch2 .. " " .. vim.b.gitsigns_head + return icons.git.Branch2 .. " " .. getLeftSubstring(vim.b.gitsigns_head, 6) else return icons.git.Branch2 .. vim.fn.fnamemodify("", ":t") end diff --git a/lua/custom/plugins/nvimufo.lua b/lua/custom/plugins/nvimufo.lua index 2baacba..2ee59ad 100644 --- a/lua/custom/plugins/nvimufo.lua +++ b/lua/custom/plugins/nvimufo.lua @@ -8,6 +8,8 @@ function TABLE_CONTAINS(tbl, x) return found end +local icons = require("user.icons").folding + return { "kevinhwang91/nvim-ufo", dependencies = { @@ -43,7 +45,8 @@ return { enabled = true, lazy = true, -- event = "BufReadPost", - event = { "BufReadPost", "BufRead", "InsertEnter", "BufNewFile" }, + -- event = { "BufReadPost", "BufRead", "InsertEnter", "BufNewFile" }, + event = "VeryLazy", config = function() vim.o.foldcolumn = "1" -- '0' is not bad vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value @@ -55,17 +58,17 @@ return { -- vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep:│,foldclose:]] -- vim.o.fillchars = [[eob: ,fold: ,foldopen:󰛲,foldsep:│,foldclose:󰜄]] -- vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep:│,foldclose:]] - vim.o.fillchars = [[eob: ,fold: ,foldopen:▾,foldsep:│,foldclose:▸]] - -- vim.opt.fillchars = { - -- vert = "▕", -- alternatives │ - -- fold = " ", - -- eob = " ", -- suppress ~ at EndOfBuffer - -- diff = "╱", -- alternatives = ⣿ ░ ─ - -- msgsep = "‾", - -- foldopen = "▾", - -- foldsep = "│", - -- foldclose = "▸", - -- } + -- vim.o.fillchars = [[eob: ,fold: ,foldopen:▾,foldsep:│,foldclose:▸]] + vim.opt.fillchars = { + vert = icons.vert, + fold = icons.fold, + eob = icons.eob, + diff = icons.diff, + msgsep = icons.msgsep, + foldopen = icons.foldopen, + foldsep = icons.foldsep, + foldclose = icons.foldclose, + } -- these are "extra", change them as you like vim.keymap.set("n", "zR", require("ufo").openAllFolds) vim.keymap.set("n", "zM", require("ufo").closeAllFolds) @@ -169,9 +172,9 @@ return { require("ufo").setup({ open_fold_hl_timeout = 150, close_fold_kinds_for_ft = { - default = { "imports", "comment" }, + -- default = { "imports", "comment" }, -- json = { "array" }, - c = { "comment", "region" }, + -- c = { "comment", "region" }, }, preview = { win_config = { diff --git a/lua/user/dashboard.lua b/lua/user/dashboard.lua index c8209ad..39baf06 100644 --- a/lua/user/dashboard.lua +++ b/lua/user/dashboard.lua @@ -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 set laststatus=3 + ]]) + end, +}) diff --git a/lua/user/icons.lua b/lua/user/icons.lua index ba7f474..fb2bbcc 100644 --- a/lua/user/icons.lua +++ b/lua/user/icons.lua @@ -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 = "", diff --git a/lua/user/lsp/settings/jsonls.lua b/lua/user/lsp/settings/jsonls.lua index f1ca560..b557dbf 100644 --- a/lua/user/lsp/settings/jsonls.lua +++ b/lua/user/lsp/settings/jsonls.lua @@ -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 diff --git a/lua/user/lsp/settings/lua_ls.lua b/lua/user/lsp/settings/lua_ls.lua index 9f5af6e..5b4d132 100644 --- a/lua/user/lsp/settings/lua_ls.lua +++ b/lua/user/lsp/settings/lua_ls.lua @@ -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, }, }, }, diff --git a/lua/user/lsp/settings/vuels.lua b/lua/user/lsp/settings/vuels.lua new file mode 100644 index 0000000..7785af8 --- /dev/null +++ b/lua/user/lsp/settings/vuels.lua @@ -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 diff --git a/lua/user/lsp/settings/yamlls.lua b/lua/user/lsp/settings/yamlls.lua new file mode 100644 index 0000000..1f94e4e --- /dev/null +++ b/lua/user/lsp/settings/yamlls.lua @@ -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 diff --git a/lua/user/nvim-tree.lua b/lua/user/nvim-tree.lua index 05f8bc5..10469f5 100644 --- a/lua/user/nvim-tree.lua +++ b/lua/user/nvim-tree.lua @@ -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, diff --git a/lua/user/startify.lua b/lua/user/startify.lua index d4d5cb8..75396e6 100644 --- a/lua/user/startify.lua +++ b/lua/user/startify.lua @@ -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 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)) diff --git a/lua/user/webdevicons.lua b/lua/user/webdevicons.lua index ccb2945..d473472 100644 --- a/lua/user/webdevicons.lua +++ b/lua/user/webdevicons.lua @@ -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", diff --git a/lua/user/whichkey.lua b/lua/user/whichkey.lua index 9405fae..2f6cbb2 100644 --- a/lua/user/whichkey.lua +++ b/lua/user/whichkey.lua @@ -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 in INSERT mode + marks = false, -- shows a list of your marks on ' and ` + registers = false, -- shows your registers on " in NORMAL or 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 - 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 + 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", }, 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 = "", -- 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 = { "", "", "", "", "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 = {""} -- 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"] = { "Alpha", "󰕮 Alpha" }, --["e"] = { "NvimTreeToggle", "Explorer" }, - ["e"] = { "NvimTreeToggle", "󰙅 Explorer" }, + ["e"] = { "NvimTreeToggle", "󰙅 Explorer" }, ["w"] = { "w!", "󰆓 Save" }, ["q"] = { "q!", "󰿅 Quit" }, -- ["c"] = { "Bdelete!", "󰅗 Close Buffer" }, @@ -273,7 +280,7 @@ local mappings = { -- }, b = { - name = " Buffers", + name = "  Buffers", -- show all buffers with telescope b = { "lua require('telescope.builtin').buffers(require('telescope.themes').get_dropdown{previewer = false})", @@ -304,7 +311,7 @@ local mappings = { }, g = { - name = " Git", + name = "  Git", g = { "lua _LAZYGIT_TOGGLE()", "Lazygit" }, j = { "lua require 'gitsigns'.next_hunk()", "Next Hunk" }, k = { "lua require 'gitsigns'.prev_hunk()", "Prev Hunk" }, @@ -327,7 +334,7 @@ local mappings = { }, l = { - name = " LSP", + name = "  LSP", a = { "lua vim.lsp.buf.code_action()", "Code Action" }, d = { "Telescope diagnostics bufnr=0", @@ -358,7 +365,7 @@ local mappings = { }, }, s = { - name = " Search", + name = "  Search", b = { "Telescope git_branches", "Checkout branch" }, c = { "Telescope colorscheme", "Colorscheme" }, h = { "Telescope help_tags", "Find Help" }, @@ -370,7 +377,7 @@ local mappings = { }, t = { - name = " Terminal", + name = "  Terminal", -- l = { "lua _LIVE_SERVER()", "Live Server" }, l = { "terminal live-server", "Live Server" }, P = { "lua _NEWTAB_TOGGLE()", "Power Shell" }, @@ -392,7 +399,7 @@ local mappings = { j = { "lua _SET_TAB_TITLE()", "Set Tab Title" }, }, r = { - name = " Run", + name = "  Run", l = { "edit term://live-server", "Live Server" }, s = { 'autocmd bufwritepost [^_]*.sass,[^_]*.scss silent exec "!sass %:p %:r.css"', @@ -544,7 +551,7 @@ local mappings = { -- }, d = debug_key, z = { - name = "󱑠 Plugins(Lazy)", + name = " 󱑠 Plugins(Lazy)", i = { "Lazy install", "Install" }, s = { "Lazy sync", "Sync" }, S = { "Lazy clear", "Status" },