dotfiles

Cross platform dotfiles for linux, mac and windows
git clone git@getsh.org:dotfiles.git
Log | Files | Refs

commit b414476abfc9aeb48cbb34d2be8f29937b65d1af
parent c1458da2d475a6de0b42e4bf4c71dba44b45f8ea
Author: Bharatvaj <bharatvaj@yahoo.com>
Date:   Tue, 20 Dec 2022 08:30:43 +0530

Move lsp stuff to unstaged as it is unconfirmed

Cosmetic changes for alacritty

Cosmetic changes for hyper-red.vim

Don't change color to cyan for last window in tmux. Too distracting.

Add fzf.vim - it's better to use this for vim, neovim and shell as it is common.
Instead of using multiple fuzzy finder for every application.

Move hyper-red.vim to vimcommon as it is common

Highlight linenumber in vim

Diffstat:
M.config/.gitignore | 5+++--
M.config/alacritty/alacritty.yml | 1-
M.config/alacritty/hyper-dark.yml | 14+++++++-------
D.config/alacritty/unix.yml | 3---
M.config/bash/bashrc | 6++----
M.config/git/config | 4++--
M.config/nvim/init.lua | 42++++++++++++++++++++++++++++--------------
M.config/nvim/lua/keybindings.lua | 55++++++++++---------------------------------------------
M.config/sh/aliases | 2+-
M.config/sh/functions | 9+++++++++
M.config/tmux/tmux.conf | 2+-
D.config/vim/hyper-red.vim | 48------------------------------------------------
M.config/vim/keybindings.vim | 1-
M.config/vim/vimrc | 5++---
M.gitmodules | 5++++-
A.local/share/vimcommon/hyper-red.vim | 48++++++++++++++++++++++++++++++++++++++++++++++++
A.local/share/vimcommon/pack/general/start/fzf.vim | 1+
D.local/share/vimcommon/pack/themes/opt/gruvbox-material | 1-
A.local/share/vimcommon/pack/ui/opt/gruvbox-material | 1+
M.local/share/vimcommon/vimrc | 4+++-
M.profile | 3++-
21 files changed, 124 insertions(+), 136 deletions(-)

diff --git a/.config/.gitignore b/.config/.gitignore @@ -9,7 +9,7 @@ !alacritty/ !alacritty/** !bash/ -!bash/** +!bash/bashrc !clink !clink/clink_settings cmd/userenv.bat @@ -25,7 +25,8 @@ cmd/userenv.bat !lynx/lynx.cfg !lynx/lynx.lss !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/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/git/config b/.config/git/config @@ -18,13 +18,13 @@ p = pull 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 sm = submodule st = status - suir = submodule update --init --recursive + suir = submodule update --init --recursiv wt = worktree wta = worktree add diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua @@ -4,40 +4,53 @@ 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 fzf.vim + packadd gruvbox-material packadd mru - packadd vim-surround - packadd vim-ninja-feet + packadd nvim-dap + packadd nvim-dap-ui packadd vim-fugitive - packadd gruvbox-material + 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 +59,4 @@ augroup user_cmds augroup END ]]) + diff --git a/.config/nvim/lua/keybindings.lua b/.config/nvim/lua/keybindings.lua @@ -17,53 +17,10 @@ end local map = vim.keymap.set --- Column Navigation/Scrolling -map('n', 'J', '<c-d>') -map('n', 'K', '<c-u>') -map('n', 'gJ', '<c-f>') -map('n', 'gK', '<c-b>') --- map('n', '<c-d>', 'J') --- map('n', 'g<c-d>', 'gJ') --- map('n', '<c-u>', 'K') --- map('n', 'g<c-u>', 'gK') - --- Edit --- map('n', "g<cr>", 'O') --- map('n', "<cr>", 'o') - --- send command upstream -map('n', "<esc>h", '<c-w>h') -map('n', "<esc>j", '<c-w>j') -map('n', "<esc>k", '<c-w>k') -map('n', "<esc>l", '<c-w>l') -map('n', "<esc>f", '<c-w>l') - --- Horizonatal scrolling -map('n', "H", 'zH') -map('n', "L", 'zL') - -map('n', "zh", 'g0') -map('n', "zj", 'L') -map('n', "zk", 'H') -map('n', "zl", 'g$') -map('n', "zm", ":call cursor(0, len(getline('.'))/2)<cr>") -map('n', "zM", 'M') - --- Line movements -map('n', "gh", '_') -map('n', "gl", '$') -map('n', "gm", 'M') - -map('n', "gM", 'M') - map('n', "U", '<c-r>') map('n', "<c-r>", '"') -map('n', "<bs>", 's') map('n', "z/", ':%s/') -map('n', "z?", ':%s?') - -map('n', "M", 'q') vim.api.nvim_create_autocmd('LspAttach', { callback = function(args) @@ -158,6 +115,12 @@ map("n", "<leader>bb", ":lua save_and_build()<CR>") 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 map("n", "<leader>fb", ":b *") map("n", "<leader>ff", ":find *") @@ -191,10 +154,12 @@ map("n", "<leader>ce", ":ChecklistEnableCheckbox<cr>") -- vim.g.checklist_filetypes:append('adoc', 'md') -- vim-fugitive -map("n", "<leader>gd", ":Gvdiff") +map("n", "<leader>gb", ":G blame<cr>") +map("n", "<leader>gd", ":Gvdiff<cr>") map("n", "<leader>gg", ":Ggrep<space>") -map("n", "<leader>lg", ":Glgrep<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>") diff --git a/.config/sh/aliases b/.config/sh/aliases @@ -38,7 +38,7 @@ alias '?d'='sr duckduckgo' alias cls=clear alias d='download' alias e='${EDITOR}' -alias f='find . -name ' +alias f=find_ alias g='git' alias g=git alias l=lfcd 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/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 @@ -64,7 +64,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 @@ -6,9 +6,9 @@ endif " General set nocompatible -set number set mouse= -set nocursorline +set cursorline +set cursorlineopt=number set exrc " Turn backup off @@ -52,7 +52,6 @@ set lazyredraw set ttyfast set nospell -set background=dark syntax on indent off " Plugins diff --git a/.gitmodules b/.gitmodules @@ -20,7 +20,7 @@ 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 + path = .local/share/vimcommon/pack/ui/opt/gruvbox-material url = https://git::@github.com/sainnhe/gruvbox-material.git [submodule ".local/share/vim/pack/general/start/vim-unimpaired"] path = .local/share/vimcommon/pack/general/opt/vim-unimpaired @@ -91,3 +91,6 @@ [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 diff --git a/.local/share/vimcommon/hyper-red.vim b/.local/share/vimcommon/hyper-red.vim @@ -0,0 +1,48 @@ +" 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! StatusLine cterm=bold gui=bold ctermfg=LightRed ctermbg=Black guifg=LightRed 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=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! 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=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/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/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,6 @@ 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 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