diff --git a/lazy-lock.json b/lazy-lock.json index e441fe4..1358ff3 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -2,7 +2,6 @@ "Comment.nvim": { "branch": "master", "commit": "e51f2b142d88bb666dcaa77d93a07f4b419aca70" }, "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, "alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" }, - "bufdelete.nvim": { "branch": "master", "commit": "f6bcea78afb3060b198125256f897040538bcb81" }, "bufferline.nvim": { "branch": "main", "commit": "73540cb95f8d95aa1af3ed57713c6720c78af915" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, @@ -15,7 +14,7 @@ "friendly-snippets": { "branch": "main", "commit": "dd2fd1281d4b22e7b4a5bfafa3e142d958e251f2" }, "github-nvim-theme": { "branch": "main", "commit": "66dcec1bd3d12f8b0bf3c885069888551a650049" }, "gitsigns.nvim": { "branch": "main", "commit": "76927d14d3fbd4ba06ccb5246e79d93b5442c188" }, - "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, + "indent-blankline.nvim": { "branch": "master", "commit": "ece00d5fb44d196680a81fd2761062d2fa44663b" }, "lazy.nvim": { "branch": "main", "commit": "758bb5de98b805acc5eeed8cdc8ac7f0bc4b0b86" }, "lsp-progress.nvim": { "branch": "main", "commit": "07ca8eadf7d02ca33ff4d1e9e500910fe17aa14d" }, "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, @@ -24,7 +23,8 @@ "mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" }, "mini.animate": { "branch": "main", "commit": "82519630b2760ffc516ebc387bef632f9c07b9f5" }, "mini.indentscope": { "branch": "main", "commit": "a8274b6ea2d868198d27bd91a31ed5ea3a6a5744" }, - "noice.nvim": { "branch": "main", "commit": "2c49d4a7fdeaca930bb08a8239bdf5bccc26507b" }, + "neoscroll.nvim": { "branch": "master", "commit": "e78657719485c5663b88e5d96ffcfb6a2fe3eec0" }, + "noice.nvim": { "branch": "main", "commit": "9f6f6ba74f8bfbf7e43d6302cf86b070362f6203" }, "none-ls-extras.nvim": { "branch": "main", "commit": "336e84b9e43c0effb735b08798ffac382920053b" }, "none-ls.nvim": { "branch": "main", "commit": "37671797d6e5f9bd0ee3ab965ab2e6de251e1930" }, "nui.nvim": { "branch": "main", "commit": "a0fd35fcbb4cb479366f1dc5f20145fd718a3733" }, @@ -37,12 +37,12 @@ "nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" }, "nvim-scrollview": { "branch": "main", "commit": "c29c5f69d37040a1fac88cbea7f5e6f06f0aff4d" }, "nvim-tree.lua": { "branch": "master", "commit": "2bc725a3ebc23f0172fb0ab4d1134b81bcc13812" }, - "nvim-treesitter": { "branch": "master", "commit": "f197a15b0d1e8d555263af20add51450e5aaa1f0" }, - "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, + "nvim-treesitter": { "branch": "master", "commit": "1eabe69bfa8f78e14fcf5d42a2b3881babaca30a" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "5f9bf4b1ead7707e4e74e5319ee56bdc81fb73db" }, + "nvim-ts-autotag": { "branch": "main", "commit": "aeb7090098722ffce16597bd0331105495640153" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "0bdccb9c67a42a5e2d99384dc9bfa29b1451528f" }, "nvim-ufo": { "branch": "main", "commit": "a5390706f510d39951dd581f6d2a972741b3fa26" }, "nvim-web-devicons": { "branch": "master", "commit": "5b9067899ee6a2538891573500e8fd6ff008440f" }, - "onedarkpro.nvim": { "branch": "main", "commit": "ec07364f3cfa9cc6467bf067a490cfd74011efcd" }, "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, "promise-async": { "branch": "main", "commit": "38a4575da9497326badd3995e768b4ccf0bb153e" }, "smart-splits.nvim": { "branch": "master", "commit": "2179ec0d26aacd4f40c766c79f6ebc83b7001e48" }, diff --git a/lua/custom/plugins/githubdark.lua b/lua/custom/plugins/githubdark.lua index bc134de..cff732b 100644 --- a/lua/custom/plugins/githubdark.lua +++ b/lua/custom/plugins/githubdark.lua @@ -70,11 +70,11 @@ return { -- ["@operator.html"] = { fg = "#faa356" }, -- ["@tag.html"] = { fg = "#fa7970" }, -- ["@tag.delimiter.html"] = { fg = "#faa356" }, - -- ["@tag.javascript"] = { fg = "#faa356" }, + ["@tag.javascript"] = { fg = "#faa356" }, -- ["@tag.javascript"] = { fg = "#8ddb8c" }, -- ["@tag.tsx"] = { fg = "#8ddb8c" }, - -- ["@tag.delimiter.javascript"] = { fg = "fg1" }, - -- ["@tag.tsx"] = { fg = "#faa356" }, + ["@tag.delimiter.javascript"] = { fg = "fg1" }, + ["@tag.tsx"] = { fg = "#faa356" }, ["@lsp.type.parameter"] = { fg = "#faa356" }, ["@property.lua"] = { fg = "#91cbff", bg = is_transparent and "NONE" or "bg1" }, ["@lsp.type.property.lua"] = { fg = "fg1", bg = is_transparent and "NONE" or "bg1" }, diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 814cb2e..88b8ffe 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -43,13 +43,13 @@ return { "hrsh7th/cmp-nvim-lua", enabled = false, }, - { - "gbprod/yanky.nvim", - event = "BufReadPre", - config = function() - require("user.yanky") - end, - }, + -- { + -- "gbprod/yanky.nvim", + -- event = "BufReadPre", + -- config = function() + -- require("user.yanky") + -- end, + -- }, -- { -- "is0n/jaq-nvim", -- event = "BufRead", diff --git a/lua/custom/plugins/lualine_github.lua b/lua/custom/plugins/lualine_github.lua index cc7c168..0ddba0c 100644 --- a/lua/custom/plugins/lualine_github.lua +++ b/lua/custom/plugins/lualine_github.lua @@ -47,7 +47,10 @@ return { 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) + -- local providers_for_methods = vim.tbl_flatten(vim.tbl_map(function(m) + -- return registered_providers[m] or {} + -- end, alternative_methods)) + local providers_for_methods = vim.iter(vim.tbl_map(function(m) return registered_providers[m] or {} end, alternative_methods)) @@ -59,9 +62,8 @@ return { 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_clients = vim.lsp.get_clients() local buf_client_names = {} if next(buf_clients) == nil then -- TODO: clean up this if statement @@ -120,7 +122,7 @@ return { local spaces = function() -- return " " .. vim.api.nvim_buf_get_option(0, "shiftwidth") - return icons.ui.Tab .. " " .. vim.api.nvim_buf_get_option(0, "shiftwidth") + return icons.ui.Tab .. " " .. vim.api.nvim_get_option_value(0, "shiftwidth") end local mode = { @@ -151,7 +153,8 @@ return { lsp_progress = lspprogress.progress end -- stylua: ignore - local github=vim.fn.fnamemodify("auto", ":t") + -- local github=vim.fn.fnamemodify("auto", ":t") + local github={} local status_ok, _ = pcall(require, "github-theme") if status_ok then local C = require("github-theme.lib.color") @@ -192,7 +195,7 @@ return { require("lualine").setup({ options = { - theme = github, + theme = github or "auto", -- theme = "auto", component_separators = { left = "", right = "" }, section_separators = { left = "", right = "" }, diff --git a/lua/custom/plugins/lualine_onedark.lua b/lua/custom/plugins/lualine_onedark.lua index e8bcb54..a040416 100644 --- a/lua/custom/plugins/lualine_onedark.lua +++ b/lua/custom/plugins/lualine_onedark.lua @@ -47,7 +47,7 @@ return { -- -- 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) + -- local providers_for_methods = vim.iter(vim.tbl_map(function(m) -- return registered_providers[m] or {} -- end, alternative_methods)) -- @@ -59,9 +59,8 @@ return { -- 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_clients = vim.lsp.get_clients() -- local buf_client_names = {} -- if next(buf_clients) == nil then -- -- TODO: clean up this if statement @@ -120,7 +119,7 @@ return { -- -- local spaces = function() -- -- return " " .. vim.api.nvim_buf_get_option(0, "shiftwidth") - -- return icons.ui.Tab .. " " .. vim.api.nvim_buf_get_option(0, "shiftwidth") + -- return icons.ui.Tab .. " " .. vim.api.nvim_get_option_value(0, "shiftwidth") -- end -- -- local mode = { @@ -151,7 +150,8 @@ return { -- lsp_progress = lspprogress.progress -- end -- -- stylua: ignore - -- local onedark=vim.fn.fnamemodify("auto", ":t") + -- -- local onedark=vim.fn.fnamemodify("auto", ":t") + -- local onedark={} -- local is_transparat = true -- local status_ok, onedarkpro = pcall(require, "onedarkpro.helpers") -- if status_ok then diff --git a/lua/custom/plugins/nvim_tree.lua b/lua/custom/plugins/nvim_tree.lua index f676736..ee625e6 100644 --- a/lua/custom/plugins/nvim_tree.lua +++ b/lua/custom/plugins/nvim_tree.lua @@ -1,279 +1,279 @@ return { - { - "kyazdani42/nvim-tree.lua", - lazy = true, - event = "VeryLazy", - cmd = { "NvimTree", "NvimTreeOpen", "NvimTreeToggle", "NvimTreeFocus", "NvimTreeClose" }, - -- dependencies = "kyazdani42/nvim-web-devicons", - config = function() - local data_exists, treeconfig = pcall(require, "core.config") - if data_exists then - if treeconfig.loadnvimtree_lazy then - 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 HEIGHT_RATIO = 0.9 -- You can change this - local WIDTH_RATIO = 0.5 -- You can change this too - - 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 = true, - -- quit_on_focus_loss = true, - -- open_win_config = { - -- relative = "editor", - -- border = "rounded", - -- width = 30, - -- height = 30, - -- row = 1, - -- col = 1, - -- }, - -- }, - float = { - enable = true, - open_win_config = function() - local screen_w = vim.opt.columns:get() - local screen_h = vim.opt.lines:get() - vim.opt.cmdheight:get() - local window_w = screen_w * WIDTH_RATIO - local window_h = screen_h * HEIGHT_RATIO - local window_w_int = math.floor(window_w) - local window_h_int = math.floor(window_h) - local center_x = (screen_w - window_w) / 2 - local center_y = ((vim.opt.lines:get() - window_h) / 2) - vim.opt.cmdheight:get() - return { - border = "rounded", - relative = "editor", - row = center_y, - col = center_x, - width = window_w_int, - height = window_h_int, - } - end, - }, - width = function() - return math.floor(vim.opt.columns:get() * WIDTH_RATIO) - end, - }, - 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 = {}, - }, - }) - end - end - -- auto open file if creation - local api = require("nvim-tree.api") - api.events.subscribe(api.events.Event.FileCreated, function(file) - vim.cmd("edit " .. file.fname) - end) - end, - }, + -- { + -- "kyazdani42/nvim-tree.lua", + -- lazy = true, + -- event = "VeryLazy", + -- cmd = { "NvimTree", "NvimTreeOpen", "NvimTreeToggle", "NvimTreeFocus", "NvimTreeClose" }, + -- -- dependencies = "kyazdani42/nvim-web-devicons", + -- config = function() + -- local data_exists, treeconfig = pcall(require, "core.config") + -- if data_exists then + -- if treeconfig.loadnvimtree_lazy then + -- 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 HEIGHT_RATIO = 0.9 -- You can change this + -- local WIDTH_RATIO = 0.5 -- You can change this too + -- + -- 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 = true, + -- -- quit_on_focus_loss = true, + -- -- open_win_config = { + -- -- relative = "editor", + -- -- border = "rounded", + -- -- width = 30, + -- -- height = 30, + -- -- row = 1, + -- -- col = 1, + -- -- }, + -- -- }, + -- float = { + -- enable = true, + -- open_win_config = function() + -- local screen_w = vim.opt.columns:get() + -- local screen_h = vim.opt.lines:get() - vim.opt.cmdheight:get() + -- local window_w = screen_w * WIDTH_RATIO + -- local window_h = screen_h * HEIGHT_RATIO + -- local window_w_int = math.floor(window_w) + -- local window_h_int = math.floor(window_h) + -- local center_x = (screen_w - window_w) / 2 + -- local center_y = ((vim.opt.lines:get() - window_h) / 2) - vim.opt.cmdheight:get() + -- return { + -- border = "rounded", + -- relative = "editor", + -- row = center_y, + -- col = center_x, + -- width = window_w_int, + -- height = window_h_int, + -- } + -- end, + -- }, + -- width = function() + -- return math.floor(vim.opt.columns:get() * WIDTH_RATIO) + -- end, + -- }, + -- 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 = {}, + -- }, + -- }) + -- end + -- end + -- -- auto open file if creation + -- local api = require("nvim-tree.api") + -- api.events.subscribe(api.events.Event.FileCreated, function(file) + -- vim.cmd("edit " .. file.fname) + -- end) + -- end, + -- }, } diff --git a/lua/custom/plugins/onedarkpro.lua b/lua/custom/plugins/onedarkpro.lua index 844ab1a..e2d2386 100644 --- a/lua/custom/plugins/onedarkpro.lua +++ b/lua/custom/plugins/onedarkpro.lua @@ -1,110 +1,110 @@ return { - { "navarasu/onedark.nvim", enabled = false }, - { - "olimorris/onedarkpro.nvim", - priority = 1000, -- Ensure it loads first - config = function() - local is_transparent = false - require("onedarkpro").setup({ - styles = { - types = "NONE", - methods = "NONE", - numbers = "NONE", - strings = "NONE", - comments = "italic", - keywords = "bold,italic", - constants = "NONE", - functions = "italic", - operators = "NONE", - variables = "NONE", - parameters = "NONE", - conditionals = "italic", - virtual_text = "NONE", - tags = "italic", - }, - colors = { - onedark = { - green = "#99c379", - gray = "#8094b4", - red = "#e06c75", - purple = "#c678dd", - yellow = "#e5c07a", - blue = "#61afef", - cyan = "#56b6c2", - bg_statusline = "#282c34", - indentline = "#3b4261", - float_bg = "#282c34", - }, - }, - options = { - cursorline = true, - transparency = is_transparent, - terminal_colors = true, - }, - highlights = { - -- overide cursor line fill colors - LineNr = { fg = "#49505E" }, -- Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set. - CursorLineNr = { fg = "${blue}" }, -- Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line. - CursorLine = { bg = "#333842" }, - Cursor = { fg = "${bg}", bg = "${fg}" }, -- character under the cursor - lCursor = { fg = "${bg}", bg = "${fg}" }, -- the character under the cursor when |language-mapping| is used (see 'guicursor') - CursorIM = { fg = "${bg}", bg = "${fg}" }, -- like Cursor, but used when in IME mode |CursorIM| - CursorColumn = { bg = "#333842" }, -- Screen-column at the cursor, when 'cursorcolumn' is set. - -- overide nvimtree folder icon fill color - NvimTreeFolderIcon = { fg = "${gray}" }, - -- overide nvimtree text fill color folder opened - NvimTreeOpenedFolderName = { fg = "${blue}" }, - -- overide nvimtree text fill color root folder - NvimTreeRootFolder = { fg = "${yellow}" }, - NvimTreeSpecialFile = { fg = "${orange}" }, - NvimTreeWinSeparator = { fg = "#202329" }, - NvimTreeIndentMarker = { fg = "#3E4450" }, - -- overide indenline fill color - IblIndent = { fg = "#3E4450" }, - -- overide cmp cursorline fill color with #333842 - PmenuSel = { bg = "#333842" }, - illuminatedWord = { bg = "#3b4261" }, - illuminatedCurWord = { bg = "#3b4261" }, - IlluminatedWordText = { bg = "#3b4261" }, - IlluminatedWordRead = { bg = "#3b4261" }, - IlluminatedWordWrite = { bg = "#3b4261" }, - StatusLine = { fg = "#f8f8f2", bg = is_transparent and "NONE" or "${bg}" }, - StatusLineTerm = { fg = "#f8f8f2", bg = "${bg}" }, - BufferLineFill = { bg = is_transparent and "NONE" or "${bg}" }, - ["@string.special.url.html"] = { fg = "${green}" }, - ["@text.uri.html"] = { fg = "${green}" }, - ["@tag.javascript"] = { fg = "${red}" }, - ["@tag.attribute"] = { fg = "${orange}", style = "italic" }, - ["@constructor.javascript"] = { fg = "${red}" }, - ["@variable"] = { fg = "${fg}", style = "NONE" }, -- various variable names - ["@variable.builtin"] = { fg = "${red}", style = "NONE" }, - ["@variable.member"] = "${cyan}", - ["@variable.parameter"] = "${red}", - ["@property"] = { fg = "${cyan}" }, -- similar to `@field` - NvimTreeGitDirty = { fg = "${yellow}" }, - Pmenu = { fg = "${fg}", bg = "${bg}" }, - PmenuThumb = { bg = "${gray}" }, -- Popup menu: Thumb of the scrollbar. - -- overide lualine fill color with bg color - LualineNormal = { bg = "${bg}" }, - -- overide lualine_c fill color with bg color - LualineC = { bg = "${bg}" }, - -- overide lualine_x fill color with bg color - LualineX = { bg = "${bg}" }, - -- overide which-key fill color with bg color - -- WhichKey = { bg = "${bg}" }, - -- -- overide which-key fill color with bg color - -- WhichKeySeperator = { bg = "${bg}" }, - -- -- overide which-key fill color with bg color - -- WhichKeyDesc = { fg = "${red}" }, - -- -- overide which-key fill color with bg color - -- WhichKeyFloat = { bg = "${bg}" }, - WhichKeyFloat = { bg = is_transparent and "NONE" or "${bg}" }, - -- -- overide which-key fill color with bg color - -- WhichKeyValue = { bg = "${bg}" }, - -- -- overide which-key fill color with bg color - -- WhichKeyBorder = { bg = "${bg}" }, - }, - }) - end, - }, + -- { "navarasu/onedark.nvim", enabled = false }, + -- { + -- "olimorris/onedarkpro.nvim", + -- priority = 1000, -- Ensure it loads first + -- config = function() + -- local is_transparent = false + -- require("onedarkpro").setup({ + -- styles = { + -- types = "NONE", + -- methods = "NONE", + -- numbers = "NONE", + -- strings = "NONE", + -- comments = "italic", + -- keywords = "bold,italic", + -- constants = "NONE", + -- functions = "italic", + -- operators = "NONE", + -- variables = "NONE", + -- parameters = "NONE", + -- conditionals = "italic", + -- virtual_text = "NONE", + -- tags = "italic", + -- }, + -- colors = { + -- onedark = { + -- green = "#99c379", + -- gray = "#8094b4", + -- red = "#e06c75", + -- purple = "#c678dd", + -- yellow = "#e5c07a", + -- blue = "#61afef", + -- cyan = "#56b6c2", + -- bg_statusline = "#282c34", + -- indentline = "#3b4261", + -- float_bg = "#282c34", + -- }, + -- }, + -- options = { + -- cursorline = true, + -- transparency = is_transparent, + -- terminal_colors = true, + -- }, + -- highlights = { + -- -- overide cursor line fill colors + -- LineNr = { fg = "#49505E" }, -- Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set. + -- CursorLineNr = { fg = "${blue}" }, -- Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line. + -- CursorLine = { bg = "#333842" }, + -- Cursor = { fg = "${bg}", bg = "${fg}" }, -- character under the cursor + -- lCursor = { fg = "${bg}", bg = "${fg}" }, -- the character under the cursor when |language-mapping| is used (see 'guicursor') + -- CursorIM = { fg = "${bg}", bg = "${fg}" }, -- like Cursor, but used when in IME mode |CursorIM| + -- CursorColumn = { bg = "#333842" }, -- Screen-column at the cursor, when 'cursorcolumn' is set. + -- -- overide nvimtree folder icon fill color + -- NvimTreeFolderIcon = { fg = "${gray}" }, + -- -- overide nvimtree text fill color folder opened + -- NvimTreeOpenedFolderName = { fg = "${blue}" }, + -- -- overide nvimtree text fill color root folder + -- NvimTreeRootFolder = { fg = "${yellow}" }, + -- NvimTreeSpecialFile = { fg = "${orange}" }, + -- NvimTreeWinSeparator = { fg = "#202329" }, + -- NvimTreeIndentMarker = { fg = "#3E4450" }, + -- -- overide indenline fill color + -- IblIndent = { fg = "#3E4450" }, + -- -- overide cmp cursorline fill color with #333842 + -- PmenuSel = { bg = "#333842" }, + -- illuminatedWord = { bg = "#3b4261" }, + -- illuminatedCurWord = { bg = "#3b4261" }, + -- IlluminatedWordText = { bg = "#3b4261" }, + -- IlluminatedWordRead = { bg = "#3b4261" }, + -- IlluminatedWordWrite = { bg = "#3b4261" }, + -- StatusLine = { fg = "#f8f8f2", bg = is_transparent and "NONE" or "${bg}" }, + -- StatusLineTerm = { fg = "#f8f8f2", bg = "${bg}" }, + -- BufferLineFill = { bg = is_transparent and "NONE" or "${bg}" }, + -- ["@string.special.url.html"] = { fg = "${green}" }, + -- ["@text.uri.html"] = { fg = "${green}" }, + -- ["@tag.javascript"] = { fg = "${red}" }, + -- ["@tag.attribute"] = { fg = "${orange}", style = "italic" }, + -- ["@constructor.javascript"] = { fg = "${red}" }, + -- ["@variable"] = { fg = "${fg}", style = "NONE" }, -- various variable names + -- ["@variable.builtin"] = { fg = "${red}", style = "NONE" }, + -- ["@variable.member"] = "${cyan}", + -- ["@variable.parameter"] = "${red}", + -- ["@property"] = { fg = "${cyan}" }, -- similar to `@field` + -- NvimTreeGitDirty = { fg = "${yellow}" }, + -- Pmenu = { fg = "${fg}", bg = "${bg}" }, + -- PmenuThumb = { bg = "${gray}" }, -- Popup menu: Thumb of the scrollbar. + -- -- overide lualine fill color with bg color + -- LualineNormal = { bg = "${bg}" }, + -- -- overide lualine_c fill color with bg color + -- LualineC = { bg = "${bg}" }, + -- -- overide lualine_x fill color with bg color + -- LualineX = { bg = "${bg}" }, + -- -- overide which-key fill color with bg color + -- -- WhichKey = { bg = "${bg}" }, + -- -- -- overide which-key fill color with bg color + -- -- WhichKeySeperator = { bg = "${bg}" }, + -- -- -- overide which-key fill color with bg color + -- -- WhichKeyDesc = { fg = "${red}" }, + -- -- -- overide which-key fill color with bg color + -- -- WhichKeyFloat = { bg = "${bg}" }, + -- WhichKeyFloat = { bg = is_transparent and "NONE" or "${bg}" }, + -- -- -- overide which-key fill color with bg color + -- -- WhichKeyValue = { bg = "${bg}" }, + -- -- -- overide which-key fill color with bg color + -- -- WhichKeyBorder = { bg = "${bg}" }, + -- }, + -- }) + -- end, + -- }, } diff --git a/lua/custom/plugins/ui.lua b/lua/custom/plugins/ui.lua index a54729c..5049fbd 100644 --- a/lua/custom/plugins/ui.lua +++ b/lua/custom/plugins/ui.lua @@ -17,10 +17,10 @@ return { -- require("user.lualine") -- end, -- }, - { "RRethy/vim-illuminate", event = "InsertEnter", enabled = true }, + -- { "RRethy/vim-illuminate", event = "InsertEnter", enabled = true }, -- { "cpea2506/one_monokai.nvim" }, -- { "luisiacc/gruvbox-baby", lazy = true, enabled = false }, -- { "projekt0n/github-nvim-theme", version = "v0.0.7" }, -- { "stevearc/dressing.nvim", enabled = false }, - { "karb94/neoscroll.nvim", enabled = false }, + -- { "karb94/neoscroll.nvim", enabled = false }, } diff --git a/lua/plugins/breadcrumb.lua b/lua/plugins/breadcrumb.lua new file mode 100644 index 0000000..bde138a --- /dev/null +++ b/lua/plugins/breadcrumb.lua @@ -0,0 +1,10 @@ +return { + "SmiteshP/nvim-navic", + lazy = true, + dependencies = "neovim/nvim-lspconfig", + event = "InsertEnter", + config = function() + require("user.breadcrumb") + require("user.winbar") + end, +} diff --git a/lua/custom/plugins/bufferline.lua b/lua/plugins/bufferline.lua similarity index 98% rename from lua/custom/plugins/bufferline.lua rename to lua/plugins/bufferline.lua index 63050ed..53a1915 100644 --- a/lua/custom/plugins/bufferline.lua +++ b/lua/plugins/bufferline.lua @@ -43,10 +43,10 @@ return { color_icons = true, numbers = "none", -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string, close_command = function(bufnum) - require("bufdelete").bufdelete(bufnum, true) + require("user.utils").bufremove(bufnum) end, right_mouse_command = function(bufnum) - require("bufdelete").bufdelete(bufnum, true) + require("user.utils").bufremove(bufnum) end, -- close_command = "bdelete! %d", -- right_mouse_command = "bdelete! %d", diff --git a/lua/plugins/coderunner.lua b/lua/plugins/coderunner.lua new file mode 100644 index 0000000..74f2b3d --- /dev/null +++ b/lua/plugins/coderunner.lua @@ -0,0 +1,58 @@ +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 +return { + "CRAG666/code_runner.nvim", + lazy = true, + cmd = { "RunCode", "RunFile", "RunProject", "RunClose" }, + opts = { + -- 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 = "", + -- 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, + }, + }, + config = function(_, opts) + require("code_runner").setup(opts) + end, +} diff --git a/lua/plugins/colorizer.lua b/lua/plugins/colorizer.lua new file mode 100644 index 0000000..eacd2b1 --- /dev/null +++ b/lua/plugins/colorizer.lua @@ -0,0 +1,25 @@ +return { + "NvChad/nvim-colorizer.lua", + lazy = true, + event = { "BufRead", "InsertEnter", "BufNewFile" }, + opts = { + user_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. + tailwind = true, + }, + 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 + }, + }, +} diff --git a/lua/plugins/comment.lua b/lua/plugins/comment.lua new file mode 100644 index 0000000..00ba463 --- /dev/null +++ b/lua/plugins/comment.lua @@ -0,0 +1,12 @@ +return { + "numToStr/Comment.nvim", + lazy = true, + opts = function() + return { + pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(), + } + end, + config = function(_, opts) + require("Comment").setup(opts) + end, +} diff --git a/lua/plugins/dap.lua b/lua/plugins/dap.lua new file mode 100644 index 0000000..d260a1c --- /dev/null +++ b/lua/plugins/dap.lua @@ -0,0 +1,22 @@ +return { + { + "rcarriga/nvim-dap-ui", + lazy = true, + event = "BufRead", + dependencies = "mfussenegger/nvim-dap", + enabled = vim.fn.has("win32") == 0, + config = function() + require("user.dapui") + end, + }, + { + "jay-babu/mason-nvim-dap.nvim", + lazy = true, + event = "BufRead", + dependencies = { "williamboman/mason.nvim", "mfussenegger/nvim-dap" }, + enabled = vim.fn.has("win32") == 0, + config = function() + require("user.mason_dap") + end, + }, +} diff --git a/lua/plugins/dressing.lua b/lua/plugins/dressing.lua new file mode 100644 index 0000000..ad00f44 --- /dev/null +++ b/lua/plugins/dressing.lua @@ -0,0 +1,34 @@ +return { + "stevearc/dressing.nvim", + lazy = true, + init = function() + ---@diagnostic disable-next-line: duplicate-set-field + vim.ui.select = function(...) + require("lazy").load({ plugins = { "dressing.nvim" } }) + return vim.ui.select(...) + end + ---@diagnostic disable-next-line: duplicate-set-field + vim.ui.input = function(...) + require("lazy").load({ plugins = { "dressing.nvim" } }) + return vim.ui.input(...) + end + end, + opts = { + 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" } }, + }, + }, + config = function(_, opts) + require("dressing").setup(opts) + end, +} diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..8438d4c --- /dev/null +++ b/lua/plugins/gitsigns.lua @@ -0,0 +1,75 @@ +local icons = require("user.icons") +return { + "lewis6991/gitsigns.nvim", + lazy = true, + enabled = vim.fn.executable("git") == 1, + ft = "gitcommit", + event = "BufRead", + opts = { + 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 = ", - ", + 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 }, + }, + config = function(_, opts) + require("gitsigns").setup(opts) + end, +} diff --git a/lua/plugins/indentblankline.lua b/lua/plugins/indentblankline.lua new file mode 100644 index 0000000..aa2d800 --- /dev/null +++ b/lua/plugins/indentblankline.lua @@ -0,0 +1,39 @@ +return { + "lukas-reineke/indent-blankline.nvim", + -- version = "3.5.4", + event = { "BufRead", "InsertEnter", "BufNewFile" }, + lazy = true, + opts = { + indent = { + char = "│", + tab_char = "│", + }, + scope = { enabled = false }, + exclude = { + buftypes = { + "nofile", + "prompt", + "quickfix", + "terminal", + }, + filetypes = { + "help", + "alpha", + "dashboard", + "neo-tree", + "Trouble", + "trouble", + "lazy", + "mason", + "notify", + "toggleterm", + "lazyterm", + "NvimTree", + "aerial", + "neogitstatus", + "startify", + }, + }, + }, + main = "ibl", +} diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua deleted file mode 100644 index b5d315c..0000000 --- a/lua/plugins/init.lua +++ /dev/null @@ -1,371 +0,0 @@ -return { - -- plugin ini merupakan penyedia library neovim lua - { - "nvim-lua/plenary.nvim", - lazy = true, - }, - -- coloring code - { - "nvim-treesitter/nvim-treesitter", - lazy = true, - event = "BufRead", - cmd = { - "TSBufDisable", - "TSBufEnable", - "TSBufToggle", - "TSDisable", - "TSEnable", - "TSToggle", - "TSInstall", - "TSInstallInfo", - "TSInstallSync", - "TSModuleInfo", - "TSUninstall", - "TSUpdate", - "TSUpdateSync", - }, - build = function() - local status_ok, ts = pcall(require, "nvim-treesitter.install") - if not status_ok then - return - end - ts.update({ with_sync = true })() - end, - config = function() - local status_ok, _ = pcall(require, "nvim-treesitter") - if not status_ok then - return - end - require("user.treesitter") - end, - }, - -- snippets - { - "rafamadriz/friendly-snippets", - event = "InsertEnter", - lazy = true, - config = function() - require("luasnip.loaders.from_vscode").lazy_load() - require("user.snippets") - require("user.snip") - end, - }, - { - "L3MON4D3/LuaSnip", - lazy = true, - opts = { - history = true, - delete_check_events = "TextChanged", - }, - -- stylua: ignore - keys = { - { "", function() require("luasnip").jump(1) end, mode = "s" }, - { "", function() require("luasnip").jump(-1) end, mode = { "i", "s" } }, - }, - }, - -- for formater linter - { - "RRethy/vim-illuminate", - event = "BufRead", - lazy = true, - config = function() - local status_ok, illuminate = pcall(require, "illuminate") - if not status_ok then - return - end - illuminate.configure({ - options = { - providers = { - "lsp", - "treesitter", - "regex", - }, - -- delay: delay in milliseconds - delay = 120, - -- filetype_overrides: filetype specific overrides. - -- The keys are strings to represent the filetype while the values are tables that - -- supports the same keys passed to .configure except for filetypes_denylist and filetypes_allowlist - filetype_overrides = {}, - -- filetypes_denylist: filetypes to not illuminate, this overrides filetypes_allowlist - filetypes_denylist = { - "dirvish", - "fugitive", - "alpha", - "NvimTree", - "lazy", - "neogitstatus", - "Trouble", - "lir", - "Outline", - "spectre_panel", - "toggleterm", - "DressingSelect", - "TelescopePrompt", - }, - -- filetypes_allowlist: filetypes to illuminate, this is overridden by filetypes_denylist - filetypes_allowlist = {}, - -- modes_denylist: modes to not illuminate, this overrides modes_allowlist - modes_denylist = {}, - -- modes_allowlist: modes to illuminate, this is overridden by modes_denylist - modes_allowlist = {}, - -- providers_regex_syntax_denylist: syntax to not illuminate, this overrides providers_regex_syntax_allowlist - -- Only applies to the 'regex' provider - -- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name') - providers_regex_syntax_denylist = {}, - -- providers_regex_syntax_allowlist: syntax to illuminate, this is overridden by providers_regex_syntax_denylist - -- Only applies to the 'regex' provider - -- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name') - providers_regex_syntax_allowlist = {}, - -- under_cursor: whether or not to illuminate under the cursor - under_cursor = true, - }, - }) - end, - }, - -- debuging - { - "rcarriga/nvim-dap-ui", - lazy = true, - event = "BufRead", - dependencies = "mfussenegger/nvim-dap", - enabled = vim.fn.has("win32") == 0, - config = function() - require("user.dapui") - end, - }, - { - "jay-babu/mason-nvim-dap.nvim", - lazy = true, - event = "BufRead", - dependencies = { "williamboman/mason.nvim", "mfussenegger/nvim-dap" }, - enabled = vim.fn.has("win32") == 0, - config = function() - require("user.mason_dap") - end, - }, - -- auto pairs - { - "windwp/nvim-autopairs", - lazy = true, - dependencies = "hrsh7th/nvim-cmp", - event = "InsertEnter", - config = function() - require("user.autopairs") - end, - }, - -- untuk comment - { - "JoosepAlviste/nvim-ts-context-commentstring", - lazy = true, - dependencies = "nvim-treesitter/nvim-treesitter", - config = function() - require("ts_context_commentstring").setup({ - enable_autocmd = false, - }) - end, - }, - { - "numToStr/Comment.nvim", - lazy = true, - config = function() - require("user.comment") - end, - }, - { - "lukas-reineke/indent-blankline.nvim", - version = "3.5.4", - event = { "BufRead", "InsertEnter", "BufNewFile" }, - lazy = true, - opts = { - indent = { - char = "│", - tab_char = "│", - }, - scope = { enabled = false }, - exclude = { - buftypes = { - "nofile", - "prompt", - "quickfix", - "terminal", - }, - filetypes = { - "help", - "alpha", - "dashboard", - "neo-tree", - "Trouble", - "trouble", - "lazy", - "mason", - "notify", - "toggleterm", - "lazyterm", - "NvimTree", - "aerial", - "neogitstatus", - "startify", - }, - }, - }, - main = "ibl", - }, - -- for multi cursor select - { - "mg979/vim-visual-multi", - event = { "BufRead", "InsertEnter", "BufNewFile" }, - lazy = true, - init = function() - vim.g.VM_mouse_mappings = 1 -- equal CTRL + Left Click on VSCODE - vim.g.VM_maps = { - ["Find Under"] = "", -- equal CTRL+D on VSCODE - ["Find Subword Under"] = "", -- equal CTRL+D on VSCODE - ["Select Cursor Down"] = "", -- equal CTRL+ALT+DOWN on VSCODE - ["Select Cursor Up"] = "", -- equal CTRL+ALT+UP on VSCODE - } - end, - }, - -- for auto close tag - { - "windwp/nvim-ts-autotag", - lazy = true, - event = "BufRead", - dependencies = "nvim-treesitter/nvim-treesitter", - config = function() - require("nvim-ts-autotag").setup() - end, - }, - -- for auto detection file and run code - { - "CRAG666/code_runner.nvim", - lazy = true, - cmd = { "RunCode", "RunFile", "RunProject", "RunClose" }, - config = function() - require("user.coderunner") - end, - }, - -- for color view - { - "NvChad/nvim-colorizer.lua", - lazy = true, - event = { "BufRead", "InsertEnter", "BufNewFile" }, - opts = { - user_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. - tailwind = true, - }, - 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 - }, - }, - }, - -- for winbar icon - { - "SmiteshP/nvim-navic", - lazy = true, - dependencies = "neovim/nvim-lspconfig", - event = "InsertEnter", - config = function() - require("user.breadcrumb") - require("user.winbar") - end, - }, - -- for popup alert - { - "rcarriga/nvim-notify", - lazy = true, - event = "VeryLazy", - keys = { - { - "un", - function() - require("notify").dismiss({ silent = true, pending = true }) - end, - desc = "Delete all Notifications", - }, - }, - opts = { - timeout = 3000, - max_height = function() - return math.floor(vim.o.lines * 0.75) - end, - max_width = function() - return math.floor(vim.o.columns * 0.75) - end, - }, - -- event = "BufWinEnter", - config = function() - local notify = require("notify") - -- this for transparency - notify.setup({ background_colour = "#000000" }) - -- this overwrites the vim notify function - vim.notify = notify.notify - end, - }, - -- for resize screen - { - "mrjones2014/smart-splits.nvim", - lazy = true, - event = { "BufRead", "InsertEnter", "BufNewFile" }, - config = function() - require("user.smartspit") - end, - }, - -- for popup input - { - "stevearc/dressing.nvim", - lazy = true, - init = function() - ---@diagnostic disable-next-line: duplicate-set-field - vim.ui.select = function(...) - require("lazy").load({ plugins = { "dressing.nvim" } }) - return vim.ui.select(...) - end - ---@diagnostic disable-next-line: duplicate-set-field - vim.ui.input = function(...) - require("lazy").load({ plugins = { "dressing.nvim" } }) - return vim.ui.input(...) - end - end, - config = function() - require("user.dressing") - end, - }, -- mini scrollview - { - "dstein64/nvim-scrollview", - lazy = true, - event = { "BufRead", "InsertEnter", "BufNewFile" }, - config = function() - require("user.nvimscroll") - end, - }, - -- for check startuptime - { "dstein64/vim-startuptime", lazy = true, cmd = "StartupTime" }, - -- { - -- "HiPhish/nvim-ts-rainbow2", - -- lazy = true, - -- event = "BufRead", - -- dependencies = "nvim-treesitter/nvim-treesitter", - -- }, - { - "lewis6991/gitsigns.nvim", - lazy = true, - enabled = vim.fn.executable("git") == 1, - ft = "gitcommit", - event = "BufRead", - config = function() - require("user.gitsigns") - end, - }, -} diff --git a/lua/plugins/neoscroll.lua b/lua/plugins/neoscroll.lua new file mode 100644 index 0000000..b38698f --- /dev/null +++ b/lua/plugins/neoscroll.lua @@ -0,0 +1,8 @@ +return { + "karb94/neoscroll.nvim", + event = "VeryLazy", + lazy = true, + config = function() + require("neoscroll").setup() + end, +} diff --git a/lua/plugins/notify.lua b/lua/plugins/notify.lua new file mode 100644 index 0000000..6677b57 --- /dev/null +++ b/lua/plugins/notify.lua @@ -0,0 +1,31 @@ +return { + "rcarriga/nvim-notify", + lazy = true, + event = "VeryLazy", + keys = { + { + "un", + function() + require("notify").dismiss({ silent = true, pending = true }) + end, + desc = "Delete all Notifications", + }, + }, + opts = { + timeout = 3000, + max_height = function() + return math.floor(vim.o.lines * 0.75) + end, + max_width = function() + return math.floor(vim.o.columns * 0.75) + end, + }, + -- event = "BufWinEnter", + config = function() + local notify = require("notify") + -- this for transparency + notify.setup({ background_colour = "#000000" }) + -- this overwrites the vim notify function + vim.notify = notify.notify + end, +} diff --git a/lua/plugins/nvimtree.lua b/lua/plugins/nvimtree.lua new file mode 100644 index 0000000..162f879 --- /dev/null +++ b/lua/plugins/nvimtree.lua @@ -0,0 +1,229 @@ +local icons = require("user.icons") +return { + "kyazdani42/nvim-tree.lua", + lazy = true, + cmd = { "NvimTree", "NvimTreeOpen", "NvimTreeToggle", "NvimTreeFocus", "NvimTreeClose" }, + opts = { + 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 = {}, + }, + }, + config = function(_, opts) + require("nvim-tree").setup(opts) + end, +} diff --git a/lua/plugins/plenary.lua b/lua/plugins/plenary.lua new file mode 100644 index 0000000..8a41e0c --- /dev/null +++ b/lua/plugins/plenary.lua @@ -0,0 +1,4 @@ +return { + "nvim-lua/plenary.nvim", + lazy = true, +} diff --git a/lua/plugins/scrollview.lua b/lua/plugins/scrollview.lua new file mode 100644 index 0000000..ddbc298 --- /dev/null +++ b/lua/plugins/scrollview.lua @@ -0,0 +1,13 @@ +return { + "dstein64/nvim-scrollview", + lazy = true, + event = { "BufRead", "InsertEnter", "BufNewFile" }, + opts = { + bg = "LightCyan", + ctermbg = 160, + }, + config = function(_, opts) + require("scrollview").setup(opts) + vim.g.scrollview_excluded_filetypes = { "NvimTree", "vista_kind", "Outline", "neo-tree" } + end, +} diff --git a/lua/plugins/smartsplit.lua b/lua/plugins/smartsplit.lua new file mode 100644 index 0000000..ebc4b83 --- /dev/null +++ b/lua/plugins/smartsplit.lua @@ -0,0 +1,21 @@ +return { + "mrjones2014/smart-splits.nvim", + lazy = true, + event = { "BufRead", "InsertEnter", "BufNewFile" }, + opts = { + ignored_filetypes = { + "nofile", + "quickfix", + "qf", + "prompt", + }, + ignored_buftypes = { "nofile" }, + }, + config = function(_, opts) + require("smart-splits").setup(opts) + vim.keymap.set("n", "", require("smart-splits").resize_left) + vim.keymap.set("n", "", require("smart-splits").resize_down) + vim.keymap.set("n", "", require("smart-splits").resize_right) + end, +} diff --git a/lua/plugins/snippets.lua b/lua/plugins/snippets.lua new file mode 100644 index 0000000..1f28e95 --- /dev/null +++ b/lua/plugins/snippets.lua @@ -0,0 +1,25 @@ +return { + { + "rafamadriz/friendly-snippets", + event = "InsertEnter", + lazy = true, + config = function() + require("luasnip.loaders.from_vscode").lazy_load() + require("user.snippets") + require("user.snip") + end, + }, + { + "L3MON4D3/LuaSnip", + lazy = true, + opts = { + history = true, + delete_check_events = "TextChanged", + }, + -- stylua: ignore + keys = { + { "", function() require("luasnip").jump(1) end, mode = "s" }, + { "", function() require("luasnip").jump(-1) end, mode = { "i", "s" } }, + }, + }, +} diff --git a/lua/plugins/startuptime.lua b/lua/plugins/startuptime.lua new file mode 100644 index 0000000..8fe5e2e --- /dev/null +++ b/lua/plugins/startuptime.lua @@ -0,0 +1 @@ +return { "dstein64/vim-startuptime", lazy = true, cmd = "StartupTime" } diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua new file mode 100644 index 0000000..ae6f9f5 --- /dev/null +++ b/lua/plugins/telescope.lua @@ -0,0 +1,172 @@ +return { + "nvim-telescope/telescope.nvim", + lazy = true, + cmd = "Telescope", + version = false, + opts = function() + local actions = require("telescope.actions") + vim.g.theme_switcher_loaded = true + return { + 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 = { + [""] = 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 = { + [""] = actions.cycle_history_next, + [""] = actions.cycle_history_prev, + + [""] = actions.move_selection_next, + [""] = actions.move_selection_previous, + + [""] = actions.close, + + [""] = actions.move_selection_next, + [""] = actions.move_selection_previous, + + [""] = actions.select_default, + [""] = actions.select_horizontal, + [""] = actions.select_vertical, + [""] = actions.select_tab, + + [""] = actions.preview_scrolling_up, + [""] = actions.preview_scrolling_down, + + [""] = actions.results_scrolling_up, + [""] = actions.results_scrolling_down, + + [""] = actions.toggle_selection + actions.move_selection_worse, + [""] = actions.toggle_selection + actions.move_selection_better, + [""] = actions.send_to_qflist + actions.open_qflist, + [""] = actions.send_selected_to_qflist + actions.open_qflist, + [""] = actions.complete_tag, + [""] = actions.which_key, -- keys from pressing + }, + + n = { + [""] = actions.close, + [""] = actions.select_default, + [""] = actions.select_horizontal, + [""] = actions.select_vertical, + [""] = actions.select_tab, + + [""] = actions.toggle_selection + actions.move_selection_worse, + [""] = actions.toggle_selection + actions.move_selection_better, + [""] = actions.send_to_qflist + actions.open_qflist, + [""] = 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, + + [""] = actions.move_selection_next, + [""] = actions.move_selection_previous, + ["gg"] = actions.move_to_top, + ["G"] = actions.move_to_bottom, + + [""] = actions.preview_scrolling_up, + [""] = actions.preview_scrolling_down, + + [""] = actions.results_scrolling_up, + [""] = actions.results_scrolling_down, + + ["?"] = actions.which_key, + }, + }, + } + end, + config = function(_, opts) + require("telescope").setup(opts) + -- load extensions + pcall(function() + for _, ext in ipairs(opts.extensions_list) do + require("telescope").load_extension(ext) + end + end) + end, +} diff --git a/lua/plugins/toggleterm.lua b/lua/plugins/toggleterm.lua new file mode 100644 index 0000000..9df2d00 --- /dev/null +++ b/lua/plugins/toggleterm.lua @@ -0,0 +1,49 @@ +return { + "akinsho/toggleterm.nvim", + lazy = true, + cmd = { + "ToggleTerm", + "TermExec", + "ToggleTermToggleAll", + "ToggleTermSendCurrentLine", + "ToggleTermSendVisualLines", + "ToggleTermSendVisualSelection", + }, + branch = "main", + enabled = true, + opts = { + size = 20, + open_mapping = [[]], + 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", + }, + }, + }, + config = function(_, opts) + require("toggleterm").setup(opts) + function _G.set_terminal_keymaps() + local optsn = { noremap = true } + vim.api.nvim_buf_set_keymap(0, "t", "", [[]], optsn) + vim.api.nvim_buf_set_keymap(0, "t", "jk", [[]], optsn) + vim.api.nvim_buf_set_keymap(0, "t", "", [[h]], optsn) + vim.api.nvim_buf_set_keymap(0, "t", "", [[j]], optsn) + vim.api.nvim_buf_set_keymap(0, "t", "", [[k]], optsn) + vim.api.nvim_buf_set_keymap(0, "t", "", [[l]], optsn) + end + vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()") + end, +} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua new file mode 100644 index 0000000..b50f404 --- /dev/null +++ b/lua/plugins/treesitter.lua @@ -0,0 +1,184 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + dependencies = { + { + "JoosepAlviste/nvim-ts-context-commentstring", + lazy = true, + config = function() + require("ts_context_commentstring").setup({ + enable_autocmd = false, + }) + end, + }, + { + "windwp/nvim-autopairs", + lazy = true, + dependencies = "hrsh7th/nvim-cmp", + event = "InsertEnter", + opts = { + check_ts = true, + ts_config = { + lua = { "string", "source" }, + javascript = { "string", "template_string" }, + java = false, + }, + disable_filetype = { "TelescopePrompt", "spectre_panel" }, + fast_wrap = { + map = "", + chars = { "{", "[", "(", '"', "'", "`" }, + pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""), + offset = 0, -- Offset from pattern match + end_key = "$", + keys = "qwertyuiopzxcvbnmasdfghjkl", + check_comma = true, + highlight = "PmenuSel", + highlight_grey = "LineNr", + }, + }, + config = function(_, opts) + require("nvim-autopairs").setup(opts) + 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 = "" } })) + end, + }, + }, + version = false, -- last release is way too old and doesn't work on Windows + build = ":TSUpdate", + -- event = { "LazyFile", "VeryLazy" }, + lazy = true, + cmd = { + "TSInstall", + "TSUninstall", + "TSUpdate", + "TSUpdateSync", + "TSInstallInfo", + "TSInstallSync", + "TSInstallFromGrammar", + }, + event = { "BufRead", "VeryLazy" }, + opts = { + highlight = { enable = true }, + indent = { enable = true }, + ensure_installed = { + "lua", + "vim", + "vimdoc", + }, + incremental_selection = { + enable = true, + }, + }, + config = function(_, opts) + if type(opts.ensure_installed) == "table" then + ---@type table + local added = {} + opts.ensure_installed = vim.tbl_filter(function(lang) + if added[lang] then + return false + end + added[lang] = true + return true + end, opts.ensure_installed) + end + require("nvim-treesitter.configs").setup(opts) + vim.schedule(function() + require("lazy").load({ plugins = { "nvim-treesitter-textobjects" } }) + end) + end, + }, + { + "nvim-treesitter/nvim-treesitter-textobjects", + lazy = true, + config = function() + -- When in diff mode, we want to use the default + -- vim text objects c & C instead of the treesitter ones. + local move = require("nvim-treesitter.textobjects.move") ---@type table + local configs = require("nvim-treesitter.configs") + for name, fn in pairs(move) do + if name:find("goto") == 1 then + move[name] = function(q, ...) + if vim.wo.diff then + local config = configs.get_module("textobjects.move")[name] ---@type table + for key, query in pairs(config or {}) do + if q == query and key:find("[%]%[][cC]") then + vim.cmd("normal! " .. key) + return + end + end + end + return fn(q, ...) + end + end + end + end, + }, + -- Automatically add closing tags for HTML and JSX + { + "windwp/nvim-ts-autotag", + lazy = true, + event = "BufRead", + opts = {}, + }, + + { + "RRethy/vim-illuminate", + lazy = true, + event = "BufRead", + opts = { + options = { + -- providers: provider used to get references in the buffer, ordered by priority + providers = { + "lsp", + "treesitter", + "regex", + }, + -- delay: delay in milliseconds + delay = 120, + -- filetype_overrides: filetype specific overrides. + -- The keys are strings to represent the filetype while the values are tables that + -- supports the same keys passed to .configure except for filetypes_denylist and filetypes_allowlist + filetype_overrides = {}, + -- filetypes_denylist: filetypes to not illuminate, this overrides filetypes_allowlist + filetypes_denylist = { + "dirvish", + "fugitive", + "alpha", + "NvimTree", + "lazy", + "neogitstatus", + "Trouble", + "lir", + "Outline", + "spectre_panel", + "toggleterm", + "DressingSelect", + "TelescopePrompt", + }, + -- filetypes_allowlist: filetypes to illuminate, this is overridden by filetypes_denylist + filetypes_allowlist = {}, + -- modes_denylist: modes to not illuminate, this overrides modes_allowlist + modes_denylist = {}, + -- modes_allowlist: modes to illuminate, this is overridden by modes_denylist + modes_allowlist = {}, + -- providers_regex_syntax_denylist: syntax to not illuminate, this overrides providers_regex_syntax_allowlist + -- Only applies to the 'regex' provider + -- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name') + providers_regex_syntax_denylist = {}, + -- providers_regex_syntax_allowlist: syntax to illuminate, this is overridden by providers_regex_syntax_denylist + -- Only applies to the 'regex' provider + -- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name') + providers_regex_syntax_allowlist = {}, + -- under_cursor: whether or not to illuminate under the cursor + under_cursor = true, + }, + }, + config = function(_, opts) + require("illuminate").configure(opts) + end, + }, +} diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index ebaacce..8e99449 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -17,52 +17,6 @@ return { require("user.lualine_cfg") end, }, - -- for show icon - { - "kyazdani42/nvim-web-devicons", - lazy = true, - dependencies = { "pojokcodeid/nvim-material-icon" }, - config = function() - require("user.webdevicons") - end, - }, - -- for tree exploler - { - "kyazdani42/nvim-tree.lua", - lazy = true, - cmd = { "NvimTree", "NvimTreeOpen", "NvimTreeToggle", "NvimTreeFocus", "NvimTreeClose" }, - config = function() - local data_exists, treeconfig = pcall(require, "core.config") - if data_exists then - if treeconfig.loadnvimtree_lazy then - require("user.nvim-tree") - end - end - end, - }, - -- for file tab - { - "famiu/bufdelete.nvim", - lazy = true, - }, - { - "akinsho/bufferline.nvim", - lazy = true, - branch = "main", - event = { "BufRead", "InsertEnter", "BufNewFile" }, - config = function() - require("user.bufferline") - end, - }, - -- for view terminal - { - "akinsho/toggleterm.nvim", - lazy = true, - cmd = { "ToggleTerm" }, - config = function() - require("user.toggleterm") - end, - }, -- key mapping { "folke/which-key.nvim", @@ -73,21 +27,4 @@ return { require("user.whichkey") end, }, - -- for search - { - "nvim-telescope/telescope.nvim", - lazy = true, - cmd = "Telescope", - version = false, -- telescope did only one release, so use HEAD for now - config = function() - require("user.telescope") - end, - }, - { - "karb94/neoscroll.nvim", - lazy = true, - config = function() - require("user.neoscroll") - end, - }, } diff --git a/lua/plugins/visualmulti.lua b/lua/plugins/visualmulti.lua new file mode 100644 index 0000000..7ba402f --- /dev/null +++ b/lua/plugins/visualmulti.lua @@ -0,0 +1,14 @@ +return { + "mg979/vim-visual-multi", + event = { "BufRead", "InsertEnter", "BufNewFile" }, + lazy = true, + init = function() + vim.g.VM_mouse_mappings = 1 -- equal CTRL + Left Click on VSCODE + vim.g.VM_maps = { + ["Find Under"] = "", -- equal CTRL+D on VSCODE + ["Find Subword Under"] = "", -- equal CTRL+D on VSCODE + ["Select Cursor Down"] = "", -- equal CTRL+ALT+DOWN on VSCODE + ["Select Cursor Up"] = "", -- equal CTRL+ALT+UP on VSCODE + } + end, +} diff --git a/lua/plugins/webdevicon.lua b/lua/plugins/webdevicon.lua new file mode 100644 index 0000000..24e8ed3 --- /dev/null +++ b/lua/plugins/webdevicon.lua @@ -0,0 +1,21 @@ +return { + "kyazdani42/nvim-web-devicons", + lazy = true, + dependencies = "pojokcodeid/nvim-material-icon", + opts = function() + local material_icon_ok, material_icon = pcall(require, "nvim-material-icon") + if not material_icon_ok then + return + end + material_icon.setup({ + override = {}, + }) + return { + override = material_icon.get_icons(), + override_by_filename = {}, + } + end, + config = function(_, opts) + require("nvim-web-devicons").setup(opts) + end, +} diff --git a/lua/plugins/yanky.lua b/lua/plugins/yanky.lua new file mode 100644 index 0000000..3e05197 --- /dev/null +++ b/lua/plugins/yanky.lua @@ -0,0 +1,19 @@ +return { + "gbprod/yanky.nvim", + event = "BufReadPre", + opts = { + ring = { + history_length = 50, + storage = "memory", + }, + preserve_cursor_position = { + enabled = false, + }, + }, + config = function(_, opts) + require("yanky").setup(opts) + -- cycle through the yank history, only work after paste + vim.keymap.set("n", "[y", "(YankyCycleForward)") + vim.keymap.set("n", "]y", "(YankyCycleBackward)") + end, +} diff --git a/lua/user/autopairs.lua b/lua/user/autopairs.lua deleted file mode 100644 index 64b83b0..0000000 --- a/lua/user/autopairs.lua +++ /dev/null @@ -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 = "", - 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("/>") .. "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 = "" } })) diff --git a/lua/user/autotag.lua b/lua/user/autotag.lua deleted file mode 100644 index 33a92af..0000000 --- a/lua/user/autotag.lua +++ /dev/null @@ -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, - }, -}) diff --git a/lua/user/bufferline.lua b/lua/user/bufferline.lua deleted file mode 100644 index bd3e24b..0000000 --- a/lua/user/bufferline.lua +++ /dev/null @@ -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" }, - }, - }, -}) diff --git a/lua/user/cmdline.lua b/lua/user/cmdline.lua deleted file mode 100644 index fc39835..0000000 --- a/lua/user/cmdline.lua +++ /dev/null @@ -1,37 +0,0 @@ -require("cmp").setup.cmdline({ "/", "?" }, { - mapping = require("cmp").mapping.preset.cmdline({ - [""] = { - c = function() - if require("cmp").visible() then - require("cmp").select_next_item() - else - require("cmp").complete() - end - end, - }, - [""] = { c = require("cmp").mapping.abort() }, - [""] = { 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 = function() - if require("cmp").visible() then - require("cmp").select_next_item() - else - require("cmp").complete() - end - end, - }, - [""] = { c = require("cmp").mapping.abort() }, - [""] = { c = require("cmp").mapping.confirm({ select = false }) }, - }), - sources = require("cmp").config.sources({ - { name = "path", keyword_length = 1 }, - }, { - { name = "cmdline", keyword_length = 1 }, - }), -}) diff --git a/lua/user/cmp.lua b/lua/user/cmp.lua deleted file mode 100644 index 820cbdd..0000000 --- a/lua/user/cmp.lua +++ /dev/null @@ -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 = { - [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }), - [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }), - [""] = cmp.mapping.select_prev_item(), - [""] = cmp.mapping.select_next_item(), - [""] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), - [""] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `` mapping. - [""] = 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. - [""] = cmp.mapping.confirm({ select = true }), - [""] = 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", - }), - [""] = 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", "!" }, --- }, --- }, --- }), --- }) diff --git a/lua/user/coderunner.lua b/lua/user/coderunner.lua deleted file mode 100644 index ae7d53f..0000000 --- a/lua/user/coderunner.lua +++ /dev/null @@ -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 = "", - -- 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, - }, -}) diff --git a/lua/user/colorizer.lua b/lua/user/colorizer.lua deleted file mode 100644 index e7e20a0..0000000 --- a/lua/user/colorizer.lua +++ /dev/null @@ -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 - }, -}) diff --git a/lua/user/comment.lua b/lua/user/comment.lua deleted file mode 100644 index a83296e..0000000 --- a/lua/user/comment.lua +++ /dev/null @@ -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, -}) diff --git a/lua/user/dressing.lua b/lua/user/dressing.lua deleted file mode 100644 index 149c754..0000000 --- a/lua/user/dressing.lua +++ /dev/null @@ -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" } }, - }, -}) diff --git a/lua/user/gitsigns.lua b/lua/user/gitsigns.lua deleted file mode 100644 index 4878218..0000000 --- a/lua/user/gitsigns.lua +++ /dev/null @@ -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 = ", - ", - 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 }, -}) diff --git a/lua/user/icons_backup.lua b/lua/user/icons_backup.lua deleted file mode 100644 index c2c523e..0000000 --- a/lua/user/icons_backup.lua +++ /dev/null @@ -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 = "", - }, -} diff --git a/lua/user/indent-o-matic.lua b/lua/user/indent-o-matic.lua deleted file mode 100644 index c625572..0000000 --- a/lua/user/indent-o-matic.lua +++ /dev/null @@ -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 }, - }, -}) diff --git a/lua/user/indentline.lua b/lua/user/indentline.lua deleted file mode 100644 index d095653..0000000 --- a/lua/user/indentline.lua +++ /dev/null @@ -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, -}) diff --git a/lua/user/indentline_backup.lua b/lua/user/indentline_backup.lua deleted file mode 100644 index e2c84be..0000000 --- a/lua/user/indentline_backup.lua +++ /dev/null @@ -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", - -- }, -}) diff --git a/lua/user/lsp/settings/eslint.lua b/lua/user/lsp/settings/eslint.lua index fc6e6fc..0f6e237 100644 --- a/lua/user/lsp/settings/eslint.lua +++ b/lua/user/lsp/settings/eslint.lua @@ -1,20 +1,20 @@ return { - cmd = { "vscode-eslint-language-server", "--stdio" }, -- add file type support - filetypes = { - "javascript", - "javascriptreact", - "javascript.jsx", - "typescript", - "typescriptreact", - "typescript.tsx", - }, - -- add dynamic root dir support - root_dir = require("lspconfig.util").root_pattern( - "package.json", - "tsconfig.json", - "jsconfig.json", - ".eslintrc.json", - ".eslintrc.js", - ".eslintrc.cjs" - ), + -- cmd = { "vscode-eslint-language-server", "--stdio" }, -- add file type support + -- filetypes = { + -- "javascript", + -- "javascriptreact", + -- "javascript.jsx", + -- "typescript", + -- "typescriptreact", + -- "typescript.tsx", + -- }, + -- -- add dynamic root dir support + -- root_dir = require("lspconfig.util").root_pattern( + -- "package.json", + -- "tsconfig.json", + -- "jsconfig.json", + -- ".eslintrc.json", + -- ".eslintrc.js", + -- ".eslintrc.cjs" + -- ), } diff --git a/lua/user/lspsaga_config.lua b/lua/user/lspsaga_config.lua deleted file mode 100644 index db33683..0000000 --- a/lua/user/lspsaga_config.lua +++ /dev/null @@ -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 to jump back -keymap("n", "gh", "Lspsaga lsp_finder") - --- Code action -keymap({ "n", "v" }, "ca", "Lspsaga code_action") - --- Rename -keymap("n", "gr", "Lspsaga rename") - --- Rename word in whole project -keymap("n", "gr", "Lspsaga rename ++project") - --- 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", "Lspsaga peek_definition") - --- Go to Definition -keymap("n", "gd", "Lspsaga goto_definition") - --- Show line diagnostics you can pass argument ++unfocus to make --- show_line_diagnostics float window unfocus -keymap("n", "sl", "Lspsaga show_line_diagnostics") - --- Show cursor diagnostic --- also like show_line_diagnostics support pass ++unfocus -keymap("n", "sc", "Lspsaga show_cursor_diagnostics") - --- Show buffer diagnostic -keymap("n", "sb", "Lspsaga show_buf_diagnostics") - --- Diagnostic jump can use `` to jump back -keymap("n", "[e", "Lspsaga diagnostic_jump_prev") -keymap("n", "]e", "Lspsaga diagnostic_jump_next") - --- 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", "o", "Lspsaga outline") - --- 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", "Lspsaga hover_doc") --- 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 w -keymap("n", "K", "Lspsaga hover_doc ++keep") - --- Callhierarchy -keymap("n", "ci", "Lspsaga incoming_calls") -keymap("n", "co", "Lspsaga outgoing_calls") - --- Float terminal -keymap({ "n", "t" }, "", "Lspsaga term_toggle") diff --git a/lua/user/lualine_20230115.lua b/lua/user/lualine_20230115.lua deleted file mode 100644 index e024b22..0000000 --- a/lua/user/lualine_20230115.lua +++ /dev/null @@ -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 = {}, -}) diff --git a/lua/user/neoscroll.lua b/lua/user/neoscroll.lua deleted file mode 100644 index 092bb76..0000000 --- a/lua/user/neoscroll.lua +++ /dev/null @@ -1,5 +0,0 @@ -local status_ok, neoscroll = pcall(require, "neoscroll") -if not status_ok then - return -end -neoscroll.setup() \ No newline at end of file diff --git a/lua/user/nvim-tree.lua b/lua/user/nvim-tree.lua deleted file mode 100644 index ec0c909..0000000 --- a/lua/user/nvim-tree.lua +++ /dev/null @@ -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 = {}, - }, -}) diff --git a/lua/user/nvimscroll.lua b/lua/user/nvimscroll.lua deleted file mode 100644 index 8df4b94..0000000 --- a/lua/user/nvimscroll.lua +++ /dev/null @@ -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" } diff --git a/lua/user/options_backup.lua b/lua/user/options_backup.lua deleted file mode 100644 index bd74388..0000000 --- a/lua/user/options_backup.lua +++ /dev/null @@ -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 diff --git a/lua/user/project.lua b/lua/user/project.lua deleted file mode 100644 index e44dd0e..0000000 --- a/lua/user/project.lua +++ /dev/null @@ -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') diff --git a/lua/user/smartspit.lua b/lua/user/smartspit.lua deleted file mode 100644 index 94242c9..0000000 --- a/lua/user/smartspit.lua +++ /dev/null @@ -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", "", require("smart-splits").resize_left) -vim.keymap.set("n", "", require("smart-splits").resize_down) -vim.keymap.set("n", "", require("smart-splits").resize_right) diff --git a/lua/user/tabnine.lua b/lua/user/tabnine.lua deleted file mode 100644 index 7964513..0000000 --- a/lua/user/tabnine.lua +++ /dev/null @@ -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) diff --git a/lua/user/telescope.lua b/lua/user/telescope.lua deleted file mode 100644 index b0706a2..0000000 --- a/lua/user/telescope.lua +++ /dev/null @@ -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 = { - [""] = 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 = { - [""] = actions.cycle_history_next, - [""] = actions.cycle_history_prev, - - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - - [""] = actions.close, - - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - - [""] = actions.select_default, - [""] = actions.select_horizontal, - [""] = actions.select_vertical, - [""] = actions.select_tab, - - [""] = actions.preview_scrolling_up, - [""] = actions.preview_scrolling_down, - - [""] = actions.results_scrolling_up, - [""] = actions.results_scrolling_down, - - [""] = actions.toggle_selection + actions.move_selection_worse, - [""] = actions.toggle_selection + actions.move_selection_better, - [""] = actions.send_to_qflist + actions.open_qflist, - [""] = actions.send_selected_to_qflist + actions.open_qflist, - [""] = actions.complete_tag, - [""] = actions.which_key, -- keys from pressing - }, - - n = { - [""] = actions.close, - [""] = actions.select_default, - [""] = actions.select_horizontal, - [""] = actions.select_vertical, - [""] = actions.select_tab, - - [""] = actions.toggle_selection + actions.move_selection_worse, - [""] = actions.toggle_selection + actions.move_selection_better, - [""] = actions.send_to_qflist + actions.open_qflist, - [""] = 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, - - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - ["gg"] = actions.move_to_top, - ["G"] = actions.move_to_bottom, - - [""] = actions.preview_scrolling_up, - [""] = actions.preview_scrolling_down, - - [""] = actions.results_scrolling_up, - [""] = 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) diff --git a/lua/user/telescope_backup.lua b/lua/user/telescope_backup.lua deleted file mode 100644 index b8dd9d6..0000000 --- a/lua/user/telescope_backup.lua +++ /dev/null @@ -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 = { - [""] = actions.cycle_history_next, - [""] = actions.cycle_history_prev, - - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - - [""] = actions.close, - - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - - [""] = actions.select_default, - [""] = actions.select_horizontal, - [""] = actions.select_vertical, - [""] = actions.select_tab, - - [""] = actions.preview_scrolling_up, - [""] = actions.preview_scrolling_down, - - [""] = actions.results_scrolling_up, - [""] = actions.results_scrolling_down, - - [""] = actions.toggle_selection + actions.move_selection_worse, - [""] = actions.toggle_selection + actions.move_selection_better, - [""] = actions.send_to_qflist + actions.open_qflist, - [""] = actions.send_selected_to_qflist + actions.open_qflist, - [""] = actions.complete_tag, - [""] = actions.which_key, -- keys from pressing - }, - - n = { - [""] = actions.close, - [""] = actions.select_default, - [""] = actions.select_horizontal, - [""] = actions.select_vertical, - [""] = actions.select_tab, - - [""] = actions.toggle_selection + actions.move_selection_worse, - [""] = actions.toggle_selection + actions.move_selection_better, - [""] = actions.send_to_qflist + actions.open_qflist, - [""] = 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, - - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - ["gg"] = actions.move_to_top, - ["G"] = actions.move_to_bottom, - - [""] = actions.preview_scrolling_up, - [""] = actions.preview_scrolling_down, - - [""] = actions.results_scrolling_up, - [""] = 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 - }, -}) diff --git a/lua/user/toggleterm.lua b/lua/user/toggleterm.lua deleted file mode 100644 index e619fc5..0000000 --- a/lua/user/toggleterm.lua +++ /dev/null @@ -1,70 +0,0 @@ -local status_ok, toggleterm = pcall(require, "toggleterm") -if not status_ok then - return -end - -toggleterm.setup({ - size = 20, - open_mapping = [[]], - 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", "", [[]], opts) - vim.api.nvim_buf_set_keymap(0, "t", "jk", [[]], opts) - vim.api.nvim_buf_set_keymap(0, "t", "", [[h]], opts) - vim.api.nvim_buf_set_keymap(0, "t", "", [[j]], opts) - vim.api.nvim_buf_set_keymap(0, "t", "", [[k]], opts) - vim.api.nvim_buf_set_keymap(0, "t", "", [[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 diff --git a/lua/user/treesitter.lua b/lua/user/treesitter.lua deleted file mode 100644 index 6503b6f..0000000 --- a/lua/user/treesitter.lua +++ /dev/null @@ -1,48 +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 = "", - -- svelte = "", - -- vue = "", - -- jsx = "{/* %s */}", - -- json = "", - -- }, - -- }, - -- rainbow = { - -- enable = true, - -- disable = { "html", "tsx" }, - -- equery = "rainbow-parens", - -- strategy = require("ts-rainbow").strategy.global, - -- }, - rainbow = { - enable = false, - extended_mode = true, -- Highlight also non-parentheses delimiters, boolean or table: lang -> boolean - max_file_lines = 1000, -- Do not enable for files with more than 1000 lines, int - }, - -- autotag = { enable = true, enable_rename = true, enable_close = true, enable_close_on_slash = true }, - incremental_selection = { enable = true }, - indent = { enable = true, disable = { "python", "css" } }, - autopairs = { - enable = true, - }, -}) diff --git a/lua/user/utils.lua b/lua/user/utils.lua new file mode 100644 index 0000000..5953b1b --- /dev/null +++ b/lua/user/utils.lua @@ -0,0 +1,44 @@ +local M = {} +function M.bufremove(buf) + buf = buf or 0 + buf = buf == 0 and vim.api.nvim_get_current_buf() or buf + + if vim.bo.modified then + local choice = vim.fn.confirm(("Save changes to %q?"):format(vim.fn.bufname()), "&Yes\n&No\n&Cancel") + if choice == 0 then -- Cancel + return + end + if choice == 1 then -- Yes + vim.cmd.write() + end + end + + for _, win in ipairs(vim.fn.win_findbuf(buf)) do + vim.api.nvim_win_call(win, function() + if not vim.api.nvim_win_is_valid(win) or vim.api.nvim_win_get_buf(win) ~= buf then + return + end + -- Try using alternate buffer + local alt = vim.fn.bufnr("#") + if alt ~= buf and vim.fn.buflisted(alt) == 1 then + vim.api.nvim_win_set_buf(win, alt) + return + end + + -- Try using previous buffer + local has_previous = pcall(vim.cmd, "bprevious") + if has_previous and buf ~= vim.api.nvim_win_get_buf(win) then + return + end + + -- Create new listed buffer + local new_buf = vim.api.nvim_create_buf(true, false) + vim.api.nvim_win_set_buf(win, new_buf) + end) + end + if vim.api.nvim_buf_is_valid(buf) then + pcall(vim.cmd, "bdelete! " .. buf) + end +end + +return M diff --git a/lua/user/webdevicons.lua b/lua/user/webdevicons.lua deleted file mode 100644 index 1dd8bd4..0000000 --- a/lua/user/webdevicons.lua +++ /dev/null @@ -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", - }, - }, -}) diff --git a/lua/user/webdevicons_backup.lua b/lua/user/webdevicons_backup.lua deleted file mode 100644 index acdd2ec..0000000 --- a/lua/user/webdevicons_backup.lua +++ /dev/null @@ -1,1642 +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 - -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", - }, - ["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 = "Md", - }, - ["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", - }, - ["py"] = { - icon = "󰌠", - color = "#387EB8", - cterm_color = "220", - name = "pythonfile", - }, - ["vue"] = { - icon = "󰡄", - color = "#4dba87", - cterm_color = "220", - name = "vuefile", - }, - ["xml"] = { - icon = "󰗀", - color = "#f1662a", - cterm_color = "220", - name = "xmlfile", - }, - ["yml"] = { - icon = "󰰳", - color = "#fbc02d", - cterm_color = "220", - name = "Ymlfile", - }, - ["txt"] = { - icon = "", - color = "#89e051", - cterm_color = "220", - name = "txtfile", - }, - ["toml"] = { - icon = "", - color = "#9c4221", - cterm_color = "124", - name = "Toml", - }, - -- ["go"] = { - -- icon = "󰟓", - -- color = "#0FBFCF", - -- cterm_color = "220", - -- name = "go", - -- }, - [".babelrc"] = { - icon = "", - color = "#cbcb41", - cterm_color = "185", - name = "Babelrc", - }, - [".bash_profile"] = { - icon = "", - color = "#89e051", - cterm_color = "113", - name = "BashProfile", - }, - [".bashrc"] = { - icon = "", - color = "#89e051", - cterm_color = "113", - name = "Bashrc", - }, - [".DS_Store"] = { - icon = "", - color = "#41535b", - cterm_color = "239", - name = "DsStore", - }, - [".gitconfig"] = { - icon = "", - color = "#41535b", - cterm_color = "239", - name = "GitConfig", - }, - [".gitlab-ci.yml"] = { - icon = "", - color = "#e24329", - cterm_color = "166", - name = "GitlabCI", - }, - [".gvimrc"] = { - icon = "", - color = "#019833", - cterm_color = "29", - name = "Gvimrc", - }, - [".npmignore"] = { - icon = "", - color = "#E8274B", - cterm_color = "161", - name = "NPMIgnore", - }, - [".npmrc"] = { - icon = "", - color = "#E8274B", - cterm_color = "161", - name = "NPMrc", - }, - [".settings.json"] = { - icon = "", - color = "#854CC7", - cterm_color = "98", - name = "SettingsJson", - }, - [".vimrc"] = { - icon = "", - color = "#019833", - cterm_color = "29", - name = "Vimrc", - }, - [".zprofile"] = { - icon = "", - color = "#89e051", - cterm_color = "113", - name = "Zshprofile", - }, - [".zshenv"] = { - icon = "", - color = "#89e051", - cterm_color = "113", - name = "Zshenv", - }, - [".zshrc"] = { - icon = "", - color = "#89e051", - cterm_color = "113", - name = "Zshrc", - }, - ["Brewfile"] = { - icon = "", - color = "#701516", - cterm_color = "1", - name = "Brewfile", - }, - ["CMakeLists.txt"] = { - icon = "", - color = "#6d8086", - cterm_color = "66", - name = "CMakeLists", - }, - ["COPYING"] = { - icon = "", - color = "#cbcb41", - cterm_color = "185", - name = "License", - }, - ["COPYING.LESSER"] = { - icon = "", - color = "#cbcb41", - cterm_color = "185", - name = "License", - }, - ["Dockerfile"] = { - icon = "", - color = "#0087c9", - cterm_color = "32", - name = "Dockerfile", - }, - ["Gemfile$"] = { - icon = "", - color = "#701516", - cterm_color = "1", - name = "Gemfile", - }, - ["Rmd"] = { - icon = "", - color = "#519aba", - cterm_color = "67", - name = "Rmd", - }, - ["Vagrantfile$"] = { - icon = "", - color = "#1563FF", - cterm_color = "27", - name = "Vagrantfile", - }, - ["_gvimrc"] = { - icon = "", - color = "#019833", - cterm_color = "29", - name = "Gvimrc", - }, - ["_vimrc"] = { - icon = "", - color = "#019833", - cterm_color = "29", - name = "Vimrc", - }, - ["ai"] = { - icon = "", - color = "#cbcb41", - cterm_color = "185", - name = "Ai", - }, - ["awk"] = { - icon = "", - color = "#4d5a5e", - cterm_color = "240", - name = "Awk", - }, - ["bash"] = { - icon = "", - color = "#89e051", - cterm_color = "113", - name = "Bash", - }, - ["bat"] = { - icon = "", - color = "#C1F12E", - cterm_color = "154", - name = "Bat", - }, - ["c"] = { - icon = "", - color = "#599eff", - cterm_color = "75", - name = "C", - }, - ["c++"] = { - icon = "", - color = "#f34b7d", - cterm_color = "204", - name = "CPlusPlus", - }, - ["cbl"] = { - icon = "⚙", - color = "#005ca5", - cterm_color = "25", - name = "Cobol", - }, - ["cc"] = { - icon = "", - color = "#f34b7d", - cterm_color = "204", - name = "CPlusPlus", - }, - ["cfg"] = { - icon = "", - color = "#ECECEC", - cterm_color = "255", - name = "Configuration", - }, - ["clj"] = { - icon = "", - color = "#8dc149", - cterm_color = "107", - name = "Clojure", - }, - ["cljc"] = { - icon = "", - color = "#8dc149", - cterm_color = "107", - name = "ClojureC", - }, - ["cljs"] = { - icon = "", - color = "#519aba", - cterm_color = "67", - name = "ClojureJS", - }, - ["cljd"] = { - icon = "", - color = "#519aba", - cterm_color = "67", - name = "ClojureDart", - }, - ["cmake"] = { - icon = "", - color = "#6d8086", - cterm_color = "66", - name = "CMake", - }, - ["cob"] = { - icon = "⚙", - color = "#005ca5", - cterm_color = "25", - name = "Cobol", - }, - ["cobol"] = { - icon = "⚙", - color = "#005ca5", - cterm_color = "25", - name = "Cobol", - }, - ["coffee"] = { - icon = "", - color = "#cbcb41", - cterm_color = "185", - name = "Coffee", - }, - ["conf"] = { - icon = "", - color = "#6d8086", - cterm_color = "66", - name = "Conf", - }, - ["config.ru"] = { - icon = "", - color = "#701516", - cterm_color = "1", - name = "ConfigRu", - }, - ["cp"] = { - icon = "", - color = "#519aba", - cterm_color = "67", - name = "Cp", - }, - ["cpp"] = { - icon = "", - color = "#519aba", - cterm_color = "67", - name = "Cpp", - }, - ["cpy"] = { - icon = "⚙", - color = "#005ca5", - cterm_color = "25", - name = "Cobol", - }, - ["cr"] = { - icon = "", - color = "#000000", - cterm_color = "16", - name = "Crystal", - }, - ["csh"] = { - icon = "", - color = "#4d5a5e", - cterm_color = "240", - name = "Csh", - }, - ["cson"] = { - icon = "", - color = "#cbcb41", - cterm_color = "185", - name = "Cson", - }, - ["css"] = { - icon = "", - color = "#42a5f5", - cterm_color = "75", - name = "Css", - }, - ["cxx"] = { - icon = "", - color = "#519aba", - cterm_color = "67", - name = "Cxx", - }, - ["d"] = { - icon = "", - color = "#427819", - cterm_color = "64", - name = "D", - }, - ["dart"] = { - icon = "", - color = "#03589C", - cterm_color = "25", - name = "Dart", - }, - ["db"] = { - icon = "", - color = "#dad8d8", - cterm_color = "253", - name = "Db", - }, - ["desktop"] = { - icon = "", - color = "#563d7c", - cterm_color = "60", - name = "DesktopEntry", - }, - ["diff"] = { - icon = "", - color = "#41535b", - cterm_color = "239", - name = "Diff", - }, - ["dockerfile"] = { - icon = "", - color = "#0087c9", - cterm_color = "32", - name = "Dockerfile", - }, - ["drl"] = { - icon = "", - color = "#ffafaf", - cterm_color = "217", - name = "Drools", - }, - ["dropbox"] = { - icon = "", - color = "#0061FE", - cterm_color = "27", - name = "Dropbox", - }, - ["dump"] = { - icon = "", - color = "#dad8d8", - cterm_color = "253", - name = "Dump", - }, - ["edn"] = { - icon = "", - color = "#519aba", - cterm_color = "67", - name = "Edn", - }, - ["eex"] = { - icon = "", - color = "#a074c4", - cterm_color = "140", - name = "Eex", - }, - ["ejs"] = { - icon = "", - color = "#cbcb41", - cterm_color = "185", - name = "Ejs", - }, - ["elm"] = { - icon = "", - color = "#519aba", - cterm_color = "67", - name = "Elm", - }, - ["epp"] = { - icon = "", - color = "#FFA61A", - cterm_color = "214", - name = "Epp", - }, - ["erb"] = { - icon = "", - color = "#701516", - cterm_color = "1", - name = "Erb", - }, - ["erl"] = { - icon = "", - color = "#B83998", - cterm_color = "132", - name = "Erl", - }, - ["ex"] = { - icon = "", - color = "#a074c4", - cterm_color = "140", - name = "Ex", - }, - ["exs"] = { - icon = "", - color = "#a074c4", - cterm_color = "140", - name = "Exs", - }, - ["f#"] = { - icon = "", - color = "#519aba", - cterm_color = "67", - name = "Fsharp", - }, - ["favicon.ico"] = { - icon = "", - color = "#cbcb41", - cterm_color = "185", - name = "Favicon", - }, - ["fnl"] = { - icon = "", - color = "#fff3d7", - cterm_color = "230", - name = "Fennel", - }, - ["fs"] = { - icon = "", - color = "#519aba", - cterm_color = "67", - name = "Fs", - }, - ["fsi"] = { - icon = "", - color = "#519aba", - cterm_color = "67", - name = "Fsi", - }, - ["fsscript"] = { - icon = "", - color = "#519aba", - cterm_color = "67", - name = "Fsscript", - }, - ["fsx"] = { - icon = "", - color = "#519aba", - cterm_color = "67", - name = "Fsx", - }, - ["gd"] = { - icon = "", - color = "#6d8086", - cterm_color = "66", - name = "GDScript", - }, - ["gemspec"] = { - icon = "", - color = "#701516", - cterm_color = "1", - name = "Gemspec", - }, - ["gif"] = { - icon = "", - color = "#26a69a", - cterm_color = "36", - name = "Gif", - }, - ["glb"] = { - icon = "", - color = "#FFB13B", - cterm_color = "215", - name = "BinaryGLTF", - }, - ["go"] = { - icon = "", - color = "#519aba", - cterm_color = "67", - name = "Go", - }, - ["godot"] = { - icon = "", - color = "#6d8086", - cterm_color = "66", - name = "GodotProject", - }, - ["graphql"] = { - icon = "", - color = "#e535ab", - cterm_color = "169", - name = "GraphQL", - }, - ["gruntfile"] = { - icon = "", - color = "#e37933", - cterm_color = "173", - name = "Gruntfile", - }, - ["gulpfile"] = { - icon = "", - color = "#cc3e44", - cterm_color = "167", - name = "Gulpfile", - }, - ["h"] = { - icon = "", - color = "#a074c4", - cterm_color = "140", - name = "H", - }, - ["haml"] = { - icon = "", - color = "#eaeae1", - cterm_color = "254", - name = "Haml", - }, - ["hbs"] = { - icon = "", - color = "#f0772b", - cterm_color = "208", - name = "Hbs", - }, - ["heex"] = { - icon = "", - color = "#a074c4", - cterm_color = "140", - name = "Heex", - }, - ["hh"] = { - icon = "", - color = "#a074c4", - cterm_color = "140", - name = "Hh", - }, - ["hpp"] = { - icon = "", - color = "#a074c4", - cterm_color = "140", - name = "Hpp", - }, - ["hrl"] = { - icon = "", - color = "#B83998", - cterm_color = "132", - name = "Hrl", - }, - ["hs"] = { - icon = "", - color = "#a074c4", - cterm_color = "140", - name = "Hs", - }, - ["htm"] = { - icon = "", - color = "#e34c26", - cterm_color = "166", - name = "Htm", - }, - ["html"] = { - icon = "", - color = "#e44d26", - cterm_color = "166", - name = "Html", - }, - ["hxx"] = { - icon = "", - color = "#a074c4", - cterm_color = "140", - name = "Hxx", - }, - ["ico"] = { - icon = "", - color = "#cbcb41", - cterm_color = "185", - name = "Ico", - }, - ["import"] = { - icon = "", - color = "#ECECEC", - cterm_color = "255", - name = "ImportConfiguration", - }, - ["ini"] = { - icon = "", - color = "#6d8086", - cterm_color = "66", - name = "Ini", - }, - ["jl"] = { - icon = "", - color = "#a270ba", - cterm_color = "133", - name = "Jl", - }, - ["json5"] = { - icon = "", - color = "#cbcb41", - cterm_color = "185", - name = "Json5", - }, - ["ksh"] = { - icon = "", - color = "#4d5a5e", - cterm_color = "240", - name = "Ksh", - }, - ["kt"] = { - icon = "", - color = "#F88A02", - cterm_color = "208", - name = "Kotlin", - }, - ["kts"] = { - icon = "", - color = "#F88A02", - cterm_color = "208", - name = "KotlinScript", - }, - ["leex"] = { - icon = "", - color = "#a074c4", - cterm_color = "140", - name = "Leex", - }, - ["less"] = { - icon = "", - color = "#563d7c", - cterm_color = "60", - name = "Less", - }, - ["lhs"] = { - icon = "", - color = "#a074c4", - cterm_color = "140", - name = "Lhs", - }, - ["lua"] = { - icon = "", - color = "#51a0cf", - cterm_color = "74", - name = "Lua", - }, - ["luau"] = { - icon = "", - color = "#51a0cf", - cterm_color = "74", - name = "Luau", - }, - ["makefile"] = { - icon = "", - color = "#6d8086", - cterm_color = "66", - name = "Makefile", - }, - ["markdown"] = { - icon = "", - color = "#519aba", - cterm_color = "67", - name = "Markdown", - }, - ["mdx"] = { - icon = "", - color = "#519aba", - cterm_color = "67", - name = "Mdx", - }, - ["mix.lock"] = { - icon = "", - color = "#a074c4", - cterm_color = "140", - name = "MixLock", - }, - ["ml"] = { - icon = "λ", - color = "#e37933", - cterm_color = "173", - name = "Ml", - }, - ["mli"] = { - icon = "λ", - color = "#e37933", - cterm_color = "173", - name = "Mli", - }, - ["mo"] = { - icon = "∞", - color = "#9772FB", - cterm_color = "99", - name = "Motoko", - }, - ["mustache"] = { - icon = "", - color = "#e37933", - cterm_color = "173", - name = "Mustache", - }, - ["nim"] = { - icon = "", - color = "#f3d400", - cterm_color = "220", - name = "Nim", - }, - ["nix"] = { - icon = "", - color = "#7ebae4", - cterm_color = "110", - name = "Nix", - }, - ["otf"] = { - icon = "", - color = "#ECECEC", - cterm_color = "255", - name = "OpenTypeFont", - }, - ["pck"] = { - icon = "", - color = "#6d8086", - cterm_color = "66", - name = "PackedResource", - }, - ["pp"] = { - icon = "", - color = "#FFA61A", - cterm_color = "214", - name = "Pp", - }, - ["Procfile"] = { - icon = "", - color = "#a074c4", - cterm_color = "140", - name = "Procfile", - }, - ["ps1"] = { - icon = "", - color = "#4d5a5e", - cterm_color = "240", - name = "PromptPs1", - }, - ["psb"] = { - icon = "", - color = "#519aba", - cterm_color = "67", - name = "Psb", - }, - ["psd"] = { - icon = "", - color = "#519aba", - cterm_color = "67", - name = "Psd", - }, - ["query"] = { - icon = "", - color = "#90a850", - cterm_color = "107", - name = "Query", - }, - ["rake"] = { - icon = "", - color = "#701516", - cterm_color = "1", - name = "Rake", - }, - ["rakefile"] = { - icon = "", - color = "#701516", - cterm_color = "1", - name = "Rakefile", - }, - ["rb"] = { - icon = "", - color = "#701516", - cterm_color = "1", - name = "Rb", - }, - ["rlib"] = { - icon = "", - color = "#dea584", - cterm_color = "180", - name = "Rlib", - }, - ["rmd"] = { - icon = "", - color = "#519aba", - cterm_color = "67", - name = "Rmd", - }, - ["rs"] = { - icon = "", - color = "#dea584", - cterm_color = "180", - name = "Rs", - }, - ["rss"] = { - icon = "", - color = "#FB9D3B", - cterm_color = "215", - name = "Rss", - }, - ["sass"] = { - icon = "", - color = "#f55385", - cterm_color = "204", - name = "Sass", - }, - ["sbt"] = { - icon = "", - color = "#cc3e44", - cterm_color = "167", - name = "sbt", - }, - ["scala"] = { - icon = "", - color = "#f44336", - cterm_color = "203", - name = "Scala", - }, - ["scm"] = { - icon = "ﬦ", - color = "#000000", - cterm_color = "16", - name = "Scheme", - }, - ["scss"] = { - icon = "", - color = "#f55385", - cterm_color = "204", - name = "Scss", - }, - ["sig"] = { - icon = "λ", - color = "#e37933", - cterm_color = "173", - name = "Sig", - }, - ["slim"] = { - icon = "", - color = "#e34c26", - cterm_color = "166", - name = "Slim", - }, - ["sln"] = { - icon = "", - color = "#854CC7", - cterm_color = "98", - name = "Sln", - }, - ["sml"] = { - icon = "λ", - color = "#e37933", - cterm_color = "173", - name = "Sml", - }, - ["sqlite"] = { - icon = "", - color = "#dad8d8", - cterm_color = "253", - name = "Sql", - }, - ["sqlite3"] = { - icon = "", - color = "#dad8d8", - cterm_color = "253", - name = "Sql", - }, - ["styl"] = { - icon = "", - color = "#8dc149", - cterm_color = "107", - name = "Styl", - }, - ["sublime"] = { - icon = "", - color = "#e37933", - cterm_color = "173", - name = "Suo", - }, - ["suo"] = { - icon = "", - color = "#854CC7", - cterm_color = "98", - name = "Suo", - }, - ["t"] = { - icon = "", - color = "#519aba", - cterm_color = "67", - name = "Tor", - }, - ["terminal"] = { - icon = "", - color = "#31B53E", - cterm_color = "71", - name = "Terminal", - }, - ["tres"] = { - icon = "", - color = "#cbcb41", - cterm_color = "185", - name = "TextResource", - }, - ["twig"] = { - icon = "", - color = "#8dc149", - cterm_color = "107", - name = "Twig", - }, - ["vim"] = { - icon = "", - color = "#019833", - cterm_color = "29", - name = "Vim", - }, - ["webmanifest"] = { - icon = "", - color = "#f1e05a", - cterm_color = "221", - name = "Webmanifest", - }, - ["xcplayground"] = { - icon = "", - color = "#e37933", - cterm_color = "173", - name = "XcPlayground", - }, - ["zig"] = { - icon = "", - color = "#f69a1b", - cterm_color = "208", - name = "Zig", - }, - ["zsh"] = { - icon = "", - color = "#89e051", - cterm_color = "113", - name = "Zsh", - }, - [".env"] = { - icon = "", - color = "#faf743", - cterm_color = "227", - name = "Env", - }, - ["lock"] = { - icon = "", - color = "#ffd54f", - cterm_color = "221", - name = "Lock", - }, - ["log"] = { - icon = "", - color = "#ffffff", - cterm_color = "231", - name = "Log", - }, - ["zip"] = { - icon = "", - color = "#afb42b", - cterm_color = "142", - name = "Zip", - }, - ["xz"] = { - icon = "", - color = "#afb42b", - cterm_color = "142", - name = "Xz", - }, - ["test.js"] = { - icon = "", - color = "#ffca28", - cterm_color = "220", - name = "TestJavascript", - }, - ["test.jsx"] = { - icon = "", - color = "#00bcd4", - cterm_color = "38", - name = "TestJavascriptReact", - }, - ["test.ts"] = { - icon = "", - color = "#00bcd4", - cterm_color = "38", - name = "TestTypescript", - }, - ["ttf"] = { - icon = "", - color = "#f44336", - cterm_color = "203", - name = "Ttf", - }, - ["woff"] = { - icon = "", - color = "#f44336", - cterm_color = "203", - name = "WebOpenFontFormat", - }, - ["woff2"] = { - icon = "", - color = "#f44336", - cterm_color = "203", - name = "WebOpenFontFormat", - }, - ["hex"] = { - icon = "", - color = "#26a69a", - cterm_color = "36", - name = "Hex", - }, - ["bin"] = { - icon = "", - color = "#26a69a", - cterm_color = "36", - name = "Bin", - }, - ["dat"] = { - icon = "", - color = "#26a69a", - cterm_color = "36", - name = "Dat", - }, - ["abc"] = { - icon = "", - color = "#ff5722", - cterm_color = "202", - name = "Abc", - }, - ["babel.config.js"] = { - icon = "", - color = "#fdd835", - cterm_color = "221", - name = "BabelConfig", - }, - ["bf"] = { - icon = "", - color = "#ff4081", - cterm_color = "204", - name = "Bf", - }, - ["exe"] = { - icon = "", - color = "#e64a19", - cterm_color = "166", - name = "Exe", - }, - ["pptx"] = { - icon = "", - color = "#d14524", - cterm_color = "166", - name = "Pptx", - }, - ["obj"] = { - icon = "", - color = "#29b6f6", - cterm_color = "39", - name = "Obj", - }, - ["fbx"] = { - icon = "", - color = "#29b6f6", - cterm_color = "39", - name = "Fbx", - }, - ["deb"] = { - icon = "", - color = "#ff0283", - cterm_color = "198", - name = "Deb", - }, - ["rpm"] = { - icon = "", - color = "#f44336", - cterm_color = "203", - name = "Rpm", - }, - ["README.md"] = { - icon = "", - color = "#42a5f5", - cterm_color = "75", - name = "README.md", - }, - ["razor"] = { - icon = "", - color = "#42a5f5", - cterm_color = "75", - name = "razor", - }, - ["sc"] = { - icon = "", - color = "#f44336", - cterm_color = "203", - name = "sc", - }, - }, - 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 = "", - color = "#ea5e5e", - cterm_color = "240", - name = "prettierrc", - }, - [".prettierrc.json"] = { - icon = "", - color = "#ea5e5e", - cterm_color = "240", - name = "prettierrcjson", - }, - [".prettierd"] = { - 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 = "", - 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", - }, - ["README.md"] = { - icon = "󰋼", - color = "#faf743", - cterm_color = "227", - name = "readmefile", - }, - }, -}) diff --git a/lua/user/whichkey.lua b/lua/user/whichkey.lua index 2f6cbb2..f12f252 100644 --- a/lua/user/whichkey.lua +++ b/lua/user/whichkey.lua @@ -17,12 +17,6 @@ function _NODE_TOGGLE() node:toggle() end --- function _NCDU_TOGGLE() --- local Terminal = require("toggleterm.terminal").Terminal --- local ncdu = Terminal:new({ cmd = "ncdu", hidden = true }) --- ncdu:toggle() --- end - function _HTOP_TOGGLE() local Terminal = require("toggleterm.terminal").Terminal local htop = Terminal:new({ cmd = "htop", hidden = true }) @@ -176,7 +170,6 @@ 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 = {}, @@ -202,19 +195,8 @@ local opts2 = { nowait = true, -- use `nowait` when creating keymaps } --- local trn = "" --- if vim.fn.has("win32") == 1 then --- trn = "pwsh" --- end -- for debug local debug_key = {} --- local trasparant = {} --- local is_dap = pcall(require, "dap") - --- local trans_ok, _ = pcall(require, "transparent") --- if trans_ok then --- trasparant = { "TransparentToggle", "Toggle Transparency" } --- end if vim.fn.has("win32") == 0 then debug_key = { @@ -240,14 +222,10 @@ local mappings2 = { ["/"] = { "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", " 󰆈 Commet Block" }, } local mappings = { - -- ["c"] = trasparant, ["a"] = { "Alpha", "󰕮 Alpha" }, - --["e"] = { "NvimTreeToggle", "Explorer" }, ["e"] = { "NvimTreeToggle", "󰙅 Explorer" }, ["w"] = { "w!", "󰆓 Save" }, ["q"] = { "q!", "󰿅 Quit" }, - -- ["c"] = { "Bdelete!", "󰅗 Close Buffer" }, - -- ["k"] = { "lua _close_buffer()", "󰅗 Close Buffer" }, -- open exloler and close toggleterm ["o"] = { "lua _OPEN_EXPLORER()lua require('toggleterm').toggle()", "󱏒 Open Explorer" }, ["h"] = { "nohlsearch", "󱪿 No Highlight" }, @@ -256,29 +234,12 @@ local mappings = { " Find files", }, ["F"] = { "Telescope live_grep theme=ivy", " Find Text" }, - -- ["P"] = { "lua require('telescope').extensions.projects.projects()", "Projects" }, - -- ["z"] = { "Lazy", "Lazy" }, - ["/"] = { function() require("Comment.api").toggle.linewise.current() end, "󰆈 Coment line", }, - -- ["m"] = { - -- name = "Markdown", - -- p = { "MarkdownPreview", "Preview" }, - -- s = { "MarkdownPreviewStop", "Stop Preview" }, - -- }, - -- p = { - -- name = "Packer", - -- c = { "PackerCompile", "Compile" }, - -- i = { "PackerInstall", "Install" }, - -- s = { "PackerSync", "Sync" }, - -- S = { "PackerStatus", "Status" }, - -- u = { "PackerUpdate", "Update" }, - -- }, - b = { name = "  Buffers", -- show all buffers with telescope @@ -378,16 +339,11 @@ local mappings = { t = { name = "  Terminal", - -- l = { "lua _LIVE_SERVER()", "Live Server" }, l = { "terminal live-server", "Live Server" }, P = { "lua _NEWTAB_TOGGLE()", "Power Shell" }, - -- l = { "ToggleTerm direction=tablive-server", "Live Server" }, x = { "ToggleTermToggleAll!", "Close Tab" }, n = { "lua _NODE_TOGGLE()", "Node" }, - -- u = { "lua _NCDU_TOGGLE()", "NCDU" }, - -- t = { "lua _HTOP_TOGGLE()", "Htop" }, b = { "lua _BTOP_TOGGLE()", "Btop" }, - -- B = { "lua _BTM_TOGGLE()", "Boottom" }, p = { "lua _PYTHON_TOGGLE()", "Python" }, f = { "ToggleTerm direction=float", "Float" }, h = { "ToggleTerm size=10 direction=horizontal", "Horizontal" }, @@ -413,142 +369,7 @@ local mappings = { "terminal mvn package", "MVN Build", }, - -- m = { - -- name = "Maven", - -- b = { "terminal mvn package", "MVN Build" }, - -- r = { "terminal java -jar target/my-app.jar", "Run JAR" }, - -- }, }, - -- D = { - -- name = "Debug", - -- b = { - -- function() - -- if is_dap then - -- require("dap").toggle_breakpoint() - -- else - -- vim.notify("DAP Not Support", "info") - -- end - -- end, - -- "Toggle Breakpoint", - -- }, - -- B = { - -- function() - -- if is_dap then - -- require("dap").clear_breakpoints() - -- else - -- vim.notify("DAP Not Support", "info") - -- end - -- end, - -- "Clear Breakpoints", - -- }, - -- c = { - -- function() - -- if is_dap then - -- require("dap").continue() - -- else - -- vim.notify("DAP Not Support", "info") - -- end - -- end, - -- "Start/Continue", - -- }, - -- i = { - -- function() - -- if is_dap then - -- require("dap").step_into() - -- else - -- vim.notify("DAP Not Support", "info") - -- end - -- end, - -- "Step Into (F11)", - -- }, - -- o = { - -- function() - -- if is_dap then - -- require("dap").step_over() - -- else - -- vim.notify("DAP Not Support", "info") - -- end - -- end, - -- "Step Over (F10)", - -- }, - -- O = { - -- function() - -- if is_dap then - -- require("dap").step_out() - -- else - -- vim.notify("DAP Not Support", "info") - -- end - -- end, - -- "Step Out (S-F11)", - -- }, - -- q = { - -- function() - -- if is_dap then - -- require("dap").close() - -- else - -- vim.notify("DAP Not Support", "info") - -- end - -- end, - -- "Close Session", - -- }, - -- Q = { - -- function() - -- if is_dap then - -- require("dap").terminate() - -- else - -- vim.notify("DAP Not Support", "info") - -- end - -- end, - -- "Terminate Session (S-F5)", - -- }, - -- p = { - -- function() - -- if is_dap then - -- require("dap").pause() - -- else - -- vim.notify("DAP Not Support", "info") - -- end - -- end, - -- "Pause (F6)", - -- }, - -- r = { - -- function() - -- if is_dap then - -- require("dap").restart_frame() - -- else - -- vim.notify("DAP Not Support", "info") - -- end - -- end, - -- "Restart (C-F5)", - -- }, - -- R = { - -- function() - -- if is_dap then - -- require("dap").repl.toggle() - -- else - -- vim.notify("DAP Not Support", "info") - -- end - -- end, - -- "Toggle REPL", - -- }, - -- }, - -- d = { - -- name = "Debug", - -- t = { "lua require'dap'.toggle_breakpoint()", "Toggle Breakpoint" }, - -- b = { "lua require'dap'.step_back()", "Step Back" }, - -- c = { "lua require'dap'.continue()", "Continue" }, - -- C = { "lua require'dap'.run_to_cursor()", "Run To Cursor" }, - -- d = { "lua require'dap'.disconnect()", "Disconnect" }, - -- g = { "lua require'dap'.session()", "Get Session" }, - -- i = { "lua require'dap'.step_into()", "Step Into" }, - -- o = { "lua require'dap'.step_over()", "Step Over" }, - -- u = { "lua require'dap'.step_out()", "Step Out" }, - -- p = { "lua require'dap'.pause()", "Pause" }, - -- r = { "lua require'dap'.repl.toggle()", "Toggle Repl" }, - -- s = { "lua require'dap'.continue()", "Start" }, - -- q = { "lua require'dap'.close()", "Quit" }, - -- U = { "lua require'dapui'.toggle({reset = true})", "Toggle UI" }, - -- }, d = debug_key, z = { name = " 󱑠 Plugins(Lazy)", diff --git a/lua/user/yanky.lua b/lua/user/yanky.lua deleted file mode 100644 index 68f6901..0000000 --- a/lua/user/yanky.lua +++ /dev/null @@ -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", "(YankyCycleForward)") -vim.keymap.set("n", "]y", "(YankyCycleBackward)")