From 53097dbe44f27b4b7b03de288ff2fa3da44a69b3 Mon Sep 17 00:00:00 2001 From: filip <“filip.rabiega@gmail.com”> Date: Sun, 26 Oct 2025 19:35:55 +0100 Subject: removed junk --- .config/shell/.bashrc | 71 ---------------------------------------------- .config/shell/.zshrc | 65 ++++++++++++++++++++++++++++++++++++++---- .config/shell/aliasrc | 2 -- .config/shell/envvarrc | 7 +---- .config/vim/.vimrc | 77 ++++++++++++++++++++++++++++++++------------------ 5 files changed, 110 insertions(+), 112 deletions(-) delete mode 100644 .config/shell/.bashrc (limited to '.config') diff --git a/.config/shell/.bashrc b/.config/shell/.bashrc deleted file mode 100644 index 6474a3b..0000000 --- a/.config/shell/.bashrc +++ /dev/null @@ -1,71 +0,0 @@ -# ~/.bashrc: executed by bash(1) for non-login shells. - -# If not running interactively, don't do anything -case $- in - *i*) ;; - *) return;; -esac - -# don't put duplicate lines or lines starting with space in the history. -HISTCONTROL=ignoreboth - -# append to the history file, don't overwrite it -shopt -s histappend - -# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) -HISTSIZE=1000 -HISTFILESIZE=2000 - -# check the window size after each command and, if necessary, -# update the values of LINES and COLUMNS. -shopt -s checkwinsize - -# set a fancy prompt -case "$TERM" in - *-256color) color_prompt=yes;; -esac - -# colored GCC warnings and errors -export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' - -# Alias definitions -if [ -f ~/.bash_aliases ]; then - . ~/.bash_aliases -fi - -# Set vi mode as the default mode -set -o vi - -# Opam configuration -test -r /home/filipek/.opam/opam-init/init.sh && . /home/filipek/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true - -# Set options for some frequently used programs -export LS_OPTIONS='-lha --color=auto' -export TAR_EXTRACT='-xvzf' -export TAR_ARCHIVE='-cvzf' -export MKDIR_OPTIONS='-p' -export RSYNC_OPTIONS='-rtvzP' -export MANPAGER="vim -M +MANPAGER - " - -export SCRIPTS=$HOME/.scripts -export PATH=$SCRIPTS:$HOME/.cargo/bin:$HOME/.local/bin:$PATH -export EDITOR="vim" -export BROWSER="librewolf" - -# GPG Config -GPG_TTY=$(tty) -export GPG_TTY - -# Prompt colors -export PS1="\[$(tput setaf 2)\]\u\[$(tput setaf 35)\]@\[$(tput setaf 10)\]\h \[$(tput setaf 33)\]\w \[$(tput sgr0)\]$ " -force_color_prompt=yes - -# Run these scripts at login -remaps - -# After every command, switch to insert mode automatically -bind -m vi-command 'RETURN':vi-insert-mode - -# Make it so that Ctrl+L works in vi mode -bind -m vi-command '"\C-l": clear-screen' -bind -m vi-insert '"\C-l": clear-screen' diff --git a/.config/shell/.zshrc b/.config/shell/.zshrc index e23be49..3e00ea5 100644 --- a/.config/shell/.zshrc +++ b/.config/shell/.zshrc @@ -14,9 +14,8 @@ 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" +[ -f "$ALIASRC" ] && source "$ALIASRC" +[ -f "$ENVVARRC" ] && source "$ENVVARRC" # Basic auto/tab complete: autoload -U compinit @@ -72,9 +71,48 @@ lfcd () { } # Some bindings -bindkey -s '^o' '^ulfcd\n' -bindkey -s '^g' '^ugitui\n' -bindkey -s '^t' '^uhtop\n' +lfcd_widget() { + zle -I + BUFFER="lfcd" + zle accept-line +} + +gitui_widget() { + zle -I + BUFFER="gitui" + zle accept-line +} + +htop_widget() { + zle -I + BUFFER="htop" + zle accept-line +} + +notesplain_widget() { + zle -I + BUFFER="notesplain" + zle accept-line +} + +# Register it as a ZLE widget +zle -N lfcd_widget +zle -N gitui_widget +zle -N htop_widget +zle -N notesplain_widget + +# Bind it in both vi keymaps +bindkey -M viins '^o' lfcd_widget +bindkey -M vicmd '^o' lfcd_widget + +bindkey -M viins '^g' gitui_widget +bindkey -M vicmd '^g' gitui_widget + +bindkey -M viins '^t' htop_widget +bindkey -M vicmd '^t' htop_widget + +bindkey -M viins '^n' notesplain_widget +bindkey -M vicmd '^n' notesplain_widget # Use vim keys in tab complete menu: bindkey -M menuselect 'h' vi-backward-char @@ -89,3 +127,18 @@ 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 + +# >>> conda initialize >>> +# !! Contents within this block are managed by 'conda init' !! +# __conda_setup="$('/home/filipek/.local/opt/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)" +# if [ $? -eq 0 ]; then +# eval "$__conda_setup" +# else +# if [ -f "/home/filipek/.local/opt/miniconda3/etc/profile.d/conda.sh" ]; then +# . "/home/filipek/.local/opt/miniconda3/etc/profile.d/conda.sh" +# else +# export PATH="/home/filipek/.local/opt/miniconda3/bin:$PATH" +# fi +# fi +# unset __conda_setup +# <<< conda initialize <<< diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index c3d3a13..0a627b0 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -57,7 +57,6 @@ alias \ copy="xsel -ib" \ fd="fdfind" \ lw="librewolf & exit -f" \ - moosic="ncmpcpp" \ nbadd='cat >> "$XDG_CONFIG_HOME"/newsboat/urls << EOF' \ py="python3" \ sd="sudo shutdown -h now" \ @@ -68,6 +67,5 @@ alias \ # Git aliases alias \ dotfiles="/usr/bin/git --git-dir=\$HOME/.dotfiles --work-tree=\$HOME" \ - obsidian="/usr/bin/git --git-dir=\$HOME/obsidian --work-tree=\$HOME" \ # Limbo diff --git a/.config/shell/envvarrc b/.config/shell/envvarrc index 42e9d3e..dab4f7a 100644 --- a/.config/shell/envvarrc +++ b/.config/shell/envvarrc @@ -13,27 +13,22 @@ export TERMINAL="st" export SCRIPTS="$HOME/.scripts" export PATH="$SCRIPTS:$HOME/.cargo/bin:$HOME/.local/bin:$PATH" -# TODO: clean up this mess +# Other stuff export XDG_CONFIG_HOME="$HOME/.config" export XDG_DATA_HOME="$HOME/.local/share" export XDG_CACHE_HOME="$HOME/.cache" export XINITRC="$XDG_CONFIG_HOME/x11/xinitrc" - export ALIASRC="$HOME/.config/shell/aliasrc" export ZSHDIR="$HOME/.config/shell" export ENVVARRC="$HOME/.config/shell/envvarrc" - export CONDARC="$HOME/.config/conda/.condarc" export _CONDA_ROOT="$HOME/.local/opt/miniconda3" - export GOPATH="$HOME/langs/go" export STARDICT_DATA_DIR="$HOME/.local/share/stardict" - export R_HISTFILE="$HOME/langs/R/.Rhistory" export R_HOME="$HOME/langs/R" export R_LIBS_USER="$HOME/langs/R" export R_PROFILE="$HOME/langs/R/.Rprofile" - export MYVIMRC="$HOME/.config/vim/.vimrc" export VIMINFO="$HOME/.config/vim/.viminfo" export VIMINIT="source $MYVIMRC" diff --git a/.config/vim/.vimrc b/.config/vim/.vimrc index a217207..2bad7b5 100644 --- a/.config/vim/.vimrc +++ b/.config/vim/.vimrc @@ -1,31 +1,46 @@ runtime ftplugin/man.vim -set runtimepath^=$HOME/.config/vim/.vim -set viminfo= -set number -set relativenumber -set title -set bg=dark -set go=a -set mouse=a -set nohlsearch -set clipboard+=unnamedplus -set noshowmode -set noruler -set laststatus=0 -set noshowcmd -set nocompatible -set autoindent -set cindent -set smartindent -set nowrap -set ignorecase -set smartcase -set laststatus=2 -set incsearch -set wildignore=*.o,*.obj,*.bak,*.exe -" Use pathogen (plugin manager) +" General settings +set nocompatible " Disable compatibility with Vi +set number " Show line numbers +set relativenumber " Show relative line numbers +set title " Set terminal title to the file name +set bg=dark " Set dark background for better colors +set laststatus=2 " Show the status line with detailed info +set showmode " Show mode at the bottom +set noshowcmd " Don't show partial commands at the bottom +set ruler " Show line/column info at the bottom + +" Search and highlighting +set nohlsearch " Disable search highlighting after search +set ignorecase " Ignore case in search +set smartcase " Make search case-sensitive if uppercase letters are used +set incsearch " Incremental search as you type +set wildignore=*.o,*.obj,*.bak,*.exe " Ignore certain file types in file completion + +" Indentation and formatting +set autoindent " Enable automatic indentation +set cindent " Enable C-style indentation +set smartindent " Enable smart indentation (e.g., after braces) +set nowrap " Disable line wrapping + +" Clipboard and mouse +set clipboard+=unnamedplus " Enable clipboard integration with system clipboard +set mouse=a " Enable mouse support for scrolling, selection, etc. + +" Session and history +set viminfofile=~/.config/vim/.viminfo " Set the viminfo file location +set viminfo='100,<50,s10,h " Clear Viminfo settings (no history saving) + +" File paths and runtime environment +set runtimepath^=$HOME/.config/vim/.vim " Add custom runtime path for plugins and resources +" Miscellaneous settings +set go=a " Enable all automatic formatting options +set spelllang=en +set nospell + +" Use pathogen (plugin manager) filetype off execute pathogen#infect() execute pathogen#helptags() @@ -48,7 +63,8 @@ autocmd BufWritePre * cal cursor(currPos[1], currPos[2]) " Mappings noremap dBx nnoremap s okzz -nnoremap S Ojzz +" nnoremap S Ojzz +nnoremap S :%s//g nnoremap Y y$ nnoremap - ddp nnoremap _ ddkP @@ -64,13 +80,18 @@ vnoremap "+y " show existing tab with 4 spaces width set tabstop=4 + " when indenting with '>', use 4 spaces width set shiftwidth=4 + " On pressing tab, insert 4 spaces set expandtab +" Compile R Markdown files with F5 +autocmd Filetype rmd map :!echo"require(rmarkdown);render('%')"\|R--vanilla + " Automatically use black on a Python file -autocmd BufWritePost *.py !black --line-length=79 % +autocmd BufWritePost *.py !black --line-length=79 % " Pymode config let g:pymode = 1 @@ -83,3 +104,5 @@ let g:pymode_indent = 1 let g:pymode_indent_hanging_width = &shiftwidth let g:pymode_indent_hanging_width = 4 let g:pymode_doc = 1 + +let maplocalleader = "," -- cgit v1.2.3