From 3b887240d1d9189be7f4adf75f3e71277b7ca833 Mon Sep 17 00:00:00 2001 From: Vikas Kushwaha <dev@vikas.rocks> Date: Sat, 22 Feb 2025 10:11:38 +0530 Subject: after fixing some boot problems --- .config/Zeal/Zeal.conf | 2 +- .config/fd/ignore | 2 + .config/htop/htoprc | 4 +- .config/lf/lfrc | 4 +- .config/mimeapps.list | 1 + .config/nvim/dev.vim | 8 + .config/nvim/init.bak.vim | 225 ---------- .config/nvim/init.vim | 48 +-- .config/nvim/onedark.vim | 713 -------------------------------- .config/nvim/other/fzf.vim | 4 +- .config/nvim/other/out.vim | 36 ++ .config/nvim/out.vim | 36 -- .config/nvim/pack/plugins/opt/fzf | 1 + .config/nvim/pack/plugins/opt/fzf.vim | 1 + .config/shell/aliasrc | 2 +- .config/shell/bm-dirs | 3 +- .config/shell/profile | 13 +- .config/yt-dlp/videos.conf | 2 +- .config/zsh/.zshrc | 9 + .config/zsh/zprofile | 2 +- .local/bin/desktop/setbg | 41 ++ .local/bin/development/dev | 67 +-- .local/bin/development/go-module-rename | 8 + .local/bin/fgrp | 5 +- .local/bin/fmd | 17 +- .local/bin/open | 4 +- .local/bin/setbg | 41 -- 27 files changed, 202 insertions(+), 1097 deletions(-) delete mode 100644 .config/nvim/init.bak.vim delete mode 100644 .config/nvim/onedark.vim create mode 100644 .config/nvim/other/out.vim delete mode 100644 .config/nvim/out.vim create mode 160000 .config/nvim/pack/plugins/opt/fzf create mode 160000 .config/nvim/pack/plugins/opt/fzf.vim create mode 100755 .local/bin/desktop/setbg create mode 100755 .local/bin/development/go-module-rename delete mode 100755 .local/bin/setbg diff --git a/.config/Zeal/Zeal.conf b/.config/Zeal/Zeal.conf index 07ee3ae..303b565 100644 --- a/.config/Zeal/Zeal.conf +++ b/.config/Zeal/Zeal.conf @@ -46,7 +46,7 @@ fuzzy_search_enabled=true [state] splitter_geometry=@ByteArray(\0\0\0\xff\0\0\0\x1\0\0\0\x2\0\0\x1X\0\0\x5P\0\xff\xff\xff\xff\x1\0\0\0\x1\0) toc_splitter_state=@ByteArray() -window_geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0\0\0\0\x1(\0\0\x6m\0\0\x4\x8f\0\0\a\x81\0\0\0\x19\0\0\xf\x87\0\0\x4\x82\0\0\0\0\x2\0\0\0\x6n\0\0\0\0\0\0\x1(\0\0\x6m\0\0\x4\x8f) +window_geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0\0\0\0\x1\xe\0\0\x6m\0\0\x4\x8e\0\0\0\0\0\0\x1\xe\0\0\x6m\0\0\x4\x8e\0\0\0\0\x2\0\0\0\x6n\0\0\0\0\0\0\x1\xe\0\0\x6m\0\0\x4\x8e) [tabs] open_new_tab_after_active=true diff --git a/.config/fd/ignore b/.config/fd/ignore index 5c4b5bc..4bfcd08 100644 --- a/.config/fd/ignore +++ b/.config/fd/ignore @@ -1,3 +1,5 @@ .git node_modules .thumbnails +.stignore +.stfolder diff --git a/.config/htop/htoprc b/.config/htop/htoprc index 1679191..2b5652b 100644 --- a/.config/htop/htoprc +++ b/.config/htop/htoprc @@ -39,14 +39,14 @@ column_meter_modes_0=1 1 1 column_meters_1=RightCPUs Tasks LoadAverage Uptime column_meter_modes_1=1 2 2 2 tree_view=0 -sort_key=46 +sort_key=47 tree_sort_key=0 sort_direction=-1 tree_sort_direction=1 tree_view_always_by_pid=0 all_branches_collapsed=0 screen:Main=PID USER PRIORITY NICE M_VIRT M_RESIDENT M_SHARE STATE PERCENT_CPU PERCENT_MEM TIME Command -.sort_key=PERCENT_CPU +.sort_key=PERCENT_MEM .tree_sort_key=PID .tree_view_always_by_pid=0 .tree_view=0 diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 75ea880..07a1d5e 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -58,7 +58,7 @@ cmd extract ${{ *.tar.gz|*.tgz) tar xzvf "$f" ;; *.tar.xz|*.txz) tar xJvf "$f" ;; *.gz) gunzip "$f" ;; - *.zip) unzip "$f" ;; + *.zip|*.epub) unzip "$f" ;; *.rar) unrar x "$f" ;; *.7z) 7z x "$f" ;; *.zst) unzstd "$f" ;; @@ -120,7 +120,7 @@ map <c-c> select_eval "fzf --reverse --query '/$ ' --header-first --header='Jump map c map d map I :rename; cmd-home -map i :rename +map i :rename; cmd-word-back; cmd-left map a :rename; cmd-right map A :rename; cmd-end map S push A<c-u> diff --git a/.config/mimeapps.list b/.config/mimeapps.list index 308341b..e517c0c 100644 --- a/.config/mimeapps.list +++ b/.config/mimeapps.list @@ -24,3 +24,4 @@ x-scheme-handler/etcher=balena-etcher-electron.desktop text/html=browser.desktop x-scheme-handler/about=browser.desktop x-scheme-handler/unknown=browser.desktop +x-scheme-handler/postman=Postman.desktop diff --git a/.config/nvim/dev.vim b/.config/nvim/dev.vim index 64f70c3..a3b888b 100644 --- a/.config/nvim/dev.vim +++ b/.config/nvim/dev.vim @@ -1,6 +1,12 @@ source ~/.config/nvim/init.vim packadd! onedark.vim +" packadd! fzf +packadd! fzf.vim + +" --> Fzf +source ~/.config/nvim/other/fzf.vim +set rtp+=/usr/share/vim/vimfiles " --> Zeal docs let g:zv_disable_mapping = 1 @@ -90,5 +96,7 @@ if exists('+termguicolors') " autocmd VimEnter * AirlineTheme endif +nnoremap <leader><C-r> :source ~/.config/nvim/dev.vim<CR> + AirlineTheme CocList extensions diff --git a/.config/nvim/init.bak.vim b/.config/nvim/init.bak.vim deleted file mode 100644 index 6057fe4..0000000 --- a/.config/nvim/init.bak.vim +++ /dev/null @@ -1,225 +0,0 @@ -let mapleader=" " - -if ! filereadable(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim"')) - echo "Downloading junegunn/vim-plug to manage plugins..." - silent !mkdir -p ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/ - silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim - autocmd VimEnter * PlugInstall -endif - -call plug#begin(system('echo -n "${XDG_DATA_HOME:-$HOME/.local/share}/nvim/plugged"')) -Plug 'tpope/vim-surround' -Plug 'tpope/vim-commentary' -Plug 'ptzz/lf.vim' -Plug 'voldikss/vim-floaterm' -Plug 'KabbAmine/zeavim.vim' ", {'on': ['Zeavim', 'ZeavimV', 'ZVVisSelection', 'ZVOperator', 'ZVKeyDocset']} -Plug 'neoclide/coc.nvim', {'on': ['CocList', 'CocConfig'], 'branch': 'release'} -Plug 'ap/vim-css-color' " color code highlighting -Plug 'xuhdev/vim-latex-live-preview', {'for': 'tex'} -Plug 'machakann/vim-verdin', {'for': 'vim'} -Plug 'puremourning/vimspector', {'for': 'python'} -" Plug 'powerman/vim-plugin-AnsiEsc' -" Plug 'junegunn/goyo.vim', {'on': 'Goyo'} -" Plug 'jreybert/vimagit' -" Plug 'lukesmithxyz/vimling' -" Plug 'vimwiki/vimwiki' -Plug 'vim-airline/vim-airline', {'on': 'AirlineTheme'} -Plug 'vim-airline/vim-airline-themes', {'on': 'AirlineTheme'} -Plug 'joshdick/onedark.vim' -call plug#end() - -let g:Verdin#autocomplete = 1 -let g:livepreview_previewer = 'zathura' - -set title showmatch nowrap -set mouse=a -set tabstop=2 shiftwidth=0 -set number relativenumber -set cursorline cursorcolumn -set cc=80 -set scrolloff=5 -set splitbelow splitright -set updatetime=500 - -syntax on -filetype plugin indent on -autocmd FileType text setlocal tabstop=8 shiftwidth=4 -autocmd FileType html setlocal tabstop=2 shiftwidth=2 -autocmd FileType sql setlocal commentstring=--\ %s -autocmd BufEnter bm-files,bm-dirs setlocal tabstop=8 shiftwidth=8 -autocmd BufWritePost bm-files,bm-dirs silent !shortcuts -autocmd BufWritePost config.h,config.def.h !cd "%:h"; sudo make clean install -autocmd BufWritePre * %s/\s\+$//e -au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif - -autocmd BufWritePost */Documents/Notes/*.md silent !pandoc % -o "$HOME/Documents/Notes/.out/$(basename % .md).html" -autocmd BufWritePost .Xresources silent !xrdb "%" -autocmd BufRead,BufNewFile *.yt* set filetype=conf - -autocmd TermOpen * startinsert -command! -nargs=* T split | terminal <args> - -" --> Scratch buffer -if exists('g:loaded_scratch') - finish -endif -let g:loaded_scratch = 1 -command! -nargs=1 -complete=command D call scratch#open(<q-args>, <q-mods>) - -" --> Zeal docs -let g:zv_disable_mapping = 1 -nmap <leader>z <Plug>Zeavim -vmap <leader>z <Plug>ZVVisSelection -nmap gz <Plug>ZVOperator -nmap <leader><leader>z <Plug>ZVKeyDocset - -" --> COC -autocmd! User coc.nvim source $HOME/.config/nvim/coc/coc-onload.vim -let g:coc_config_home = '$HOME/.config/nvim/coc' -let g:coc_data_home = '$HOME/.local/share/nvim/site/coc' -let g:coc_global_extensions = [ - \ 'coc-json', - \ 'coc-marketplace', - \ 'coc-css', - \ 'coc-tsserver', - \ 'coc-pyright', - \ 'coc-java', - \ 'coc-sh', - \ ] -nnoremap <silent><nowait> <leader>ca :<C-u>CocList diagnostics<cr> -nnoremap <silent><nowait> <leader>ce :<C-u>CocList extensions<cr> -nnoremap <silent><nowait> <leader>cc :<C-u>CocList commands<cr> -nnoremap <silent><nowait> <leader>co :<C-u>CocList outline<cr> -nnoremap <silent><nowait> <leader>cs :<C-u>CocList -I symbols<cr> -nnoremap <silent><nowait> <leader>cj :<C-u>CocNext<CR> -nnoremap <silent><nowait> <leader>ck :<C-u>CocPrev<CR> -nnoremap <silent><nowait> <leader>cp :<C-u>CocListResume<CR> -nnoremap <leader>cm :CocList marketplace<CR> - -" --> Vimspector -let g:vimspector_base_dir = expand('$HOME/.local/share/nvim/vimspector') -let g:vimspector_enable_mappings = 'HUMAN' -nnoremap <leader>dc <Plug>VimspectorContinue -nnoremap <leader>ds <Plug>VimspectorStop -nnoremap <leader>dr <Plug>VimspectorRestart -nnoremap <leader>dp <Plug>VimspectorPause -nnoremap <leader>dl <Plug>VimspectorBreakpoints -nnoremap <leader>dd <Plug>VimspectorToggleBreakpoint -nnoremap <leader>db <Plug>VimspectorToggleConditionalBreakpoint -nnoremap <leader>df <Plug>VimspectorAddFunctionBreakpoint -nnoremap <leader>dg <Plug>VimspectorGoToCurrentLine -nnoremap <leader>dx :call vimspector#ClearBreakpoints()<CR> -nnoremap <leader>dq :VimspectorReset<CR> -nnoremap <A-C> <Plug>VimspectorContinue -nnoremap <A-n> <Plug>VimspectorStepOver -nnoremap <A-i> <Plug>VimspectorStepInto -nnoremap <A-o> <Plug>VimspectorStepOut -nnoremap <A-b> <Plug>VimspectorToggleBreakpoint -nnoremap <A-c> <Plug>VimspectorRunToCursor - -" --> Lf -" let g:lf_command_override = 'lf -command ...' -let g:NERDTreeHijackNetrw = 0 -" let g:lf_replace_netrw = 1 -let g:lf_width = 1.0 -let g:lf_height = 1.0 -let g:lf_map_keys = 0 -nnoremap <Esc>o :LfCurrentFile<CR> -nnoremap <Esc>l :LfWorkingDirectory<CR> -nnoremap <leader>o :LfCurrentFileNewTab<CR> -nnoremap <leader>l :LfWorkingDirectoryExistingOrNewTab<CR> - -" --> onedark theme -if exists('+termguicolors') && filereadable(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/onedark.vim"')) - let g:airline_theme = 'onedark' - let g:onedark_terminal_italics = 1 - let g:onedark_color_overrides = { - \ "foreground": { "gui": "#BBC2CF", "cterm": "145", "cterm16": "NONE" }, - \ "background": { "gui": "#181C24", "cterm": "235", "cterm16": "NONE" }, - \ "comment_grey": { "gui": "#6C7380", "cterm": "59", "cterm16": "7" }, - \ "gutter_fg_grey": { "gui": "#6272A4", "cterm": "238", "cterm16": "8" }, - \ "special_grey": { "gui": "#5Ba078", "cterm": "238", "cterm16": "7" }, - \ } - " \ "background": { "gui": "#202426", "cterm": "235", "cterm16": "NONE" }, - " - " \ "red": { "gui": "#E06C75", "cterm": "204", "cterm16": "1" }, - " \ "dark_red": { "gui": "#BE5046", "cterm": "196", "cterm16": "9" }, - " \ "green": { "gui": "#98C379", "cterm": "114", "cterm16": "2" }, - " \ "yellow": { "gui": "#E5C07B", "cterm": "180", "cterm16": "3" }, - " \ "dark_yellow": { "gui": "#D19A66", "cterm": "173", "cterm16": "11" }, - " \ "blue": { "gui": "#61AFEF", "cterm": "39", "cterm16": "4" }, - " \ "purple": { "gui": "#C678DD", "cterm": "170", "cterm16": "5" }, - " \ "cyan": { "gui": "#56B6C2", "cterm": "38", "cterm16": "6" }, - " \ "black": { "gui": "#282C34", "cterm": "235", "cterm16": "0" }, - " \ "white": { "gui": "#ABB2BF", "cterm": "145", "cterm16": "15" }, - " \ "cursor_grey": { "gui": "#2C323C", "cterm": "236", "cterm16": "0" }, - " \ "visual_grey": { "gui": "#3E4452", "cterm": "237", "cterm16": "8" }, - " \ "menu_grey": { "gui": "#3E4452", "cterm": "237", "cterm16": "7" }, - " \ "vertsplit": { "gui": "#3E4452", "cterm": "59", "cterm16": "7" }, - - " autocmd ColorScheme * call onedark#extend_highlight("LineNr", { - " \ "fg": { "gui": "#6272A4", "cterm": "238", "cterm16": "8" }, - " \ }) - let &t_8f="\<Esc>[38;2;%lu;%lu;%lum" - let &t_8b="\<Esc>[48;2;%lu;%lu;%lum" - set termguicolors noshowmode - colorscheme onedark - autocmd VimEnter * AirlineTheme -endif - -if !exists('g:lasttab') - let g:lasttab = 1 -endif -nmap g; :exe "tabn ".g:lasttab<CR> -au TabLeave * let g:lasttab = tabpagenr() -nnoremap g1 1gt -nnoremap g2 2gt -nnoremap g3 3gt -nnoremap g4 4gt -nnoremap g5 5gt -nnoremap g6 6gt -nnoremap g7 7gt -nnoremap g8 8gt -nnoremap g9 :tablast<CR> - -vnoremap <C-c> "*y :let @+=@*<CR> -vnoremap <C-A-c> "*d :let @+=@*<CR> -noremap <C-p> "+p -noremap <C-A-p> "+P - -nnoremap c "_c -inoremap jk <Esc> -" map ;n /<++><Enter>c4l -imap ;n <Esc>/<++><Enter>c4l - -autocmd FileType html,markdown inoremap ;s ><Esc>bi<<Esc>ea -autocmd FileType html,markdown inoremap ;c ><Esc>bi</<Esc>ea -autocmd FileType html,markdown inoremap ;i <Esc>b"tywi<<Esc>ea><++></><CR><++><Esc>k$P2F>i -autocmd FileType html,markdown inoremap ;l <Esc>b"tywi<<Esc>ea></><CR><++><Esc>k$PF<i -autocmd FileType html,markdown inoremap ;b <Esc>b"tywi<<Esc>ea><CR><++><CR></><CR><++><Esc>k$P2k$i -autocmd FileType html,markdown inoremap ;ap <p><CR><++><CR></p><CR><++><Esc>3k$i -autocmd FileType html,markdown inoremap ;aa <a href=""><CR><++><CR></a><CR><++><Esc>3k$hi - -nnoremap <leader>fl :w<CR>:!dev lint "%"<CR> -nnoremap <leader>fm :w<CR>:!dev format "%"<CR> -nnoremap <leader>fc :w<CR>:!dev compile "%"<CR> -nnoremap <leader>fr :w<CR>:!dev run "%"<CR> -nnoremap <leader>ft :w<CR>:!dev test "%"<CR> - -autocmd BufEnter * nmap <leader>t :w<CR>:se nornu<CR>:!dev test "%"<CR>:se rnu<CR> -autocmd BufEnter * nmap <leader>T :w<CR>:se nornu<CR>:T dev test "%"<CR> -autocmd BufEnter * imap <F5> <Esc>:w<CR>:se nornu<CR>:T dev test "%"<CR> - -nnoremap <leader>w :set wrap!<CR> -nnoremap <leader>p :!opout "%:p"<CR> -nnoremap <leader>F :Goyo<CR> -nnoremap <leader>O :T mimeopen --ask %<CR> -nnoremap <leader>ec :tabnew ~/.config/nvim/init.vim<CR> -nnoremap <leader><C-r> :source ~/.config/nvim/init.vim<CR> -nnoremap <leader>s :%s//gc<Left><Left><Left> -nnoremap <leader>r :w<CR>:!%:p<CR> -nnoremap <leader>R :w<CR>:T %:p<CR> - -nnoremap <leader>gc :T git add --all && git commit<CR> - -source ~/.config/nvim/shortcuts.vim diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 8001758..9261061 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -17,21 +17,15 @@ if filereadable(config_dir . "autoload/plug.vim") Plug 'xuhdev/vim-latex-live-preview', {'for': 'tex'} Plug 'ap/vim-css-color' " color code highlighting Plug 'neoclide/coc.nvim', {'on': ['CocList', 'CocConfig'], 'branch': 'release'} - " Plug 'KabbAmine/zeavim.vim' ", {'on': ['Zeavim', 'ZeavimV', 'ZVVisSelection', 'ZVOperator', 'ZVKeyDocset']} " Plug 'machakann/vim-verdin', {'for': 'vim'} + " Plug 'fatih/vim-go', {'for': 'go'} " Plug 'puremourning/vimspector', {'for': 'python'} - " Plug 'powerman/vim-plugin-AnsiEsc' - " Plug 'junegunn/goyo.vim', {'on': 'Goyo'} " Plug 'jreybert/vimagit' - " Plug 'lukesmithxyz/vimling' - " Plug 'vimwiki/vimwiki' Plug 'vim-airline/vim-airline', {'on': 'AirlineTheme'} - Plug 'vim-airline/vim-airline-themes', {'on': 'AirlineTheme'} - " Plug 'joshdick/onedark.vim' - Plug 'pangloss/vim-javascript' - Plug 'leafgarland/typescript-vim' - Plug 'peitalin/vim-jsx-typescript' + " Plug 'pangloss/vim-javascript' + " Plug 'leafgarland/typescript-vim' + " Plug 'peitalin/vim-jsx-typescript' " Plug 'styled-components/vim-styled-components', { 'branch': 'main' } " Plug 'jparise/vim-graphql' @@ -63,7 +57,8 @@ autocmd FileType sql setlocal commentstring=--\ %s autocmd BufEnter bm-files,bm-dirs setlocal tabstop=8 shiftwidth=8 autocmd BufWritePost bm-files,bm-dirs silent !shortcuts autocmd VimLeave *.tex !dev clean "%" -" autocmd BufWritePost config.h,config.def.h !cd "%:h"; rm -f config.h; sudo make install +autocmd BufWritePost config.def.h !cd "%:h"; rm -f config.h; sudo make install +autocmd BufWritePost config.h !cd "%:h"; sudo make install autocmd BufWritePre * %s/\s\+$//e au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif @@ -98,10 +93,10 @@ let g:NERDTreeHijackNetrw = 0 let g:lf_width = 1.0 let g:lf_height = 1.0 let g:lf_map_keys = 0 -nnoremap <Esc>o :LfCurrentFile<CR> -nnoremap <Esc>l :LfWorkingDirectory<CR> -nnoremap <leader>o :LfCurrentFileNewTab<CR> -nnoremap <leader>l :LfWorkingDirectoryExistingOrNewTab<CR> +nnoremap <Esc>l :LfCurrentFile<CR> +nnoremap <Esc>o :LfWorkingDirectory<CR> +nnoremap <leader>l :LfCurrentFileNewTab<CR> +nnoremap <leader>o :LfWorkingDirectoryExistingOrNewTab<CR> if !exists('g:lasttab') let g:lasttab = 1 @@ -129,14 +124,14 @@ inoremap jk <Esc> inoremap ;n <Esc>/<++><Enter>c4l nnoremap <leader>n /<++><Enter>c4l -autocmd FileType html,markdown inoremap ;s ><Esc>bi<<Esc>ea -autocmd FileType html,markdown inoremap ;c ><Esc>bi</<Esc>ea -autocmd FileType html,markdown inoremap ;i <Esc>b"tywi<<Esc>ea></><Esc>PF<i -autocmd FileType html,markdown inoremap ;I <Esc>b"tywi<<Esc>ea><++></><Esc>P2F>i<Space> -autocmd FileType html,markdown inoremap ;b <Esc>b"tywi<<Esc>ea><CR></<Esc>"tpa><CR><++><Esc>kO -autocmd FileType html,markdown inoremap ;B <Esc>b"tywi<<Esc>ea><CR><++><CR></<Esc>"tpa><CR><++><Esc>3k$i<Space> -autocmd FileType html,markdown inoremap ;ap <p><CR><++><CR></p><CR><++><Esc>3k$i -autocmd FileType html,markdown inoremap ;aa <a href=""><CR><++><CR></a><CR><++><Esc>3k$hi +autocmd FileType html,markdown,template inoremap ;s ><Esc>bi<<Esc>ea +autocmd FileType html,markdown,template inoremap ;c ><Esc>bi</<Esc>ea +autocmd FileType html,markdown,template inoremap ;i <Esc>b"tywi<<Esc>ea></><Esc>PF<i +autocmd FileType html,markdown,template inoremap ;I <Esc>b"tywi<<Esc>ea><++></><Esc>P2F>i<Space> +autocmd FileType html,markdown,template inoremap ;b <Esc>b"tywi<<Esc>ea><CR></<Esc>"tpa><CR><++><Esc>kO +autocmd FileType html,markdown,template inoremap ;B <Esc>b"tywi<<Esc>ea><CR><++><CR></<Esc>"tpa><CR><++><Esc>3k$i<Space> +autocmd FileType html,markdown,template inoremap ;ap <p><CR><++><CR></p><CR><++><Esc>3k$i +autocmd FileType html,markdown,template inoremap ;aa <a href=""><CR><++><CR></a><CR><++><Esc>3k$hi autocmd FileType tex inoremap ;b <Esc>b"tywi\begin{<Esc>ea}<CR>\end{<Esc>"tpa}<Esc>kA autocmd FileType tex inoremap ;s \section{}<Esc>i @@ -151,9 +146,11 @@ autocmd FileType go inoremap ;ae err<Space>:=<Space><++><CR>if<Space>err<Space>! nnoremap <leader>fl :w<CR>:!dev lint "%"<CR> nnoremap <leader>fm :w<CR>:%!dev format "%"<CR> +nnoremap <leader>fM :w<CR>:%!dev minify "%"<CR> nnoremap <leader>fc :w<CR>:!dev compile "%"<CR> nnoremap <leader>fe :w<CR>:!dev run "%"<CR> nnoremap <leader>ft :w<CR>:!dev test "%"<CR> +nnoremap <leader>fb :w<CR>:!dev build "%"<CR> nnoremap <leader>fr :w<CR>:!dev clean "%"<CR> nnoremap <leader>Fl :w<CR>:T dev lint "%"<CR> @@ -163,9 +160,10 @@ nnoremap <leader>Fe :w<CR>:T dev run "%"<CR> nnoremap <leader>Ft :w<CR>:T dev test "%"<CR> nnoremap <leader>Fr :w<CR>:T dev clean "%"<CR> +autocmd BufEnter * nmap <leader>b :w<CR>:se nornu<CR>:!dev build "%"<CR>:se rnu<CR> +autocmd BufEnter * nmap <leader>B :w<CR>:se nornu<CR>:T dev build "%"<CR> autocmd BufEnter * nmap <leader>t :w<CR>:se nornu<CR>:!dev test "%"<CR>:se rnu<CR> autocmd BufEnter * nmap <leader>T :w<CR>:se nornu<CR>:T dev test "%"<CR> -autocmd BufEnter * imap <F5> <Esc>:w<CR>:se nornu<CR>:T dev test "%"<CR> autocmd BufEnter vartak-results-data.pl nmap <leader>t :w<CR>:se nornu<CR>:!vartak-results-data.pl ~/GDrive/vartak/results/university/1S002557.pdf<CR>:se rnu<CR> @@ -174,8 +172,6 @@ nnoremap <leader>fo :!opout "%:p"<CR> nnoremap <leader>ec :tabnew ~/.config/nvim/init.vim<CR> nnoremap <leader><C-r> :source ~/.config/nvim/init.vim<CR> nnoremap <leader>s :%s//gc<Left><Left><Left> -nnoremap <leader>r :w<CR>:!%:p<CR> -nnoremap <leader>R :w<CR>:T %:p<CR> nnoremap <leader>gc :T git add --all && git commit<CR> diff --git a/.config/nvim/onedark.vim b/.config/nvim/onedark.vim deleted file mode 100644 index 6769d6c..0000000 --- a/.config/nvim/onedark.vim +++ /dev/null @@ -1,713 +0,0 @@ -" vim:fdm=marker -" Vim Color File -" Name: onedark.vim -" Maintainer: https://github.com/joshdick/onedark.vim/ -" License: The MIT License (MIT) -" Based On: https://github.com/MaxSt/FlatColor/ - -" Companion statusline plugin and terminal themes are included with onedark.vim: -" * https://github.com/joshdick/onedark.vim#lightlinevim-colorscheme -" * https://github.com/joshdick/onedark.vim#vim-airline-theme -" * https://github.com/joshdick/onedark.vim/tree/main/term - -" Color Reference {{{ - -" The following colors were measured inside Atom using its built-in inspector. - -" +---------------------------------------------+ -" | Color Name | RGB | Hex | -" |--------------+--------------------+---------| -" | Black | rgb(40, 44, 52) | #282c34 | -" |--------------+--------------------+---------| -" | White | rgb(171, 178, 191) | #abb2bf | -" |--------------+--------------------+---------| -" | Light Red | rgb(224, 108, 117) | #e06c75 | -" |--------------+--------------------+---------| -" | Dark Red | rgb(190, 80, 70) | #be5046 | -" |--------------+--------------------+---------| -" | Green | rgb(152, 195, 121) | #98c379 | -" |--------------+--------------------+---------| -" | Light Yellow | rgb(229, 192, 123) | #e5c07b | -" |--------------+--------------------+---------| -" | Dark Yellow | rgb(209, 154, 102) | #d19a66 | -" |--------------+--------------------+---------| -" | Blue | rgb(97, 175, 239) | #61afef | -" |--------------+--------------------+---------| -" | Magenta | rgb(198, 120, 221) | #c678dd | -" |--------------+--------------------+---------| -" | Cyan | rgb(86, 182, 194) | #56b6c2 | -" |--------------+--------------------+---------| -" | Gutter Grey | rgb(76, 82, 99) | #4b5263 | -" |--------------+--------------------+---------| -" | Comment Grey | rgb(92, 99, 112) | #5c6370 | -" +---------------------------------------------+ - -" }}} - -" Initialization {{{ - -highlight clear - -if exists("syntax_on") - syntax reset -endif - -set t_Co=256 - -let g:colors_name="onedark" - -" Set to "256" for 256-color terminals, or -" set to "16" to use your terminal emulator's native colors -" (a 16-color palette for this color scheme is available; see -" < https://github.com/joshdick/onedark.vim/blob/main/README.md > -" for more information.) -if !exists("g:onedark_termcolors") - let g:onedark_termcolors = 256 -endif - -" Not all terminals support italics properly. If yours does, opt-in. -if !exists("g:onedark_terminal_italics") - let g:onedark_terminal_italics = 0 -endif - -" This function is based on one from FlatColor: https://github.com/MaxSt/FlatColor/ -" Which in turn was based on one found in hemisu: https://github.com/noahfrederick/vim-hemisu/ -let s:group_colors = {} " Cache of default highlight group settings, for later reference via `onedark#extend_highlight` -function! s:h(group, style, ...) - if (a:0 > 0) " Will be true if we got here from onedark#extend_highlight - let s:highlight = s:group_colors[a:group] - for style_type in ["fg", "bg", "sp"] - if (has_key(a:style, style_type)) - let l:default_style = (has_key(s:highlight, style_type) ? copy(s:highlight[style_type]) : { "cterm16": "NONE", "cterm": "NONE", "gui": "NONE" }) - let s:highlight[style_type] = extend(l:default_style, a:style[style_type]) - endif - endfor - if (has_key(a:style, "gui")) - let s:highlight.gui = a:style.gui - endif - if (has_key(a:style, "cterm")) - let s:highlight.cterm = a:style.cterm - endif - else - let s:highlight = a:style - let s:group_colors[a:group] = s:highlight " Cache default highlight group settings - endif - - if g:onedark_terminal_italics == 0 - if has_key(s:highlight, "cterm") && s:highlight["cterm"] == "italic" - unlet s:highlight.cterm - endif - if has_key(s:highlight, "gui") && s:highlight["gui"] == "italic" - unlet s:highlight.gui - endif - endif - - if g:onedark_termcolors == 16 - let l:ctermfg = (has_key(s:highlight, "fg") ? s:highlight.fg.cterm16 : "NONE") - let l:ctermbg = (has_key(s:highlight, "bg") ? s:highlight.bg.cterm16 : "NONE") - else - let l:ctermfg = (has_key(s:highlight, "fg") ? s:highlight.fg.cterm : "NONE") - let l:ctermbg = (has_key(s:highlight, "bg") ? s:highlight.bg.cterm : "NONE") - endif - - execute "highlight" a:group - \ "guifg=" (has_key(s:highlight, "fg") ? s:highlight.fg.gui : "NONE") - \ "guibg=" (has_key(s:highlight, "bg") ? s:highlight.bg.gui : "NONE") - \ "guisp=" (has_key(s:highlight, "sp") ? s:highlight.sp.gui : "NONE") - \ "gui=" (has_key(s:highlight, "gui") ? s:highlight.gui : "NONE") - \ "ctermfg=" . l:ctermfg - \ "ctermbg=" . l:ctermbg - \ "cterm=" (has_key(s:highlight, "cterm") ? s:highlight.cterm : "NONE") -endfunction - -" public {{{ - -function! onedark#set_highlight(group, style) - call s:h(a:group, a:style) -endfunction - -function! onedark#extend_highlight(group, style) - call s:h(a:group, a:style, 1) -endfunction - -" }}} - -" }}} - -" Color Variables {{{ - -let s:colors = onedark#GetColors() - -let s:red = s:colors.red -let s:dark_red = s:colors.dark_red -let s:green = s:colors.green -let s:yellow = s:colors.yellow -let s:dark_yellow = s:colors.dark_yellow -let s:blue = s:colors.blue -let s:purple = s:colors.purple -let s:cyan = s:colors.cyan -let s:white = s:colors.white -let s:black = s:colors.black -let s:foreground = s:colors.foreground -let s:background = s:colors.background -let s:comment_grey = s:colors.comment_grey -let s:gutter_fg_grey = s:colors.gutter_fg_grey -let s:cursor_grey = s:colors.cursor_grey -let s:visual_grey = s:colors.visual_grey -let s:menu_grey = s:colors.menu_grey -let s:special_grey = s:colors.special_grey -let s:vertsplit = s:colors.vertsplit - -" }}} - -" Terminal Colors {{{ - -if has('nvim') - let g:terminal_color_0 = s:black.gui - let g:terminal_color_1 = s:red.gui - let g:terminal_color_2 = s:green.gui - let g:terminal_color_3 = s:yellow.gui - let g:terminal_color_4 = s:blue.gui - let g:terminal_color_5 = s:purple.gui - let g:terminal_color_6 = s:cyan.gui - let g:terminal_color_7 = s:comment_grey.gui - let g:terminal_color_8 = s:visual_grey.gui - let g:terminal_color_9 = s:red.gui - let g:terminal_color_10 = s:green.gui - let g:terminal_color_11 = s:yellow.gui - let g:terminal_color_12 = s:blue.gui - let g:terminal_color_13 = s:purple.gui - let g:terminal_color_14 = s:cyan.gui - let g:terminal_color_15 = s:white.gui -else - let g:terminal_ansi_colors = [ - \ s:black.gui, s:red.gui, s:green.gui, s:yellow.gui, - \ s:blue.gui, s:purple.gui, s:cyan.gui, s:comment_grey.gui, - \ s:visual_grey.gui, s:red.gui, s:green.gui, s:yellow.gui, - \ s:blue.gui, s:purple.gui, s:cyan.gui, s:white.gui - \] -endif - -" }}} - -" Syntax Groups (descriptions and ordering from `:h w18`) {{{ - -call s:h("Comment", { "fg": s:comment_grey, "gui": "italic", "cterm": "italic" }) " any comment -call s:h("Constant", { "fg": s:cyan }) " any constant -call s:h("String", { "fg": s:green }) " a string constant: "this is a string" -call s:h("Character", { "fg": s:green }) " a character constant: 'c', '\n' -call s:h("Number", { "fg": s:dark_yellow }) " a number constant: 234, 0xff -call s:h("Boolean", { "fg": s:dark_yellow }) " a boolean constant: TRUE, false -call s:h("Float", { "fg": s:dark_yellow }) " a floating point constant: 2.3e10 -call s:h("Identifier", { "fg": s:red }) " any variable name -call s:h("Function", { "fg": s:blue }) " function name (also: methods for classes) -call s:h("Statement", { "fg": s:purple }) " any statement -call s:h("Conditional", { "fg": s:purple }) " if, then, else, endif, switch, etc. -call s:h("Repeat", { "fg": s:purple }) " for, do, while, etc. -call s:h("Label", { "fg": s:purple }) " case, default, etc. -call s:h("Operator", { "fg": s:purple }) " sizeof", "+", "*", etc. -call s:h("Keyword", { "fg": s:purple }) " any other keyword -call s:h("Exception", { "fg": s:purple }) " try, catch, throw -call s:h("PreProc", { "fg": s:yellow }) " generic Preprocessor -call s:h("Include", { "fg": s:blue }) " preprocessor #include -call s:h("Define", { "fg": s:purple }) " preprocessor #define -call s:h("Macro", { "fg": s:purple }) " same as Define -call s:h("PreCondit", { "fg": s:yellow }) " preprocessor #if, #else, #endif, etc. -call s:h("Type", { "fg": s:yellow }) " int, long, char, etc. -call s:h("StorageClass", { "fg": s:yellow }) " static, register, volatile, etc. -call s:h("Structure", { "fg": s:yellow }) " struct, union, enum, etc. -call s:h("Typedef", { "fg": s:yellow }) " A typedef -call s:h("Special", { "fg": s:blue }) " any special symbol -call s:h("SpecialChar", { "fg": s:dark_yellow }) " special character in a constant -call s:h("Tag", {}) " you can use CTRL-] on this -call s:h("Delimiter", {}) " character that needs attention -call s:h("SpecialComment", { "fg": s:comment_grey }) " special things inside a comment -call s:h("Debug", {}) " debugging statements -call s:h("Underlined", { "gui": "underline", "cterm": "underline" }) " text that stands out, HTML links -call s:h("Ignore", {}) " left blank, hidden -call s:h("Error", { "fg": s:red }) " any erroneous construct -call s:h("Todo", { "fg": s:purple }) " anything that needs extra attention; mostly the keywords TODO FIXME and XXX - -" }}} - -" Highlighting Groups (descriptions and ordering from `:h highlight-groups`) {{{ -call s:h("ColorColumn", { "bg": s:cursor_grey }) " used for the columns set with 'colorcolumn' -call s:h("Conceal", {}) " placeholder characters substituted for concealed text (see 'conceallevel') -call s:h("Cursor", { "fg": s:black, "bg": s:blue }) " the character under the cursor -call s:h("CursorIM", {}) " like Cursor, but used when in IME mode -call s:h("CursorColumn", { "bg": s:cursor_grey }) " the screen column that the cursor is in when 'cursorcolumn' is set -if &diff - " Don't change the background color in diff mode - call s:h("CursorLine", { "gui": "underline" }) " the screen line that the cursor is in when 'cursorline' is set -else - call s:h("CursorLine", { "bg": s:cursor_grey }) " the screen line that the cursor is in when 'cursorline' is set -endif -call s:h("Directory", { "fg": s:blue }) " directory names (and other special names in listings) -call s:h("DiffAdd", { "bg": s:green, "fg": s:black }) " diff mode: Added line -call s:h("DiffChange", { "fg": s:yellow, "gui": "underline", "cterm": "underline" }) " diff mode: Changed line -call s:h("DiffDelete", { "bg": s:red, "fg": s:black }) " diff mode: Deleted line -call s:h("DiffText", { "bg": s:yellow, "fg": s:black }) " diff mode: Changed text within a changed line -if get(g:, 'onedark_hide_endofbuffer', 0) - " If enabled, will style end-of-buffer filler lines (~) to appear to be hidden. - call s:h("EndOfBuffer", { "fg": s:black }) " filler lines (~) after the last line in the buffer -endif -call s:h("ErrorMsg", { "fg": s:red }) " error messages on the command line -call s:h("VertSplit", { "fg": s:vertsplit }) " the column separating vertically split windows -call s:h("Folded", { "fg": s:comment_grey }) " line used for closed folds -call s:h("FoldColumn", {}) " 'foldcolumn' -call s:h("SignColumn", {}) " column where signs are displayed -call s:h("IncSearch", { "fg": s:yellow, "bg": s:comment_grey }) " 'incsearch' highlighting; also used for the text replaced with ":s///c" -call s:h("LineNr", { "fg": s:gutter_fg_grey }) " Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set. -call s:h("CursorLineNr", {}) " Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line. -call s:h("MatchParen", { "fg": s:blue, "gui": "underline", "cterm": "underline" }) " The character under the cursor or just before it, if it is a paired bracket, and its match. -call s:h("ModeMsg", {}) " 'showmode' message (e.g., "-- INSERT --") -call s:h("MoreMsg", {}) " more-prompt -call s:h("NonText", { "fg": s:special_grey }) " '~' and '@' at the end of the window, characters from 'showbreak' and other characters that do not really exist in the text (e.g., ">" displayed when a double-wide character doesn't fit at the end of the line). -call s:h("Normal", { "fg": s:foreground, "bg": s:background }) " normal text -call s:h("Pmenu", { "fg": s:white, "bg": s:menu_grey }) " Popup menu: normal item. -call s:h("PmenuSel", { "fg": s:cursor_grey, "bg": s:blue }) " Popup menu: selected item. -call s:h("PmenuSbar", { "bg": s:cursor_grey }) " Popup menu: scrollbar. -call s:h("PmenuThumb", { "bg": s:white }) " Popup menu: Thumb of the scrollbar. -call s:h("Question", { "fg": s:purple }) " hit-enter prompt and yes/no questions -call s:h("QuickFixLine", { "fg": s:black, "bg": s:yellow }) " Current quickfix item in the quickfix window. -call s:h("Search", { "fg": s:black, "bg": s:yellow }) " Last search pattern highlighting (see 'hlsearch'). Also used for similar items that need to stand out. -call s:h("SpecialKey", { "fg": s:special_grey }) " Meta and special keys listed with ":map", also for text used to show unprintable characters in the text, 'listchars'. Generally: text that is displayed differently from what it really is. -call s:h("SpellBad", { "fg": s:red, "gui": "underline", "cterm": "underline" }) " Word that is not recognized by the spellchecker. This will be combined with the highlighting used otherwise. -call s:h("SpellCap", { "fg": s:dark_yellow }) " Word that should start with a capital. This will be combined with the highlighting used otherwise. -call s:h("SpellLocal", { "fg": s:dark_yellow }) " Word that is recognized by the spellchecker as one that is used in another region. This will be combined with the highlighting used otherwise. -call s:h("SpellRare", { "fg": s:dark_yellow }) " Word that is recognized by the spellchecker as one that is hardly ever used. spell This will be combined with the highlighting used otherwise. -call s:h("StatusLine", { "fg": s:white, "bg": s:cursor_grey }) " status line of current window -call s:h("StatusLineNC", { "fg": s:comment_grey }) " status lines of not-current windows Note: if this is equal to "StatusLine" Vim will use "^^^" in the status line of the current window. -call s:h("StatusLineTerm", { "fg": s:white, "bg": s:cursor_grey }) " status line of current :terminal window -call s:h("StatusLineTermNC", { "fg": s:comment_grey }) " status line of non-current :terminal window -call s:h("TabLine", { "fg": s:comment_grey }) " tab pages line, not active tab page label -call s:h("TabLineFill", {}) " tab pages line, where there are no labels -call s:h("TabLineSel", { "fg": s:white }) " tab pages line, active tab page label -call s:h("Terminal", { "fg": s:white, "bg": s:black }) " terminal window (see terminal-size-color) -call s:h("Title", { "fg": s:green }) " titles for output from ":set all", ":autocmd" etc. -call s:h("Visual", { "bg": s:visual_grey }) " Visual mode selection -call s:h("VisualNOS", { "bg": s:visual_grey }) " Visual mode selection when vim is "Not Owning the Selection". Only X11 Gui's gui-x11 and xterm-clipboard supports this. -call s:h("WarningMsg", { "fg": s:yellow }) " warning messages -call s:h("WildMenu", { "fg": s:black, "bg": s:blue }) " current match in 'wildmenu' completion - -" }}} - -" Termdebug highlighting for Vim 8.1+ {{{ - -" See `:h hl-debugPC` and `:h hl-debugBreakpoint`. -call s:h("debugPC", { "bg": s:special_grey }) " the current position -call s:h("debugBreakpoint", { "fg": s:black, "bg": s:red }) " a breakpoint - -" }}} - -" Language-Specific Highlighting {{{ - -" CSS -call s:h("cssAttrComma", { "fg": s:purple }) -call s:h("cssAttributeSelector", { "fg": s:green }) -call s:h("cssBraces", { "fg": s:white }) -call s:h("cssClassName", { "fg": s:dark_yellow }) -call s:h("cssClassNameDot", { "fg": s:dark_yellow }) -call s:h("cssDefinition", { "fg": s:purple }) -call s:h("cssFontAttr", { "fg": s:dark_yellow }) -call s:h("cssFontDescriptor", { "fg": s:purple }) -call s:h("cssFunctionName", { "fg": s:blue }) -call s:h("cssIdentifier", { "fg": s:blue }) -call s:h("cssImportant", { "fg": s:purple }) -call s:h("cssInclude", { "fg": s:white }) -call s:h("cssIncludeKeyword", { "fg": s:purple }) -call s:h("cssMediaType", { "fg": s:dark_yellow }) -call s:h("cssProp", { "fg": s:white }) -call s:h("cssPseudoClassId", { "fg": s:dark_yellow }) -call s:h("cssSelectorOp", { "fg": s:purple }) -call s:h("cssSelectorOp2", { "fg": s:purple }) -call s:h("cssTagName", { "fg": s:red }) - -" Fish Shell -call s:h("fishKeyword", { "fg": s:purple }) -call s:h("fishConditional", { "fg": s:purple }) - -" Go -call s:h("goDeclaration", { "fg": s:purple }) -call s:h("goBuiltins", { "fg": s:cyan }) -call s:h("goFunctionCall", { "fg": s:blue }) -call s:h("goVarDefs", { "fg": s:red }) -call s:h("goVarAssign", { "fg": s:red }) -call s:h("goVar", { "fg": s:purple }) -call s:h("goConst", { "fg": s:purple }) -call s:h("goType", { "fg": s:yellow }) -call s:h("goTypeName", { "fg": s:yellow }) -call s:h("goDeclType", { "fg": s:cyan }) -call s:h("goTypeDecl", { "fg": s:purple }) - -" HTML (keep consistent with Markdown, below) -call s:h("htmlArg", { "fg": s:dark_yellow }) -call s:h("htmlBold", { "fg": s:dark_yellow, "gui": "bold", "cterm": "bold" }) -call s:h("htmlBoldItalic", { "fg": s:green, "gui": "bold,italic", "cterm": "bold,italic" }) -call s:h("htmlEndTag", { "fg": s:white }) -call s:h("htmlH1", { "fg": s:red }) -call s:h("htmlH2", { "fg": s:red }) -call s:h("htmlH3", { "fg": s:red }) -call s:h("htmlH4", { "fg": s:red }) -call s:h("htmlH5", { "fg": s:red }) -call s:h("htmlH6", { "fg": s:red }) -call s:h("htmlItalic", { "fg": s:purple, "gui": "italic", "cterm": "italic" }) -call s:h("htmlLink", { "fg": s:cyan, "gui": "underline", "cterm": "underline" }) -call s:h("htmlSpecialChar", { "fg": s:dark_yellow }) -call s:h("htmlSpecialTagName", { "fg": s:red }) -call s:h("htmlTag", { "fg": s:white }) -call s:h("htmlTagN", { "fg": s:red }) -call s:h("htmlTagName", { "fg": s:red }) -call s:h("htmlTitle", { "fg": s:white }) - -" JavaScript -call s:h("javaScriptBraces", { "fg": s:white }) -call s:h("javaScriptFunction", { "fg": s:purple }) -call s:h("javaScriptIdentifier", { "fg": s:purple }) -call s:h("javaScriptNull", { "fg": s:dark_yellow }) -call s:h("javaScriptNumber", { "fg": s:dark_yellow }) -call s:h("javaScriptRequire", { "fg": s:cyan }) -call s:h("javaScriptReserved", { "fg": s:purple }) -" https://github.com/pangloss/vim-javascript -call s:h("jsArrowFunction", { "fg": s:purple }) -call s:h("jsClassKeyword", { "fg": s:purple }) -call s:h("jsClassMethodType", { "fg": s:purple }) -call s:h("jsDocParam", { "fg": s:blue }) -call s:h("jsDocTags", { "fg": s:purple }) -call s:h("jsExport", { "fg": s:purple }) -call s:h("jsExportDefault", { "fg": s:purple }) -call s:h("jsExtendsKeyword", { "fg": s:purple }) -call s:h("jsFrom", { "fg": s:purple }) -call s:h("jsFuncCall", { "fg": s:blue }) -call s:h("jsFunction", { "fg": s:purple }) -call s:h("jsGenerator", { "fg": s:yellow }) -call s:h("jsGlobalObjects", { "fg": s:yellow }) -call s:h("jsImport", { "fg": s:purple }) -call s:h("jsModuleAs", { "fg": s:purple }) -call s:h("jsModuleWords", { "fg": s:purple }) -call s:h("jsModules", { "fg": s:purple }) -call s:h("jsNull", { "fg": s:dark_yellow }) -call s:h("jsOperator", { "fg": s:purple }) -call s:h("jsStorageClass", { "fg": s:purple }) -call s:h("jsSuper", { "fg": s:red }) -call s:h("jsTemplateBraces", { "fg": s:dark_red }) -call s:h("jsTemplateVar", { "fg": s:green }) -call s:h("jsThis", { "fg": s:red }) -call s:h("jsUndefined", { "fg": s:dark_yellow }) -" https://github.com/othree/yajs.vim -call s:h("javascriptArrowFunc", { "fg": s:purple }) -call s:h("javascriptClassExtends", { "fg": s:purple }) -call s:h("javascriptClassKeyword", { "fg": s:purple }) -call s:h("javascriptDocNotation", { "fg": s:purple }) -call s:h("javascriptDocParamName", { "fg": s:blue }) -call s:h("javascriptDocTags", { "fg": s:purple }) -call s:h("javascriptEndColons", { "fg": s:white }) -call s:h("javascriptExport", { "fg": s:purple }) -call s:h("javascriptFuncArg", { "fg": s:white }) -call s:h("javascriptFuncKeyword", { "fg": s:purple }) -call s:h("javascriptIdentifier", { "fg": s:red }) -call s:h("javascriptImport", { "fg": s:purple }) -call s:h("javascriptMethodName", { "fg": s:white }) -call s:h("javascriptObjectLabel", { "fg": s:white }) -call s:h("javascriptOpSymbol", { "fg": s:cyan }) -call s:h("javascriptOpSymbols", { "fg": s:cyan }) -call s:h("javascriptPropertyName", { "fg": s:green }) -call s:h("javascriptTemplateSB", { "fg": s:dark_red }) -call s:h("javascriptVariable", { "fg": s:purple }) - -" JSON -call s:h("jsonCommentError", { "fg": s:white }) -call s:h("jsonKeyword", { "fg": s:red }) -call s:h("jsonBoolean", { "fg": s:dark_yellow }) -call s:h("jsonNumber", { "fg": s:dark_yellow }) -call s:h("jsonQuote", { "fg": s:white }) -call s:h("jsonMissingCommaError", { "fg": s:red, "gui": "reverse" }) -call s:h("jsonNoQuotesError", { "fg": s:red, "gui": "reverse" }) -call s:h("jsonNumError", { "fg": s:red, "gui": "reverse" }) -call s:h("jsonString", { "fg": s:green }) -call s:h("jsonStringSQError", { "fg": s:red, "gui": "reverse" }) -call s:h("jsonSemicolonError", { "fg": s:red, "gui": "reverse" }) - -" LESS -call s:h("lessVariable", { "fg": s:purple }) -call s:h("lessAmpersandChar", { "fg": s:white }) -call s:h("lessClass", { "fg": s:dark_yellow }) - -" Markdown (keep consistent with HTML, above) -call s:h("markdownBlockquote", { "fg": s:comment_grey }) -call s:h("markdownBold", { "fg": s:dark_yellow, "gui": "bold", "cterm": "bold" }) -call s:h("markdownBoldItalic", { "fg": s:green, "gui": "bold,italic", "cterm": "bold,italic" }) -call s:h("markdownCode", { "fg": s:green }) -call s:h("markdownCodeBlock", { "fg": s:green }) -call s:h("markdownCodeDelimiter", { "fg": s:green }) -call s:h("markdownH1", { "fg": s:red }) -call s:h("markdownH2", { "fg": s:red }) -call s:h("markdownH3", { "fg": s:red }) -call s:h("markdownH4", { "fg": s:red }) -call s:h("markdownH5", { "fg": s:red }) -call s:h("markdownH6", { "fg": s:red }) -call s:h("markdownHeadingDelimiter", { "fg": s:red }) -call s:h("markdownHeadingRule", { "fg": s:comment_grey }) -call s:h("markdownId", { "fg": s:purple }) -call s:h("markdownIdDeclaration", { "fg": s:blue }) -call s:h("markdownIdDelimiter", { "fg": s:purple }) -call s:h("markdownItalic", { "fg": s:purple, "gui": "italic", "cterm": "italic" }) -call s:h("markdownLinkDelimiter", { "fg": s:purple }) -call s:h("markdownLinkText", { "fg": s:blue }) -call s:h("markdownListMarker", { "fg": s:red }) -call s:h("markdownOrderedListMarker", { "fg": s:red }) -call s:h("markdownRule", { "fg": s:comment_grey }) -call s:h("markdownUrl", { "fg": s:cyan, "gui": "underline", "cterm": "underline" }) - -" Perl -call s:h("perlFiledescRead", { "fg": s:green }) -call s:h("perlFunction", { "fg": s:purple }) -call s:h("perlMatchStartEnd",{ "fg": s:blue }) -call s:h("perlMethod", { "fg": s:purple }) -call s:h("perlPOD", { "fg": s:comment_grey }) -call s:h("perlSharpBang", { "fg": s:comment_grey }) -call s:h("perlSpecialString",{ "fg": s:dark_yellow }) -call s:h("perlStatementFiledesc", { "fg": s:red }) -call s:h("perlStatementFlow",{ "fg": s:red }) -call s:h("perlStatementInclude", { "fg": s:purple }) -call s:h("perlStatementScalar",{ "fg": s:purple }) -call s:h("perlStatementStorage", { "fg": s:purple }) -call s:h("perlSubName",{ "fg": s:yellow }) -call s:h("perlVarPlain",{ "fg": s:blue }) - -" PHP -call s:h("phpVarSelector", { "fg": s:red }) -call s:h("phpOperator", { "fg": s:white }) -call s:h("phpParent", { "fg": s:white }) -call s:h("phpMemberSelector", { "fg": s:white }) -call s:h("phpType", { "fg": s:purple }) -call s:h("phpKeyword", { "fg": s:purple }) -call s:h("phpClass", { "fg": s:yellow }) -call s:h("phpUseClass", { "fg": s:white }) -call s:h("phpUseAlias", { "fg": s:white }) -call s:h("phpInclude", { "fg": s:purple }) -call s:h("phpClassExtends", { "fg": s:green }) -call s:h("phpDocTags", { "fg": s:white }) -call s:h("phpFunction", { "fg": s:blue }) -call s:h("phpFunctions", { "fg": s:cyan }) -call s:h("phpMethodsVar", { "fg": s:dark_yellow }) -call s:h("phpMagicConstants", { "fg": s:dark_yellow }) -call s:h("phpSuperglobals", { "fg": s:red }) -call s:h("phpConstants", { "fg": s:dark_yellow }) - -" Ruby -call s:h("rubyBlockParameter", { "fg": s:red}) -call s:h("rubyBlockParameterList", { "fg": s:red }) -call s:h("rubyClass", { "fg": s:purple}) -call s:h("rubyConstant", { "fg": s:yellow}) -call s:h("rubyControl", { "fg": s:purple }) -call s:h("rubyEscape", { "fg": s:red}) -call s:h("rubyFunction", { "fg": s:blue}) -call s:h("rubyGlobalVariable", { "fg": s:red}) -call s:h("rubyInclude", { "fg": s:blue}) -call s:h("rubyIncluderubyGlobalVariable", { "fg": s:red}) -call s:h("rubyInstanceVariable", { "fg": s:red}) -call s:h("rubyInterpolation", { "fg": s:cyan }) -call s:h("rubyInterpolationDelimiter", { "fg": s:red }) -call s:h("rubyInterpolationDelimiter", { "fg": s:red}) -call s:h("rubyRegexp", { "fg": s:cyan}) -call s:h("rubyRegexpDelimiter", { "fg": s:cyan}) -call s:h("rubyStringDelimiter", { "fg": s:green}) -call s:h("rubySymbol", { "fg": s:cyan}) - -" Sass -" https://github.com/tpope/vim-haml -call s:h("sassAmpersand", { "fg": s:red }) -call s:h("sassClass", { "fg": s:dark_yellow }) -call s:h("sassControl", { "fg": s:purple }) -call s:h("sassExtend", { "fg": s:purple }) -call s:h("sassFor", { "fg": s:white }) -call s:h("sassFunction", { "fg": s:cyan }) -call s:h("sassId", { "fg": s:blue }) -call s:h("sassInclude", { "fg": s:purple }) -call s:h("sassMedia", { "fg": s:purple }) -call s:h("sassMediaOperators", { "fg": s:white }) -call s:h("sassMixin", { "fg": s:purple }) -call s:h("sassMixinName", { "fg": s:blue }) -call s:h("sassMixing", { "fg": s:purple }) -call s:h("sassVariable", { "fg": s:purple }) -" https://github.com/cakebaker/scss-syntax.vim -call s:h("scssExtend", { "fg": s:purple }) -call s:h("scssImport", { "fg": s:purple }) -call s:h("scssInclude", { "fg": s:purple }) -call s:h("scssMixin", { "fg": s:purple }) -call s:h("scssSelectorName", { "fg": s:dark_yellow }) -call s:h("scssVariable", { "fg": s:purple }) - -" TeX -call s:h("texStatement", { "fg": s:purple }) -call s:h("texSubscripts", { "fg": s:dark_yellow }) -call s:h("texSuperscripts", { "fg": s:dark_yellow }) -call s:h("texTodo", { "fg": s:dark_red }) -call s:h("texBeginEnd", { "fg": s:purple }) -call s:h("texBeginEndName", { "fg": s:blue }) -call s:h("texMathMatcher", { "fg": s:blue }) -call s:h("texMathDelim", { "fg": s:blue }) -call s:h("texDelimiter", { "fg": s:dark_yellow }) -call s:h("texSpecialChar", { "fg": s:dark_yellow }) -call s:h("texCite", { "fg": s:blue }) -call s:h("texRefZone", { "fg": s:blue }) - -" TypeScript -call s:h("typescriptReserved", { "fg": s:purple }) -call s:h("typescriptEndColons", { "fg": s:white }) -call s:h("typescriptBraces", { "fg": s:white }) - -" XML -call s:h("xmlAttrib", { "fg": s:dark_yellow }) -call s:h("xmlEndTag", { "fg": s:red }) -call s:h("xmlTag", { "fg": s:red }) -call s:h("xmlTagName", { "fg": s:red }) - -" }}} - -" Plugin Highlighting {{{ - -" airblade/vim-gitgutter -call s:h("GitGutterAdd", { "fg": s:green }) -call s:h("GitGutterChange", { "fg": s:yellow }) -call s:h("GitGutterDelete", { "fg": s:red }) - -" dense-analysis/ale -call s:h("ALEError", { "fg": s:red, "gui": "underline", "cterm": "underline" }) -call s:h("ALEWarning", { "fg": s:yellow, "gui": "underline", "cterm": "underline" }) -call s:h("ALEInfo", { "gui": "underline", "cterm": "underline" }) -call s:h("ALEErrorSign", { "fg": s:red }) -call s:h("ALEWarningSign", { "fg": s:yellow }) -call s:h("ALEInfoSign", { }) - -" easymotion/vim-easymotion -call s:h("EasyMotionTarget", { "fg": s:red, "gui": "bold", "cterm": "bold" }) -call s:h("EasyMotionTarget2First", { "fg": s:yellow, "gui": "bold", "cterm": "bold" }) -call s:h("EasyMotionTarget2Second", { "fg": s:dark_yellow, "gui": "bold", "cterm": "bold" }) -call s:h("EasyMotionShade", { "fg": s:comment_grey }) - -" lewis6991/gitsigns.nvim -hi link GitSignsAdd GitGutterAdd -hi link GitSignsChange GitGutterChange -hi link GitSignsDelete GitGutterDelete - -" mhinz/vim-signify -hi link SignifySignAdd GitGutterAdd -hi link SignifySignChange GitGutterChange -hi link SignifySignDelete GitGutterDelete - -" neoclide/coc.nvim -call s:h("CocErrorSign", { "fg": s:red }) -call s:h("CocWarningSign", { "fg": s:yellow }) -call s:h("CocInfoSign", { "fg": s:blue }) -call s:h("CocHintSign", { "fg": s:cyan }) -call s:h("CocFadeOut", { "fg": s:comment_grey }) -" https://github.com/joshdick/onedark.vim/issues/313 -highlight! link CocMenuSel PmenuSel - -" neomake/neomake -call s:h("NeomakeErrorSign", { "fg": s:red }) -call s:h("NeomakeWarningSign", { "fg": s:yellow }) -call s:h("NeomakeInfoSign", { "fg": s:blue }) - -" plasticboy/vim-markdown (keep consistent with Markdown, above) -call s:h("mkdDelimiter", { "fg": s:purple }) -call s:h("mkdHeading", { "fg": s:red }) -call s:h("mkdLink", { "fg": s:blue }) -call s:h("mkdURL", { "fg": s:cyan, "gui": "underline", "cterm": "underline" }) - -" prabirshrestha/vim-lsp -call s:h("LspErrorText", { "fg": s:red }) -call s:h("LspWarningText", { "fg": s:yellow }) -call s:h("LspInformationText", { "fg":s:blue }) -call s:h("LspHintText", { "fg":s:cyan }) -call s:h("LspErrorHighlight", { "fg": s:red, "gui": "underline", "cterm": "underline" }) -call s:h("LspWarningHighlight", { "fg": s:yellow, "gui": "underline", "cterm": "underline" }) -call s:h("LspInformationHighlight", { "fg":s:blue, "gui": "underline", "cterm": "underline" }) -call s:h("LspHintHighlight", { "fg":s:cyan, "gui": "underline", "cterm": "underline" }) - -" tpope/vim-fugitive -call s:h("diffAdded", { "fg": s:green }) -call s:h("diffRemoved", { "fg": s:red }) - -" }}} - -" Git Highlighting {{{ - -call s:h("gitcommitComment", { "fg": s:comment_grey }) -call s:h("gitcommitUnmerged", { "fg": s:green }) -call s:h("gitcommitOnBranch", {}) -call s:h("gitcommitBranch", { "fg": s:purple }) -call s:h("gitcommitDiscardedType", { "fg": s:red }) -call s:h("gitcommitSelectedType", { "fg": s:green }) -call s:h("gitcommitHeader", {}) -call s:h("gitcommitUntrackedFile", { "fg": s:cyan }) -call s:h("gitcommitDiscardedFile", { "fg": s:red }) -call s:h("gitcommitSelectedFile", { "fg": s:green }) -call s:h("gitcommitUnmergedFile", { "fg": s:yellow }) -call s:h("gitcommitFile", {}) -call s:h("gitcommitSummary", { "fg": s:white }) -call s:h("gitcommitOverflow", { "fg": s:red }) -hi link gitcommitNoBranch gitcommitBranch -hi link gitcommitUntracked gitcommitComment -hi link gitcommitDiscarded gitcommitComment -hi link gitcommitSelected gitcommitComment -hi link gitcommitDiscardedArrow gitcommitDiscardedFile -hi link gitcommitSelectedArrow gitcommitSelectedFile -hi link gitcommitUnmergedArrow gitcommitUnmergedFile - -" }}} - -" Neovim-Specific Highlighting {{{ - -if has("nvim") - " Neovim terminal colors {{{ - let g:terminal_color_0 = s:black.gui - let g:terminal_color_1 = s:red.gui - let g:terminal_color_2 = s:green.gui - let g:terminal_color_3 = s:yellow.gui - let g:terminal_color_4 = s:blue.gui - let g:terminal_color_5 = s:purple.gui - let g:terminal_color_6 = s:cyan.gui - let g:terminal_color_7 = s:white.gui - let g:terminal_color_8 = s:visual_grey.gui - let g:terminal_color_9 = s:dark_red.gui - let g:terminal_color_10 = s:green.gui " No dark version - let g:terminal_color_11 = s:dark_yellow.gui - let g:terminal_color_12 = s:blue.gui " No dark version - let g:terminal_color_13 = s:purple.gui " No dark version - let g:terminal_color_14 = s:cyan.gui " No dark version - let g:terminal_color_15 = s:comment_grey.gui - let g:terminal_color_background = s:background.gui - let g:terminal_color_foreground = s:foreground.gui - " }}} - - " Neovim Diagnostics {{{ - call s:h("DiagnosticError", { "fg": s:red }) - call s:h("DiagnosticWarn", { "fg": s:yellow }) - call s:h("DiagnosticInfo", { "fg": s:blue }) - call s:h("DiagnosticHint", { "fg": s:cyan }) - call s:h("DiagnosticUnderlineError", { "fg": s:red, "gui": "underline", "cterm": "underline" }) - call s:h("DiagnosticUnderlineWarn", { "fg": s:yellow, "gui": "underline", "cterm": "underline" }) - call s:h("DiagnosticUnderlineInfo", { "fg": s:blue, "gui": "underline", "cterm": "underline" }) - call s:h("DiagnosticUnderlineHint", { "fg": s:cyan, "gui": "underline", "cterm": "underline" }) - " }}} - - " Neovim LSP (for versions < 0.5.1) {{{ - hi link LspDiagnosticsDefaultError DiagnosticError - hi link LspDiagnosticsDefaultWarning DiagnosticWarn - hi link LspDiagnosticsDefaultInformation DiagnosticInfo - hi link LspDiagnosticsDefaultHint DiagnosticHint - hi link LspDiagnosticsUnderlineError DiagnosticUnderlineError - hi link LspDiagnosticsUnderlineWarning DiagnosticUnderlineWarn - hi link LspDiagnosticsUnderlineInformation DiagnosticUnderlineInfo - hi link LspDiagnosticsUnderlineHint DiagnosticUnderlineHint - " }}} -endif - -" }}} - -" Must appear at the end of the file to work around this oddity: -" https://groups.google.com/forum/#!msg/vim_dev/afPqwAFNdrU/nqh6tOM87QUJ -set background=dark diff --git a/.config/nvim/other/fzf.vim b/.config/nvim/other/fzf.vim index 32cb18b..371b680 100644 --- a/.config/nvim/other/fzf.vim +++ b/.config/nvim/other/fzf.vim @@ -14,6 +14,6 @@ imap <c-x><c-f> <plug>(fzf-complete-path) imap <c-x><c-l> <plug>(fzf-complete-line) " Fzf keybindings -nnoremap <leader>ff :Files<CR> -nnoremap <leader>. :Files %:p:h<CR> +nnoremap <leader>ff :Files<CR> +nnoremap <leader>f. :Files %:p:h<CR> diff --git a/.config/nvim/other/out.vim b/.config/nvim/other/out.vim new file mode 100644 index 0000000..6e4e1f1 --- /dev/null +++ b/.config/nvim/other/out.vim @@ -0,0 +1,36 @@ +" capture (dump) the (somewhat long) ouput of the commands like `:digraph`, `:map', `:highlight`, `:scripnames` etc. + +function! s:dump(cmd) abort + + " Start a new split or maybe a buffer or a tab + " enew | " open a new buffer + 10split | enew | " open a new split (with 10% height (?)) + " tabnew | " open a new tab + + " Make it a scratch buffer ( `:help special-buffers`) + setlocal + \ bufhidden=wipe + \ buftype=nofile + \ nobuflisted + \ nolist + \ noswapfile + \ norelativenumber + \ nonumber + + " Write the cmd output to the buffer + put =execute(a:cmd) + " There are 2 empty line at the beginning of the buffer before the ouput of + " the cmd. Not sure from where they are comning from. Anyhow I will delete + " them. + norm gg2dd + + " No modifications to this buffer + setlocal readonly nomodifiable nomodified + + " Press escape to close when you're done + nnoremap <buffer><silent> <Esc> :bd<CR> + +endfunction + +" Define a command to use the function easier +command! -nargs=1 Dump execute "call s:dump(" string(<q-args>) ")" diff --git a/.config/nvim/out.vim b/.config/nvim/out.vim deleted file mode 100644 index 6e4e1f1..0000000 --- a/.config/nvim/out.vim +++ /dev/null @@ -1,36 +0,0 @@ -" capture (dump) the (somewhat long) ouput of the commands like `:digraph`, `:map', `:highlight`, `:scripnames` etc. - -function! s:dump(cmd) abort - - " Start a new split or maybe a buffer or a tab - " enew | " open a new buffer - 10split | enew | " open a new split (with 10% height (?)) - " tabnew | " open a new tab - - " Make it a scratch buffer ( `:help special-buffers`) - setlocal - \ bufhidden=wipe - \ buftype=nofile - \ nobuflisted - \ nolist - \ noswapfile - \ norelativenumber - \ nonumber - - " Write the cmd output to the buffer - put =execute(a:cmd) - " There are 2 empty line at the beginning of the buffer before the ouput of - " the cmd. Not sure from where they are comning from. Anyhow I will delete - " them. - norm gg2dd - - " No modifications to this buffer - setlocal readonly nomodifiable nomodified - - " Press escape to close when you're done - nnoremap <buffer><silent> <Esc> :bd<CR> - -endfunction - -" Define a command to use the function easier -command! -nargs=1 Dump execute "call s:dump(" string(<q-args>) ")" diff --git a/.config/nvim/pack/plugins/opt/fzf b/.config/nvim/pack/plugins/opt/fzf new file mode 160000 index 0000000..bfea9e5 --- /dev/null +++ b/.config/nvim/pack/plugins/opt/fzf @@ -0,0 +1 @@ +Subproject commit bfea9e53a62777a433af25552d440537297a1323 diff --git a/.config/nvim/pack/plugins/opt/fzf.vim b/.config/nvim/pack/plugins/opt/fzf.vim new file mode 160000 index 0000000..6cda389 --- /dev/null +++ b/.config/nvim/pack/plugins/opt/fzf.vim @@ -0,0 +1 @@ +Subproject commit 6cda389bdea953c9c66a3cfe57e40463ffd61ae9 diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index 489f66d..7325729 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -17,7 +17,7 @@ alias lf='lfcd' alias rs='exec $SHELL' alias sr='ff ~/.config ~/.local/bin ~/bin' -alias uc='cd ~ && gitpush' +alias uc='cd ~ && gitpush' # update config alias gpu='gitpush' lt() { tree -aC --dirsfirst -I "$IGNORE_GLOB" "$@" | less -F; } diff --git a/.config/shell/bm-dirs b/.config/shell/bm-dirs index 11f3852..cf9de6c 100644 --- a/.config/shell/bm-dirs +++ b/.config/shell/bm-dirs @@ -18,8 +18,8 @@ lbn ~/.local/bin bn ~/bin sd ~/sdcard rp ~/repos +an ~/Android ap ~/Applications -ad ~/Arduino dv ~/Dev cm ~/Dev/cloud-maker cs ~/Dev/sites/csstudent41.github.io @@ -50,4 +50,5 @@ usr ${PREFIX:-/usr} ush /usr/share usd /usr/share/doc usha /usr/share/applications +tmp /tmp tmu /tmp/mozilla_${USER}0 diff --git a/.config/shell/profile b/.config/shell/profile index 51111c1..c981fbc 100644 --- a/.config/shell/profile +++ b/.config/shell/profile @@ -97,19 +97,14 @@ export FZF_DEFAULT_OPTS=" # export GTYPIST_OPTS="--color 3,0 --banner-colors 0,2,4,1" # green-yellow export GTYPIST_OPTS="--color 6,0 --banner-color 0,4,5,1" # blue-cyan -# # path -# find -L ~/.local/share/gem/ruby/3.0.0/bin ~/.local/bin ~/bin \ -# -type d ! -wholename '*/.st*' | -# while read -r dir; do -# [ "$PATH" = "${PATH#*"$dir"}" ] && export PATH="$dir:$PATH" -# done - if [ "$PATH" = "${PATH#*"$HOME/.local/bin"}" ]; then _build_path() { find -L "$@" -type d ! -wholename '*/.st*' ! -wholename '*.git*' -printf '%p:'; } [ -d ~/bin ] && export PATH="$(_build_path ~/bin)$PATH" [ -d ~/.local/bin ] && export PATH="$(_build_path ~/.local/bin)$PATH" - export PATH="$PATH:$XDG_DATA_HOME/gem/ruby/3.0.0/bin" - export PATH="$PATH:$HOME/Applications/flutter/bin" + for dir in \ + "$XDG_DATA_HOME/gem/ruby/3.0.0/bin" \ + "$GOPATH/bin" + do [ -d "$dir" ] && export PATH="$PATH:$dir"; done fi [ -n "$TERMUX_VERSION" ] && { diff --git a/.config/yt-dlp/videos.conf b/.config/yt-dlp/videos.conf index cecd1bb..04d3137 100644 --- a/.config/yt-dlp/videos.conf +++ b/.config/yt-dlp/videos.conf @@ -1,2 +1,2 @@ --config config ---format bestvideo*[height<=720][fps<=30]+bestaudio +--format bestvideo*[height<=1080][fps<=30]+bestaudio diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index b6c435e..6c3b004 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -286,6 +286,7 @@ alias sv='sudo sv' alias mmv='noglob zmv -W' alias s='sudo ' alias fh='fzf --tac < "$OPEN_HISTFILE"' +alias ide='nvim -u "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/dev.vim"' alias mirror='sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist-arch' alias mirrord='sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist-arch' alias cleanup='sudo pacman -Rns $(pacman -Qtdq)' @@ -294,6 +295,14 @@ alias gtypist="gtypist $GTYPIST_OPTS" alias typ='launch-gtypist -l "$(sed "/^gtypist lesson - \(.*\)$/!d; s//\1/" ~/Documents/Notes/QuickNote.md)"' alias typa='launch-gtypist -e 3 -l "$(sed "/^gtypist lesson - \(.*\)$/!d; s//\1/" ~/Documents/Notes/ak47.txt)"' +# Launch new (W)indow in background +W() { + windowid="$(xdotool getactivewindow)" + setsid -f $TERMINAL >/dev/null 2>&1 + while [ "$(xdotool getactivewindow)" = "$windowid" ]; do sleep 0.1; done + xdotool windowfocus "$windowid" +} + # Find command package F() { ret=$? diff --git a/.config/zsh/zprofile b/.config/zsh/zprofile index 46c5217..f41c6a2 100644 --- a/.config/zsh/zprofile +++ b/.config/zsh/zprofile @@ -9,7 +9,7 @@ on_ac_power="$(cat /sys/class/power_supply/ACAD/online)" case "$TTY" in /dev/tty1) - [ "$on_ac_power" = 1 ] && { + command -V optimus-manager >/dev/null && [ "$on_ac_power" = 1 ] { echo "Waiting for nvidia card to load up..." until [ -e /dev/dri/card0 ]; do; sleep 0.1; done } diff --git a/.local/bin/desktop/setbg b/.local/bin/desktop/setbg new file mode 100755 index 0000000..c288895 --- /dev/null +++ b/.local/bin/desktop/setbg @@ -0,0 +1,41 @@ +#!/bin/sh + +# This script does the following: +# Run by itself, set the wallpaper (at X start). +# If given a file, set that as the new wallpaper. +# If given a directory, choose random file in it. +# If wal is installed, also generates a colorscheme. + +# Location of link to wallpaper link. +bgloc="${XDG_DATA_HOME:-$HOME/.local/share}/bg" + +# Configuration files of applications that have their themes changed by pywal. +dunstconf="${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc" +zathuraconf="${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc" + +# Give -s as parameter to make notifications silent. +while getopts "s" o; do case "${o}" in + s) silent='1' ;; +esac done + +shift $((OPTIND - 1)) + +trueloc="$(readlink -f "$1")" && +case "$(file --mime-type -b "$trueloc")" in + image/* ) ln -sf "$trueloc" "$bgloc" && [ -z "$silent" ] && notify-send -i "$bgloc" "Changing wallpaper..." ;; + inode/directory ) ln -sf "$(find "$trueloc" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$bgloc" && [ -z "$silent" ] && notify-send -i "$bgloc" "Random Wallpaper chosen." ;; + *) [ -z "$silent" ] && notify-send "🖼️ Error" "Not a valid image or directory." ; exit 1;; +esac + +# If pywal is installed, use it. +if command -v wal >/dev/null 2>&1 ; then + wal -n -i "$(readlink -f $bgloc)" -o "${XDG_CONFIG_HOME:-$HOME/.config}/wal/postrun" >/dev/null 2>&1 +# If pywal is removed, return config files to normal. +else + [ -f "$dunstconf.bak" ] && unlink "$dunstconf" && mv "$dunstconf.bak" "$dunstconf" + [ -f "$zathuraconf.bak" ] && unlink "$zathuraconf" && mv "$zathuraconf.bak" "$zathuraconf" +fi + +xwallpaper --zoom "$bgloc" +# If running, dwm hit the key to refresh the color scheme. +pidof dwm >/dev/null && xdotool key super+F5 diff --git a/.local/bin/development/dev b/.local/bin/development/dev index cd95f27..37b50d6 100755 --- a/.local/bin/development/dev +++ b/.local/bin/development/dev @@ -3,24 +3,26 @@ err() { [ "$DEV_SUPRESS_ERRORS" = 1 ] || printf "dev: %s\n" "$@" >&2; exit 5; } -[ "$#" -lt 2 ] && { err "dev - execute action based on file -USAGE: dev <ACTION> <FILE> [ARGS...]"; } +[ "$#" -lt 2 ] && { err "dev - execute task based on file +USAGE: dev <TASK> <FILE> [ARGS...]"; } -action="$1" +task="$1" file="$2" -basename="${file##*/}" +file_base="${file##*/}" +file_ext="${file_base##*.}" shift 2 [ -e "$file" ] || err "$file: No such file or directory" # auxilary functions findweb() { find "$@" -or -name '*.html'; } +watchcmd() { entr -r sh -c "echo; date; printf '\n$ %s\n' '$1'; $1"; } -### ################################################################# +##################################################################### ### BEGIN TASKS -### ################################################################# +##################################################################### sh_lint() { shellcheck -x "$file"; } sh_run() { $(sed -n '1s|^#!/.*/\(.*\)|\1|p' "$file") "$file" "$@"; } @@ -37,7 +39,11 @@ cls_compile() { file="${file%.cls}.tex"; tex_compile "$@"; } html_format() { tidy -q "$file" 2>/dev/null; } html_lint() { tidy -q "$file" >/dev/null; } html_run() { w3m "$file"; } +css_format() { esbuild "$file"; } +css_minify() { esbuild --minify "$file"; } js_test() { node "$file"; } +js_format() { esbuild "$file"; } +js_minify() { esbuild --minify "$file"; } json_format() { jq . "$file"; } php_run() { php "$file" "$@"; } @@ -50,7 +56,7 @@ go_lint() { gofmt -d "$file"; } go_compile() { go build "$file"; } go_run() { "$(realpath "${file%.go}")" "$@"; } go_test() { TMPDIR=~/.cache/go-tmp go run "$file" "$@"; } -go_serve() { findweb . -name '*.go' | entr -r sh -c "printf '\n\n$ go run *.go\n'; dev test *.go"; } +go_serve() { findweb . -name '*.go' | watchcmd "go run '$file'"; } c_test() { out="${file%.c}" @@ -113,7 +119,6 @@ kt_test() { py_format() { autopep8 "$file"; } py_formatin() { autopep8 -i "$file"; } -py_serve() { findweb . -name '*.py' | entr -r python "$file"; } # py_lint() { # [ -t 1 ] && printf '\033[33m' # pycodestyle "$file" >&2 @@ -129,9 +134,23 @@ py_run() { # fi } -### ################################################################# +## Default Tasks + +_serve() { + [ "$file_ext" != "$file_base" ] && FINDCMD="-name '*.$file_ext'" + eval "findweb -name '$file' $FINDCMD" | watchcmd "${@:-dev test $file}" +} + +_build() { + if [ -f mimetype ]; then + [ "$(cat mimetype)" = "application/epub+zip" ] || return 5 + zip -Xr9D "../${PWD##*/}.epub" mimetype * + fi +} + +##################################################################### ### END TASKS -### ################################################################# +##################################################################### @@ -145,22 +164,24 @@ case $filetype in application/json) filetype_ext="json" ;; text/x-php) filetype_ext="php" ;; text/x-awk) filetype_ext="awk" ;; + *) filetype_ext="NULL" ;; esac -if [ "${basename#*.}" != "${basename}" ]; then - file_ext="${basename##*.}" -else - [ -z "$filetype_ext" ] && err "no file type association for $filetype" +if [ "$file_ext" = "$file_base" ]; then + [ "$filetype_ext" = "NULL" ] && err "no file type association for $filetype" NO_BASENAME=1 fi execute_task() { - file_task="${file_ext}_${action}" - filetype_task="${filetype_ext}_${action}" + file_task="${file_ext}_${task}" + filetype_task="${filetype_ext}_${task}" + default_task="_${task}" if [ "$NO_BASENAME" != 1 ] && [ "${tasks#*"[$file_task]"}" != "$tasks" ]; then - $file_task; ret=$? + $file_task "$@"; ret=$? elif [ "${tasks#*"[$filetype_task]"}" != "$tasks" ]; then - $filetype_task; ret=$? + $filetype_task "$@"; ret=$? + elif [ "${tasks#*"[$default_task]"}" != "$tasks" ]; then + $default_task "$@"; ret=$? else return 1 fi @@ -170,13 +191,13 @@ execute_task() { tasks="$(sed -n "/^### BEGIN TASKS$/,/^### END TASKS$/ s/\(^[a-zA-Z0-9_]\+\)().*/[\1]/p" "$0")" -if [ "$action" = test ]; then - execute_task && exit - for action in lint compile run; do - execute_task && tested=1 +if [ "$task" = test ]; then + execute_task "$@" && exit + for task in lint compile run; do + execute_task "$@" && tested=1 done [ "$tested" != 1 ] && err "no tests for .${file_ext:-$filetype_ext} file" exit 0 fi -execute_task || err "no $action action for .${file_ext:-$filetype_ext} file" +execute_task "$@" || err "no $task task for .${file_ext:-$filetype_ext} file" diff --git a/.local/bin/development/go-module-rename b/.local/bin/development/go-module-rename new file mode 100755 index 0000000..68f158c --- /dev/null +++ b/.local/bin/development/go-module-rename @@ -0,0 +1,8 @@ +#!/bin/sh + +# go-module-rename <OLD_MODULE_NAME> <NEW_MODULE_NAME> + +go mod edit -module "$2" +find . -type f -name '*.go' | xargs sed -i \ + -e "s|\"$1/|\"$2/|g" \ + -e "s|\"$1\"|\"$2\"|g" diff --git a/.local/bin/fgrp b/.local/bin/fgrp index b9c0566..18bcabd 100755 --- a/.local/bin/fgrp +++ b/.local/bin/fgrp @@ -16,14 +16,15 @@ fi mkdir -pv "$FZF_HISTDIR" export FZF_HIST="$FZF_HISTDIR/grep_history" -grep -Rnsi --exclude-dir=.git --exclude-dir=node_modules --color=always "$@" | +cmd="grep -Rnsi --exclude-dir=.git --exclude-dir=node_modules --color=always" +$cmd "$@" | fzf --ansi \ --history="$FZF_HIST" \ --prompt="grep > " \ --preview='preview "$(echo {1} | cut -d: -f1)"' \ --preview-window="hidden" \ --bind 'ctrl-v:toggle-preview,ctrl-space:toggle-preview' \ - --bind "ctrl-r:reload(grep -Rns --color=always $*)" \ + --bind "ctrl-r:reload($cmd $*)" \ --bind 'enter:execute(append-to-history {} "$FZF_HIST"; OPENFLAG=0 fgrp {})' \ --bind 'alt-e:execute(append-to-history {} "$FZF_HIST"; OPENFLAG=0 OPENWITH=${EDITOR:-vi} fgrp {})' \ --bind 'alt-o:execute(append-to-history {} "$FZF_HIST"; OPENFLAG=0 OPENWITH=${OPENER:-xdg-open} fgrp {})' \ diff --git a/.local/bin/fmd b/.local/bin/fmd index 7dfb0e9..511b587 100755 --- a/.local/bin/fmd +++ b/.local/bin/fmd @@ -6,21 +6,20 @@ export PREVIEW="${PREVIEW:-"cat \"\$(dirname {})/.description/\${\$(basename {})%.*}.txt\" 2>/dev/null || preview {}"}" -find_files() { - filter="${XDG_CONFIG_HOME:-$HOME/.config}/ytignore" - if command -v fd >/dev/null; then - fd -I --color=always --type=file --ignore-file="$filter" . "$@" - else - eval "find $* -type f ! -path '*/.*' $(sed -z "s/\(\S\+\)\n/! -name '\1' /g" "$filter")" - fi -} +filter="${XDG_CONFIG_HOME:-$HOME/.config}/ytignore" +if command -v fd >/dev/null; then + export FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS --ansi" + find_files() { fd -I --color=always --type=file --ignore-file="$filter" . "$@"; } +else + find_files() { eval "find $* -type f ! -path '*/.*' $(sed -z "s/\(\S\+\)\n/! -name '\1' /g" "$filter")"; } +fi [ -z "$FZF_HISTDIR" ] && export FZF_HISTDIR="${XDG_STATE_HOME:-$HOME/.local/state}/fzf" mkdir -pv "$FZF_HISTDIR" export FZF_HIST="$FZF_HISTDIR/${FMD_HIST_NAME:-media_history}" -find_files "$@" | sort | fzf --multi --reverse --history="$FZF_HIST" \ +find_files "$@" | fzf --multi --reverse --history="$FZF_HIST" \ --header="${FZF_HEADER:-Browse Media Files}" --header-first \ --preview="$PREVIEW" --preview-window=hidden \ --bind 'alt-C:execute(librewolf-open "$(mediainfo --inform="General;%Comment%" {})")' \ diff --git a/.local/bin/open b/.local/bin/open index b054729..5b38cb7 100755 --- a/.local/bin/open +++ b/.local/bin/open @@ -5,7 +5,7 @@ for file in "$@"; do case "$file" in - *.pdf|*.djvu|*.epub) setsid -f zathura "$file" ;; + *.pdf|*.djvu|*.epub) setsid -f zathura "$file" 2>/dev/null ;; *.png|*.jpg|*.jpeg|*.webp) setsid -f nsxiv "$file" ;; *.gif|*.mkv|*.mp3|*.mp4|*.webm|*.ogg) ${PLAYER:-mpv --sub-auto=fuzzy} "$file" ;; *.html) ${BROWSER:-w3m} "$file" ;; @@ -25,7 +25,7 @@ for file in "$@"; do case "$filetype" in inode/directory) ${FILES:-lf} "$file" ; exit ;; text/html*) ${BROWSER:-w3m} "$file" ;; - *pdf|*djvu|*epub+zip|*oxps|*fictionbook) setsid -f zathura "$file" ;; + *pdf|*djvu|*epub+zip|*oxps|*fictionbook) setsid -f zathura "$file" 2>/dev/null ;; text/*|*json|*zip|*zstd) "${EDITOR:-nvim}" "$file" ;; application/vnd.openxmlformats-officedocument.*) setsid -f libreoffice "$file" ;; application/sc) sc-im "$file" ;; diff --git a/.local/bin/setbg b/.local/bin/setbg deleted file mode 100755 index c288895..0000000 --- a/.local/bin/setbg +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh - -# This script does the following: -# Run by itself, set the wallpaper (at X start). -# If given a file, set that as the new wallpaper. -# If given a directory, choose random file in it. -# If wal is installed, also generates a colorscheme. - -# Location of link to wallpaper link. -bgloc="${XDG_DATA_HOME:-$HOME/.local/share}/bg" - -# Configuration files of applications that have their themes changed by pywal. -dunstconf="${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc" -zathuraconf="${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc" - -# Give -s as parameter to make notifications silent. -while getopts "s" o; do case "${o}" in - s) silent='1' ;; -esac done - -shift $((OPTIND - 1)) - -trueloc="$(readlink -f "$1")" && -case "$(file --mime-type -b "$trueloc")" in - image/* ) ln -sf "$trueloc" "$bgloc" && [ -z "$silent" ] && notify-send -i "$bgloc" "Changing wallpaper..." ;; - inode/directory ) ln -sf "$(find "$trueloc" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$bgloc" && [ -z "$silent" ] && notify-send -i "$bgloc" "Random Wallpaper chosen." ;; - *) [ -z "$silent" ] && notify-send "🖼️ Error" "Not a valid image or directory." ; exit 1;; -esac - -# If pywal is installed, use it. -if command -v wal >/dev/null 2>&1 ; then - wal -n -i "$(readlink -f $bgloc)" -o "${XDG_CONFIG_HOME:-$HOME/.config}/wal/postrun" >/dev/null 2>&1 -# If pywal is removed, return config files to normal. -else - [ -f "$dunstconf.bak" ] && unlink "$dunstconf" && mv "$dunstconf.bak" "$dunstconf" - [ -f "$zathuraconf.bak" ] && unlink "$zathuraconf" && mv "$zathuraconf.bak" "$zathuraconf" -fi - -xwallpaper --zoom "$bgloc" -# If running, dwm hit the key to refresh the color scheme. -pidof dwm >/dev/null && xdotool key super+F5 -- cgit v1.2.3