diff options
author | filip <“filip.rabiega@gmail.com”> | 2025-07-10 11:03:20 +0200 |
---|---|---|
committer | filip <“filip.rabiega@gmail.com”> | 2025-07-10 11:03:20 +0200 |
commit | a91716202265bbc178ac00140e0fc8978b79c94c (patch) | |
tree | 25735dd207522d3638c50501f7d316dacd72c5ec /.config | |
parent | 94d9b788ddd93ffe45153762bb0b224a98ed4027 (diff) | |
download | dotfiles-a91716202265bbc178ac00140e0fc8978b79c94c.tar.gz dotfiles-a91716202265bbc178ac00140e0fc8978b79c94c.tar.bz2 dotfiles-a91716202265bbc178ac00140e0fc8978b79c94c.zip |
new dotfiles
Diffstat (limited to '.config')
-rw-r--r-- | .config/shell/.bashrc | 71 | ||||
-rw-r--r-- | .config/shell/aliasrc | 76 | ||||
-rw-r--r-- | .config/vim/.vimrc | 111 |
3 files changed, 258 insertions, 0 deletions
diff --git a/.config/shell/.bashrc b/.config/shell/.bashrc new file mode 100644 index 0000000..6474a3b --- /dev/null +++ b/.config/shell/.bashrc @@ -0,0 +1,71 @@ +# ~/.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/aliasrc b/.config/shell/aliasrc new file mode 100644 index 0000000..435be0b --- /dev/null +++ b/.config/shell/aliasrc @@ -0,0 +1,76 @@ +#!/bin/sh + +# Use $XINITRC variable if file exists. +[ -f "$XINITRC" ] && alias startx="startx $XINITRC" + +[ -f "$MBSYNCRC" ] && alias mbsync="mbsync -c $MBSYNCRC" + +# sudo not required for some system commands +for command in mount umount sv apt apt-get aptitude dpkg su shutdown poweroff reboot ; do + alias $command="sudo $command" +done; unset command + +# Stuff here is kinda messy (too bad) +alias c="clear" + +# Verbosity and settings that you pretty much just always are going to want. +alias \ + cp="cp -iv" \ + echo="echo -n" \ + journalctl="journalctl -xe" \ + mkd="mkdir -pv" \ + mv="mv -iv" \ + rm="logrm -vI" \ + rmd="rmdir -vp" \ + rsync="rsync -vrPlu" \ + +# Colorize commands when possible. +alias \ + ccat="highlight --out-format=ansi" \ + diff="diff --color=auto" \ + dir="dir --color=auto" \ + egrep="egrep --color=auto" \ + fgrep="fgrep --color=auto" \ + grep="grep --color=auto" \ + ip="ip -color=auto" \ + ls="ls_new" \ + vdir="vdir --color=auto" \ + +# Make stuff easy to customize and source automatically +alias \ + vrc='vim "$HOME/.config/vim/.vimrc"' \ + zal='vim "$ZSHDIR/aliasrc" && source "$ZSHDIR/aliasrc"' \ + zen='vim "$ZSHDIR/envvarrc" && source "$ZSHDIR/envvarrc"' \ + zrc='vim "$HOME/.zshrc" && source "$HOME/.zshrc"' \ + +# Aliases for connecting to server +alias \ + ctg="ssh git@rabiega.xyz" \ + cts="ssh root@rabiega.xyz" \ + +# Making stuff shorter +alias \ + ..="cd .." \ + b="buku --suggest" \ + bd="buku-dmenu" \ + copy="xsel -ib" \ + cs="chadsearch" \ + lw="librewolf & exit -f" \ + ms="mansplain &" \ + nbadd='cat >> "$XDG_CONFIG_HOME"/newsboat/urls << EOF' \ + obs="exec /usr/bin/obsidian" \ + py="python3" \ + sd="sudo shutdown -h now" \ + tor="cd ~/Downloads/tor-browser/ && ./start-tor-browser.desktop && cd -" \ + update="sudo apt update && apt upgrade" \ + update_dwm="cd ~/repos/dwm && cp ~/repos/dwm/config.def.h ~/repos/dwm/config.h && sudo make clean install && cd -" \ + wifi_connect="nmcli device wifi connect" \ + wifi_list="nmcli device wifi list" \ + wttr="curl wttr.in/Wroclaw" \ + +# 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/vim/.vimrc b/.config/vim/.vimrc new file mode 100644 index 0000000..e8e9417 --- /dev/null +++ b/.config/vim/.vimrc @@ -0,0 +1,111 @@ +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) + +filetype off +execute pathogen#infect() +execute pathogen#helptags() +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 + +" Automatically source .inputrc after saving +autocmd BufWritePost ~/.inputrc !bind -f ~/.inputrc + +" Automatically deletes all trailing whitespace and newlines at end of file on save. & reset cursor position +autocmd BufWritePre * let currPos = getpos(".") +autocmd BufWritePre * %s/\s\+$//e +autocmd BufWritePre * %s/\n\+\%$//e +autocmd BufWritePre * cal cursor(currPos[1], currPos[2]) + +" Mappings +noremap <BS> dBx +nnoremap s o<Esc> +nnoremap S o<Esc>k +nnoremap Y y$ +nnoremap - ddp +nnoremap _ ddkP +nnoremap <C-J> "+yy +nnoremap <C-K> <ESC>"+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 + +" 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 + +let g:pymode = 0 + +" 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 |