commit b17dec8e4475776945b4d68ad05b003527c07fba Author: gin Date: Wed May 13 14:17:03 2026 +0800 initial commit diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..d0b35a0 --- /dev/null +++ b/.vimrc @@ -0,0 +1,25 @@ +syntax on + +colorscheme catppuccin + +" option +set number +set relativenumber +set encoding=utf-8 + +set expandtab +set tabstop=4 +set softtabstop=4 +set shiftwidth=4 + +set cindent +set autoindent +set smartindent + +" keymap +noremap s w +noremap J 5j +noremap K 5k +noremap H 0 +noremap L $ + diff --git a/README.md b/README.md new file mode 100644 index 0000000..2cf4a19 --- /dev/null +++ b/README.md @@ -0,0 +1,32 @@ +# Arch Linux WSL Dotfiles + +## Requirement + +* fd +* tree +* bat +* highlight + +## Installtion + +vim + +```sh +ln -sf dotfiles/.vimrc ~/.vimrc +``` + +zsh + +```sh +touch ~/.zshrc + +ln -sf dotfiles/zsh ~/.config/zsh + +echo "source ~/.config/zsh" > ~/.zshrc +``` + +yazi + +```sh +ln -sf dotfiles/yazi ~/.config/yazi +``` diff --git a/yazi/init.lua b/yazi/init.lua new file mode 100644 index 0000000..a5fe1b2 --- /dev/null +++ b/yazi/init.lua @@ -0,0 +1,3 @@ +require("full-border"):setup { + type = ui.Border.PLAIN, +} diff --git a/yazi/plugins/full-border.yazi/main.lua b/yazi/plugins/full-border.yazi/main.lua new file mode 100644 index 0000000..501156d --- /dev/null +++ b/yazi/plugins/full-border.yazi/main.lua @@ -0,0 +1,53 @@ +--- @since 25.2.26 + +local function setup(_, opts) + local type = opts and opts.type or ui.Border.ROUNDED + local old_build = Tab.build + + Tab.build = function(self, ...) + local bar = function(c, x, y) + if x <= 0 or x == self._area.w - 1 or th.mgr.border_symbol ~= "│" then + return ui.Bar(ui.Edge.TOP) + end + + return ui.Bar(ui.Edge.TOP) + :area( + ui.Rect { x = x, y = math.max(0, y), w = ya.clamp(0, self._area.w - x, 1), h = math.min(1, self._area.h) } + ) + :symbol(c) + end + + local c = self._chunks + self._chunks = { + c[1]:pad(ui.Pad.y(1)), + -- TODO: remove this compatibility hack + fs.unique and c[2]:pad(ui.Pad.y(1)) or c[2]:pad(ui.Pad(1, c[3].w > 0 and 0 or 1, 1, c[1].w > 0 and 0 or 1)), + c[3]:pad(ui.Pad.y(1)), + } + + local style = th.mgr.border_style + if rt.opener then -- TODO: remove this compatibility hack + self._base = ya.list_merge(self._base or {}, { + ui.Border(ui.Edge.ALL):area(self._area):type(type):style(style), + + bar("┬", c[2].x, c[1].y), + bar("┴", c[2].x, c[1].bottom - 1), + bar("┬", c[2].right - 1, c[2].y), + bar("┴", c[2].right - 1, c[2].bottom - 1), + }) + else + self._base = ya.list_merge(self._base or {}, { + ui.Border(ui.Edge.ALL):area(self._area):type(type):style(style), + + bar("┬", c[1].right - 1, c[1].y), + bar("┴", c[1].right - 1, c[1].bottom - 1), + bar("┬", c[2].right, c[2].y), + bar("┴", c[2].right, c[2].bottom - 1), + }) + end + + old_build(self, ...) + end +end + +return { setup = setup } diff --git a/yazi/theme.toml b/yazi/theme.toml new file mode 100644 index 0000000..93d5271 --- /dev/null +++ b/yazi/theme.toml @@ -0,0 +1,17 @@ +[indicator] +padding = { open = "▐", close = "▌" } + +[tabs] +sep_inner = { open = "", close = "" } +sep_outer = { open = "", close = "" } + +[status] +sep_left = { open = "", close = "" } +sep_right = { open = "", close = "" } + +[icon] +globs = [] +dirs = [] +files = [] +exts = [] +conds = [] diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh new file mode 100644 index 0000000..29262cd --- /dev/null +++ b/zsh/aliases.zsh @@ -0,0 +1,3 @@ +alias ls="ls --color=auto" +alias ll="ls -l" +alias grep="grep --color=auto" diff --git a/zsh/fzf.zsh b/zsh/fzf.zsh new file mode 100644 index 0000000..ec821f5 --- /dev/null +++ b/zsh/fzf.zsh @@ -0,0 +1,15 @@ +export FZF_DEFAULT_OPTS=" \ +--height 40% \ +--style full \ +--layout reverse \ +--preview 'tree -C {} | head -160' +" + +# select directory by default +export FZF_DEFAULT_COMMAND=" +fd -a --type f --type d --hidden --follow --exclude .git --exclude node_modules --base-directory $HOME +" + +export FZF_CTRL_T_OPTS="--preview '(highlight -O ansi -l {} 2> /dev/null || bat --color=always {} || tree -C {}) 2> /dev/null | head -160'" +export FZF_ALT_C_OPTS="--preview 'tree -C {} | head -160'" +export FZF_CTRL_R_OPTS="--preview 'echo {}' --preview-window down:3:hidden:wrap --bind '?:toggle-preview'" diff --git a/zsh/prompt.zsh b/zsh/prompt.zsh new file mode 100644 index 0000000..ba8c03c --- /dev/null +++ b/zsh/prompt.zsh @@ -0,0 +1,9 @@ +if [ -n "$BASH_VERSION" ]; then + export PS1='\[\e[38;5;147m\]\u\[\e[0m\]@\[\e[38;5;183m\]\h\[\e[0m\] \[\e[38;5;225m\]\w\[\e[0m\] \$ ' +else + if [ "$UID" -eq 0 ]; then + export PROMPT="%F{147}%n%f@%F{183}%m%f %F{225}%~%f %# " + else + export PROMPT="%F{147}%n%f@%F{183}%m%f %F{225}%~%f \$ " + fi +fi diff --git a/zsh/zsh b/zsh/zsh new file mode 120000 index 0000000..705b4f4 --- /dev/null +++ b/zsh/zsh @@ -0,0 +1 @@ +/root/.config/zsh \ No newline at end of file diff --git a/zsh/zshrc b/zsh/zshrc new file mode 100644 index 0000000..d691a69 --- /dev/null +++ b/zsh/zshrc @@ -0,0 +1,11 @@ +bindkey -e + +# setup for fzf +source ${0:A:h}/fzf.zsh +source <(fzf --zsh) + +source ${0:A:h}/aliases.zsh +source ${0:A:h}/prompt.zsh + +# set default editor +export EDITOR=vim