diff options
author | filip <“filip.rabiega@gmail.com”> | 2025-09-24 00:40:08 +0200 |
---|---|---|
committer | filip <“filip.rabiega@gmail.com”> | 2025-09-24 00:40:08 +0200 |
commit | e1eb005dca06e079d414eb3ea222e9cc35fa4be5 (patch) | |
tree | 1fc6986be7de3f4275b113cdac59b1e5cc9e50c1 | |
parent | 0042e1ab913dcdc1a908df495e8df5bdb8eab297 (diff) | |
download | dotfiles-e1eb005dca06e079d414eb3ea222e9cc35fa4be5.tar.gz dotfiles-e1eb005dca06e079d414eb3ea222e9cc35fa4be5.tar.bz2 dotfiles-e1eb005dca06e079d414eb3ea222e9cc35fa4be5.zip |
added zshrc
-rw-r--r-- | .config/shell/.zshrc | 91 | ||||
-rw-r--r-- | .config/vim/.vimrc | 62 | ||||
-rw-r--r-- | .profile | 19 |
3 files changed, 123 insertions, 49 deletions
diff --git a/.config/shell/.zshrc b/.config/shell/.zshrc new file mode 100644 index 0000000..e23be49 --- /dev/null +++ b/.config/shell/.zshrc @@ -0,0 +1,91 @@ +# Filip's config for the Zoomer Shell + +# Enable colors and change prompt: +autoload -U colors && colors # Load colors +export PS1="%{$(tput setaf 34)%}%n%{$(tput setaf 40)%}@%{$(tput setaf 46)%}%m %{$(tput setaf 154)%}%1~ %{$(tput sgr0)%}$ " +setopt autocd # Automatically cd into typed directory. +stty stop undef # Disable ctrl-s to freeze terminal. +setopt interactive_comments + +# History in cache directory: +HISTSIZE=10000000 +SAVEHIST=10000000 +HISTFILE="${XDG_CACHE_HOME:-$HOME/.cache}/shell/history" +setopt inc_append_history + +# Load aliases and shortcuts if existent. +[ -f "$HOME/.config/shell/envvarrc" ] && source "$HOME/.config/shell/envvarrc" +[ -f "$HOME/.config/shell/aliasrc" ] && source "$HOME/.config/shell/aliasrc" +# [ -f "$HOME/.config/shell/funcrc" ] && source "$HOME/.config/shell/funcrc" + +# Basic auto/tab complete: +autoload -U compinit +zstyle ':completion:*' menu select +zmodload zsh/complist +compinit +_comp_options+=(globdots) # Include hidden files. + +# vi mode +# bindkey -v +export KEYTIMEOUT=1 + +# Exit even if there are running jobs +setopt NO_CHECK_JOBS + +### Added by Zinit's installer +if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then + print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f" + command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit" + command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \ + print -P "%F{33} %F{34}Installation successful.%f%b" || \ + print -P "%F{160} The clone has failed.%f%b" +fi + +source "$HOME/.local/share/zinit/zinit.git/zinit.zsh" +autoload -Uz _zinit +(( ${+_comps} )) && _comps[zinit]=_zinit + +# Load a few important annexes, without Turbo +# (this is currently required for annexes) +zinit light-mode for \ + zdharma-continuum/zinit-annex-as-monitor \ + zdharma-continuum/zinit-annex-bin-gem-node \ + zdharma-continuum/zinit-annex-patch-dl \ + zdharma-continuum/zinit-annex-rust + +### End of Zinit's installer chunk + +# Load plugins with zinit +zinit ice depth=1 +zinit light jeffreytse/zsh-vi-mode +ZVM_VI_INSERT_ESCAPE_BINDKEY=jk +zinit light zsh-users/zsh-syntax-highlighting + +lfcd () { + tmp="$(mktemp -uq)" + trap 'rm -f $tmp >/dev/null 2>&1' HUP INT QUIT TERM PWR EXIT + lf -last-dir-path="$tmp" "$@" + if [ -f "$tmp" ]; then + dir="$(cat "$tmp")" + [ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir" + fi +} + +# Some bindings +bindkey -s '^o' '^ulfcd\n' +bindkey -s '^g' '^ugitui\n' +bindkey -s '^t' '^uhtop\n' + +# 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 + +# Edit line in vim with ctrl-e: +autoload edit-command-line; zle -N edit-command-line +bindkey '^e' edit-command-line +bindkey -M vicmd '^[[P' vi-delete-char +bindkey -M vicmd '^e' edit-command-line +bindkey -M visual '^[[P' vi-delete diff --git a/.config/vim/.vimrc b/.config/vim/.vimrc index e8e9417..b8f2f15 100644 --- a/.config/vim/.vimrc +++ b/.config/vim/.vimrc @@ -33,21 +33,6 @@ syntax on filetype plugin on filetype plugin indent on -" Automatically use black on a Python file -autocmd BufWritePost *.py !black --line-length=79 % - -" Pymode config -let g:pymode = 1 -let g:pymode_warnings = 0 -let g:pymode_trim_whitespaces = 1 -let g:pymode_options = 1 -let g:pymode_options_max_line_length = 79 -let g:pymode_options_colorcolumn = 1 -let g:pymode_indent = 1 -let g:pymode_indent_hanging_width = &shiftwidth -let g:pymode_indent_hanging_width = 4 -let g:pymode_doc = 1 - " Automatically source .vimrc after saving autocmd BufWritePost ~/.vimrc source $MYVIMRC @@ -62,23 +47,20 @@ autocmd BufWritePre * cal cursor(currPos[1], currPos[2]) " Mappings noremap <BS> dBx -nnoremap s o<Esc> -nnoremap S o<Esc>k +nnoremap s o<Esc>kzz +nnoremap S O<Esc>jzz nnoremap Y y$ nnoremap - ddp nnoremap _ ddkP nnoremap <C-J> "+yy -nnoremap <C-K> <ESC>"+p +nnoremap <C-W> "+yW +nnoremap <C-K> "+p nnoremap <space> i<space><esc> nnoremap <silent> <F7> :tabnew ~/.vimrc<CR> nnoremap <silent> <F8> :TlistToggle<CR> nnoremap <silent> <F9> :NERDTree<CR> -vnoremap sb "zdi<b><C-R>z</b><Esc> : to do końca nie działa -vnoremap sp "zdi<p><C-R>z</p><Esc> -inoremap <C-d> <Esc>ddi -inoremap <C-y> <Esc>yyi -inoremap <C-p> <Esc>pi inoremap <Space><Space> <Esc>/<++><CR>"_c4l +vnoremap <C-J> "+y " show existing tab with 4 spaces width set tabstop=4 @@ -87,25 +69,17 @@ set shiftwidth=4 " On pressing tab, insert 4 spaces set expandtab -let g:pymode = 0 +" Automatically use black on a Python file +autocmd BufWritePost *.py !black --line-length=79 % -" Haskell -let g:haskell_enable_quantification = 1 " to enable highlighting of `forall` -let g:haskell_enable_recursivedo = 1 " to enable highlighting of `mdo` and `rec` -let g:haskell_enable_arrowsyntax = 1 " to enable highlighting of `proc` -let g:haskell_enable_pattern_synonyms = 1 " to enable highlighting of `pattern` -let g:haskell_enable_typeroles = 1 " to enable highlighting of type roles -let g:haskell_enable_static_pointers = 1 " to enable highlighting of `static` -let g:haskell_backpack = 1 " to enable highlighting of backpack keywords -let g:haskell_indent_if = 3 -let g:haskell_indent_case = 2 -let g:haskell_indent_let = 4 -let g:haskell_indent_where = 6 -let g:haskell_indent_before_where = 2 -let g:haskell_indent_after_bare_where = 2 -let g:haskell_indent_do = 2 -let g:haskell_indent_in = 1 -let g:cabal_indent_section = 2 -let g:haskell_indent_case_alternative = 1 -let g:haskell_indent_guard = 2 -let g:hindent_on_save = 1 +" Pymode config +let g:pymode = 1 +let g:pymode_warnings = 0 +let g:pymode_trim_whitespaces = 1 +let g:pymode_options = 1 +let g:pymode_options_max_line_length = 79 +let g:pymode_options_colorcolumn = 1 +let g:pymode_indent = 1 +let g:pymode_indent_hanging_width = &shiftwidth +let g:pymode_indent_hanging_width = 4 +let g:pymode_doc = 1 @@ -12,18 +12,27 @@ export BROWSER="librewolf" export EDITOR="vim" export SHELL="zsh" export TERMINAL="st" +export IMAGE_VIEWER="sxiv" export SCRIPTS="$HOME/.scripts" -export ALIASRC="$ZDOTDIR/aliasrc" +export ALIASRC="$HOME/.config/shell/aliasrc" export VIMINFO="$HOME/.config/vim/.viminfo" -export VIMINIT="source $HOME/.config/vim/.vimrc" -export LS_OPTIONS="-lha --color=auto" +export MYVIMRC="$HOME/.config/vim/.vimrc" +export VIMINIT="source $MYVIMRC" export MANPAGER="vim -M +MANPAGER -" export PATH="$SCRIPTS:$HOME/.cargo/bin:$HOME/.local/bin:$PATH" -export RSYNC_OPTIONS="-rtvzP" export XDG_CONFIG_HOME="$HOME/.config" export XDG_DATA_HOME="$HOME/.config" export STARDICT_DATA_DIR="$HOME/.local/share/stardict" # Use custom remaps from the script -remaps + +autostart="remaps xcompmgr xhidecursor" + +for program in $autostart; do + pidof -sx "$program" || "$program" & +done >/dev/null 2>&1 + +# Set wallpaper + +xwallpaper --stretch "$HOME"/pix/wallpaper.jpg |