Skip to content

Commit

Permalink
full update
Browse files Browse the repository at this point in the history
  • Loading branch information
biocoderh committed Oct 6, 2023
1 parent 59dd35b commit 88f55e7
Show file tree
Hide file tree
Showing 35 changed files with 637 additions and 548 deletions.
2 changes: 1 addition & 1 deletion .bash_profile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

[[ -f ~/.profile ]] && . ~/.profile
[[ -f "$HOME/.profile" ]] && . "$HOME/.profile"
2 changes: 1 addition & 1 deletion .bashrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

[[ -f ~/.shrc ]] && . ~/.shrc
[[ -f "$HOME/.shrc" ]] && . "$HOME/.shrc"

# If not running interactively, don't do anything
[[ $- != *i* ]] && return
Expand Down
15 changes: 15 additions & 0 deletions .config/samba/smb.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[global]
server string = %h
use sendfile = yes
min receivefile size = 16384

[homes]
writable = yes

[printers]
guest ok = yes
printable = yes

[media]
path = /media
writable = yes
4 changes: 3 additions & 1 deletion .config/zsh/.zprofile
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
[ -f $HOME/.profile ] && source $HOME/.profile
#!/usr/bin/env zsh

[[ -f "$HOME/.profile" ]] && source "$HOME/.profile"
51 changes: 17 additions & 34 deletions .config/zsh/.zshrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
[ -f $HOME/.shrc ] && source $HOME/.shrc
#!/usr/bin/env zsh

[[ -f "$HOME/.shrc" ]] && source "$HOME/.shrc"

# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.config/zsh/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
Expand All @@ -24,19 +26,8 @@ zmodload zsh/complist
compinit
_comp_options+=(globdots) # Include hidden files.

# vi mode
bindkey -v
export KEYTIMEOUT=1

# Use vim keys in tab complete menu:
bindkey -M menuselect 'h' vi-backward-char
bindkey -M menuselect 'k' vi-up-line-or-history
bindkey -M menuselect 'l' vi-forward-char
bindkey -M menuselect 'j' vi-down-line-or-history
bindkey -v '^?' backward-delete-char

