diff options
author | pankunull <panku_null@proton.me> | 2025-08-31 17:11:12 +0200 |
---|---|---|
committer | pankunull <panku_null@proton.me> | 2025-08-31 17:11:12 +0200 |
commit | 51c3f7a21e82fbe0d0e78093ac43092d5d62217a (patch) | |
tree | d18fc1a64d703491d904a8026097e7d260e3c8a6 | |
parent | c7210afe5a9e05a4b5f9edd302ea6b95e190353f (diff) |
update
-rw-r--r-- | src/.bashrc | 7 | ||||
-rw-r--r-- | src/.bashrc_alias | 2 | ||||
-rw-r--r-- | src/.bashrc_ps1 | 44 | ||||
-rw-r--r-- | src/.tmux-procman/shell.pid | 1 | ||||
-rwxr-xr-x | src/.tmux.conf | 6 | ||||
-rw-r--r-- | src/.tmux/themes/linux.theme | 38 | ||||
l--------- | src/.tmux/themes/selected.theme | 2 | ||||
-rwxr-xr-x | src/.vim/colors/cyberpunk.vim | 2 | ||||
-rw-r--r-- | src/.vim/colors/ice.vim | 3 | ||||
-rwxr-xr-x | src/.vimrc | 138 | ||||
-rwxr-xr-x | src/.vimrc.bak | 51 |
11 files changed, 242 insertions, 52 deletions
diff --git a/src/.bashrc b/src/.bashrc index 53036bf..d69cb43 100644 --- a/src/.bashrc +++ b/src/.bashrc @@ -12,11 +12,18 @@ export LC_ALL=en_US.UTF-8 source ~/.bashrc_ps1 source ~/.bashrc_alias +# Minimalist PS1: shows last exit, user, current folder + +PS1='[\$? \u \W ]\$ ' + + # colored GCC warnings and errors export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' # PATH export PATH=~/bin:$PATH +export PATH=~/bin/audio-convert:$PATH + # Title bar #echo -ne "\033]0;$(lsb_release -ds) $(hostname) $(uname -r)\007" diff --git a/src/.bashrc_alias b/src/.bashrc_alias index d25769c..b6fe39a 100644 --- a/src/.bashrc_alias +++ b/src/.bashrc_alias @@ -1,2 +1,4 @@ alias ta='tmux a -t' alias tl='tmux ls' + +alias lsg='ls --group-directories-first' diff --git a/src/.bashrc_ps1 b/src/.bashrc_ps1 index ae945a1..48599a5 100644 --- a/src/.bashrc_ps1 +++ b/src/.bashrc_ps1 @@ -1,49 +1,45 @@ -# Dynamic PS1: exit code, time, user, current directory, git, colorized +# Dynamic PS1 using terminal palette colors only function update_ps1 { local exit_code=$? # Color exit code: green if 0, red otherwise if [[ $exit_code -eq 0 ]]; then - local exit_display="\[\033[1;32m\]$exit_code\[\033[0m\]" # green + local exit_display="\[\e[1;32m\]$exit_code\[\e[0m\]" # bright green else - local exit_display="\[\033[1;31m\]$exit_code\[\033[0m\]" # red + local exit_display="\[\e[1;31m\]$exit_code\[\e[0m\]" # bright red fi - # Symbol always white - local symbol="\[\033[1;37m\]\$\[\033[0m\]" + # Symbol always bright white + local symbol="\[\e[1;37m\]\$\[\e[0m\]" - # White brackets - local open_bracket="\[\033[1;37m\][\[\033[0m\]" - local close_bracket="\[\033[1;37m\]]\[\033[0m\]" + # Brackets in bright white + local open_bracket="\[\e[1;37m\][\[\e[0m\]" + local close_bracket="\[\e[1;37m\]]\[\e[0m\]" - # Time in HH:MM:SS - #local time="\[\033[1;37m\]\t\[\033[0m\]" - - # User - #local user="\[\033[1;37m\]\u\[\033[0m\]" + # User: red for root, cyan otherwise if [ $(id -u) -eq 0 ]; then - local user="\[\033[1;31m\]\u\[\033[0m\]" + local user="\[\e[1;31m\]\u\[\e[0m\]" else - local user="\[\033[1;36m\]\u\[\033[0m\]" + local user="\[\e[1;36m\]\u\[\e[0m\]" fi - # Current folder only, ~ for home - local folder="\[\033[1;33m\]\W\[\033[0m\]" + # Current folder: yellow + local folder="\[\e[1;33m\]\W\[\e[0m\]" - # Git status + # Git status: green if up to date, red if ahead, yellow if dirty local git_status="" - if [[ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" == true ]]; then - if [[ -z $(git log origin/master..HEAD 2>/dev/null) ]]; then - git_status="\[\033[1;38;5;10m\](git)\[\033[0m\]" # green if up to date + if git rev-parse --is-inside-work-tree &>/dev/null; then + if [[ -z $(git status --porcelain 2>/dev/null) ]]; then + git_status="\[\e[1;32m\](git)\[\e[0m\]" # clean else - git_status="\[\033[1;38;5;9m\](git)\[\033[0m\]" # red if ahead + git_status="\[\e[1;31m\](git)\[\e[0m\]" # dirty fi fi # Build the prompt - export PS1="${open_bracket} ${exit_display} ${user} ${folder} ${git_status}${close_bracket} ${symbol} " + PS1="${open_bracket}${exit_display} ${user} ${folder}${git_status}${close_bracket}${symbol} " } - # Update PS1 after every command PROMPT_COMMAND='update_ps1' + diff --git a/src/.tmux-procman/shell.pid b/src/.tmux-procman/shell.pid new file mode 100644 index 0000000..3a20daa --- /dev/null +++ b/src/.tmux-procman/shell.pid @@ -0,0 +1 @@ +1251 diff --git a/src/.tmux.conf b/src/.tmux.conf index 7b66371..6302a09 100755 --- a/src/.tmux.conf +++ b/src/.tmux.conf @@ -7,6 +7,12 @@ set -g status on set -g history-limit 10000 set -g terminal-overrides ',*:Tc' + +set-option -g display-panes-time 100 # milliseconds +set-option -g repeat-time 50 # in milliseconds, default is 500 +set-option -s escape-time 10 # default 500ms, lower = faster key recognition + + # Pass through bracketed paste bind-key ] run-shell "tmux set-buffer -- \"$(xclip -o -selection clipboard)\"; tmux paste-buffer" diff --git a/src/.tmux/themes/linux.theme b/src/.tmux/themes/linux.theme new file mode 100644 index 0000000..2741e83 --- /dev/null +++ b/src/.tmux/themes/linux.theme @@ -0,0 +1,38 @@ +# ================================ +# Linux style: black and light gray (active tab light foreground) +# ================================ + +# Status bar background black, foreground light gray +set -g status-bg "#000000" # Pure black +set -g status-fg "#cccccc" # Light gray + +# Status left (session name) +set -g status-left "#[bold]#[fg=#cccccc,bg=#000000] ⧉ #S #[default]" + +# Refresh status bar every second (live clock) +set -g status-interval 1 + +# Status right (clock, date, host) +set -g status-right "#[bold]#[fg=#cccccc,bg=#000000] %H:%M:%S | %d %b %Y | #H #[default]" + +# Window status inactive (gray on black, bold) +setw -g window-status-format "#[bold,fg=#888888,bg=#000000] #I:#W #[default]" + +# Window status active (inverse, darker background, light foreground, bold) +setw -g window-status-current-format "#[bold,fg=#eeeeee,bg=#666666] #I:#W #[default]" + +# Window styles +setw -g window-status-style fg=#888888,bg=#000000 +setw -g window-status-current-style fg=#eeeeee,bg=#666666 + +# Pane borders +set -g pane-border-style fg=#666666 +set -g pane-active-border-style fg=#cccccc + +# Message style (prompts, commands) +set -g message-style fg=#cccccc,bg=#000000 + +# Clock colors +set -g clock-mode-color "#cccccc" +set -g clock-mode-style 24 + diff --git a/src/.tmux/themes/selected.theme b/src/.tmux/themes/selected.theme index 0d1c159..d22bee9 120000 --- a/src/.tmux/themes/selected.theme +++ b/src/.tmux/themes/selected.theme @@ -1 +1 @@ -/home/bytepolar/.tmux/themes/ice.theme
\ No newline at end of file +/home/bytepolar/.tmux/themes/linux.theme
\ No newline at end of file diff --git a/src/.vim/colors/cyberpunk.vim b/src/.vim/colors/cyberpunk.vim index 85a656b..b742dd1 100755 --- a/src/.vim/colors/cyberpunk.vim +++ b/src/.vim/colors/cyberpunk.vim @@ -12,7 +12,7 @@ hi clear "hi Normal guifg=#ffffff guibg=#0f0f1a "hi Normal guifg=#ffffff guibg=#000000 -hi Normal guifg=#ffffff guibg=NONE +hi Normal guifg=#ffffff guibg=NONE "hi LineNr guifg=#ff6fff guibg=#0f0f1a "hi LineNr guifg=#ff6fff guibg=#000000 hi LineNr guifg=#ff6fff guibg=NONE diff --git a/src/.vim/colors/ice.vim b/src/.vim/colors/ice.vim index c707333..64afe5d 100644 --- a/src/.vim/colors/ice.vim +++ b/src/.vim/colors/ice.vim @@ -11,7 +11,8 @@ set termguicolors hi clear " Normal text -hi Normal guifg=#ffffff guibg=NONE +"hi Normal guifg=#ffffff guibg=NONE +hi Normal guifg=NONE guibg=NONE hi LineNr guifg=#00d7ff guibg=NONE hi CursorLineNr guifg=#00d7ff guibg=NONE gui=bold hi CursorLine guibg=NONE @@ -1,20 +1,69 @@ -syntax on -colorscheme ice +" ------------------------------- +" Global options +" ------------------------------- + +"colorscheme ice +colorscheme default + +" Colors +if has('termguicolors') + set termguicolors +endif + +" Cursor can rest beyond the last character +set virtualedit=onemore -" Your usual config below +" Highlight +set hlsearch + +" Options +syntax on set number -set expandtab -set shiftwidth=4 -set tabstop=4 -set softtabstop=4 +set tabstop=8 +set shiftwidth=8 +set softtabstop=8 +set noexpandtab set autoindent set smartindent set scrolloff=999 +set relativenumber set mouse=a -"""""""""""""""""""""""""""""""""""""""""" -" Statubar + +" Line numbers +hi LineNr ctermfg=7 ctermbg=NONE guifg=#505050 guibg=NONE +hi CursorLineNr ctermfg=7 ctermbg=NONE guifg=#505050 guibg=NONE + + +" ------------------------------- +" Toggle between default and kernel-style settings +" ------------------------------- + +let g:vim_kernel_mode = 1 " 0 = personal, 1 = kernel + +function! ToggleListStyle() + if g:vim_kernel_mode + " Kernel style settings + set list " show tabs, trailing spaces, eol + set listchars=tab:>-,trail:~,eol:$ + let g:vim_list_mode = 1 + echo "List mode" + else + " Restore your personal settings + set nolist + set listchars= + let g:vim_list_mode = 0 + echo "No list mode" + endif + " toggle the mode for next call + let g:vim_kernel_mode = !g:vim_kernel_mode +endfunction + + +" ------------------------------- +" Statusbar +" ------------------------------- function! VisualModeLineCount() if mode() =~# 'v' @@ -37,14 +86,19 @@ function! ReadOnlyFlag() return '' " Empty if not modified endfunction + +" Function to display current column / total columns in current line +function! ColAndTotal() + return printf('%d/%d', col('.'), col('$')) +endfunction + " Full-width statusline set laststatus=2 -set statusline= " LEFT Side set statusline= set statusline+=%f " File name -set statusline+=\ [%l:%c] " Line and column +set statusline+=\ [%l:%{ColAndTotal()}] " Line and column / total columns set statusline+=\ [%L/%p%%] " Total lines and percent set statusline+=%{VisualModeLineCount()} " Selected lines in visual mode set statusline+=%{ModifiedFlag()} " Custom modified flag @@ -53,19 +107,11 @@ set statusline+=%{ModifiedFlag()} " Custom modified flag set statusline+=%= " RIGHT side -set statusline+=\ [%y] " Filetype +set statusline+=\ [%y] " Filetype set statusline+=%{ReadOnlyFlag()} -"""""""""""""""""""""""""""""""""""""""""" - " Status bar transparent hi StatusLine ctermbg=0 cterm=NONE - -" Cursor can rest beyond the last character -set virtualedit=onemore - -" Highlight -set hlsearch " Disable expandtab for make files autocmd FileType make setlocal noexpandtab @@ -75,15 +121,61 @@ if has("clipboard") set clipboard=unnamedplus endif +" =============================== +" Kernel-style 80-column guide for C files +" =============================== + +" Use ftplugin for C files only +augroup c_kernel_style + autocmd! + + " Trigger for C files + autocmd FileType c call s:kernel_c_setup() +augroup END + +function! s:kernel_c_setup() + " Highlight the 80th column + setlocal colorcolumn=80 + + " Optional: show cursor position + setlocal ruler + + " Optional: soft wrap for comments + setlocal textwidth=80 + setlocal formatoptions+=t + + " Optional: subtle color for colorcolumn (works in GUI or truecolor terminals) + hi ColorColumn ctermbg=236 guibg=#3a3a3a +endfunction + + +" ------------------------------- +" Keymaps +" ------------------------------- + " F2: absolute numbers only nnoremap <F2> :set number!<CR> " F4: absolute numbers only nnoremap <F4> :set relativenumber!<CR> -" Search highlight +" F5: Search highlight nnoremap <F5> :nohlsearch<CR> +" F6: to toggle kernel style +nnoremap <F6> :call ToggleListStyle()<CR> + +" F7: remove all trailing line +nnoremap <F7> :%s/\s\+$//e<CR> + +" F8 will run checkpatch.pl and populate quickfix list +nnoremap <F8> :w<CR>:cexpr system('checkpatch.pl --no-tree --file ' . expand('%:p'))<CR>:cwindow<CR> + +" Quickfix navigation with Shift + > / Shift + < +" Note: Vim sees these as > and < in normal mode +nnoremap > :cnext<CR> +nnoremap < :cprev<CR> + if &term =~ 'tmux\|xterm\|konsole' " Map HOME key to move to beginning of line in normal mode noremap <Esc>[1~ 0 @@ -91,7 +183,3 @@ if &term =~ 'tmux\|xterm\|konsole' noremap <Esc>OH 0 endif -" Colors -if has('termguicolors') - set termguicolors -endif diff --git a/src/.vimrc.bak b/src/.vimrc.bak new file mode 100755 index 0000000..3aa6721 --- /dev/null +++ b/src/.vimrc.bak @@ -0,0 +1,51 @@ +syntax on +set background=dark +colorscheme cyberpunk + +" Your usual config below +set number +set expandtab +set shiftwidth=4 +set tabstop=4 +set softtabstop=4 +set autoindent +set smartindent +set scrolloff=999 +set mouse=a + +" Cursor can rest beyond the last character +set virtualedit=onemore + +" Highlight +set hlsearch + +" Disable expandtab for make files +autocmd FileType make setlocal noexpandtab + + +if has("clipboard") + set clipboard=unnamedplus +endif + + +" F2: absolute numbers only +nnoremap <F2> :set number!<CR> + +" F4: absolute numbers only +nnoremap <F4> :set relativenumber!<CR> + +" Search highlight +nnoremap <F5> :nohlsearch<CR> + +if &term =~ 'tmux\|xterm\|konsole' + " Map HOME key to move to beginning of line in normal mode + noremap <Esc>[1~ 0 + noremap <Esc>[H 0 + noremap <Esc>OH 0 +endif + + + +if has('termguicolors') + set termguicolors +endif |