From 2eb52c65dcc4d7c3cca60a79ddd552f17b34a747 Mon Sep 17 00:00:00 2001 From: DeadGit Date: Mon, 12 Oct 2020 19:44:04 -0300 Subject: [PATCH] Regresiones del quilombo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit En realidad ni tantas. Estuve lurkeando bastante en #neovim y segun parece toda la cuestion de packadd no esta tan afilada como podria/deberia estar. O sea, funciona, pero hay un tema de expectativa que se genero en los usuarios despues de años de usar plugin managers que aprendieron a manejar ciertas idiosincracias del rtp. Y resulta que si bien se puede hacer que packadd se adapte a eso, hay un par de vueltas de tuerca mas que hay que darle. Asi que volvi a usar vim-plug porque funciona como quiero que lo haga asi que si, expectativa cumplida. Tambien volvi a Defx porque me parece que es mas flexible que Fern en cuanto a configuracion. Y afine la configuracion de la integracion git. Hubieron otros cambios menores y reacomodamientos de cosas tambien. Lo otro que hice fueron regresiones mas pequeñas como el prompt, al que le saque un par de cosas que resulta que no iba a usar nunca al final. Finalmente hubo limpieza y varios cambios pequeños aqui y alla. --- .config/alacritty.yml | 6 +- .config/bspwm/bspwmrc | 5 +- .config/lf/lfrc | 2 +- .config/mpv/mpv.conf | 1 + .config/newsboat/config | 1 + .config/nvim/after/ftplugin/html.vim | 2 +- .config/nvim/after/ftplugin/markdown.vim | 1 + .config/nvim/after/ftplugin/tex.vim | 2 + .config/nvim/after/ftplugin/typescript.vim | 3 +- .config/nvim/after/plugin/coc.vim | 52 ++++++++++++++++++ .config/nvim/autoload/dead/statusline.vim | 15 ++++- .config/nvim/autoload/dead/tabline.vim | 4 ++ .config/nvim/ftplugin/go.vim | 6 ++ .config/nvim/init.vim | 29 ++++++---- .config/nvim/plugin/ale.vim | 2 +- .config/nvim/plugin/autocmds.vim | 13 ++--- .config/nvim/plugin/coc.vim | 46 ---------------- .config/nvim/plugin/gitgutter.vim | 1 + .config/nvim/plugin/lateks.vim | 10 ++++ .config/nvim/plugin/mappings/fm.vim | 47 ---------------- .config/nvim/plugin/settings.vim | 4 +- .config/sxhkd/sxhkdrc | 2 +- .config/tmux/tmux.conf | 10 ++-- .config/zsh/conf/00_prompt.zsh | 51 +++++------------ .config/zsh/conf/01_teclas.zsh | 1 + .config/zsh/conf/03_aliases.zsh | 3 +- .config/zsh/conf/10_plugins.zsh | 2 + .config/zsh/conf/20_autocompletar.zsh | 8 +-- .local/bin/bspmonis | 7 +-- .local/bin/hx | 6 +- .local/bin/pantallazo | 14 ++--- .local/bin/pom | 64 +++++++++++++++++++++- .zshenv | 12 ++-- doc/xbpaketes | 13 ++--- 34 files changed, 237 insertions(+), 208 deletions(-) create mode 100644 .config/nvim/after/ftplugin/tex.vim create mode 100644 .config/nvim/after/plugin/coc.vim delete mode 100644 .config/nvim/plugin/coc.vim create mode 100644 .config/nvim/plugin/lateks.vim delete mode 100644 .config/nvim/plugin/mappings/fm.vim diff --git a/.config/alacritty.yml b/.config/alacritty.yml index 508e6fa..b59e6bf 100644 --- a/.config/alacritty.yml +++ b/.config/alacritty.yml @@ -5,7 +5,7 @@ window: padding: x: 15 - y: 6 + y: 5 # decorations: none @@ -34,8 +34,8 @@ font: # Offset is the extra space around each character. `offset.y` can be thought of # as modifying the line spacing, and `offset.x` as modifying the letter spacing. offset: - x: 1 - y: 2 + x: 0 + y: 1 draw_bold_text_with_bright_colors: false diff --git a/.config/bspwm/bspwmrc b/.config/bspwm/bspwmrc index 473db81..c725431 100755 --- a/.config/bspwm/bspwmrc +++ b/.config/bspwm/bspwmrc @@ -7,10 +7,10 @@ randbg & bspc config border_width 2 bspc config window_gap 6 -bspc config top_padding 10 +bspc config top_padding 5 bspc config left_padding 0 bspc config right_padding 0 -bspc config bottom_padding 10 +bspc config bottom_padding 15 bspc config split_ratio 0.5 # Opciones @@ -55,3 +55,4 @@ bspc rule -a gzdoom state=fullscreen xcompmgr & unclutter --jitter 30 --timeout 3 --ignore-scrolling & +$TERMINAL & diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 8921a6d..8ba5151 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -265,7 +265,7 @@ map o &mimeopen $f map O $mimeopen --ask $f map cx $chmod +x "$f" map bg $setbg $f -map U %du -sh $f +map du %du -sh $f map Y %cp -ri $fs . map D %mv -i $fs . map za $apack "$f".zip $f diff --git a/.config/mpv/mpv.conf b/.config/mpv/mpv.conf index 8da1ee5..e5bba8f 100644 --- a/.config/mpv/mpv.conf +++ b/.config/mpv/mpv.conf @@ -3,6 +3,7 @@ ao=jack,alsa, # scale=ewa_lanczossharp # cscale=ewa_lanczossharp # hwdec=vaapi +volume=70 deband=no geometry=50%:50% alang=eng,en diff --git a/.config/newsboat/config b/.config/newsboat/config index 0389f79..02421f2 100644 --- a/.config/newsboat/config +++ b/.config/newsboat/config @@ -60,6 +60,7 @@ bind-key u pageup bind-key l open bind-key h quit bind-key M mark-feed-read +bind-key m toggle-article-read bind-key o open-in-browser-and-mark-read bind-key n next-unread bind-key N prev-unread diff --git a/.config/nvim/after/ftplugin/html.vim b/.config/nvim/after/ftplugin/html.vim index 77325c5..c96867a 100644 --- a/.config/nvim/after/ftplugin/html.vim +++ b/.config/nvim/after/ftplugin/html.vim @@ -1,2 +1,2 @@ -let b:ale_linters = ['prettier_standard'] let b:ale_fixers = ['prettier_standard'] +let b:ale_linters = ['prettier_standard'] diff --git a/.config/nvim/after/ftplugin/markdown.vim b/.config/nvim/after/ftplugin/markdown.vim index 889a16d..5ee4e5c 100644 --- a/.config/nvim/after/ftplugin/markdown.vim +++ b/.config/nvim/after/ftplugin/markdown.vim @@ -14,6 +14,7 @@ nnoremap ]s nnoremap z= nnoremap z=1 nnoremap zg +inoremap u[s1z=`]au " Todo list nnoremap i-[] diff --git a/.config/nvim/after/ftplugin/tex.vim b/.config/nvim/after/ftplugin/tex.vim new file mode 100644 index 0000000..c38c638 --- /dev/null +++ b/.config/nvim/after/ftplugin/tex.vim @@ -0,0 +1,2 @@ +setlocal spell spelllang=es,en_us +inoremap u[s1z=`]au diff --git a/.config/nvim/after/ftplugin/typescript.vim b/.config/nvim/after/ftplugin/typescript.vim index 9ac19ee..dddc495 100644 --- a/.config/nvim/after/ftplugin/typescript.vim +++ b/.config/nvim/after/ftplugin/typescript.vim @@ -1,3 +1,2 @@ let b:ale_linters = ['tsserver', 'eslint'] -let b:ale_fixers = ['prettier_standard'] - +let b:ale_linters = ['prettier_standard'] diff --git a/.config/nvim/after/plugin/coc.vim b/.config/nvim/after/plugin/coc.vim new file mode 100644 index 0000000..54658d3 --- /dev/null +++ b/.config/nvim/after/plugin/coc.vim @@ -0,0 +1,52 @@ +" Config +nnoremap :vsplit:CocConfig + +if exists('b:coc_enabled=1') + set completeopt-=preview + + let g:coc_global_extensions = ['coc-highlight', 'coc-snippets', 'coc-tsserver', 'coc-css', 'coc-html', 'coc-json', 'coc-emmet'] + + inoremap + \ pumvisible() ? "\" : + \ coc#expandableOrJumpable() ? + \ "\=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\" : + \ check_back_space() ? "\" : + \ coc#refresh() + + function! s:check_back_space() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' + endfunction + + inoremap coc#refresh() + + if exists('*complete_info') + inoremap complete_info()["selected"] != "-1" ? "\" : "\u\" + else + inoremap pumvisible() ? "\" : "\u\" + endif + + " GoTo code navigation. + nnoremap gd (coc-definition) + nnoremap gr (coc-references) + + " Use D to show documentation in preview window. + nnoremap D :call show_documentation() + + function! s:show_documentation() + if (index(['vim','help'], &filetype) >= 0) + execute 'h '.expand('') + else + call CocAction('doHover') + endif + endfunction + + " Symbol renaming. + nnoremap rn (coc-rename) + + aug Cursor + au! + au CursorHold * silent call CocActionAsync('highlight') + au User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') + aug END +endif diff --git a/.config/nvim/autoload/dead/statusline.vim b/.config/nvim/autoload/dead/statusline.vim index c4f37d8..168aab3 100644 --- a/.config/nvim/autoload/dead/statusline.vim +++ b/.config/nvim/autoload/dead/statusline.vim @@ -10,6 +10,7 @@ function! dead#statusline#StatusLine() abort let l:statusline='' let l:statusline.='%#TabLineFill#%{dead#statusline#LinterStatus()} ' let l:statusline.='%#User6#%{fugitive#head()} ' + let l:statusline.='%#User1#%{GitStatus()} ' let l:statusline.='%{dead#statusline#LinePasteMode()}' let l:statusline.='%= ' let l:statusline.='%#User1#%p%% %l:%c ' @@ -33,7 +34,7 @@ function! dead#statusline#HelpStatusLine() abort return l:statusline endfunction -function! dead#statusline#FernStatusLine() abort +function! dead#statusline#FMStatusLine() abort let l:statusline='' let l:statusline.='%#User8#' let l:statusline.='%= ' @@ -67,8 +68,8 @@ function! dead#statusline#RefreshStatusLine(mode) if &filetype ==? 'help' setlocal statusline=%!dead#statusline#HelpStatusLine() endif - if &filetype ==? 'fern' - setlocal statusline=%!dead#statusline#FernStatusLine() + if &filetype ==? 'Defx' + setlocal statusline=%!dead#statusline#FMStatusLine() endif endfunction @@ -82,3 +83,11 @@ function! dead#statusline#LinterStatus() abort \ l:all_errors \) endfunction + +function! GitStatus() abort + if !get(g:, 'gitgutter_enabled', 0) || empty(FugitiveHead()) + return '' + endif + let [ l:added, l:modified, l:removed ] = GitGutterGetHunkSummary() + return printf('+%d ~%d -%d', l:added, l:modified, l:removed) +endfunction diff --git a/.config/nvim/autoload/dead/tabline.vim b/.config/nvim/autoload/dead/tabline.vim index 2e84efa..eee82ff 100644 --- a/.config/nvim/autoload/dead/tabline.vim +++ b/.config/nvim/autoload/dead/tabline.vim @@ -20,6 +20,10 @@ function! dead#tabline#Tabline() abort endif endfor + if &filetype ==? 'Defx' + let s = '' + endif + let s .= '%#TabLineFill#' if (exists('g:tablineclosebutton')) let s .= '%=%999XX' diff --git a/.config/nvim/ftplugin/go.vim b/.config/nvim/ftplugin/go.vim index f9aafd3..72fc532 100644 --- a/.config/nvim/ftplugin/go.vim +++ b/.config/nvim/ftplugin/go.vim @@ -1,3 +1,9 @@ setlocal noexpandtab setlocal shiftwidth=4 setlocal tabstop=4 + +aug miscs + au! + au CursorHold * silent call CocActionAsync('highlight') + au User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') +aug END diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 9c3a232..c91a16c 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -3,11 +3,19 @@ let g:python_host_skip_check=1 " Skip python 2 host check if filereadable('bin/python3') let g:python3_host_prog = '/bin/python3' endif -let g:node_host_prog = '~/.local/share/npm/bin/neovim-node-host' -let $GIT_EDITOR = 'nvr -cc split --remote-wait' +if filereadable('~/.local/share/npm/bin/neovim-node-host') + let g:node_host_prog = '~/.local/share/npm/bin/neovim-node-host' +endif if executable("rg") set grepprg=rg\ --vimgrep + set grepformat=%f:%l:%c:%m endif +if empty(glob('~/.local/share/nvim/site/autoload/plug.vim')) + silent !curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs + \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + autocmd VimEnter * PlugInstall --sync | call coc#util#install() | source $MYVIMRC +endif +let $GIT_EDITOR = 'nvr -cc split --remote-wait' let mapleader="\" let maplocalleader=',' @@ -24,11 +32,12 @@ let g:srcery_underline = 1 let g:srcery_undercurl = 1 colorscheme srcery -packadd! pear-tree -packadd! loupe -packadd! vim-commentary -packadd! fzf.vim -packadd! fern.vim -packadd! ale -packadd! coc.nvim -packadd! vim-fugitive +call plug#begin(stdpath('data') . '/plugged') +Plug 'dense-analysis/ale' +Plug 'lervag/vimtex', {'for': 'latex'} +Plug 'neoclide/coc.nvim', {'branch': 'release', 'for': ['javascript', 'html', 'css', 'json', 'typescript', 'jsx', 'tsx', 'go']} +Plug 'tpope/vim-fugitive' +Plug 'airblade/vim-gitgutter' +Plug 'junegunn/fzf.vim' +Plug 'Shougo/defx.nvim', { 'do': ':UpdateRemotePlugins' } +call plug#end() diff --git a/.config/nvim/plugin/ale.vim b/.config/nvim/plugin/ale.vim index 0028936..f539d97 100644 --- a/.config/nvim/plugin/ale.vim +++ b/.config/nvim/plugin/ale.vim @@ -11,7 +11,7 @@ let g:ale_set_highlights = 1 let g:ale_set_signs = 1 let g:ale_javascript_eslint_suppress_missing_config = 1 let g:ale_sign_error = '𝐗' -let g:ale_sign_warning = '⚠' +let g:ale_sign_warning = '➤' let g:ale_sign_info = '●' let g:ale_loclist_msg_format = '[%linter%] %s% (code)% [%severity%]' let g:ale_linter_aliases = { 'jsx': ['css', 'javascript'] } diff --git a/.config/nvim/plugin/autocmds.vim b/.config/nvim/plugin/autocmds.vim index 80b174f..ddd65e9 100644 --- a/.config/nvim/plugin/autocmds.vim +++ b/.config/nvim/plugin/autocmds.vim @@ -3,32 +3,27 @@ scriptencoding utf-8 if !exists('autocommands_loaded') && has('autocmd') let autocommands_loaded = 1 - aug miscs - au CursorHold * silent call CocActionAsync('highlight') - au User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') - aug END - - aug inserts + aug OnInsert au BufWinEnter,FocusGained,InsertLeave,WinEnter * call dead#functions#Relativize(1) au BufWinLeave,FocusLost,InsertEnter,WinLeave * call dead#functions#Relativize(0) au InsertLeave * setlocal nopaste au InsertLeave,CompleteDone * if pumvisible() == 0 | pclose | endif aug END - aug file_types + aug FileTypes au BufNewFile ~/doc/blog/*.md 0r ~/.config/nvim/templates/wiki.skeleton au FileType gitcommit,gitrebase,gitconfig set bufhidden=delete au BufNewFile,BufRead requirements*.txt set syntax=python au FileType fzf tnoremap aug END - aug status_line + aug StatusLine au VimEnter * call dead#statusline#UpdateInactiveWindows() au VimEnter,WinEnter,BufWinEnter * call dead#statusline#RefreshStatusLine('active') au WinLeave * call dead#statusline#RefreshStatusLine('inactive') aug END - aug on_save + aug OnSave au BufWritePre * :%s/\s\+$//e au BufWritePost *xresources !xrdb % au BufWritePost *sxhkdrc !pkill -USR1 sxhkd diff --git a/.config/nvim/plugin/coc.vim b/.config/nvim/plugin/coc.vim deleted file mode 100644 index b0a91b0..0000000 --- a/.config/nvim/plugin/coc.vim +++ /dev/null @@ -1,46 +0,0 @@ -let g:coc_global_extensions = ['coc-highlight', 'coc-snippets', 'coc-tsserver', 'coc-css', 'coc-html', 'coc-json', 'coc-emmet'] - -" Config -nnoremap :vsplit:CocConfig - -let g:coc_snippet_next = '' -let g:coc_snippet_prev = '' - -inoremap - \ pumvisible() ? "\" : - \ coc#expandableOrJumpable() ? - \ "\=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\" : - \ check_back_space() ? "\" : - \ coc#refresh() - -function! s:check_back_space() abort - let col = col('.') - 1 - return !col || getline('.')[col - 1] =~# '\s' -endfunction - -inoremap coc#refresh() - -if exists('*complete_info') - inoremap complete_info()["selected"] != "-1" ? "\" : "\u\" -else - inoremap pumvisible() ? "\" : "\u\" -endif - -" GoTo code navigation. -nnoremap gd (coc-definition) -nnoremap gr (coc-references) - -" Use D to show documentation in preview window. -nnoremap D :call show_documentation() - -function! s:show_documentation() - if (index(['vim','help'], &filetype) >= 0) - execute 'h '.expand('') - else - call CocAction('doHover') - endif -endfunction - -" Symbol renaming. -nnoremap rn (coc-rename) - diff --git a/.config/nvim/plugin/gitgutter.vim b/.config/nvim/plugin/gitgutter.vim index f85ed35..5ed025d 100644 --- a/.config/nvim/plugin/gitgutter.vim +++ b/.config/nvim/plugin/gitgutter.vim @@ -1,4 +1,5 @@ let g:gitgutter_highlight_linenrs = 1 let g:gitgutter_set_sign_backgrounds = 1 +let g:gitgutter_terminal_reports_focus=0 let g:gitgutter_map_keys = 0 let g:gitgutter_grep = 'rg --color=never' diff --git a/.config/nvim/plugin/lateks.vim b/.config/nvim/plugin/lateks.vim new file mode 100644 index 0000000..eaa3ac5 --- /dev/null +++ b/.config/nvim/plugin/lateks.vim @@ -0,0 +1,10 @@ +let g:tex_flavor='latex' +let g:Tex_DefaultTargetFormat ='pdf' +let g:vimtex_compiler_progname = 'nvr' +let g:vimtex_view_method = 'zathura' +let g:vimtex_motion_matchparen = 0 +let g:vimtex_quickfix_mode = 0 +let g:vimtex_complete_enable = 1 +let g:vimtex_view_use_temp_files = 2 +set conceallevel=1 +let g:tex_conceal='abdmg' diff --git a/.config/nvim/plugin/mappings/fm.vim b/.config/nvim/plugin/mappings/fm.vim deleted file mode 100644 index c7d2dad..0000000 --- a/.config/nvim/plugin/mappings/fm.vim +++ /dev/null @@ -1,47 +0,0 @@ -nnoremap :Fern . -reveal=% -drawer -toggle - -function! s:init_fern() abort - setlocal nonumber norelativenumber - - nmap - \ (fern-my-expand-or-collapse) - \ fern#smart#leaf( - \ "\(fern-action-collapse)", - \ "\(fern-action-expand)", - \ "\(fern-action-collapse)", - \ ) - - nmap - \ (fern-my-open-expand-collapse) - \ fern#smart#leaf( - \ "\(fern-action-open:select)", - \ "\(fern-action-expand)", - \ "\(fern-action-collapse)", - \ ) - - nmap (fern-action-open:split) - nmap (fern-action-open:vsplit) - nmap t (fern-action-open:tabedit) - nmap r (fern-action-rename) - nmap R (fern-action-reload) - nmap N (fern-action-new-file) - nmap K (fern-action-new-dir) - nmap c (fern-action-copy) - nmap m (fern-action-move) - nmap ! (fern-action-hidden:toggle) - nmap C (fern-action-clipboard-copy) - nmap M (fern-action-clipboard-move) - nmap P (fern-action-clipboard-paste) - nmap l (fern-action-expand) - nmap D (fern-action-remove) - nmap (fern-action-leave) - nmap (fern-action-mark-toggle) - nmap (fern-my-open-expand-collapse) - nmap o (fern-my-expand-or-collapse) - nmap (fern-action-open-and-close) -endfunction - -augroup fern-custom - autocmd! * - autocmd FileType fern call s:init_fern() -augroup END diff --git a/.config/nvim/plugin/settings.vim b/.config/nvim/plugin/settings.vim index 92bb92a..835e016 100644 --- a/.config/nvim/plugin/settings.vim +++ b/.config/nvim/plugin/settings.vim @@ -28,7 +28,6 @@ set foldclose=all set foldlevelstart=10 set selectmode=key set keymodel=startsel -set signcolumn=yes:2 set tabstop=2 set shiftwidth=2 set softtabstop=2 @@ -41,14 +40,13 @@ set title set redrawtime=500 set ttimeoutlen=10 set nowritebackup -set completeopt-=preview set undofile set undolevels=1000 set undoreload=10000 set listchars+=precedes:<,extends:> set diffopt+=algorithm:histogram,indent-heuristic set diffopt+=foldcolumn:0 -set fillchars=eob:\ ,stlnc:\ ,stl:\ ,vert:\│ +set fillchars=diff:\ ,eob:\ ,stlnc:\ ,stl:\ ,vert:\│ set formatoptions+=nl set formatoptions-=crot let formatlistpat='^\s*\(\d\+[\]:.)}\t ]\|[*-][\t ]\)\s*' diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 3534c4a..5a3e96b 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -39,7 +39,7 @@ super + {_,shift,ctrl} + u bspc node {@/ -B,@brother -B,@/ -E} super + m - bspc monitor -f last + bspc monitor -f last && notifocus # Run Applications super + {_,shift} + ntilde diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf index 8d330f6..a00dd3e 100644 --- a/.config/tmux/tmux.conf +++ b/.config/tmux/tmux.conf @@ -3,7 +3,6 @@ set -g default-terminal 'tmux-256color' set -as terminal-overrides ',alacritty:Tc' set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux-3.0 -# set -g set-titles-string "#S > #{pane_current_command} (#{=-15:?window_name,#{window_name},#{s/deadguy/home/:?pane_current_path,#{b:pane_current_path},}})" set -g set-titles-string "#S > #{=-15:?window_name,#{window_name},#{s/deadguy/home/:?pane_current_path,#{b:pane_current_path},}} (#T)" set -g mode-keys vi set -g history-limit 102400 @@ -31,8 +30,7 @@ set -g monitor-activity on set -g bell-action none # Statusbar -set -g pane-border-status bottom -set -g pane-border-format '──' +set -g pane-border-status off set -g automatic-rename-format '#{s/zsh//:pane_current_command}' set -g pane-border-style fg=colour0,dim set -g pane-active-border-style fg=colour0,dim @@ -41,9 +39,9 @@ set -g status-interval 60 set -g mode-style 'fg=#EEEEEE,bg=#75507B' set -g message-command-style bg=colour0,fg=colour13 set -g message-style 'bg=#222222,fg=white,italics' -set -g status-style bg=default,fg=colour7 -set -g status-left '' -set -g status-right '#(txbar) #[fg=colour134]%a %d #[fg=colour167]%R #[fg=colour7]#S' +set -g status-style "bg=default,fg=#999999" +set -g status-left '#[fg=#555555]#S: ' +set -g status-right '#(txbar) #[fg=colour134]%a %d #[fg=colour167]%R' set -g window-status-separator ' ' set -g window-status-current-style fg=colour3 set -g window-status-activity-style bg=default,fg=colour15,italics diff --git a/.config/zsh/conf/00_prompt.zsh b/.config/zsh/conf/00_prompt.zsh index 5b6c28f..1f3e9a5 100644 --- a/.config/zsh/conf/00_prompt.zsh +++ b/.config/zsh/conf/00_prompt.zsh @@ -1,32 +1,20 @@ -# Set PS1 and RPS1 -precmd() { - local git_branch git_toplvl suffix +function precmd() { + if [ -z "$NEW_LINE_BEFORE_PROMPT" ]; then + NEW_LINE_BEFORE_PROMPT=1 + elif [ "$NEW_LINE_BEFORE_PROMPT" -eq 1 ]; then + echo "\n" + fi +} - # -- Add a line before the prompt - [[ -v PS1_NL ]] && echo || PS1_NL= +function () { + if [[ $EUID == 0 ]]; then + local SUFFIX='%(?,%F{yellow},%F{red})%n%f:' + else + local SUFFIX='%(?,%F{yellow},%F{red})>%f' + fi - # -- PS1 (in precmd, avoid tools updating PS1) - if [[ $EUID == 0 ]]; then - suffix='%(?,%F{yellow},%F{red})%n%f:' - else - suffix='%(?,%F{yellow},%F{red})>%f' - fi - PS1="%B${suffix}%b " - - # -- RPS1 - # Error code if != 0 - RPS1='%B%(?..%{%F{red}%}(%?%)%{%f%}) ' - - # if in git repo, print / - if git_branch="$( git rev-parse --abbrev-ref HEAD 2>/dev/null )"; then - [[ -z "$(git status --porcelain 2>/dev/null)" ]] \ - && RPS1+="%F{green}${git_branch}%F{231}%b " \ - || RPS1+="%F{166}${git_branch}%F{231}%b " - git_toplvl="$( git rev-parse --show-toplevel 2>/dev/null )" - RPS1+="%F{240}[%F{201}${git_toplvl##*/}:%F{12}%2~%F{240}]%f" - else - RPS1+='%b%F{12}%2~%f' - fi + PS1="%B${SUFFIX}%b " + export RPS1="%B%(?..%{%F{red}%}(%?%)%{%f%}) %b%F{12}%2~%f" } export SPROMPT="zsh: correct %F{red}'%R'%f to %F{green}'%r'%f [%B%Uy%u%bes, %B%Un%u%bo, %B%Ue%u%bdit, %B%Ua%u%bbort]? " @@ -48,12 +36,3 @@ zle-line-init() { zle -N zle-line-init echo -ne '\e[5 q' preexec() { echo -ne '\e[6 q' ;} - -# (Un)set (r)prompts -PS2='%F{245}> %f' -PS3='%F{245}> %f' -PS4='%F{245}> %f' -unset RPS2 RPS3 RPS4 - -# Clear previous rprompts -setopt TRANSIENT_RPROMPT diff --git a/.config/zsh/conf/01_teclas.zsh b/.config/zsh/conf/01_teclas.zsh index dfa76f1..6eb6492 100644 --- a/.config/zsh/conf/01_teclas.zsh +++ b/.config/zsh/conf/01_teclas.zsh @@ -86,6 +86,7 @@ bindkey -M viins '^[[B' history-substring-search-down bindkey -M viins '^E' edit-command-line bindkey '^L' tmux-clear-screen bindkey '^X' run-with-sudo +bindkey '^G' "dotbare fedit^J" # }}} # Normal {{{ bindkey -M vicmd 'j' down-line # Override down-line-or-history. diff --git a/.config/zsh/conf/03_aliases.zsh b/.config/zsh/conf/03_aliases.zsh index 622e019..6ef3f59 100644 --- a/.config/zsh/conf/03_aliases.zsh +++ b/.config/zsh/conf/03_aliases.zsh @@ -89,7 +89,8 @@ alias \ ping='ping -c 5' \ dd='dd status=progress' \ dfc='dfc -dmT' \ - strim='mpv --jack-port="OBS Jack Input"' + strim='mpv --jack-port="OBS Jack Input"' \ + slrn='slrn -i ~/.config/slrn/rc -f ~/.config/slrn/jnewsrc.club --create' # Comandos alias \ diff --git a/.config/zsh/conf/10_plugins.zsh b/.config/zsh/conf/10_plugins.zsh index 2d2b8bc..ec33ff9 100644 --- a/.config/zsh/conf/10_plugins.zsh +++ b/.config/zsh/conf/10_plugins.zsh @@ -1,4 +1,5 @@ foreach plugin ( + dotbare/dotbare.plugin.zsh zsh-autopair/autopair.plugin.zsh zsh-system-clipboard/zsh-system-clipboard.plugin.zsh zsh-history-substring-search/zsh-history-substring-search.plugin.zsh @@ -6,5 +7,6 @@ foreach plugin ( source $ZDOTDIR/conf/$plugin } +bindkey -s '^G' "dotbare fedit"^j HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE=1 typeset -g ZSH_SYSTEM_CLIPBOARD_TMUX_SUPPORT='true' diff --git a/.config/zsh/conf/20_autocompletar.zsh b/.config/zsh/conf/20_autocompletar.zsh index ac0b858..6797c2e 100644 --- a/.config/zsh/conf/20_autocompletar.zsh +++ b/.config/zsh/conf/20_autocompletar.zsh @@ -39,7 +39,7 @@ zstyle ':completion:*' verbose yes zstyle ':completion:*' completer _complete _match _approximate zstyle ':completion:*:match:*' original only zstyle ':completion:*:approximate:*' max-errors 1 numeric -zstyle -e ':completion:*:approximate:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3>7?7:($#PREFIX+$#SUFFIX)/3))numeric)' +zstyle -e ':completion:*:approximate:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3>7?7:($#PREFIX+$#SUFFIX)/3))numeric)' zstyle ':completion:*:functions' ignored-patterns '(_*|pre(cmd|exec))' zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters zstyle ':completion:*:*:cd:*:directory-stack' menu yes select @@ -53,9 +53,9 @@ zstyle ':completion:*:(rm|kill|diff):*' ignore-line other zstyle ':completion:*:rm:*' file-patterns '*:all-files' zstyle ':completion:*:*:*:*:processes' command 'ps -u $LOGNAME -o pid,user,command -w' zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;36=0=01' -zstyle ':completion:*:*:kill:*' menu yes select -zstyle ':completion:*:*:kill:*' force-list always -zstyle ':completion:*:*:kill:*' insert-ids single +zstyle ':completion:*:(killall|pkill|kill):*' menu yes select +zstyle ':completion:*:(killall|pkill|kill):*' force-list always +zstyle ':completion:*:(killall|pkill|kill):*' insert-ids single zstyle ':completion:*:man:*' menu yes select zstyle ':completion:*:manuals' separate-sections true zstyle ':completion:*:manuals.(^1*)' insert-sections true diff --git a/.local/bin/bspmonis b/.local/bin/bspmonis index de3281b..ef2669d 100755 --- a/.local/bin/bspmonis +++ b/.local/bin/bspmonis @@ -1,14 +1,13 @@ #!/bin/sh -M=$(bspc query -M --names) -NUM=$(echo "$M" | awk 'END{print NR}') +NUM=$(bspc query -M --names | awk 'END {print NR}') if [ "$NUM" = 1 ]; then bspc monitor -d 1 2 3 4 5 6 7 8 9 10 bspc rule -a Firefox:Navigator state=tiled desktop='^2' elif [ "$NUM" = 2 ]; then - pri=$(echo "$M" | awk NR==1) - sec=$(echo "$M" | awk NR==2) + pri=$(bspc query -M --names | awk NR==1) + sec=$(bspc query -M --names | awk NR==2) bspc monitor "$pri" -d 1 2 3 4 5 bspc monitor "$sec" -d 6 7 8 9 10 bspc rule -a Firefox:Navigator state=tiled desktop='^6' diff --git a/.local/bin/hx b/.local/bin/hx index 5f01ebd..21207f7 100755 --- a/.local/bin/hx +++ b/.local/bin/hx @@ -1,10 +1,6 @@ #!/bin/sh -# Dotfiles on Git -# Instructions here https://news.ycombinator.com/item?id=11070797 -# https://developer.atlassian.com/blog/2016/02/best-way-to-store-dotfiles-git-bare-repo/ - -h() { git --git-dir="$HOME/.local/share/hexagons/" --work-tree="$HOME" "$@"; } +h() { git --git-dir="$XDG_DATA_HOME/hexagons/" --work-tree="$HOME" "$@"; } case $1 in *) h "$@" ;; diff --git a/.local/bin/pantallazo b/.local/bin/pantallazo index 229e1a3..579688b 100755 --- a/.local/bin/pantallazo +++ b/.local/bin/pantallazo @@ -1,13 +1,13 @@ #!/bin/sh -file=$HOME/img/scrot/"$(date +%s)".png +file=$HOME/img/scrot/"$(date +%H_%M)".png vent=$(bspc query -N -n .focused) case "$(printf "Seleccion\\nVentana\\nPantalla\\nCopiar seleccion\\nCopiar ventana\\nCopiar pantalla" | dmenu -w 200 -p " ")" in - "Seleccion") maim -us "$file" ;; - "Ventana") maim -ui "$(printf "%d\n" $vent)" "$file" ;; - "Pantalla") maim -u "$file" ;; - "Copiar seleccion") maim -us | xclip -selection clipboard -t image/png ;; - "Copiar ventana") maim -ui "$(printf "%d\n" "$vent")" | xclip -selection clipboard -t image/png ;; - "Copiar pantalla") maim -u | xclip -selection clipboard -t image/png ;; +"Seleccion") maim -us "$file" ;; +"Ventana") maim -ui "$(printf "%d\n" $vent)" "$file" ;; +"Pantalla") maim -u "$file" ;; +"Copiar seleccion") maim -us | xclip -selection clipboard -t image/png ;; +"Copiar ventana") maim -ui "$(printf "%d\n" "$vent")" | xclip -selection clipboard -t image/png ;; +"Copiar pantalla") maim -u | xclip -selection clipboard -t image/png ;; esac diff --git a/.local/bin/pom b/.local/bin/pom index 6b0e36a..f45ebd9 100755 --- a/.local/bin/pom +++ b/.local/bin/pom @@ -4,8 +4,66 @@ TITLE="Tomatimer!" ICON1="$HOME/img/.icn/tomate1.png" ICON2="$HOME/img/.icn/tomate2.png" BEEP="paplay ~/snd/.notification.ogg" -TIMER=1800 -notify-send "$TITLE" --icon="$ICON2" "Te aviso en $((TIMER/60)) minutos :)" +uso() { + echo "Uso: $(basename "$0") [focus time] [short break] [long break]" +} -eval "(sleep $TIMER && notify-send '$TITLE' --icon=$ICON1 'Hora del recreo. Sali de la compu' && $BEEP &)" +if [ "$1" = "-h" ]; then + uso + exit 0 +fi + +focus_time=${1:-25} +short_break=${2:-5} +long_break=${3:-20} + +# Ensure all arguments are numbers +case $focus_time$short_break$long_break in + *[!0-9]*) + echo "Todos los argumentos deben ser números enteros positivos" >&2 + usage >&2 + exit 1 + ;; +esac + +countdown() { + timer=$(($1 * 60)) + while true; do + # minutos=$((timer / 60)) + # segundos=$((timer - 60*minutes)) + # printf '\e[0K\r' + # printf 'Quedan: %02d:%02d' "$minutos" "$segundos" + + [ $timer -eq 0 ] && break + timer=$((timer - 1)) + sleep 1 + done + # printf '\n' +} + +while true; do + notify-send "$TITLE" --icon="$ICON2" "Concentrate por $focus_time minutos" + countdown "$focus_time" + + notify-send "$TITLE" --icon="$ICON1" "Hace una pausa de $short_break minutos (1/4)" && $BEEP + countdown "$short_break" + + notify-send "$TITLE" --icon="$ICON2" "Concentrate por $focus_time minutos" + countdown "$focus_time" + + notify-send "$TITLE" --icon="$ICON1" "Hace una pausa de $short_break minutos (2/4)" && $BEEP + countdown "$short_break" + + notify-send "$TITLE" --icon="$ICON2" "Concentrate por $focus_time minutos" + countdown "$focus_time" + + notify-send "$TITLE" --icon="$ICON1" "Hace una pausa de $short_break minutos (3/4)" && $BEEP + countdown "$short_break" + + notify-send "$TITLE" --icon="$ICON2" "Concentrate por $focus_time minutos" + countdown "$focus_time" + + notify-send "$TITLE" --icon="$ICON1" "Hora del recreo. Salí de la compu por $long_break minutos (4/4)" && $BEEP + countdown "$long_break" +done diff --git a/.zshenv b/.zshenv index 7f5b23c..da6c2ef 100644 --- a/.zshenv +++ b/.zshenv @@ -13,15 +13,10 @@ export COLORTERM="truecolor" export OPENER="xdg-open" export PAGER="less" export FILE="lf" - export GREP_COLOR="0;32" export TIME_STYLE="long-iso" export BLOCK_SIZE="'1" export QUOTING_STYLE=literal -export HIGHLIGHT_OPTIONS='--out-format="ansi" --style="pablo"' - -export GTK2_RC_FILES="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-2.0/gtkrc-2.0" -export QT_QPA_PLATFORMTHEME="gtk3" export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" export XDG_DATA_HOME="$HOME/.local/share" @@ -44,6 +39,13 @@ export NODE_REPL_HISTORY="${XDG_DATA_HOME:-$HOME/.local/share}/node_repl_history export RANDFILE="${XDG_DATA_HOME:-$HOME/.local/share}/rnd" export GOPATH="${XDG_DATA_HOME:-$HOME/.local/share}/go" export HISTFILE="${XDG_DATA_HOME:-$HOME/.local/share}/bash/history" +export HIGHLIGHT_OPTIONS='--out-format="ansi" --style="pablo"' +export GTK2_RC_FILES="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-2.0/gtkrc-2.0" +export QT_QPA_PLATFORMTHEME="gtk3" +export LYNX_LSS="${XDG_CONFIG_HOME:-$HOME/.config}/lynx.lss" +export NNTPSERVER="news.tilde.club" +export DOTBARE_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/hexagons" +export DOTBARE_TREE="$HOME" _JAVA_OPTIONS="-Djava.util.prefs.userRoot=${XDG_DATA_HOME:-$HOME/.local/share}/java " _JAVA_OPTIONS+="-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true " diff --git a/doc/xbpaketes b/doc/xbpaketes index 408ce4e..3f72f79 100644 --- a/doc/xbpaketes +++ b/doc/xbpaketes @@ -13,7 +13,6 @@ alsa-utils android-udev-rules ansible atool -audacity base-system bat bc @@ -37,7 +36,6 @@ file-roller firefox freepats fzf -gallery-dl gcc git git-extras @@ -56,7 +54,6 @@ hub i3lock-color intel-ucode isync -iwd j4-dmenu-desktop jack-devel jq @@ -80,7 +77,6 @@ libva-intel-driver lm_sensors lynx maim -mblaze mdadm mediainfo mlocate @@ -90,6 +86,7 @@ mpv msmtp ncmpcpp ncurses-term +neomutt neovim neovim-remote newsboat @@ -100,12 +97,10 @@ notmuch noto-fonts-cjk noto-fonts-emoji noto-fonts-ttf -obs openjdk11 p7zip pass patch -pd pinentry-gtk pinentry-tty pkg-config @@ -118,11 +113,13 @@ python3-ansible-lint python3-pip ripgrep rkhunter +rofi runit-nftables setxkbmap shellcheck shfmt simple-mtpfs +slrn snooze socklog-void sxhkd @@ -133,13 +130,12 @@ timidity tmux toilet transmission +tremc udevil ueberzug unclutter-xfixes unrar unzip -vice -vifm void-repo-multilib void-repo-nonfree vsv @@ -159,6 +155,7 @@ xrdb xset xsetroot xss-lock +xtitle xtools xz yarn