From 06ddd359a744812c848cb5b96e9cc31c1b2a4837 Mon Sep 17 00:00:00 2001 From: js0ny Date: Sun, 1 Dec 2024 07:07:57 +0000 Subject: [PATCH] sync: from macOS --- bootstrap/set_symblink_unix.bash | 6 +- platforms/mac/sketchybarrc | 13 +++- platforms/mac/skhdrc | 1 + platforms/mac/yabairc | 6 +- tools/nvim/lua/keymaps/language.lua | 2 + tools/nvim/lua/plugins/lsp.lua | 11 ++++ tools/nvim/lua/plugins/mod/obsidian-nvim.lua | 4 +- tools/yazi/config/keymap.toml | 69 ++++++++++++++++++++ tools/yazi/config/yazi.toml | 2 + tools/zsh/common.zshrc | 1 - tools/zsh/zshenv | 8 +++ 11 files changed, 113 insertions(+), 10 deletions(-) create mode 100644 tools/yazi/config/keymap.toml create mode 100644 tools/yazi/config/yazi.toml diff --git a/bootstrap/set_symblink_unix.bash b/bootstrap/set_symblink_unix.bash index 0b056ac..3dac67a 100644 --- a/bootstrap/set_symblink_unix.bash +++ b/bootstrap/set_symblink_unix.bash @@ -1,6 +1,7 @@ #! /bin/bash mkdir -p $XDG_CONFIG_HOME/conda $XDG_CONFIG_HOME/git $XDG_CONFIG_HOME/ideavim $XDG_CONFIG_HOME/markdownlint $XDG_CONFIG_HOME/pip $XDG_CONFIG_HOME/neovide $XDG_CONFIG_HOME/powershell $XDG_CONFIG_HOME/vscode $XDG_CONFIG_HOME/NuGet $XDG_CONFIG_HOME/vim $XDG_CONFIG_HOME/tmux $XDG_CONFIG_HOME/npm $XDG_CONFIG_HOME/readline $XDG_CONFIG_HOME/ipython -mkdir -p ~/.config/zellij # Not support XDG_CONFIG_HOME but same directory +# Not support XDG_CONFIG_HOME but same directory +mkdir -p ~/.config/zellij ~/.config/yazi ~/.config/glow # mkdir -p $WAKATIME_HOME # mkdir -p $XDG_STATE_HOME/vim/undo $XDG_STATE_HOME/vim/backup $XDG_STATE_HOME/vim/swap $XDG_STATE_HOME/vim/view mkdir -p $HOME/Obsidian @@ -22,6 +23,9 @@ ln -sf $DOTFILES/common/zellij.config.kdl ~/.config/zellij/config.kdl # $DOTFILES/tools ln -sf $DOTFILES/tools/ipython $XDG_CONFIG_HOME/ipython ln -sf $DOTFILES/tools/nvim $XDG_CONFIG_HOME/nvim +ln -sf $DOTFILES/tools/yazi/config/keymap.toml ~/.config/yazi/keymap.toml +ln -sf $DOTFILES/tools/yazi/config/yazi.toml ~/.config/yazi/yazi.toml + if [ $(uname) = "Darwin"]; then mkdir -p ~/.config/karabiner $XDG_CONFIG_HOME/skhd $XDG_CONFIG_HOME/yabai $XDG_CONFIG_HOME/sketchybar diff --git a/platforms/mac/sketchybarrc b/platforms/mac/sketchybarrc index bc8b5a6..7486611 100755 --- a/platforms/mac/sketchybarrc +++ b/platforms/mac/sketchybarrc @@ -17,7 +17,6 @@ PLUGIN_DIR="$CONFIG_DIR/plugins" # https://felixkratz.github.io/SketchyBar/config/tricks#color-picker sketchybar --bar position=top height=40 blur_radius=30 color=0x40000000 - ##### Changing Defaults ##### # We now change some default values, which are applied to all further items. # For a full list of all available item properties see: @@ -82,14 +81,22 @@ sketchybar --add item chevron left \ # volume is registered. More info about the event system can be found here: # https://felixkratz.github.io/SketchyBar/config/events -sketchybar --add item clock right \ +sketchybar --add item clock center \ --set clock update_freq=10 icon= script="$PLUGIN_DIR/clock.sh" \ --add item volume right \ --set volume script="$PLUGIN_DIR/volume.sh" \ --subscribe volume volume_change \ --add item battery right \ --set battery update_freq=120 script="$PLUGIN_DIR/battery.sh" \ - --subscribe battery system_woke power_source_change + --subscribe battery system_woke power_source_change \ + --add item apple_music right + +sketchybar --add item music right +sketchybar --set music \ + script="$PLUGIN_DIR/music.sh" \ + update_freq=5 \ + label.color=0xffd7ba7d \ + background.corner_radius=5 ##### Force all scripts to run the first time (never do this in a script) ##### sketchybar --update diff --git a/platforms/mac/skhdrc b/platforms/mac/skhdrc index 48e0bc8..2dc756f 100644 --- a/platforms/mac/skhdrc +++ b/platforms/mac/skhdrc @@ -33,3 +33,4 @@ shift + alt - e : \ shift + alt - i : \ yabai -m window --resize right:20:0 ; \ yabai -m window --resize left:20:0 + diff --git a/platforms/mac/yabairc b/platforms/mac/yabairc index d3fa357..a9d6b8d 100644 --- a/platforms/mac/yabairc +++ b/platforms/mac/yabairc @@ -31,13 +31,12 @@ yabai -m config \ window_animation_easing ease_out_circ \ window_opacity_duration 0.0 \ active_window_opacity 1.0 \ - normal_window_opacity 0.90 \ - window_opacity off \ + normal_window_opacity 0.70 \ + window_opacity on \ insert_feedback_color 0xffd75f5f \ split_ratio 0.50 \ split_type auto \ auto_balance off \ - top_padding 12 \ bottom_padding 12 \ left_padding 12 \ right_padding 12 \ @@ -48,4 +47,5 @@ yabai -m config \ mouse_action2 resize \ mouse_drop_action swap + echo "yabai configuration loaded.." diff --git a/tools/nvim/lua/keymaps/language.lua b/tools/nvim/lua/keymaps/language.lua index 0f8ad64..29f5d97 100644 --- a/tools/nvim/lua/keymaps/language.lua +++ b/tools/nvim/lua/keymaps/language.lua @@ -22,6 +22,8 @@ vim.api.nvim_create_autocmd("FileType", { pattern = "markdown", callback = function() set_markdown_keymaps(0) + vim.opt_local.shiftwidth = 2 + vim.opt_local.tabstop = 2 end, }) diff --git a/tools/nvim/lua/plugins/lsp.lua b/tools/nvim/lua/plugins/lsp.lua index 2a35089..514a3c4 100644 --- a/tools/nvim/lua/plugins/lsp.lua +++ b/tools/nvim/lua/plugins/lsp.lua @@ -1,6 +1,17 @@ return { { import = "plugins.mod.lspconfig" }, + { "MeanderingProgrammer/render-markdown.nvim" }, + -- { + -- "OXY2DEV/markview.nvim", + -- lazy = false, -- Recommended + -- -- ft = "markdown" -- If you decide to lazy-load anyway + -- + -- dependencies = { + -- "nvim-treesitter/nvim-treesitter", + -- "nvim-tree/nvim-web-devicons" + -- } + -- }, { "williamboman/mason.nvim", config = true }, { "williamboman/mason-lspconfig.nvim", diff --git a/tools/nvim/lua/plugins/mod/obsidian-nvim.lua b/tools/nvim/lua/plugins/mod/obsidian-nvim.lua index 528036e..48ed3a7 100644 --- a/tools/nvim/lua/plugins/mod/obsidian-nvim.lua +++ b/tools/nvim/lua/plugins/mod/obsidian-nvim.lua @@ -1,7 +1,7 @@ return { "epwalsh/obsidian.nvim", version = "*", -- recommended, use latest release instead of latest commit - lazy = true, + lazy = false, ft = "markdown", -- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault: -- event = { @@ -21,7 +21,7 @@ return { workspaces = { { name = "personal", - path = "/mnt/c/Users/citoy/Obsidian", + path = "~/Obsidian", }, }, completion = { diff --git a/tools/yazi/config/keymap.toml b/tools/yazi/config/keymap.toml new file mode 100644 index 0000000..0c889b3 --- /dev/null +++ b/tools/yazi/config/keymap.toml @@ -0,0 +1,69 @@ +# A TOML linter such as https://taplo.tamasfe.dev/ can use this schema to validate your config. +# If you encounter any issues, please make an issue at https://github.com/yazi-rs/schemas. +"$schema" = "https://yazi-rs.github.io/schemas/prepend_keymap.json" + +[manager] + +prepend_keymap = [ + + # Hopping + { on = "e", run = "arrow -1", desc = "Move cursor up" }, + { on = "n", run = "arrow 1", desc = "Move cursor down" }, + { on = "i", run = "enter", desc = "Enter the child directory" }, + { on = "I", run = "forward", desc = "Go forward to the next directory" }, + + # Seeking + { on = "E", run = "seek -5", desc = "Seek up 5 units in the preview" }, + { on = "N", run = "seek 5", desc = "Seek down 5 units in the preview" }, + + # Find + { on = "k", run = "find_arrow", desc = "Go to the next found" }, + { on = "K", run = "find_arrow --previous", desc = "Go to the previous found" }, + + +] + +[tasks] + +prepend_keymap = [ + { on = "e", run = "arrow -1", desc = "Move cursor up" }, + { on = "n", run = "arrow 1", desc = "Move cursor down" }, +] + +[select] + +prepend_keymap = [ + { on = "e", run = "arrow -1", desc = "Move cursor up" }, + { on = "n", run = "arrow 1", desc = "Move cursor down" }, +] + +[input] + +prepend_keymap = [ + # Mode + { on = "l", run = "insert", desc = "Enter insert mode" }, + { on = "L", run = [ "move -999", "insert" ], desc = "Move to the BOL, and enter insert mode" }, + { on = "i", run = "move 1", desc = "Move forward a character" }, + { on = "j", run = "forward --end-of-word", desc = "Move forward to the end of the current or next word" }, +] + +[confirm] +prepend_keymap = [ + { on = "N", run = "close", desc = "Cancel the confirm" }, + + { on = "e", run = "arrow -1", desc = "Move cursor up" }, + { on = "n", run = "arrow 1", desc = "Move cursor down" }, +] + +[completion] + +prepend_keymap = [ +] + +[help] + +prepend_keymap = [ + # Navigation + { on = "e", run = "arrow -1", desc = "Move cursor up" }, + { on = "n", run = "arrow 1", desc = "Move cursor down" }, +] \ No newline at end of file diff --git a/tools/yazi/config/yazi.toml b/tools/yazi/config/yazi.toml new file mode 100644 index 0000000..a01d710 --- /dev/null +++ b/tools/yazi/config/yazi.toml @@ -0,0 +1,2 @@ +[manager] +show_hidden = true \ No newline at end of file diff --git a/tools/zsh/common.zshrc b/tools/zsh/common.zshrc index 8cac855..d5ee087 100644 --- a/tools/zsh/common.zshrc +++ b/tools/zsh/common.zshrc @@ -32,4 +32,3 @@ esac for file in $DOTFILES/tools/zsh/mod/*.zsh; do source $file done - diff --git a/tools/zsh/zshenv b/tools/zsh/zshenv index e78aa31..d84cf50 100644 --- a/tools/zsh/zshenv +++ b/tools/zsh/zshenv @@ -58,6 +58,14 @@ fi if command -v az > /dev/null; then export AZURE_CONFIG_DIR="$XDG_DATA_HOME"/azure fi +# Bun JS +# mv ~/.bun $XDG_DATA_HOME/bun +# ln -sf $XDG_DATA_HOME/bun/bin/bun ~/.local/bin/bun +if command -v bun > /dev/null; then + export BUN_INSTALL="$XDG_DATA_HOME"/bun + export PATH="$BUN_INSTALL/bin:$PATH" + [ -s "$BUN_INSTALL/_bun" ] && source "$BUN_INSTALL/_bun" +fi # Cargo if command -v cargo > /dev/null; then export CARGO_HOME="$XDG_DATA_HOME"/cargo