From 2ce30970f6d26946ba61835e15429d52eddae2d3 Mon Sep 17 00:00:00 2001 From: Pojok Code Date: Fri, 11 Oct 2024 21:00:07 +0700 Subject: [PATCH 1/2] enc: fix nvim-tree open file exploler --- lazy-lock.json | 66 +++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 36 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 051246c..bc324a9 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -2,7 +2,7 @@ "Comment.nvim": { "branch": "master", "commit": "e51f2b142d88bb666dcaa77d93a07f4b419aca70" }, "Eva-Theme.nvim": { "branch": "master", "commit": "902dd17975a7710e544d409ea856dbecc9d64997" }, "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, - "alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" }, + "alpha-nvim": { "branch": "main", "commit": "bf3c8bb8c02ed3d9644cc5bbc48e2bdc39349cd7" }, "auto-conform.nvim": { "branch": "main", "commit": "d04389f955dd0990e85a269b226199f458de32a6" }, "auto-lint.nvim": { "branch": "main", "commit": "aff13cb8eaa055e66e940d43b7d83166397e5413" }, "bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" }, @@ -13,55 +13,49 @@ "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "code_runner.nvim": { "branch": "main", "commit": "6c5bfe44a6c7523350cd706e6b3b8101166eed99" }, - "codeium.vim": { "branch": "main", "commit": "e0342fde9474fdd0a36ff9692fe0031b7611a19f" }, - "conform.nvim": { "branch": "master", "commit": "acc7337cfd24ddfa3109bfc8c258c09c88c5c450" }, - "dressing.nvim": { "branch": "master", "commit": "71349f24c6e07b39f33600985843c289ca735308" }, - "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, + "code_runner.nvim": { "branch": "main", "commit": "dcedccbf969a0f3bc00db446172b4966e83101dd" }, + "codeium.vim": { "branch": "main", "commit": "b9be24761977b64c100db1c8745635d46172a4e2" }, + "conform.nvim": { "branch": "master", "commit": "50649648851cd0e126dfedd0f3c33b900a6f1ef8" }, + "dressing.nvim": { "branch": "master", "commit": "1b7921eecc65af1baf8ac1dc06f0794934cbcfb2" }, + "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, "gitsigns.nvim": { "branch": "main", "commit": "0b04035bb7b3c83e999b9676e2fb46fd0aa9f910" }, - "indent-blankline.nvim": { "branch": "master", "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" }, + "indent-blankline.nvim": { "branch": "master", "commit": "e7a4442e055ec953311e77791546238d1eaae507" }, "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, "live-server.nvim": { "branch": "main", "commit": "5fc8abb727827a09d0ce1b7757d0a4c7b5802b09" }, "lsp-progress.nvim": { "branch": "main", "commit": "d5f4d28efe75ce636bfbe271eb45f39689765aab" }, - "lualine.nvim": { "branch": "master", "commit": "544dd1583f9bb27b393f598475c89809c4d5e86b" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "9ae570e206360e47d30b4c35a4550c165f4ea7b7" }, - "mason-nvim-dap.nvim": { "branch": "main", "commit": "4ba55f9755ebe8297d92c419b90a946123292ae6" }, + "lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, "mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" }, - "mini.indentscope": { "branch": "main", "commit": "1222393d9c5e8d92b913ccab6701a7164b21781c" }, + "mini.indentscope": { "branch": "main", "commit": "da9af64649e114aa79480c238fd23f6524bc0903" }, "neoscroll.nvim": { "branch": "master", "commit": "a731f66f1d39ec6175fd201c5bf849e54abda99c" }, - "noice.nvim": { "branch": "main", "commit": "448bb9c524a7601035449210838e374a30153172" }, + "noice.nvim": { "branch": "main", "commit": "df448c649ef6bc5a6a633a44f2ad0ed8d4442499" }, "nui.nvim": { "branch": "main", "commit": "a0fd35fcbb4cb479366f1dc5f20145fd718a3733" }, - "nvim-autopairs": { "branch": "master", "commit": "e38c5d837e755ce186ae51d2c48e1b387c4425c6" }, - "nvim-cmp": { "branch": "main", "commit": "d818fd0624205b34e14888358037fb6f5dc51234" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "194ec600488f7c7229668d0e80bd197f3a2b84ff" }, - "nvim-dap": { "branch": "master", "commit": "5ba8ceace596360321cf33fa4b56d9d46e057ce9" }, - "nvim-dap-ui": { "branch": "master", "commit": "f7d75cca202b52a60c520ec7b1ec3414d6e77b0f" }, - "nvim-dap-virtual-text": { "branch": "master", "commit": "484995d573c0f0563f6a66ebdd6c67b649489615" }, - "nvim-lint": { "branch": "master", "commit": "efc6fc83f0772283e064c53a8f9fb5645bde0bc0" }, - "nvim-lspconfig": { "branch": "master", "commit": "0b8165cf95806bc4bb8f745bb0c92021b2ed4b98" }, + "nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" }, + "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "0671e0eabc6842676d3310370e8fae4e1c51d7f9" }, + "nvim-lint": { "branch": "master", "commit": "f707b3ae50417067fa63fdfe179b0bff6b380da1" }, + "nvim-lspconfig": { "branch": "master", "commit": "056f569f71e4b726323b799b9cfacc53653bceb3" }, "nvim-material-icon": { "branch": "main", "commit": "38fc13fe4811c4bf62533180ff5e7bbd237c5ef5" }, "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, - "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, - "nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" }, - "nvim-scrollview": { "branch": "main", "commit": "30ca6e18265928eb4ea7402346b4dfddbd8ce41e" }, - "nvim-tree.lua": { "branch": "master", "commit": "f9ff00bc06d7cb70548a3847d7a2a05e928bc988" }, - "nvim-treesitter": { "branch": "master", "commit": "63be47f203d3e9174fdac3872fb9766e5bcc5a11" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "34867c69838078df7d6919b130c0541c0b400c47" }, - "nvim-ts-autotag": { "branch": "main", "commit": "dc5e1687ab76ee02e0f11c5ce137f530b36e98b3" }, - "nvim-ts-context-commentstring": { "branch": "main", "commit": "6b5f95aa4d24f2c629a74f2c935c702b08dbde62" }, + "nvim-notify": { "branch": "master", "commit": "fbef5d32be8466dd76544a257d3f3dce20082a07" }, + "nvim-scrollview": { "branch": "main", "commit": "bc37a942debe191fffd072f0f1f2ec7c56c54b17" }, + "nvim-tree.lua": { "branch": "master", "commit": "4a9e82d10a3715d0c3845e1d2f66ddfb8b711253" }, + "nvim-treesitter": { "branch": "master", "commit": "19079207ba4a8c7ed956f40a111a22b1a2dfa6e8" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "b91c98afa6c42819aea6cbc1ba38272f5456a5cf" }, + "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "9c74db656c3d0b1c4392fc89a016b1910539e7c0" }, "nvim-web-devicons": { "branch": "master", "commit": "5b9067899ee6a2538891573500e8fd6ff008440f" }, "playground": { "branch": "master", "commit": "bcfab84f98a33f2ad34dda6c842046dca70aabf6" }, "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, - "rainbow-delimiters.nvim": { "branch": "master", "commit": "12b1a1e095d968887a17ef791c2edb78d7595d46" }, - "rest.nvim": { "branch": "main", "commit": "91badd46c60df6bd9800c809056af2d80d33da4c" }, - "smart-splits.nvim": { "branch": "master", "commit": "66fda3a601a5b4c679656f15eb6ddd613c8d3216" }, - "telescope.nvim": { "branch": "master", "commit": "47ab113de540d1d1d9cdf7dba76dc60ddd808bb8" }, - "tiny-devicons-auto-colors.nvim": { "branch": "main", "commit": "9be4af5b1bc1f26a11206ed7ce8bf44312e7941a" }, - "toggleterm.nvim": { "branch": "main", "commit": "8ed0f52006d3207ec6c94de7db62da840937ef2a" }, + "rainbow-delimiters.nvim": { "branch": "master", "commit": "d227e6c9879bb50af35cd733461198666981d482" }, + "smart-splits.nvim": { "branch": "master", "commit": "1a2b268a7ec7aeef879cdd15973339010ec134f7" }, + "telescope.nvim": { "branch": "master", "commit": "df534c3042572fb958586facd02841e10186707c" }, + "tiny-devicons-auto-colors.nvim": { "branch": "main", "commit": "a39fa4c92268832f6034306793b8acbfec2a7549" }, + "toggleterm.nvim": { "branch": "main", "commit": "137d06fb103952a0fb567882bb8527e2f92d327d" }, "vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" }, "vim-startuptime": { "branch": "master", "commit": "97a88e688482a09c3c4b777d07b509b328a5ec29" }, - "vim-visual-multi": { "branch": "master", "commit": "38b0e8d94a5499ccc17d6159763d32c79f53417b" }, + "vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" }, "virt-column.nvim": { "branch": "master", "commit": "b62b4ef0774d19452d4ed18e473e824c7a756f2f" }, - "which-key.nvim": { "branch": "main", "commit": "6c1584eb76b55629702716995cca4ae2798a9cca" }, + "which-key.nvim": { "branch": "main", "commit": "fb070344402cfc662299d9914f5546d840a22126" }, "yanky.nvim": { "branch": "main", "commit": "9268018e92d02650a94e39dd5f5903c542f7ea11" } } From 30ba4f5233efceed951cda62976e46495aab306e Mon Sep 17 00:00:00 2001 From: Pojok Code Date: Fri, 11 Oct 2024 21:00:37 +0700 Subject: [PATCH 2/2] enc: fix nvim-tree exploler error --- lua/custom/default.lua | 8 +- lua/plugins/bufferline.lua | 4 + lua/plugins/cmp_cmdline.lua | 7 + lua/plugins/nvimtree.lua | 97 +++++++++++- lua/plugins/nvimtree_20241011.lua | 222 +++++++++++++++++++++++++++ lua/plugins/themes/evatheme.lua | 13 +- lua/user/autocommands.lua | 10 ++ lua/user/utils/cheatsheet.lua | 56 +++++++ lua/user/utils/lualine_component.lua | 8 +- 9 files changed, 414 insertions(+), 11 deletions(-) create mode 100644 lua/plugins/nvimtree_20241011.lua create mode 100644 lua/user/utils/cheatsheet.lua diff --git a/lua/custom/default.lua b/lua/custom/default.lua index 5a94332..9508436 100644 --- a/lua/custom/default.lua +++ b/lua/custom/default.lua @@ -103,7 +103,7 @@ pcode.coderunner = { -- https://github.com/nvim-tree/nvim-tree.lua -- 0 = normal -- 1 = float -pcode.nvimtree_isfloat = 0 +pcode.nvimtree_isfloat = 1 -- https://github.com/roobert/tailwindcss-colorizer-cmp.nvim pcode.tailwindcolorizer = false @@ -154,10 +154,10 @@ pcode.refactoring = false pcode.database = false -- https://github.com/rest-nvim/rest.nvim -pcode.rest_client = true +pcode.rest_client = false -- https://github.com/mfussenegger/nvim-dap -pcode.nvim_dap = true -- not support for windows os (auto config mason-nvim-dap) +pcode.nvim_dap = false -- not support for windows os (auto config mason-nvim-dap) -- conefig special support test & dap pcode.active_rust_config = false @@ -166,7 +166,7 @@ pcode.active_javascript_config = { jest_command = "npm test -- ", jest_config = "jest.config.mjs", } -pcode.active_prisma_config = true +pcode.active_prisma_config = false pcode.active_php_config = false pcode.active_golang_config = false pcode.active_python_config = false diff --git a/lua/plugins/bufferline.lua b/lua/plugins/bufferline.lua index 3122fe5..2865427 100644 --- a/lua/plugins/bufferline.lua +++ b/lua/plugins/bufferline.lua @@ -177,6 +177,10 @@ return { fg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" }, bg = { attribute = "bg", highlight = "Normal" }, }, + indicator_visible = { + fg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" }, + bg = { attribute = "bg", highlight = "Normal" }, + }, }, }) end, diff --git a/lua/plugins/cmp_cmdline.lua b/lua/plugins/cmp_cmdline.lua index c67800c..800e8e2 100644 --- a/lua/plugins/cmp_cmdline.lua +++ b/lua/plugins/cmp_cmdline.lua @@ -99,6 +99,13 @@ return { desc = "Scroll backward", mode = { "i", "n", "s" }, }, + { + "", + function() + require("user.utils.cheatsheet").run() + end, + desc = "Chatseet", + }, }, }, { diff --git a/lua/plugins/nvimtree.lua b/lua/plugins/nvimtree.lua index 604d126..e4912c4 100644 --- a/lua/plugins/nvimtree.lua +++ b/lua/plugins/nvimtree.lua @@ -1,10 +1,10 @@ -local icons = pcode.icons local set_view = {} if pcode.nvimtree_isfloat == 1 then set_view = require("user.utils.nvimtree").float else set_view = require("user.utils.nvimtree").normal end +--[[ local icons = pcode.icons return { "kyazdani42/nvim-tree.lua", lazy = true, @@ -219,3 +219,98 @@ return { end) end, } + ]] + +return { + "nvim-tree/nvim-tree.lua", + cmd = { "NvimTreeFindFileToggle", "NvimTree", "NvimTreeOpen", "NvimTreeToggle", "NvimTreeFocus", "NvimTreeClose" }, + keys = { + { "e", "NvimTreeToggle", desc = "󰙅 Explorer" }, + }, + opts = function() + local icons = pcode.icons + return { + filters = { dotfiles = false }, + disable_netrw = true, + hijack_cursor = true, + sync_root_with_cwd = true, + update_focused_file = { + enable = true, + update_root = false, + }, + view = set_view, + renderer = { + root_folder_label = false, + highlight_git = true, + -- indent_markers = { enable = true }, + 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, + }, + filters = { + dotfiles = false, + git_clean = false, + no_buffer = false, + custom = { "node_modules", "\\.cache", "\\.git" }, + exclude = { + ".gitignore", + ".prettierignore", + }, + }, + } + end, + config = function(_, opts) + require("nvim-tree").setup(opts) + local api = require("nvim-tree.api") + api.events.subscribe(api.events.Event.FileCreated, function(file) + vim.cmd("edit " .. file.fname) + end) + end, +} \ No newline at end of file diff --git a/lua/plugins/nvimtree_20241011.lua b/lua/plugins/nvimtree_20241011.lua new file mode 100644 index 0000000..018f8c9 --- /dev/null +++ b/lua/plugins/nvimtree_20241011.lua @@ -0,0 +1,222 @@ +-- local icons = pcode.icons +-- local set_view = {} +-- if pcode.nvimtree_isfloat == 1 then +-- set_view = require("user.utils.nvimtree").float +-- else +-- set_view = require("user.utils.nvimtree").normal +-- end +-- return { +-- "kyazdani42/nvim-tree.lua", +-- lazy = true, +-- cmd = { "NvimTreeFindFileToggle", "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 = set_view, +-- 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 = {}, +-- }, +-- }, +-- keys = { +-- { "e", "NvimTreeToggle", desc = "󰙅 Explorer" }, +-- }, +-- config = function(_, opts) +-- require("nvim-tree").setup(opts) +-- local api = require("nvim-tree.api") +-- api.events.subscribe(api.events.Event.FileCreated, function(file) +-- vim.cmd("edit " .. file.fname) +-- end) +-- end, +-- } +return {} diff --git a/lua/plugins/themes/evatheme.lua b/lua/plugins/themes/evatheme.lua index b616055..df625b4 100644 --- a/lua/plugins/themes/evatheme.lua +++ b/lua/plugins/themes/evatheme.lua @@ -11,8 +11,12 @@ if substring(tostring(clr), "Eva") and true or false then pattern = "*", callback = function() local hi = vim.api.nvim_set_hl - hi(0, "LspInfoBorder", { fg = "#2F3F5C" }) - hi(0, "FloatBorder", { fg = "#2F3F5C" }) + -- hi(0, "LspInfoBorder", { fg = "#2F3F5C" }) + -- hi(0, "LspInfoBorder", { fg = "#598DEF" }) + hi(0, "LspInfoBorder", { fg = "#8A97C3" }) + -- hi(0, "FloatBorder", { fg = "#2F3F5C" }) + -- hi(0, "FloatBorder", { fg = "#598DEF" }) + hi(0, "FloatBorder", { fg = "#8A97C3" }) hi(0, "StatusLine", { bg = color.background }) hi(0, "StatusLineNC", { bg = color.background }) hi(0, "WinBar", { bg = color.background }) @@ -30,6 +34,11 @@ if substring(tostring(clr), "Eva") and true or false then hi(0, "NvimTreeGitMergeIcon", { bg = color.dark, fg = color.git.diffModified }) hi(0, "NvimTreeGitStagedIcon", { bg = color.dark, fg = color.git.stagedModified }) hi(0, "MiniIndentscopeSymbol", { bg = color.dark, fg = color.parameter }) + -- cursor + -- hi(0, "Cursor", { bg = "#838FA7", fg = "#838FA7" }) + hi(0, "CursorColumn", { bg = color.dark, fg = "#838FA7" }) + hi(0, "TermCursor", { bg = "#FF9070", fg = color.dark }) + hi(0, "TermCursorNC", { bg = "#FF9070", fg = color.dark }) end, }) end, diff --git a/lua/user/autocommands.lua b/lua/user/autocommands.lua index eaf163f..8b0c0c4 100644 --- a/lua/user/autocommands.lua +++ b/lua/user/autocommands.lua @@ -86,6 +86,16 @@ vim.filetype.add({ }, }) +-- config cursor +vim.opt.guicursor = { + "n-v:block", -- Normal, Visual, Command mode: block cursor + "i-ci-ve-c:ver25", -- Insert, Command-line Insert, Visual mode: vertical bar cursor + "r-cr:hor20", -- Replace, Command-line Replace mode: horizontal bar cursor + "o:hor50", -- Operator-pending mode: horizontal bar cursor + "a:blinkwait700-blinkoff400-blinkon250", -- Blinking settings + "sm:block-blinkwait175-blinkoff150-blinkon175", -- Select mode: block cursor with blinking +} + -- Autoformat -- augroup _lsp -- autocmd! diff --git a/lua/user/utils/cheatsheet.lua b/lua/user/utils/cheatsheet.lua new file mode 100644 index 0000000..b52ce5e --- /dev/null +++ b/lua/user/utils/cheatsheet.lua @@ -0,0 +1,56 @@ +local M = {} + +M.run = function() + local Popup = require("nui.popup") + local event = require("nui.utils.autocmd").event + + -- Buat popup untuk menampilkan keymapping + local popup = Popup({ + enter = true, + focusable = true, + border = { + style = "rounded", + text = { + top = " Key Mappings ", + }, + }, + position = "50%", + size = { + width = "80%", + height = "80%", + }, + }) + + -- Daftar keymapping yang akan ditampilkan dalam dua kolom dengan section header + -- stylua: ignore + local key_mappings = { + { "a ", "Toggle Dashboard ", "e ", "Toggle Explorer "}, + { "c ", "Chat AI ", "bb", ":Telescope buffers "}, + { " ", " ", "bd", ":bdelete "}, + { " ", " ", " ", " "}, + { "Terminal ", " ", " ", " "}, + { "tt ", ":ToggleTerm ", "tn", ":ToggleTerm direction=horizontal"}, + } + + -- Fungsi untuk mengubah daftar keymapping menjadi format string + local function format_key_mappings(mappings) + local formatted = {} + for _, mapping in ipairs(mappings) do + table.insert(formatted, string.format("%-20s %-20s %-20s %s", mapping[1], mapping[2], mapping[3], mapping[4])) + end + return formatted + end + + -- Set konten popup dengan daftar keymapping yang diformat + vim.api.nvim_buf_set_lines(popup.bufnr, 0, -1, false, format_key_mappings(key_mappings)) + + -- Mount popup + popup:mount() + + -- Unmount popup ketika cursor meninggalkan buffer + popup:on(event.BufLeave, function() + popup:unmount() + end) +end + +return M diff --git a/lua/user/utils/lualine_component.lua b/lua/user/utils/lualine_component.lua index dd7401e..1781a4d 100644 --- a/lua/user/utils/lualine_component.lua +++ b/lua/user/utils/lualine_component.lua @@ -46,7 +46,7 @@ return { color = function() local buf = vim.api.nvim_get_current_buf() local ts = vim.treesitter.highlighter.active[buf] - return { fg = ts and not vim.tbl_isempty(ts) and "#50fa7b" or "#FF5555" } + return { fg = ts and not vim.tbl_isempty(ts) and "#98C379" or "#E06C75" } end, cond = hide_in_width, }, @@ -71,7 +71,7 @@ return { color = function() if pcode.codeium then local codeium = all_trim(vim.api.nvim_call_function("codeium#GetStatusString", {})) - return { fg = codeium == "OFF" and "#3E4452" or "#50fa7b" } + return { fg = codeium == "OFF" and "#3E4452" or "#98C379" } else return {} end @@ -222,11 +222,11 @@ return { separator = { left = " ", right = "" }, fmt = function(str) if pcode.show_mode == 1 then - return icons.ui.Neovim .. " " .. (mode_map[str] or str) + return icons.ui.Neovim .. " " .. str:sub(1, 1) elseif pcode.show_mode == 2 then return icons.ui.Neovim elseif pcode.show_mode == 3 then - return (mode_map[str] or str) + return str:sub(1, 1) elseif pcode.show_mode == 4 then return nil else