commit 2c21f4eb21ea02be53918fad5c1003f27ab3596b parent cf93a2599aff670431a4a0f67d4ebfd40e528d26 Author: Bharatvaj Hemanth <bharatvaj@yahoo.com> Date: Sat, 21 Jan 2023 14:53:08 +0530 Merge branch 'main' of getsh.org:dotfiles Diffstat:
45 files changed, 341 insertions(+), 191 deletions(-)
diff --git a/.config/.gitignore b/.config/.gitignore @@ -9,7 +9,7 @@ !alacritty/ !alacritty/** !bash/ -!bash/** +!bash/bashrc !clink !clink/clink_settings !cmd/ @@ -25,7 +25,8 @@ !mutt/ !mutt/** !nvim/ -!nvim/** +!nvim/init.lua +!nvim/lua/keybindings.lua !sh/ !sh/** !tmux/ diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml @@ -4,7 +4,6 @@ mouse: import: - ~/.config/alacritty/hyper-dark.yml - ~/.config/alacritty/font.yml - - ~/.config/alacritty/unix.yml - ~/.config/alacritty/windows.yml - ~/.config/alacritty/mac.yml - ~/.config/alacritty/bindings.yml diff --git a/.config/alacritty/font.yml b/.config/alacritty/font.yml @@ -1,17 +1,17 @@ font: normal: - family: Bitstream Vera Sans Mono - style: Roman + family: Fira Mono + style: Regular bold: - family: Bitstream Vera Sans Mono + family: Fira Mono style: Bold italic: - family: Bitstream Vera Sans Mono + family: Fira Mono style: Oblique bold_italic: - family: Bitstream Vera Sans Mono + family: Fira Mono style: Bold Oblique diff --git a/.config/alacritty/hyper-dark.yml b/.config/alacritty/hyper-dark.yml @@ -15,17 +15,17 @@ colors: green: '0x33ff00' yellow: '0xfeff00' blue: '0x0066ff' - magenta: '0xcc00ff' - cyan: '0x00ffff' - white: '0xd0d0d0' + magenta: '0x9D8DC8' + cyan: '0x0B8E8B' + white: '0xc0c0c0' # Bright colors bright: - black: '0x808080' - red: '0xfe0100' + black: '0x555555' + red: '0xFF2222' green: '0x33ff00' yellow: '0xfeff00' blue: '0x0066ff' - magenta: '0xcc00ff' - cyan: '0x00ffff' + magenta: '0xB2F3F3' + cyan: '0x71F4F1' white: '0xFFFFFF' diff --git a/.config/alacritty/unix.yml b/.config/alacritty/unix.yml @@ -1,3 +0,0 @@ -shell: - program: bash - args: ['--login', '-i'] diff --git a/.config/bash/bashrc b/.config/bash/bashrc @@ -4,8 +4,6 @@ PATH_EXPORTS=( "${ESSENTIAL_PATH_EXPORTS[@]}" "${OTHER_PATH_EXPORTS[@]}" ) export PATH="${PATH}:${PATH_EXPORTS[*]}" -[ -f ${XDG_CONFIG_HOME}/bash/autojump.bash ] && ${XDG_CONFIG_HOME}/bash/autojump.bash +PS1='\w> ' -PS1='\w $ ' - -[ -f /usr/local/etc/profile.d/autojump.sh ] && . /usr/local/etc/profile.d/autojump.sh +[ -f "$XDG_CONFIG_HOME/bash/unstaged" ] && . "$XDG_CONFIG_HOME/bash/unstaged" diff --git a/.config/cmd/aliases.bat b/.config/cmd/aliases.bat @@ -4,3 +4,11 @@ doskey n=cd $* doskey g=git $* doskey e=%EDITOR% $* doskey l=lfcd.cmd +doskey ls=dir /B $* +doskey cp=copy $* +doskey mv=move $* +doskey pwd=cd +doskey rm=del $* +doskey clear=cls +doskey lynx=lynx -cfg %USERPROFILE%\.config\lynx\lynx.cfg $* +doskey cat=type $* diff --git a/.config/cmd/env.bat b/.config/cmd/env.bat @@ -6,6 +6,7 @@ set VISUAL=vim set EDITOR=%VISUAL% set GNUPGHOME=%XDG_DATA_HOME%\gnupg +set GPGHOME=%XDG_DATA_HOME%\gnupg set PASSWORD_STORE_DIR=%XDG_DATA_HOME%\pass set PASS_BASE_DIR=%XDG_DATA_HOME%\pass set NB_PATH=%XDG_DATA_HOME%\notebook diff --git a/.config/git/config b/.config/git/config @@ -16,9 +16,10 @@ lgr = log --graph --oneline --decorate --all lss = log --show-signature p = pull + po = pull origin pu = push put = push --tags - puuo = push -u origin + puo = push -u origin rs = remote set-url rso = remote set-url origin rv = remote --verbose @@ -28,6 +29,9 @@ wt = worktree wta = worktree add +[push] + autoSetupRemote = true + [difftool] prompt = false diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua @@ -4,40 +4,52 @@ local g = vim.g set.packpath="$XDG_DATA_HOME/nvim" -local map = require("utils").map -require("keybindings") +g.loaded_node_provider = 0 +g.loaded_ruby_provider = 0 +g.loaded_perl_provider = 0 +g.loaded_python3_provider = 0 +require'keybindings' set.tabstop=4 set.shiftwidth=4 -set.number=true -set.laststatus=1 -set.expandtab=false +set.cursorline=true +set.cursorlineopt="number" +set.laststatus=2 +set.wildignore:append("out/**") + +set.exrc=true set.hlsearch=true set.incsearch=true set.wrapscan=false -require'lspconfig'.clangd.setup{} - set.shortmess="Iat" g.netrw_banner = 0 g.netrw_liststyle = 3 -require('nvim_comment').setup() +require'nvim_comment'.setup() --- TODO use lua api -vim.cmd('source $XDG_DATA_HOME/vimcommon/vimrc') vim.cmd([[ +" TODO use lua api +source $XDG_DATA_HOME/vimcommon/vimrc + function! s:load_plugins(t) abort - packadd vim-tmux-navigator - packadd mru - packadd vim-surround - packadd vim-ninja-feet - packadd vim-fugitive + packadd fzf.vim packadd gruvbox-material + packadd nvim-dap + packadd nvim-dap-ui + packadd vim-fugitive + packadd vim-ninja-feet + packadd vim-surround + packadd vim-tmux-navigator + packadd vim-unimpaired + packadd vim-xcode + + lua require"dapui".setup() + lua require"unstaged" endfunction augroup user_cmds @@ -46,3 +58,4 @@ augroup user_cmds augroup END ]]) + diff --git a/.config/nvim/lua/keybindings.lua b/.config/nvim/lua/keybindings.lua @@ -1,10 +1,8 @@ --- keybindings -local set = vim.opt - +-- keybindings local set = vim.opt function save_and_build() -- TODO require vim-dispatch - vim.cmd('wall') - vim.cmd('Make') + vim.cmd('wall') + vim.cmd('Make') end function toggle_list(is_local_buffer) @@ -17,11 +15,31 @@ function toggle_list(is_local_buffer) end end --- function toggle_highlight() --- if vim.opt.highlight then --- vim. --- --- end +local map = vim.keymap.set + +map('n', "U", '<c-r>') +map('n', "<c-r>", '"') + +map('n', "z/", ':%s/') + +vim.api.nvim_create_autocmd('LspAttach', { + callback = function(args) + -- vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') + + local lspbuf = vim.lsp.buf + local bufopts = { noremap=true, buffer=args.buf } + map({'n', 'v'}, '<a-CR>', lspbuf.code_action, bufopts) + map('n', 'gD', lspbuf.declaration, bufopts) + map('n', 'gd', lspbuf.definition, bufopts) + map('n', 'K', lspbuf.hover, bufopts) + map('n', 'gi', lspbuf.implementation, bufopts) + map('n', '<space>D', lspbuf.type_definition, bufopts) + map('n', '<space>rn', lspbuf.rename, bufopts) + map('n', '<space>ca', lspbuf.code_action, bufopts) + map('n', 'gr', lspbuf.references, bufopts) + map('n', '<space>f', function() lspbuf.format { async = true } end, bufopts) + end +}) vim.cmd([[ function! DiffWithSaved() @@ -37,72 +55,81 @@ function file_mv_helper() vim.cmd('normal! 0i"A"0y$A p0imv j0') end --- Run Make -local map = require("utils").map -- general -map("n", "<leader>co", ":copen<cr>", { silent = false }) -map("n", "<leader>cd", ":cdo<space>s/", { silent = false }) -map("n", "<leader>ec", ":edit $XDG_CONFIG_HOME/nvim/init.lua<cr>", { silent = true }) -map("n", "<leader>ek", ":edit $XDG_CONFIG_HOME/nvim/lua/keybindings.lua<cr>", { silent = false }) -map("n", "<leader>et", ":set expandtab<cr>", { silent = false }) -map("n", "<leader>lb", ":ls<CR>:b<space>", { silent = false }) -map("n", "<leader>lo", ":lopen<cr>", { silent = false }) -map("n", "<leader>ld", ":ldo<space>s/", { silent = false }) -map("n", "<leader>p", ":Rg<cr>", { silent = false }) -map("n", "<leader>sc", ":source $XDG_CONFIG_HOME/nvim/init.lua<cr>", { silent = false }) -map("n", "<leader>so", ":source %<cr>", { silent = false }) -map("n", "<leader>sp", ":set paste<cr>", { silent = false }) -map("n", "<leader>tl", ":lua toggle_list(true)<CR>", { silent = true }) -map("n", "<leader>tt", ":tabnew<cr>", { silent = false }) -map("n", "<leader>vg", ":vimgrep<space>", { silent = false }) -map("n", "<leader>wd", ":call DiffWithSaved()<cr>", { silent = false }); +map("n", "<leader>aa", ":argadd **<cr>") +map("n", "<leader>co", ":copen<cr>") +map("n", "<leader>cd", ":cdo<space>s/") +map("n", "<leader>ec", ":edit $XDG_CONFIG_HOME/nvim/init.lua<cr>") +map("n", "<leader>ek", ":edit $XDG_CONFIG_HOME/nvim/lua/keybindings.lua<cr>") +map("n", "<leader>et", ":set expandtab<cr>") +map("n", "<leader>lb", ":ls<CR>:b<space>") +map("n", "<leader>lo", ":lopen<cr>") +map("n", "<leader>ld", ":ldo<space>s/") +map("n", "<leader>p", ":Rg<cr>") +map("n", "<leader>sc", ":source $XDG_CONFIG_HOME/nvim/init.lua<cr>") +map("n", "<leader>so", ":source %<cr>") +map("n", "<leader>spp", ":set paste<cr>") +map("n", "<leader>spa", ":set path+=**<cr>") +map("n", "<leader>tl", ":lua toggle_list(true)<CR>") +map("n", "<leader>tt", ":tabnew<cr>") +map("n", "<leader>vg", ":vimgrep<space>") +map("n", "<leader>wd", ":call DiffWithSaved()<cr>") -- quick write and quit -map("n", "<Leader>ww", ":w<CR>", { silent = true }) -map("n", "<Leader>wq", ":wq<CR>", { silent = true }) -map("n", "<Leader>qq", ":q<CR>", { silent = true }) -map("n", "<leader><cr>", ":noh<CR>", { silent = true }) +map("n", "<Leader>qq", ":q<CR>") +map("n", "<Leader>ww", ":w<CR>") +map("n", "<leader><cr>", ":noh<CR>") -- buffers -map("n", "<leader>sc", ":source ~/.config/vim/vimrc<enter>", { silent = true }) -map("n", "<leader>ss", ":split<enter>", { silent = true }) -map("n", "<leader>vv", ":vsplit<enter>", { silent = true }) +map("n", "<leader>sc", ":source ~/.config/vim/vimrc<enter>") +map("n", "<leader>ss", ":split<enter>") +map("n", "<leader>vv", ":vsplit<enter>") --- vimspector -map("n", "<leader>dd", ":call vimspector#Launch()<CR>", { silent = true }) -map("n", "<leader>dc", ":call GotoWindow(g:vimspector_session_windows.code)<CR>", { silent = true }) -map("n", "<leader>dt", ":call GotoWindow(g:vimspector_session_windows.tagpage)<CR>", { silent = true }) -map("n", "<leader>dv", ":call GotoWindow(g:vimspector_session_windows.variables)<CR>", { silent = true }) -map("n", "<leader>dw", ":call GotoWindow(g:vimspector_session_windows.watches)<CR>", { silent = true }) -map("n", "<leader>ds", ":call GotoWindow(g:vimspector_session_windows.stack_trace)<CR>", { silent = true }) -map("n", "<leader>do", ":call GotoWindow(g:vimspector_session_windows.output)<CR>", { silent = true }) -map("n", "<leader>de", ":call vimspector#Reset()<CR>", { silent = true }) +-- nvim-dap +map("n", "<leader>dd", ":lua require'dap'.continue()<cr>") +map("n", "<leader>de", ":lua require'dap'.terminate()<cr> | :lua require'dap'.close()<cr>") +map("n", "<leader>dl", ":lua require'dap'.step_into()<cr>") +map("n", "<leader>dj", ":lua require'dap'.step_over()<cr>") +map("n", "<leader>dk", ":lua require'dap'.step_out()<cr>") +map("n", "<leader>dr", ":lua require'dap'.restart()<cr>") -map("n", "<leader>dtcb", ":call vimspector#CleanLineBreakpoint()<CR>", { silent = true }) +-- nvim-dap-ui +map("n", "<leader>du", ":lua require'dapui'.toggle()<cr>") -map("n", "<leader>dl", "<Plug>VimspectorStepInto", { silent = true }) -map("n", "<leader>dj", "<Plug>VimspectorStepOver", { silent = true }) -map("n", "<leader>dk", "<Plug>VimspectorStepOut", { silent = true }) -map("n", "<leader>d_", "<Plug>VimspectorRestart", { silent = true }) -map("n", "<leader>d<space>", ":call vimspector#Continue()<CR>", { silent = true }) +map("n", "<leader>drc", ":lua require'dap'.RunToCursor()") +map("n", "<leader>db" , ":lua require'dap'.toggle_breakpoint()<cr>") +map("n", "<leader>dcb", ":lua require'dap'.ToggleConditionalBreakpoint()") -map("n", "<leader>drc", "<Plug>VimspectorRunToCursor", { silent = true }) -map("n", "<leader>dbp" , "<Plug>VimspectorToggleBreakpoint", { silent = true }) -map("n", "<leader>dcbp", "<Plug>VimspectorToggleConditionalBreakpoint", { silent = true }) +-- map("n", "<leader>dc", ":call GotoWindow(require'dap'.session_windows.code)<CR>") +-- map("n", "<leader>dt", ":call GotoWindow(require'dap'.session_windows.tagpage)<CR>") +-- map("n", "<leader>dv", ":call GotoWindow(require'dap'.session_windows.variables)<CR>") +-- map("n", "<leader>dw", ":call GotoWindow(require'dap'.session_windows.watches)<CR>") +-- map("n", "<leader>ds", ":call GotoWindow(require'dap'.session_windows.stack_trace)<CR>") +-- map("n", "<leader>do", ":call GotoWindow(require'dap'.session_windows.output)<CR>") +-- map("n", "<leader>dtcb", ":call vimspector#CleanLineBreakpoint()<CR>") -map("n", "<leader>bb", ":lua save_and_build()<CR>", { silent = false }) +map("n", "<leader>bb", ":lua save_and_build()<CR>") +map("n", "<leader>bc", ":Make clean<CR>") -- development -map("n", "<leader>oc", ":grepadd /:: %", { silent = false }) -map("n", "<leader>oh", ":grepadd /:: %", { silent = false }) +map("n", "<leader>oc", ":grepadd /:: %") +map("n", "<leader>oh", ":grepadd /:: %") + +vim.keymap.set('n', '\\f', ":CommandTGit<cr>") +vim.keymap.set('n', '\\F', ":CommandTFind<cr>") +vim.keymap.set('n', '\\g', ":CommandTGit<cr>") +vim.keymap.set('n', '\\b', ":CommandTBuffer<cr>") + -- quick navigation --- telscope.nvim -map("n", "<leader>ff", ":b *", { silent = false }) +map("n", "<leader>fb", ":b *") +map("n", "<leader>ff", ":find *") +map("n", "<leader>fs", ":set foldmethod=syntax<cr>") + -- file helpers -map("n", "<leader>fmv", "lua file_mv_helper()", { silent = true }) +map("n", "<leader>fmv", "lua file_mv_helper()") -- doc functions function doc_quick_underline(n) @@ -117,28 +144,41 @@ function reverse_date() vim.cmd('normal! dt/wwpldeBP') end -map("n", "<leader>h1", ":lua doc_quick_underline(1)<cr>", { silent = true }); -map("n", "<leader>h2", ":lua doc_quick_underline(2)<cr>", { silent = true }); +map("n", "<leader>h1", ":lua doc_quick_underline(1)<cr>") +map("n", "<leader>h2", ":lua doc_quick_underline(2)<cr>") -map("n", "<leader>ct", ":ChecklistToggleCheckbox<cr>", { silent = true }); -map("n", "<leader>ce", ":ChecklistEnableCheckbox<cr>", { silent = true }); --- map("n", "<leader>cd", ":ChecklistDisableCheckbox<cr>", { silent = true }); +map("n", "<leader>ct", ":ChecklistToggleCheckbox<cr>") +map("n", "<leader>ce", ":ChecklistEnableCheckbox<cr>") +-- map("n", "<leader>cd", ":ChecklistDisableCheckbox<cr>") -- vim.g.checklist_filetypes:append('adoc', 'md') -- vim-fugitive -map("n", "<leader>gg", ":Ggrep<space>", { silent = false }); -map("n", "<leader>lg", ":Glgrep<space>", { silent = false }); -map("n", "<leader>gwq", ":Gwq<cr>", { silent = false }); +map("n", "<leader>gb", ":G blame<cr>") +map("n", "<leader>gd", ":Gvdiff<cr>") +map("n", "<leader>gg", ":Ggrep<space>") +map("n", "<leader>gr", ":G reset %<cr>") +map("n", "<leader>gwq", ":Gwq<cr>") +map("n", "<leader>lg", ":Glgrep<space>") + +-- useful +map("n", "<leader>nn", ":set number<cr>") -- neovim diagnostics -map("n", "<leader>sd", ":lua vim.diagnostic.open_float()<cr>", { silent = false }); +map("n", "<leader>sd", ":lua vim.diagnostic.open_float()<cr>") -- netrw keybindings -map("n", "<leader>sf", ":Ex<cr>", { silent = false }); +map("n", "<leader>sf", ":Ex<cr>") + +-- subst with power +map("n", "cn", "*``cgn") +map("n", "cN", "*``cgN") +vim.cmd([[ +let g:mc = "y/\\V\<C-r>=escape(@\", '/')\<CR>\<CR>" +vnoremap <expr> cn g:mc . "``cgn" +]]) -- nb -- TODO open a fuzzy finder quickly. Even better use fuzzy finder without chdir -map("n", "<leader>nb", ":chdir $NB_PATH<cr>", { silent = false }); - +map("n", "<leader>nb", ":chdir $NB_PATH<cr> | :pwd<cr>") diff --git a/.config/nvim/lua/utils.lua b/.config/nvim/lua/utils.lua @@ -1,11 +0,0 @@ -local M = {} - -function M.map(mode, lhs, rhs, opts) - local options = { noremap = true } - if opts then - options = vim.tbl_extend("force", options, opts) - end - vim.api.nvim_set_keymap(mode, lhs, rhs, options) -end - -return M diff --git a/.config/sh/aliases b/.config/sh/aliases @@ -9,6 +9,7 @@ alias wget='wget --hsts-file="$XDG_CACHE_HOME/wget-hsts"' # [misc] alias doas=sudo +alias qc='ssh $(ci)' # [baseutils_conditioning] thwart sl && thwart ld && thwart lls && thwart sls && thwart lsl && thwart lss && thwart kls @@ -26,6 +27,7 @@ alias ..='cd ..' alias n='cd_and_ls' alias cf="quickopen cd d" alias ef="quickopen ${EDITOR} f" +alias gf='$EDITOR $(git ls-files | ${FUZZER})' alias vf="quickopen ${VISUAL} f" # TODO make it work for linux alias of="quickopen open f" @@ -36,12 +38,17 @@ alias of="quickopen open f" # [shorthands] alias '?d'='sr duckduckgo' alias cls=clear -alias d='wget' +alias d='download' alias e='${EDITOR}' -alias f='find . -name ' +alias f=find_ alias g='git' alias g=git alias l=lfcd alias le=less +alias m=make alias v="VIMINIT='' nvim" alias x=extract_archive + +# [longhands] +alias girl='grep -irl' +alias gir='grep -ir' diff --git a/.config/sh/functions b/.config/sh/functions @@ -49,3 +49,12 @@ quickopen() { cd_and_ls() { cd $* && ls } + +download() { + # TODO use wget if curl not available + curl -fLO $* +} + +find_() { + find . -name "*$**" +} diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf @@ -36,6 +36,7 @@ bind -T copy-mode-vi y send-keys -X copy-selection-and-cancel set-option -g mouse on setw -g mode-keys vi +set-option -g focus-events on set-option -s set-clipboard off bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy" bind P paste-buffer @@ -44,7 +45,6 @@ bind P paste-buffer set-option -g status-style "bg=default" set -g status-fg default set -g window-status-current-style "fg=red,bold" -set -g window-status-last-style "fg=cyan" set -g pane-active-border-style "bg=default,fg=red" set -g pane-border-lines single set -g pane-border-status off diff --git a/.config/vim/gvimrc b/.config/vim/gvimrc @@ -1,2 +1,3 @@ set guifont=Bitstream\ Vera\ Sans\ Mono set guioptions= +colorscheme gruvbox-material diff --git a/.config/vim/hyper-red.vim b/.config/vim/hyper-red.vim @@ -1,48 +0,0 @@ -" Hyper Red -" TODO handle tCo less than 16 case -" TODO handle light theme -" Probably use a autogroup for handling tCo count change -" Do it in lua -if &background == "dark" - hi LineNr guibg=NONE ctermbg=NONE guifg=DarkGray ctermfg=DarkGray - hi CursorLineNr guibg=NONE ctermbg=NONE guifg=White ctermfg=White - hi StatusLine cterm=bold gui=bold ctermfg=White ctermbg=Black guifg=White guibg=Black - hi StatusLineNC guibg=lightgray ctermbg=lightgray guifg=black ctermfg=black - hi Statement ctermfg=Red guifg=Red - hi Constant ctermfg=LightGreen guifg=LightGreen - hi String ctermfg=LightBlue guifg=LightBlue - hi Special cterm=bold ctermfg=LightGreen guifg=LightYellow - hi Identifier ctermfg=White guifg=White - hi IncSearch ctermbg=Black ctermfg=Yellow guibg=Black guifg=Yellow - hi Search ctermbg=LightBlue ctermfg=Black guibg=Blue guifg=White - hi Todo cterm=underline ctermbg=NONE ctermfg=LightYellow guibg=NONE guifg=LightYellow - hi Comment ctermfg=DarkGray guifg=DarkGray - hi Visual ctermbg=White ctermfg=Black guibg=White guifg=Black - hi Type ctermfg=LightGray guifg=LightGray - hi PreProc ctermfg=DarkGray guifg=DarkGray - hi MatchParen ctermbg=NONE cterm=underline ctermfg=LightMagenta -else - hi LineNr guibg=NONE ctermbg=NONE guifg=LightGray ctermfg=LightGray - hi StatusLine cterm=bold gui=bold guibg=NONE ctermbg=NONE guifg=Black ctermfg=Black - hi StatusLineNC guibg=DarkGray ctermbg=DarkGray guifg=White ctermfg=White - hi Statement ctermfg=Red guifg=Red - hi Constant ctermfg=Green guifg=Green - hi String ctermfg=DarkBlue guifg=DarkBlue - hi Special cterm=bold ctermfg=DarkGreen guifg=DarkGreen - hi Identifier ctermfg=Black guifg=Black - hi IncSearch ctermbg=White ctermfg=Yellow guibg=White guifg=Yellow - hi Search ctermbg=Blue ctermfg=White guibg=Blue guifg=White - hi Todo cterm=underline,bold ctermbg=NONE ctermfg=Yellow guibg=NONE guifg=Yellow - hi Comment ctermfg=LightGray guifg=LightGray - hi Visual ctermbg=Black ctermfg=white guibg=Black guifg=white - hi Type ctermfg=DarkGray guifg=DarkGray - hi PreProc ctermfg=LightGray guifg=LightGray - hi MatchParen guibg=NONE ctermbg=NONE gui=underline cterm=underline guifg=DarkMagenta ctermfg=DarkMagenta -endif -set fillchars=vert:\│ -hi VertSplit term=NONE cterm=NONE gui=NONE -hi SignColumn ctermbg=NONE guibg=NONE - -if (&t_Co == 8) - hi Comment ctermfg=NONE -endif diff --git a/.config/vim/keybindings.vim b/.config/vim/keybindings.vim @@ -42,7 +42,11 @@ call SetupCommandAlias("man","help") nnoremap <leader>tb :call ToggleBackground()<CR> nnoremap <leader>tl :call ToggleList()<CR> + +" development nnoremap <leader>bb :call SaveAndBuild()<CR> +nnoremap <leader>bc :Make clean<CR> + nnoremap <leader>fmv :call FileMvHelper()<CR> " Quick save and write @@ -64,7 +68,6 @@ nnoremap <CR> :noh<CR><CR>:<backspace> nnoremap <leader>cc :ChecklistToggleCheckbox<cr> let g:gutentags_file_list_command = 'rg --files' -nnoremap <tab><tab> :CtrlPBuffer<cr> " vim-fugitive nnoremap <leader>gg :Ggrep<space> diff --git a/.config/vim/vimrc b/.config/vim/vimrc @@ -1,4 +1,7 @@ -if !has('nvim') +if has('nvim') + luafile ~/.config/nvim/init.lua + finish +else if has("&viminfofile") set viminfofile=$XDG_CACHE_DIR/vim/viminfo endif @@ -6,9 +9,9 @@ endif " General set nocompatible -set number set mouse= -set nocursorline +set cursorline +set cursorlineopt=number set exrc " Turn backup off @@ -52,7 +55,6 @@ set lazyredraw set ttyfast set nospell -set background=dark syntax on indent off " Plugins @@ -83,7 +85,6 @@ function! s:load_plugins(t) abort set undodir=$XDG_CACHE_HOME/vim/undo | call mkdir(&undodir, 'p') packadd vim-tmux-navigator packadd vim-commentary - packadd mru packadd vim-surround packadd vim-ninja-feet packadd vim-fugitive diff --git a/.gitmodules b/.gitmodules @@ -19,12 +19,9 @@ [submodule ".local/share/vim/pack/general/opt/vim-ninja-feet"] path = .local/share/vimcommon/pack/general/opt/vim-ninja-feet url = https://git::@github.com/tommcdo/vim-ninja-feet.git -[submodule ".local/share/vim/pack/themes/start/gruvbox-material"] - path = .local/share/vimcommon/pack/themes/opt/gruvbox-material +[submodule ".local/share/vimcommon/pack/ui/opt/gruvbox-material"] + path = .local/share/vimcommon/pack/ui/opt/gruvbox-material url = https://git::@github.com/sainnhe/gruvbox-material.git -[submodule ".local/share/nvim/pack/general/start/nvim-lspconfig"] - path = .local/share/nvim/pack/general/start/nvim-lspconfig - url = https://github.com/neovim/nvim-lspconfig [submodule ".local/share/vim/pack/general/start/vim-unimpaired"] path = .local/share/vimcommon/pack/general/opt/vim-unimpaired url = https://github.com/tpope/vim-unimpaired @@ -44,7 +41,7 @@ path = .local/share/nvim/pack/general/start/vim-dispatch-neovim url = https://github.com/radenling/vim-dispatch-neovim [submodule ".local/share/nvim/pack/development/start/nvim-dap"] - path = .local/share/nvim/pack/development/start/nvim-dap + path = .local/share/nvim/pack/dev/opt/nvim-dap url = https://github.com/mfussenegger/nvim-dap [submodule ".local/share/nvim/pack/general/start/nvim-comment"] path = .local/share/nvim/pack/general/start/nvim-comment @@ -70,3 +67,36 @@ [submodule ".local/share/vimcommon/pack/general/start/vim-minisnip"] path = .local/share/vimcommon/pack/general/start/vim-minisnip url = https://github.com/joereynolds/vim-minisnip/ +[submodule ".local/share/vimcommon/pack/dev/opt/clang_complete"] + path = .local/share/vimcommon/pack/dev/opt/clang_complete + url = https://github.com/xavierd/clang_complete +[submodule ".local/share/vimcommon/pack/dev/opt/swift.vim"] + path = .local/share/vimcommon/pack/dev/opt/swift.vim + url = https://github.com/keith/swift.vim +[submodule ".local/share/vimcommon/pack/dev/opt/tagbar"] + path = .local/share/vimcommon/pack/dev/opt/tagbar + url = https://github.com/preservim/tagbar +[submodule ".local/share/vimcommon/pack/general/start/vim-pbxproj"] + path = .local/share/vimcommon/pack/general/start/vim-pbxproj + url = https://github.com/cfdrake/vim-pbxproj +[submodule ".local/share/vimcommon/pack/dev/opt/vim-submode"] + path = .local/share/vimcommon/pack/general/start/vim-submode + url = https://github.com/kana/vim-submode +[submodule ".local/share/vimcommon/pack/dev/opt/xcodebuild.vim"] + path = .local/share/vimcommon/pack/dev/opt/xcodebuild.vim + url = https://github.com/jerrymarino/xcodebuild.vim +[submodule ".local/share/nvim/pack/dev/opt/nvim-dap-ui"] + path = .local/share/nvim/pack/dev/opt/nvim-dap-ui + url = https://github.com/rcarriga/nvim-dap-ui +[submodule ".local/share/vimcommon/pack/dev/opt/vim-xcode"] + path = .local/share/vimcommon/pack/dev/opt/vim-xcode + url = https://github.com/gfontenot/vim-xcode +[submodule ".local/share/vimcommon/pack/general/opt/fzf.vim"] + path = .local/share/vimcommon/pack/general/start/fzf.vim + url = https://github.com/junegunn/fzf.vim +[submodule ".local/share/vimcommon/pack/general/start/gitignore"] + path = .local/share/vimcommon/pack/general/start/gitignore + url = https://github.com/vim-scripts/gitignore +[submodule ".local/share/nvim/pack/dev/start/nvim-lspconfig"] + path = .local/share/nvim/pack/dev/opt/nvim-lspconfig + url = https://github.com/neovim/nvim-lspconfig diff --git a/.local/bin/cmd/lfcd.cmd b/.local/bin/cmd/lfcd.cmd @@ -10,6 +10,4 @@ lf -last-dir-path=%tmpfile% %* if not exist %tmpfile% exit set /p dir=<%tmpfile% del /f %tmpfile% -if not exist "%dir%" exit -if "%dir%" == "%cd%" exit cd /d "%dir%" diff --git a/.local/bin/cmd/spot.cmd b/.local/bin/cmd/spot.cmd @@ -0,0 +1,20 @@ +@echo off +setlocal EnableDelayedExpansion + +set start_path="C:\ProgramData\Microsoft\Windows\Start Menu" +cd %start_path% + +set row= +for /f "usebackq tokens=*" %%f in (`dir /b/s *.lnk`) do set row=!row!"%%f"; + +:s_tmploop +set s_tmpfile="%tmp%\s_spot.%random%.tmp" +if exist %s_tmpfile% goto:s_tmploop + +wmenu.exe -e %row% | more > "!s_tmpfile!" + +set /p c_tmpfile=<!s_tmpfile! +if not exist "%c_tmpfile%" exit +del /f !s_tmpfile! +start "%c_tmpfile%" "%c_tmpfile%" +endlocal diff --git a/.local/bin/sh/ci b/.local/bin/sh/ci @@ -0,0 +1,8 @@ +#!/bin/sh +# ci - computer index + +s_db=~/.local/share/personal/systems.json + +s_system=$(jq -r 'keys[]' "$s_db" | fzf) +s_addr=$(jq -r ".$s_system" "$s_db") +echo $s_addr diff --git a/.local/bin/sh/pofs b/.local/bin/sh/pofs @@ -0,0 +1,9 @@ +#!/bin/sh -eu + +# reliable password fuzzy searcher + +cd "${PASSWORD_STORE_DIR}" || exit 1 + +selection="$(find -L totp -name '*.gpg' | sed 's/.gpg$//g' | ${FUZZER})" + +test -z "${selection}" || pass otp ${1} "${selection}" diff --git a/.local/bin/sh/songdl b/.local/bin/sh/songdl @@ -8,7 +8,7 @@ cd "$SONGDL_HOME" song_name=$1 -youtube-dl --external-downloader aria2c --extract-audio --audio-format mp3 "$song_name" +youtube-dl --extract-audio --audio-format mp3 "$song_name" --external-downloader aria2c if type mpc >/dev/null; then mpc update diff --git a/.local/share/nvim/pack/dev/opt/nvim-dap b/.local/share/nvim/pack/dev/opt/nvim-dap @@ -0,0 +1 @@ +Subproject commit 61643680dcb771a29073cd432894e2f81a7c2ae3 diff --git a/.local/share/nvim/pack/dev/opt/nvim-dap-ui b/.local/share/nvim/pack/dev/opt/nvim-dap-ui @@ -0,0 +1 @@ +Subproject commit 0f385f7f5268f408a546772c049271121b0d71c9 diff --git a/.local/share/nvim/pack/dev/opt/nvim-lspconfig b/.local/share/nvim/pack/dev/opt/nvim-lspconfig @@ -0,0 +1 @@ +Subproject commit 7b98aadc6e85db4fc3af6c1ec22c4774d965506e diff --git a/.local/share/nvim/pack/development/start/nvim-dap b/.local/share/nvim/pack/development/start/nvim-dap @@ -1 +0,0 @@ -Subproject commit d2fcb949cd25fcdee0481a79672297082fc6c39e diff --git a/.local/share/nvim/pack/general/start/nvim-lspconfig b/.local/share/nvim/pack/general/start/nvim-lspconfig @@ -1 +0,0 @@ -Subproject commit 54181ddb2709a4cd594e29bf82343c79196ec0c6 diff --git a/.local/share/vimcommon/commands b/.local/share/vimcommon/commands diff --git a/.local/share/vimcommon/hyper-red.vim b/.local/share/vimcommon/hyper-red.vim @@ -0,0 +1,46 @@ +" Hyper Red +" TODO handle tCo less than 16 case +" TODO handle light theme +" Probably use a autogroup for handling tCo count change +" Do it in lua +if &background == "dark" + hi! LineNr guibg=NONE ctermbg=NONE guifg=DarkGray ctermfg=DarkGray + hi! CursorLineNr cterm=NONE gui=NONE guibg=NONE ctermbg=NONE guifg=White ctermfg=White + hi! StatusLineNC guibg=LightGray ctermbg=LightGray guifg=Black ctermfg=Black + hi! Statement ctermfg=Red guifg=Red + hi! Constant ctermfg=LightGreen guifg=LightGreen + hi! String ctermfg=LightBlue guifg=LightBlue + hi! Special cterm=bold ctermfg=LightMagenta guifg=LightMagenta + hi! Identifier ctermfg=White guifg=White + hi! IncSearch ctermbg=Black ctermfg=Yellow guibg=Black guifg=Yellow + hi! Search ctermbg=LightBlue ctermfg=Black guibg=DarkGray guifg=Black + hi! Todo cterm=underline ctermbg=NONE ctermfg=LightYellow guibg=NONE guifg=LightYellow + hi! Comment ctermfg=DarkGray guifg=DarkGray + hi! Visual ctermbg=White ctermfg=Black guibg=White guifg=Black + hi! Type ctermfg=LightGray guifg=LightGray + hi! PreProc ctermfg=DarkGray guifg=DarkGray + hi! MatchParen ctermbg=NONE cterm=underline ctermfg=LightMagenta +else + hi! LineNr cterm=NONE gui=NONE guibg=NONE ctermbg=NONE guifg=LightGray ctermfg=LightGray + hi! StatusLineNC guibg=DarkGray ctermbg=DarkGray guifg=White ctermfg=White + hi! Statement ctermfg=Red guifg=Red + hi! Constant ctermfg=Green guifg=Green + hi! String ctermfg=DarkBlue guifg=DarkBlue + hi! Special cterm=bold ctermfg=DarkMagenta guifg=DarkMagenta + hi! Identifier ctermfg=Black guifg=Black + hi! IncSearch ctermbg=Black ctermfg=Yellow guibg=Black guifg=Yellow + hi! Search ctermbg=Blue ctermfg=White guibg=Blue guifg=White + hi! Todo cterm=underline,bold ctermbg=NONE ctermfg=Yellow guibg=NONE guifg=Yellow + hi! Comment ctermfg=LightGray guifg=LightGray + hi! Visual ctermbg=Black ctermfg=white guibg=Black guifg=white + hi! Type ctermfg=DarkGray guifg=DarkGray + hi! PreProc ctermfg=LightGray guifg=LightGray + hi! MatchParen guibg=NONE ctermbg=NONE gui=underline cterm=underline guifg=DarkMagenta ctermfg=DarkMagenta +endif +set fillchars=vert:\│ +hi! VertSplit term=NONE cterm=NONE gui=NONE +hi! SignColumn ctermbg=NONE guibg=NONE + +if (&t_Co == 8) + hi! Comment ctermfg=NONE +endif diff --git a/.local/share/vimcommon/pack/dev/opt/clang_complete b/.local/share/vimcommon/pack/dev/opt/clang_complete @@ -0,0 +1 @@ +Subproject commit e25b6a54e5cf648eb36d5be5b82c1bbb22260fde diff --git a/.local/share/vimcommon/pack/dev/opt/swift.vim b/.local/share/vimcommon/pack/dev/opt/swift.vim @@ -0,0 +1 @@ +Subproject commit 3e0529e1a97e3da24aabd18daf8ed92c6da8c68b diff --git a/.local/share/vimcommon/pack/dev/opt/tagbar b/.local/share/vimcommon/pack/dev/opt/tagbar @@ -0,0 +1 @@ +Subproject commit 83933d557409639df53fd2ca21484279b5854c1e diff --git a/.local/share/vimcommon/pack/dev/opt/vim-xcode b/.local/share/vimcommon/pack/dev/opt/vim-xcode @@ -0,0 +1 @@ +Subproject commit 2adc409bd7bb58499218f4f487c825e55306e46d diff --git a/.local/share/vimcommon/pack/dev/opt/xcodebuild.vim b/.local/share/vimcommon/pack/dev/opt/xcodebuild.vim @@ -0,0 +1 @@ +Subproject commit d62fa4cf952b4b8a1650778bdec284c35e468279 diff --git a/.local/share/vimcommon/pack/general/start/fzf.vim b/.local/share/vimcommon/pack/general/start/fzf.vim @@ -0,0 +1 @@ +Subproject commit 9ceac718026fd39498d95ff04fa04d3e40c465d7 diff --git a/.local/share/vimcommon/pack/general/start/gitignore b/.local/share/vimcommon/pack/general/start/gitignore @@ -0,0 +1 @@ +Subproject commit 061c5c756713f42b92b6b69b0a081075319a60d0 diff --git a/.local/share/vimcommon/pack/general/start/vim-pbxproj b/.local/share/vimcommon/pack/general/start/vim-pbxproj @@ -0,0 +1 @@ +Subproject commit d230f2cc70faf47ec0b97ffefa8235991438aca8 diff --git a/.local/share/vimcommon/pack/general/start/vim-submode b/.local/share/vimcommon/pack/general/start/vim-submode @@ -0,0 +1 @@ +Subproject commit d29de4f55c40a7a03af1d8134453a703d6affbd2 diff --git a/.local/share/vimcommon/pack/themes/opt/gruvbox-material b/.local/share/vimcommon/pack/themes/opt/gruvbox-material @@ -1 +0,0 @@ -Subproject commit 2807579bd0a9981575dbb518aa65d3206f04ea02 diff --git a/.local/share/vimcommon/pack/ui/opt/gruvbox-material b/.local/share/vimcommon/pack/ui/opt/gruvbox-material @@ -0,0 +1 @@ +Subproject commit 2807579bd0a9981575dbb518aa65d3206f04ea02 diff --git a/.local/share/vimcommon/vimrc b/.local/share/vimcommon/vimrc @@ -2,4 +2,9 @@ set packpath^=$XDG_DATA_HOME/vimcommon let g:minisnip_dir=$XDG_DATA_HOME . '/vimcommon/minisnip' -source $XDG_CONFIG_HOME/vim/hyper-red.vim +set background=dark + +source $XDG_DATA_HOME/vimcommon/hyper-red.vim + +set path+=** +set wildignore+=**/out/** diff --git a/.profile b/.profile @@ -67,9 +67,10 @@ export GEM_SPEC_CACHE="$XDG_CACHE_HOME"/gem # Make `history` print timestamp HISTTIMEFORMAT="%F %T " +HISTCONTROL=erasedups # Local executables -export PATH=${PATH}:${HOME}/.local/bin:${HOME}/.local/bin/sh:${XDG_DATA_HOME}/npm/bin:${XDG_DATA_HOME}/.cargo/bin +export PATH=${PATH}:${HOME}/.local/bin:${HOME}/.local/bin/sh:${XDG_DATA_HOME}/npm/bin:${XDG_DATA_HOME}/.cargo/bin:${XDG_DATA_HOME}/gem/bin chance() { # Hit or miss