aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--alacritty/.config/alacritty/alacritty.toml19
-rw-r--r--tmux/.tmux.conf91
-rw-r--r--zsh/.config/zsh/.zshrc56
-rw-r--r--zsh/.config/zsh/aliases.zsh2
-rw-r--r--zsh/.config/zsh/bindings.zsh23
-rw-r--r--zsh/.config/zsh/plugins.zsh5
-rw-r--r--zsh/.config/zsh/prompt.zsh73
-rw-r--r--zsh/.zshenv5
8 files changed, 159 insertions, 115 deletions
diff --git a/alacritty/.config/alacritty/alacritty.toml b/alacritty/.config/alacritty/alacritty.toml
new file mode 100644
index 0000000..8cc9953
--- /dev/null
+++ b/alacritty/.config/alacritty/alacritty.toml
@@ -0,0 +1,19 @@
+[env]
+TERM = "xterm-256color"
+
+[font]
+size = 11.0
+
+[font.normal]
+family = "CommitMono Nerd Font Mono"
+style = "Regular"
+
+[font.bold]
+style = "Bold"
+
+[font.italic]
+style = "Regular" # Italic
+
+[[keyboard.bindings]]
+action = "ToggleFullscreen"
+key = "F11"
diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf
new file mode 100644
index 0000000..8fec4b2
--- /dev/null
+++ b/tmux/.tmux.conf
@@ -0,0 +1,91 @@
+# Keybindings
+setw -g mode-keys vi
+bind-key k select-pane -U
+bind-key j select-pane -D
+bind-key h select-pane -L
+bind-key l select-pane -R
+bind-key M-k resize-pane -U 5
+bind-key M-j resize-pane -D 5
+bind-key M-h resize-pane -L 5
+bind-key M-l resize-pane -R 5
+bind 'v' copy-mode
+
+
+unbind '"'
+unbind %
+bind-key "\\" split-window -h -c "#{pane_current_path}"
+bind-key "|" split-window -fh -c "#{pane_current_path}"
+bind-key "-" split-window -v -c "#{pane_current_path}"
+bind-key "_" split-window -fv -c "#{pane_current_path}"
+
+unbind c
+bind c new-window -c "#{pane_current_path}"
+
+unbind r
+bind r source-file $HOME/.tmux.conf
+
+set -g prefix C-s
+
+# start window numbers at 1 to match keyboard order with tmux window order
+set -g base-index 1
+set-window-option -g pane-base-index 1
+
+# renumber windows sequentially after closing any of them
+set -g renumber-windows on
+
+# remove administrative debris (session name, hostname, time) in status bar
+set -g status-left ''
+set -g status-right ''
+
+# increase scrollback lines
+set -g history-limit 50000
+
+# don't suspend-client
+unbind-key C-z
+
+
+# Style
+
+# Dark grey background
+set -g default-terminal "screen-256color"
+set -ag terminal-overrides ",xterm-256color:Tc"
+
+# Pane border
+set -g pane-border-style fg=cyan
+set -g pane-active-border-style fg=green
+
+# Status bar
+set -g status-style bg=black,fg=yellow
+set -g window-status-style fg=green,bold
+
+# Message/input
+set -g message-style bg=black,fg=white
+
+# Pane text
+set -g pane-border-style fg=white
+
+
+# Plugins
+set-environment -g TMUX_PLUGIN_MANAGER_PATH $XDG_DATA_HOME/tmux/plugins/
+
+# List of plugins
+set -g @plugin 'tmux-plugins/tpm'
+set -g @plugin 'tmux-plugins/tmux-sensible'
+set -g @plugin 'tmux-plugins/tmux-yank'
+
+set -g @plugin 'tmux-plugins/tmux-resurrect'
+set -g @plugin 'tmux-plugins/tmux-continuum'
+set -g @plugin 'tmux-plugins/tmux-sessionist'
+
+# restore: neovim session, automatic
+set -g @resurrect-strategy-nvim 'session'
+set -g @resurrect-capture-pane-contents 'on'
+set -g @continuum-restore 'on'
+set -g @continuum-save-interval '5'
+
+run $XDG_DATA_HOME'/tmux/plugins/tpm/tpm'
+run-shell $XDG_DATA_HOME'/tmux/plugins/tmux-continuum/continuum.tmux'
+run-shell $XDG_DATA_HOME'/tmux/plugins/tmux-sessionist/sessionist.tmux'
+run-shell $XDG_DATA_HOME'/tmux/plugins/tmux-resurrect/resurrect.tmux'
+
+
diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc
index 1a0a6ef..f121dae 100644
--- a/zsh/.config/zsh/.zshrc
+++ b/zsh/.config/zsh/.zshrc
@@ -21,16 +21,31 @@ stty stop undef # Disable ctrl-s to freeze terminal.
zle_highlight=('paste:none')
unsetopt BEEP # Unset beep
+# Interactive env
+# NOTE: I'd like to propogate this to fzf-tab to not dublicate defaults, but
+# if i do so, fzf starts behave strange. So for now there is two places where
+# i define its defaults - here and in fzf-tab settigs
+export FZF_DEFAULT_OPTS="\
+ --height=60%\
+ --layout=reverse\
+ --info=inline\
+ --tmux center,90%,90%\
+ --bind='ctrl-y:accept'\
+ --bind='ctrl-a:toggle-all'\
+ --bind='ctrl-u:preview-half-page-up'\
+ --bind='ctrl-d:preview-half-page-down'"
+
# Plugins
source $ZDOTDIR/functions.zsh
zsh_add_plugin "zsh-users/zsh-syntax-highlighting" # Syntax highlighting
-zsh_add_plugin "zsh-users/zsh-completions" # Bunch of completions for many commands
+zsh_add_plugin "zsh-users/zsh-completions" # Completions for many commands
zsh_add_plugin "zsh-users/zsh-autosuggestions" # Interact with completions
-zsh_add_plugin "zsh-users/zsh-history-substring-search" # Substring history search
+zsh_add_plugin "zsh-users/zsh-history-substring-search" # Substr history search
zsh_add_plugin "Aloxaf/fzf-tab" # FZF integration
+zsh_add_plugin "Freed-Wu/fzf-tab-source" # Many predefined settings for fzf-tab
# Colors
@@ -46,26 +61,30 @@ zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
zstyle ':completion:*' menu no
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh/.zcompcache"
-zstyle ':fzf-tab:*' fzf-bindings 'ctrl-j:accept'
-zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'
-zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath'
+zstyle ':fzf-tab:*' fzf-command ftb-tmux-popup
+zstyle ':fzf-tab:*' use-fzf-default-opts yes
+zstyle ':fzf-tab:complete:*' fzf-bindings \
+ 'ctrl-y:accept' \
+ 'ctrl-a:toggle-all' \
+ 'ctrl-u:preview-half-page-up' \
+ 'ctrl-d:preview-half-page-down'
_comp_options+=(globdots) # Include hidden files.
# Prompt
autoload -Uz vcs_info
zstyle ':vcs_info:*' enable git
-zstyle ':vcs_info:*' formats "%F{228} %b%f %c%u "
+zstyle ':vcs_info:*' formats " %F{228} %b%f%c%u"
zstyle ':vcs_info:*' check-for-changes true # This might be expensive
zstyle ':vcs_info:*' get-revision true
zstyle ':vcs_info:*' check-for-staged-changes true
-zstyle ':vcs_info:*' patch-format '%p [%n|%c|%u]'
-zstyle ':vcs_info:*' nopatch-format '%p [%n|%c|%u]'
+# zstyle ':vcs_info:*' patch-format '%p [%n|%c|%u]'
+# zstyle ':vcs_info:*' nopatch-format '%p [%n|%c|%u]'
# This is default
-zstyle ':vcs_info:*' stagedstr '%B%F{green}+%f%b'
-zstyle ':vcs_info:*' unstagedstr '%B%F{red}*%f%b'
+zstyle ':vcs_info:*' stagedstr ' %B%F{green}+%f%b'
+zstyle ':vcs_info:*' unstagedstr ' %B%F{red}*%f%b'
-# TODO: how this unstaged marker looks ugly
+# TODO: now this unstaged marker looks ugly
# zstyle ':vcs_info:git*+set-message:*' hooks git-untracked
# +vi-git-untracked()
# {
@@ -85,7 +104,7 @@ precmd()
}
setopt prompt_subst
-PROMPT='%B%F{40}%~%f%b ${vcs_info_msg_0_}%F{40}%f '
+PROMPT='%B%F{40}%~%f%b${vcs_info_msg_0_} %F{40}%f '
# Bindings
@@ -112,3 +131,16 @@ alias c='clear'
# Shell integrations
source <(fzf --zsh)
+
+
+# Start tmux
+
+function start_tmux() {
+ if type tmux &> /dev/null; then
+ if [[ -z "$TMUX" && -z $TERMINAL_CONTEXT ]]; then
+ tmux -2 new-session -A -s home
+ fi
+ fi
+}
+
+start_tmux
diff --git a/zsh/.config/zsh/aliases.zsh b/zsh/.config/zsh/aliases.zsh
deleted file mode 100644
index 937dffc..0000000
--- a/zsh/.config/zsh/aliases.zsh
+++ /dev/null
@@ -1,2 +0,0 @@
-alias v=nvim
-alias la="ls -la"
diff --git a/zsh/.config/zsh/bindings.zsh b/zsh/.config/zsh/bindings.zsh
deleted file mode 100644
index 82a4fd3..0000000
--- a/zsh/.config/zsh/bindings.zsh
+++ /dev/null
@@ -1,23 +0,0 @@
-bindkey -s '^o' 'ranger^M'
-bindkey -s '^f' 'zi^M'
-bindkey -s '^s' 'ncdu^M'
-bindkey -s '^z' 'zi^M'
-bindkey '^[[P' delete-char
-
-# Search navigation
-autoload -U up-line-or-beginning-search
-autoload -U down-line-or-beginning-search
-zle -N up-line-or-beginning-search
-zle -N down-line-or-beginning-search
-bindkey "^p" up-line-or-beginning-search # Up
-bindkey "^n" down-line-or-beginning-search # Down
-bindkey "^k" up-line-or-beginning-search # Up
-bindkey "^j" down-line-or-beginning-search # Down
-
-# Edit line in vim with ctrl-e:
-autoload edit-command-line; zle -N edit-command-line
-bindkey '^e' edit-command-line
-
-# Unbind
-bindkey -r "^u"
-bindkey -r "^d"
diff --git a/zsh/.config/zsh/plugins.zsh b/zsh/.config/zsh/plugins.zsh
deleted file mode 100644
index 177835a..0000000
--- a/zsh/.config/zsh/plugins.zsh
+++ /dev/null
@@ -1,5 +0,0 @@
-source $ZDOTDIR/functions.zsh
-
-# Plugins
-zsh_add_plugin "zsh-users/zsh-autosuggestions"
-zsh_add_plugin "zsh-users/zsh-syntax-highlighting"
diff --git a/zsh/.config/zsh/prompt.zsh b/zsh/.config/zsh/prompt.zsh
deleted file mode 100644
index 3e74427..0000000
--- a/zsh/.config/zsh/prompt.zsh
+++ /dev/null
@@ -1,73 +0,0 @@
-COLOR_PROMPT_TEXT='009'
-COLOR_PROMPT_GLYPH='255'
-NUM_DIRS_LEFT_OF_TRUNCATION=1
-NUM_DIRS_RIGHT_OF_TRUNCATION=2
-GLYPH_PROMPT_TRUNCATION_SYMBOL='⋯'
-GLYPH_PROMPT_END_SYMBOL='❯'
-
-set_prompt() {
- [[ $NUM_DIRS_LEFT_OF_TRUNCATION -le 0 ]] && NUM_DIRS_LEFT_OF_TRUNCATION=1
- [[ $NUM_DIRS_RIGHT_OF_TRUNCATION -le 0 ]] && NUM_DIRS_RIGHT_OF_TRUNCATION=2
-
- local prompt_truncation_symbol="%F{${COLOR_PROMPT_GLYPH}}%B${GLYPH_PROMPT_TRUNCATION_SYMBOL}%b%f"
- local prompt_end_symbol="%F{${COLOR_PROMPT_GLYPH}}%B${GLYPH_PROMPT_END_SYMBOL}%b%f"
- local total_dirs=$(($NUM_DIRS_LEFT_OF_TRUNCATION+$NUM_DIRS_RIGHT_OF_TRUNCATION+1))
- local dir_path_full="%F{${COLOR_PROMPT_TEXT}}%d%f"
- local dir_path_truncated="%F{${COLOR_PROMPT_TEXT}}%-${NUM_DIRS_LEFT_OF_TRUNCATION}d/%f${prompt_truncation_symbol}%F{${COLOR_PROMPT_TEXT}}/%${NUM_DIRS_RIGHT_OF_TRUNCATION}d%f"
-
- PROMPT="%(${total_dirs}C.${dir_path_truncated}.${dir_path_full}) ${prompt_end_symbol} "
-}
-
-precmd_functions+=(set_prompt)
-
-
-COLOR_GIT_REPOSITORY_TEXT='245'
-COLOR_GIT_BRANCH_TEXT='255'
-COLOR_GIT_STATUS_CLEAN='010'
-COLOR_GIT_STATUS_DIRTY='009'
-GLYPH_GIT_BRANCH_SYNC_SYMBOL='«'
-GLYPH_GIT_STASH_SYMBOL='∘'
-GLYPH_GIT_STATUS_SYMBOL='»'
-
-set_rprompt() {
- local git_branch_name=$(git symbolic-ref --short HEAD 2> /dev/null)
- if [[ -z $git_branch_name ]]; then
- RPROMPT=""
-
- return
- fi
-
- local git_remote_commit=$(git rev-parse "origin/$git_branch_name" 2> /dev/null)
- local git_local_commit=$(git rev-parse "$git_branch_name" 2> /dev/null)
- local git_branch_sync_color=$COLOR_GIT_STATUS_DIRTY
- if [[ $git_remote_commit == $git_local_commit ]]; then
- git_branch_sync_color=$COLOR_GIT_STATUS_CLEAN
- fi
-
- local git_stash=$(git stash list)
- local git_stash_symbol=$GLYPH_GIT_STASH_SYMBOL
- if [[ -z $git_stash ]]; then
- git_stash_symbol=""
- fi
-
- local git_status=$(git status --porcelain)
- local git_stash_color=$COLOR_GIT_STATUS_DIRTY
- local git_status_color=$COLOR_GIT_STATUS_DIRTY
- if [[ -z $git_status ]]; then
- git_stash_color=$COLOR_GIT_STATUS_CLEAN
- git_status_color=$COLOR_GIT_STATUS_CLEAN
- fi
-
- local git_repository_path=$(git rev-parse --show-toplevel)
- local git_repository_name=$(basename "$git_repository_path")
-
- local git_repository_text="%F{${COLOR_GIT_REPOSITORY_TEXT}}${git_repository_name}%f"
- local git_branch_sync_symbol="%F{${git_branch_sync_color}}%B${GLYPH_GIT_BRANCH_SYNC_SYMBOL}%b%f"
- local git_stash_symbol="%F{${git_stash_color}}%B${git_stash_symbol}%b%f"
- local git_status_symbol="%F{${git_status_color}}%B${GLYPH_GIT_STATUS_SYMBOL}%b%f"
- local git_branch_text="%F{${COLOR_GIT_BRANCH_TEXT}}${git_branch_name}%f"
-
- RPROMPT="${git_repository_text} ${git_branch_sync_symbol}${git_stash_symbol}${git_status_symbol} ${git_branch_text}"
-}
-
-precmd_functions+=(set_rprompt)
diff --git a/zsh/.zshenv b/zsh/.zshenv
index 82356e0..a2d91da 100644
--- a/zsh/.zshenv
+++ b/zsh/.zshenv
@@ -1,3 +1,7 @@
+# GUIX
+export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"
+GUIX_PROFILE="$HOME/.config/guix/current"
+. "$GUIX_PROFILE/etc/profile"
# XDG Paths
export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config}
export XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache}
@@ -11,3 +15,4 @@ export ZDOTDIR=$XDG_CONFIG_HOME/zsh
# User environment variables
export EDITOR="nvim"
+export PAGER="less"