From 4e21de794614a0ae6e3480de79b9b8ad40e30281 Mon Sep 17 00:00:00 2001 From: JyyHuang Date: Tue, 9 Jul 2024 15:59:47 -0400 Subject: [PATCH] update files --- firefox/userChrome.css | 137 +++++++++++++++++----------- firefox/userContent.css | 4 - komorebi/komorebi.json | 11 +-- nvim/lazy-lock.json | 25 ++--- nvim/lua/options.lua | 3 + nvim/lua/plugin_config/gitsigns.lua | 100 ++++++++++++++++++++ nvim/lua/plugin_config/lualine.lua | 48 ++++++++++ nvim/lua/plugin_config/neogit.lua | 10 ++ nvim/lua/plugin_config/none-ls.lua | 2 + nvim/lua/remap.lua | 13 +-- zsh/.zshrc | 22 +++-- 11 files changed, 286 insertions(+), 89 deletions(-) create mode 100644 nvim/lua/plugin_config/gitsigns.lua create mode 100644 nvim/lua/plugin_config/lualine.lua create mode 100644 nvim/lua/plugin_config/neogit.lua diff --git a/firefox/userChrome.css b/firefox/userChrome.css index a08c1f6..0212530 100644 --- a/firefox/userChrome.css +++ b/firefox/userChrome.css @@ -1,4 +1,3 @@ - @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* Background image new tab page */ * { @@ -15,11 +14,11 @@ } :root { - --window: -moz-Dialog !important; - --secondary: color-mix(in srgb, currentColor 5%, -moz-Dialog) !important; - --uc-border-radius: 0px; - --uc-status-panel-spacing: 0px; - --uc-page-action-margin: 7px; + --window: -moz-Dialog !important; + --secondary: color-mix(in srgb, currentColor 5%, -moz-Dialog) !important; + --uc-border-radius: 0px; + --uc-status-panel-spacing: 0px; + --uc-page-action-margin: 7px; } /* animation and effect */ @@ -29,42 +28,52 @@ transition-delay: 0.1s; filter: alpha(opacity=0); opacity: 0; - transition: visibility, ease 0.1s, margin-top, ease 0.1s, opacity, ease 0.1s, - rotate, ease 0.1s !important; + transition: + visibility, + ease 0.1s, + margin-top, + ease 0.1s, + opacity, + ease 0.1s, + rotate, + ease 0.1s !important; } #nav-bar:hover, #nav-bar:focus-within, -#urlbar[focused='true'], -#identity-box[open='true'], +#urlbar[focused="true"], +#identity-box[open="true"], #titlebar:hover + #nav-bar:not([customizing]), -#toolbar-menubar:not([inactive='true']) ~ #nav-bar:not([customizing]) -{ +#toolbar-menubar:not([inactive="true"]) ~ #nav-bar:not([customizing]) { visibility: visible; margin-top: 0px; filter: alpha(opacity=100); opacity: 100; } -#PersonalToolbar{ - margin-top: 0px!important; +#PersonalToolbar { + margin-top: 0px !important; } -#nav-bar .toolbarbutton-1[open='true'] { +#nav-bar .toolbarbutton-1[open="true"] { visibility: visible; opacity: 100; } -#PersonalToolbar .toolbarbutton-1[open='true'] { +#PersonalToolbar .toolbarbutton-1[open="true"] { visibility: visible; opacity: 100; } :root:not([customizing]) :hover > .tabbrowser-tab:not(:hover) { - transition: blur, ease 0.1s !important; + transition: + blur, + ease 0.1s !important; } :root:not([customizing]) :not(:hover) > .tabbrowser-tab { - transition: blur, ease 0.1s !important; + transition: + blur, + ease 0.1s !important; } #tabbrowser-tabs .tab-label-container[customizing] { @@ -74,26 +83,45 @@ } /* Removes annoying buttons and spaces */ -.titlebar-spacer[type="pre-tabs"], .titlebar-spacer[type="post-tabs"]{display: none !important} -#tabbrowser-tabs{border-inline-start-width: 0!important} +.titlebar-spacer[type="pre-tabs"], +.titlebar-spacer[type="post-tabs"] { + display: none !important; +} +#tabbrowser-tabs { + border-inline-start-width: 0 !important; +} /* Makes some buttons nicer */ -#PanelUI-menu-button, #unified-extensions-button, #reload-button, #stop-button {padding: 2px !important} -#reload-button, #stop-button{margin: 1px !important;} +#PanelUI-menu-button, +#unified-extensions-button, +#reload-button, +#stop-button { + padding: 2px !important; +} +#reload-button, +#stop-button { + margin: 1px !important; +} /* X-button */ :root { - --show-tab-close-button: none; - --show-tab-close-button-hover: -moz-inline-block; + --show-tab-close-button: none; + --show-tab-close-button-hover: -moz-inline-block; +} +.tabbrowser-tab:not([pinned]) .tab-close-button { + display: var(--show-tab-close-button) !important; +} +.tabbrowser-tab:not([pinned]):hover .tab-close-button { + display: var(--show-tab-close-button-hover) !important; } -.tabbrowser-tab:not([pinned]) .tab-close-button { display: var(--show-tab-close-button) !important; } -.tabbrowser-tab:not([pinned]):hover .tab-close-button { display: var(--show-tab-close-button-hover) !important } /* tabbar */ /* Hide the secondary Tab Label * e.g. playing indicator (the text, not the icon) */ -.tab-secondary-label { display: none !important; } +.tab-secondary-label { + display: none !important; +} :root { --toolbarbutton-border-radius: 0 !important; @@ -101,7 +129,7 @@ --tab-block-margin: 0 !important; } -.tabbrowser-tab:is([visuallyselected='true'], [multiselected]) +.tabbrowser-tab:is([visuallyselected="true"], [multiselected]) > .tab-stack > .tab-background { box-shadow: none !important; @@ -112,7 +140,7 @@ margin-left: -1px !important; } -.tabbrowser-tab[last-visible-tab='true'] { +.tabbrowser-tab[last-visible-tab="true"] { padding-inline-end: 0 !important; } @@ -121,47 +149,54 @@ } /* multi tab selection */ -#tabbrowser-tabs:not([noshadowfortests]) .tabbrowser-tab:is([multiselected]) +#tabbrowser-tabs:not([noshadowfortests]) + .tabbrowser-tab:is([multiselected]) > .tab-stack - > .tab-background:-moz-lwtheme { outline-color: var(--toolbarseparator-color) !important; } + > .tab-background:-moz-lwtheme { + outline-color: var(--toolbarseparator-color) !important; +} /* remove gap after pinned tabs */ #tabbrowser-tabs[haspinnedtabs]:not([positionpinnedtabs]) > #tabbrowser-arrowscrollbox - > .tabbrowser-tab:nth-child(1 of :not([pinned], [hidden])) { margin-inline-start: 0 !important; } + > .tabbrowser-tab:nth-child(1 of :not([pinned], [hidden])) { + margin-inline-start: 0 !important; +} /* Removes annoying border */ -#navigator-toolbox{border:none !important;} +#navigator-toolbox { + border: none !important; +} /* Removes the annoying rainbow thing from the hamburger */ -#appMenu-fxa-separator{border-image:none !important;} +#appMenu-fxa-separator { + border-image: none !important; +} -#PlacesToolbarItems { - justify-content: center !important; +#PlacesToolbarItems { + justify-content: center !important; } #alltabs-button { - display: none !important; + display: none !important; } #star-button[starred] { - fill: #c0caf5 !important; + fill: #c0caf5 !important; } -.tab-background[selected]{ background: #1a1b26 !important;} +.tab-background[selected] { + background: #1a1b26 !important; +} -.bookmark-item{ - color: white; - font-size: 13px !important; - margin-left: 5px !important; - margin-right: 5px !important; - padding: 4px !important; +.bookmark-item { + color: white; + font-size: 13px !important; + margin-left: 5px !important; + margin-right: 5px !important; + padding: 4px !important; } .bookmark-item:hover { - color: white!important; - background-color: rgba(192, 202, 245,0.3)!important; /* pale gray */ + color: white !important; + background-color: rgba(192, 202, 245, 0.3) !important; /* pale gray */ } - - - - diff --git a/firefox/userContent.css b/firefox/userContent.css index 61829a4..ca17015 100644 --- a/firefox/userContent.css +++ b/firefox/userContent.css @@ -1,7 +1,3 @@ -* { - font-family: "Ubuntu Nerd Font"; -} - @-moz-document url(about:home), url(about:newtab), url(about:privatebrowsing){ /* Newtab */ diff --git a/komorebi/komorebi.json b/komorebi/komorebi.json index c54bf82..f7682bb 100644 --- a/komorebi/komorebi.json +++ b/komorebi/komorebi.json @@ -26,9 +26,8 @@ }, "manage_rules": [ { - "kind": "Title", - "id": "- Discord", - "matching_strategy": "EndsWith" + "kind": "Exe", + "id": "Discord.exe", } ], "monitors": [ @@ -59,11 +58,11 @@ { "name": "V", "layout": "BSP", + "workspace_rules": [ { - "kind": "Title", - "id": "- Discord", - "matching_strategy": "EndsWith" + "kind": "Exe", + "id": "Discord.exe" } ] } diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index a7d2845..379d379 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,28 +1,31 @@ { - "LuaSnip": { "branch": "master", "commit": "de1a287c9cb525ae52bc846e8f6207e5ef1da5ac" }, + "LuaSnip": { "branch": "master", "commit": "878ace11983444d865a72e1759dbcc331d1ace4c" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "friendly-snippets": { "branch": "main", "commit": "dd2fd1281d4b22e7b4a5bfafa3e142d958e251f2" }, - "lazy.nvim": { "branch": "main", "commit": "8f19915175395680808de529e4220da8dafc0759" }, + "diffview.nvim": { "branch": "main", "commit": "3afa6a053f680e9f1329c4a151db988a482306cd" }, + "friendly-snippets": { "branch": "main", "commit": "d0610077b6129cf9f7f78afbe3a1425d60f6e2f1" }, + "gitsigns.nvim": { "branch": "main", "commit": "75dc649106827183547d3bedd4602442340d2f7f" }, + "lazy.nvim": { "branch": "main", "commit": "ad30030b6abca7dac5a493c58b4d183b3fe93202" }, + "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "a4caa0d083aab56f6cd5acf2d42331b74614a585" }, "mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" }, - "mason.nvim": { "branch": "main", "commit": "49ff59aded1047a773670651cfa40e76e63c6377" }, - "none-ls.nvim": { "branch": "main", "commit": "aa4442a8493934e3354e507a556ea5f670f68491" }, + "mason.nvim": { "branch": "main", "commit": "0950b15060067f752fde13a779a994f59516ce3d" }, + "neogit": { "branch": "master", "commit": "acdefce66f702427d820db97e00ad9d4ae63e716" }, + "none-ls.nvim": { "branch": "main", "commit": "f5b960a73418249aebcdae3455de320360509253" }, "nvim-autopairs": { "branch": "master", "commit": "c15de7e7981f1111642e7e53799e1211d4606cb9" }, "nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" }, - "nvim-lspconfig": { "branch": "master", "commit": "2c1877081b237a643e52ebdebaf36c84a2695639" }, - "nvim-treesitter": { "branch": "master", "commit": "298a9dd4f8a0d95b347a7ebd301849d8b0e3917e" }, + "nvim-lspconfig": { "branch": "master", "commit": "710a8fa7379db32199545f30ea01dd8446b9302f" }, + "nvim-treesitter": { "branch": "master", "commit": "979beffc1a86e7ba19bd6535c0370d8e1aaaad3c" }, "nvim-treesitter-context": { "branch": "master", "commit": "f62bfe19e0fbc13ae95649dfb3cf22f4ff85b683" }, - "nvim-web-devicons": { "branch": "master", "commit": "e37bb1feee9e7320c76050a55443fa843b4b6f83" }, + "nvim-web-devicons": { "branch": "master", "commit": "b77921fdc44833c994fdb389d658ccbce5490c16" }, "oil.nvim": { "branch": "master", "commit": "2cb39e838e9dcd8b374f09a3a87a2e5ec9d372f6" }, "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, - "tokyonight": { "branch": "main", "commit": "b9b494fa7f7bbf2fe0747b47fa290fb7a4eddcc7" }, - "undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" }, - "vim-fugitive": { "branch": "master", "commit": "4f59455d2388e113bd510e85b310d15b9228ca0d" } + "tokyonight": { "branch": "main", "commit": "7e5ef71a103e7de5fe6c05f5d6ab97d1640f08cf" }, + "undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" } } \ No newline at end of file diff --git a/nvim/lua/options.lua b/nvim/lua/options.lua index 5c6e8a5..23e770e 100644 --- a/nvim/lua/options.lua +++ b/nvim/lua/options.lua @@ -7,6 +7,9 @@ vim.opt.foldmethod = "syntax" vim.opt.showmode = false +vim.opt.showcmd = false +vim.opt.cmdheight = 0 + vim.opt.splitbelow = true vim.opt.splitright = true diff --git a/nvim/lua/plugin_config/gitsigns.lua b/nvim/lua/plugin_config/gitsigns.lua new file mode 100644 index 0000000..2be2c88 --- /dev/null +++ b/nvim/lua/plugin_config/gitsigns.lua @@ -0,0 +1,100 @@ +return { + "lewis6991/gitsigns.nvim", + config = function() + require("gitsigns").setup({ + signs = { + add = { text = "+" }, + change = { text = "~" }, + delete = { text = "-" }, + topdelete = { text = "‾" }, + changedelete = { text = "~" }, + untracked = { text = "┆" }, + }, + signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` + numhl = false, -- Toggle with `:Gitsigns toggle_numhl` + linehl = false, -- Toggle with `:Gitsigns toggle_linehl` + word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` + watch_gitdir = { + follow_files = true, + }, + auto_attach = true, + attach_to_untracked = false, + 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, + virt_text_priority = 100, + }, + current_line_blame_formatter = ", - ", + current_line_blame_formatter_opts = { + relative_time = false, + }, + sign_priority = 6, + update_debounce = 100, + status_formatter = nil, -- Use default + max_file_length = 40000, -- Disable if file is longer than this (in lines) + preview_config = { + -- Options passed to nvim_open_win + border = "single", + style = "minimal", + relative = "cursor", + row = 0, + col = 1, + }, + }) + end, + on_attach = function(bufnr) + local gitsigns = require("gitsigns") + + local function map(mode, l, r, opts) + opts = opts or {} + opts.buffer = bufnr + vim.keymap.set(mode, l, r, opts) + end + + -- Navigation + map("n", "]c", function() + if vim.wo.diff then + vim.cmd.normal({ "]c", bang = true }) + else + gitsigns.nav_hunk("next") + end + end) + + map("n", "[c", function() + if vim.wo.diff then + vim.cmd.normal({ "[c", bang = true }) + else + gitsigns.nav_hunk("prev") + end + end) + + -- Actions + map("n", "hs", gitsigns.stage_hunk) + map("n", "hr", gitsigns.reset_hunk) + map("v", "hs", function() + gitsigns.stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) + end) + map("v", "hr", function() + gitsigns.reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) + end) + map("n", "hS", gitsigns.stage_buffer) + map("n", "hu", gitsigns.undo_stage_hunk) + map("n", "hR", gitsigns.reset_buffer) + map("n", "hp", gitsigns.preview_hunk) + map("n", "hb", function() + gitsigns.blame_line({ full = true }) + end) + map("n", "tb", gitsigns.toggle_current_line_blame) + map("n", "hd", gitsigns.diffthis) + map("n", "hD", function() + gitsigns.diffthis("~") + end) + map("n", "td", gitsigns.toggle_deleted) + + -- Text object + map({ "o", "x" }, "ih", ":Gitsigns select_hunk") + end, +} diff --git a/nvim/lua/plugin_config/lualine.lua b/nvim/lua/plugin_config/lualine.lua new file mode 100644 index 0000000..03b2688 --- /dev/null +++ b/nvim/lua/plugin_config/lualine.lua @@ -0,0 +1,48 @@ +return { + "nvim-lualine/lualine.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + -- Change the background of lualine_c section for normal mode + + require("lualine").setup({ + options = { + icons_enabled = true, + theme = "auto", + component_separators = { left = "", right = "" }, + section_separators = { left = "", right = "" }, + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + globalstatus = false, + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + }, + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { "branch", "diff", "diagnostics" }, + lualine_c = { "filename" }, + lualine_x = { "encoding", "fileformat", "filetype", "searchcount" }, + lualine_y = { "progress" }, + lualine_z = { "location" }, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { "filename" }, + lualine_x = { "location" }, + lualine_y = {}, + lualine_z = {}, + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {}, + }) + end, +} diff --git a/nvim/lua/plugin_config/neogit.lua b/nvim/lua/plugin_config/neogit.lua new file mode 100644 index 0000000..29d8242 --- /dev/null +++ b/nvim/lua/plugin_config/neogit.lua @@ -0,0 +1,10 @@ +return { + "NeogitOrg/neogit", + dependencies = { + "nvim-lua/plenary.nvim", -- required + "sindrets/diffview.nvim", -- optional - Diff integration + -- Only one of these is needed, not both. + "nvim-telescope/telescope.nvim", -- optional + }, + config = true, +} diff --git a/nvim/lua/plugin_config/none-ls.lua b/nvim/lua/plugin_config/none-ls.lua index 8befc46..41db7f0 100644 --- a/nvim/lua/plugin_config/none-ls.lua +++ b/nvim/lua/plugin_config/none-ls.lua @@ -6,7 +6,9 @@ return { null_ls.setup({ sources = { null_ls.builtins.formatting.stylua, + null_ls.builtins.formatting.prettierd, null_ls.builtins.formatting.prettier, + null_ls.builtins.formatting.black, null_ls.builtins.formatting.clang_format, }, }) diff --git a/nvim/lua/remap.lua b/nvim/lua/remap.lua index 1abbaca..2914953 100644 --- a/nvim/lua/remap.lua +++ b/nvim/lua/remap.lua @@ -67,7 +67,7 @@ vim.keymap.set("n", "J", "mzJ`z", { desc = "Move next line to end of current lin vim.keymap.set("n", "", "", { silent = true, desc = "Switch to left panel" }) vim.keymap.set("n", "", "", { silent = true, desc = "Switch to bottom panel" }) vim.keymap.set("n", "", "", { silent = true, desc = "Switch to top panel" }) -vim.keymap.set("n", "", "", "", { silent = true, desc = "Switch to right panel" }) -- Paste preserve vim.keymap.set("x", "p", '"_dP', { desc = "Preserve paste" }) @@ -81,15 +81,8 @@ vim.keymap.set( { desc = "Replace all words after current line" } ) --- Fugitive -vim.keymap.set("n", "gs", vim.cmd.Git, { desc = "Open Fugitive (git)" }) -vim.keymap.set("n", "gv", vim.cmd.Gvdiffsplit, { desc = "Open git changes in a split" }) -vim.keymap.set("n", "gl", function() - vim.cmd(":Git log") -end, { desc = "Open Git log" }) -vim.keymap.set("n", "gl%", function() - vim.cmd(":Git log %") -end, { desc = "Open Git log for file currently open" }) +--Neogit +vim.keymap.set("n", "gg", vim.cmd.Neogit, { desc = "Switch to left panel" }) -- None ls vim.keymap.set({ "n", "v" }, "mp", vim.lsp.buf.format, { desc = "Format" }) diff --git a/zsh/.zshrc b/zsh/.zshrc index 25dbf60..0b430b2 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -9,6 +9,7 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]] source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" fi +[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh # Set up the prompt autoload -Uz promptinit @@ -27,7 +28,10 @@ HISTFILE=~/.zsh_history # Use modern completion system autoload -Uz compinit -compinit +for dump in ~/.zcompdump(N.mh+24); do + compinit +done +compinit -C zstyle ':completion:*' auto-description 'specify: %d' zstyle ':completion:*' completer _expand _complete _correct _approximate @@ -66,7 +70,7 @@ alias win="cd `cmd.exe /c echo %systemdrive%%homepath% 2> /dev/null | tr -d '\r' alias ll="ls -la" -[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh + bindkey '^I' autosuggest-accept export ZSH_AUTOSUGGEST_STRATEGY=( history @@ -76,9 +80,13 @@ export ZSH_AUTOSUGGEST_STRATEGY=( # wezterm shell integration . $Home/etc/profile.d/wezterm.sh -export PATH=”$PATH:/home/joyjosr/.local/bin” - -export NVM_DIR="$HOME/.nvm" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm -[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion +# Bind Ctrl+F to the desired command +# Bind Ctrl+F (represented as "^F") to call the fzf_open function +bindkey -s '^F' 'vim $(fzf --preview "bat --style=numbers --color=always {}")\n' +# fnm +FNM_PATH="/home/joyjosr/.local/share/fnm" +if [ -d "$FNM_PATH" ]; then + export PATH="/home/joyjosr/.local/share/fnm:$PATH" + eval "`fnm env`" +fi