# Change cursor shape for different vi modes.
function zle-keymap-select {
zle-keymap-select() {
if [[ ${KEYMAP} == vicmd ]] ||
[[ $1 = 'block' ]]; then
echo -ne '\e[1 q'
Expand All @@ -56,38 +47,30 @@ zle -N zle-line-init
echo -ne '\e[5 q' # Use beam shape cursor on startup.
preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt.

# Use lf to switch directories and bind it to ctrl-o
lfcd () {
# Use lf to switch directories
lfcd() {
tmp="$(mktemp)"
lf -last-dir-path="$tmp" "$@"
if [ -f "$tmp" ]; then
if [[ -f "$tmp" ]]; then
dir="$(cat "$tmp")"
rm -f "$tmp"
[ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir"
[[ -d "$dir" ]] && [[ "$dir" != "$(pwd)" ]] && cd "$dir"
fi
}
bindkey -s '^o' 'lfcd\n'

# Edit line in vim with ctrl-e:
autoload edit-command-line; zle -N edit-command-line
bindkey '^e' edit-command-line
# Edit line in vim
autoload edit-command-line
zle -N edit-command-line

# fzf
[ -f /usr/share/fzf/completion.zsh ] && source /usr/share/fzf/completion.zsh
[ -f /usr/share/fzf/key-bindings.zsh ] && source /usr/share/fzf/key-bindings.zsh
[[ -f "/usr/share/fzf/completion.zsh" ]] && source "/usr/share/fzf/completion.zsh"
[[ -f "/usr/share/fzf/key-bindings.zsh" ]] && source "/usr/share/fzf/key-bindings.zsh"

# Plugins
source $ZDOTDIR/plugins.zsh

# zsh-history-substring-search
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
bindkey -M vicmd 'k' history-substring-search-up
bindkey -M vicmd 'j' history-substring-search-down
source "$ZDOTDIR/plugins.zsh"

# zsh-autosuggestions
bindkey '^ ' autosuggest-accept
bindkey '^@' autosuggest-accept
# Key bindings
[[ ! -f "$ZDOTDIR/key-bindings.zsh" ]] || source "$ZDOTDIR/key-bindings.zsh"

# To customize prompt, run `p10k configure` or edit ~/.config/zsh/.p10k.zsh.
[[ ! -f $ZDOTDIR/p10k.zsh ]] || source $ZDOTDIR/p10k.zsh
[[ ! -f "$ZDOTDIR/p10k.zsh" ]] || source "$ZDOTDIR/p10k.zsh"
41 changes: 41 additions & 0 deletions .config/zsh/key-bindings.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# vi mode
bindkey -v
export KEYTIMEOUT=1

# Use vim keys in tab complete menu:
bindkey -M menuselect 'h' vi-backward-char
bindkey -M menuselect 'k' vi-up-line-or-history
bindkey -M menuselect 'l' vi-forward-char
bindkey -M menuselect 'j' vi-down-line-or-history
bindkey -v '^?' backward-delete-char

# Use lf to switch directories
bindkey -s '^o' 'lfcd\n'

# Edit line in vim
bindkey '^e' edit-command-line

# fzf - Paste the selected file path(s) into the command line
bindkey -M emacs '^T' fzf-file-widget
bindkey -M vicmd '^T' fzf-file-widget
bindkey -M viins '^T' fzf-file-widget

# fzf - cd into the selected directory
bindkey -M emacs '\ec' fzf-cd-widget
bindkey -M vicmd '\ec' fzf-cd-widget
bindkey -M viins '\ec' fzf-cd-widget

# fzf - Paste the selected command from history into the command line
bindkey -M emacs '^R' fzf-history-widget
bindkey -M vicmd '^R' fzf-history-widget
bindkey -M viins '^R' fzf-history-widget

# zsh-history-substring-search
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
bindkey -M vicmd 'k' history-substring-search-up
bindkey -M vicmd 'j' history-substring-search-down

# zsh-autosuggestions
bindkey '^ ' autosuggest-accept
bindkey '^@' autosuggest-accept
30 changes: 8 additions & 22 deletions .config/zsh/plugins.zsh
Original file line number Diff line number Diff line change
@@ -1,38 +1,24 @@
# plugins directory
ZPLUGINDIR=$HOME/.local/share/zsh/plugins
[ -d $ZPLUGINDIR ] || mkdir -p $ZPLUGINDIR
ZPLUGINDIR="${XDG_DATA_HOME:-$HOME/.local/share}/zsh/plugins"
[[ -d "$ZPLUGINDIR" ]] || mkdir -p "$ZPLUGINDIR"

# antidote.lite loader
if [[ ! -d $ZPLUGINDIR/zsh_unplugged ]]; then
git clone --quiet https://github.com/mattmc3/zsh_unplugged $ZPLUGINDIR/zsh_unplugged
if [[ ! -d "$ZPLUGINDIR/zsh_unplugged" ]]; then
git clone --quiet https://github.com/mattmc3/zsh_unplugged "$ZPLUGINDIR/zsh_unplugged"
fi

source $ZPLUGINDIR/zsh_unplugged/zsh_unplugged.zsh

repos=(
# load order!
romkatv/powerlevel10k
# deferred
romkatv/zsh-defer

zsh-users/zsh-history-substring-search
zsh-users/zsh-autosuggestions

#zsh-users/zsh-syntax-highlighting
zdharma-continuum/fast-syntax-highlighting
)

# Load all plugins
# antidote.lite loader
source "$ZPLUGINDIR/zsh_unplugged/antidote.lite.zsh"
plugin-clone $repos
plugin-load $repos

plugins-update() {
plugin-update $repos
}

plugins-list() {
ls $ZPLUGINDIR
}

plugins-clean() {
rm -rfi $ZPLUGINDIR
exec zsh
}
63 changes: 0 additions & 63 deletions .local/bin/alhp-install

This file was deleted.

Loading

0 comments on commit 88f55e7

Please sign in to comment.