1
0
Fork 0

bash: archive .bashrc; vim: simplify and archive old vim configs

This commit is contained in:
Von Random 2025-03-14 16:25:14 +02:00
parent 5e30fd7146
commit 4f811f48dc
6 changed files with 2414 additions and 17 deletions

42
_archive/dot_bashrc Normal file
View file

@ -0,0 +1,42 @@
# shellcheck shell=bash disable=SC1090,SC2164
[[ $- != *i* ]] && return
HISTSIZE=1000
HISTFILE="$HOME/.bash_history.$UID"
HISTCONTROL=ignoredups
shopt -s histappend checkwinsize autocd
export LESS='i M R'
export PAGER=less
export EDITOR=vim
export TIME_STYLE=long-iso
PS1='\[\e[0m\][ \u@\h \[\e[34m\]\w\[\e[0m\] ]\n\$ '
unalias -a
diff() { command diff --color "$@"; }
tailf() { command less +F "$@"; }
rgrep() { command grep --exclude-dir=\.git -R "$@"; }
whence() { command -v "$@"; }
ls() { command ls --color=auto "$@"; }
ll() { ls -alh "$@"; }
ld() { ls -dlh "$@"; }
# git
gci() { command git commit "$@"; }
gsl() { command git stash list "$@"; }
gss() { command git status -sbu "$@"; }
gup() { command git pull "$@"; }
groot() { cd "$(command git rev-parse --show-cdup)"; }
ggrep() { command git grep "$@"; }
gsi() { command tig status; }
# tmux
tmux() { command tmux -2 "$@"; }
atmux() { tmux attach; }
# we want to see exit code on error (it also has to be the last entry here)
trap_msg='\e[31m>>\e[0m exit \e[31m%s\e[0m\n'
trap 'printf "$trap_msg" "$?" >&2' ERR

53
_archive/dot_vimplugrc Normal file
View file

@ -0,0 +1,53 @@
vim9script
autocmd BufRead *vimplugrc set ft=vim
execute 'source' fnameescape(g:plug)
plug#begin(g:plugdir)
Plug 'junegunn/vim-plug'
Plug 'lifepillar/vim-gruvbox8'
Plug 'hashivim/vim-terraform'
Plug 'itchyny/lightline.vim'
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
Plug 'junegunn/vim-easy-align'
Plug 'mhinz/vim-signify'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rsi'
Plug 'tpope/vim-vinegar'
Plug 'w0rp/ale', {'for': ['sh']}
plug#end()
# easy-align
xmap <Leader>a <Plug>(EasyAlign)
nmap <Leader>a <Plug>(EasyAlign)
# fzf
nmap <Leader>ff :Files<CR>
nmap <Leader>fg :GFiles<CR>
nmap <Leader>fb :Buffers<CR>
nmap <Leader>fl :Lines<CR>
nmap <Leader>ft :Filetypes<CR>
# lightline
g:lightline = {
colorscheme: 'gruvbox8',
separator: { left: '', right: ''},
subseparator: { left: '\u2022', right: '\u2022'}
}
if has('gui_running')
set guifont=VascadiaMod:h14
set guicursor=a:blinkon0,a:block,i:ver1-Cursor/lCursor,r:hor1-Cursor/lCursor
set guiheadroom=0 guioptions=aei mouse=a
map <S-Insert> <MiddleMouse>
map! <S-Insert> <MiddleMouse>
endif
g:gruvbox_plugin_hi_groups = 1
&t_8f = "\u1b[38;2;%lu;%lu;%lum"
&t_8b = "\u1b[48;2;%lu;%lu;%lum"
&bg = 'dark'
&tgc = 1
colorscheme gruvbox8

38
_archive/dot_vimrc Normal file
View file

@ -0,0 +1,38 @@
vim9script
set nobackup nomodeline backspace=indent,eol,start foldmethod=marker cursorline
set list listchars=tab:-->,nbsp:x,trail:*
set hlsearch incsearch ignorecase smartcase
set scrolloff=3 sidescrolloff=15 sidescroll=1
set tabstop=3 softtabstop=4 shiftwidth=4 smarttab expandtab autoindent
set wildmenu showcmd ruler laststatus=2 mouse= t_ut= guicursor= t_Co=256
set belloff=all colorcolumn=80 formatoptions+=j relativenumber breakindent
set keymap=russian-jcukenwintype iminsert=0 imsearch=0
&statusline = "[%F] %R%H%W%M %=[%{&fenc}/%{&ff}] %y [%4l/%L:%3v]"
g:sh_indent_case_labels = 1
g:mapleader = "\<Space>"
# mappings
map <Space> <NOP>
noremap <F1> <Esc>
noremap <Leader>/ :noh<CR>
noremap <Leader>y "+y
noremap <Leader>d "+d
noremap <Leader>p "+p
noremap <Leader>P "+P
noremap q <NOP>
noremap! <F1> <Esc>
noremap! <C-@> <C-^>
noremap! <C-Space> <C-^>
nnoremap <Leader>l :setlocal list!<CR>
nnoremap <Leader>c :setlocal cursorline!<CR>
nnoremap <Leader>w :setlocal wrap!<CR>
g:plugrc = expand('$HOME/.vimplugrc')
g:plugdir = expand('$HOME/.vim/plugged')
g:plug = g:plugdir .. '/vim-plug/plug.vim'
if filereadable(g:plugrc) && filereadable(g:plug) && v:version >= 703
execute 'source' fnameescape(g:plugrc)
endif
syntax on
filetype plugin on