commit 580b6a0fd7aa782627a76946376a7c3e598ceb1c
parent 023a81b505a8686fe1ac1102d3e82da3eb39911d
Author: Bharatvaj <bharatvaj@yahoo.com>
Date: Sun, 7 Aug 2022 00:43:10 +0530
nvim: Add useful keybindings
...that I keep typing.
nvim: hyper-red fine tuned. Match Paren is now handled!, also some tty
conditions are handled. Not fully tested.
nvim: Add gruvbox-material
sh: 'n' will cd and ls
sh: 'v' better alias for nvim
git: put will push tags
tmux: better borders for floating window and indicate last window with
light blue.
Diffstat:
9 files changed, 58 insertions(+), 19 deletions(-)
diff --git a/.config/git/config b/.config/git/config
@@ -17,6 +17,7 @@
lss = log --show-signature
p = pull
pu = push
+ put = push --tags
puuo = push -u origin
rs = remote set-url
rso = remote set-url origin
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua
@@ -16,8 +16,6 @@ set.expandtab=false
set.hlsearch=true
set.incsearch=true
set.wrapscan=false
-set.ignorecase=true
-set.smartcase=true
require'lspconfig'.clangd.setup{}
diff --git a/.config/nvim/lua/keybindings.lua b/.config/nvim/lua/keybindings.lua
@@ -17,6 +17,22 @@ function toggle_list(is_local_buffer)
end
end
+-- function toggle_highlight()
+-- if vim.opt.highlight then
+-- vim.
+--
+-- end
+
+vim.cmd([[
+function! DiffWithSaved()
+ let filetype=&ft
+ diffthis
+ vnew | r # | normal! 1Gdd
+ diffthis
+ exe "setlocal bt=nofile bh=wipe nobl noswf ro ft=" . filetype
+endfunction
+]])
+
function file_mv_helper()
vim.cmd('normal! 0i"A"0y$A p0imv j0')
end
@@ -36,15 +52,17 @@ map("n", "<leader>ls", ":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 });
-- 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>cs", ":noh<CR>", { silent = true })
+map("n", "<leader><cr>", ":noh<CR>", { silent = true })
-- buffers
map("n", "<leader>sc", ":source ~/.config/vim/vimrc<enter>", { silent = true })
@@ -112,3 +130,9 @@ map("n", "<leader>cd", ":ChecklistDisableCheckbox<cr>", { silent = true });
map("n", "<leader>gg", ":Ggrep<space>", { silent = false });
map("n", "<leader>lg", ":Glgrep<space>", { silent = false });
map("n", "<leader>gwq", ":Gwq<cr>", { silent = false });
+
+-- neovim diagnostics
+map("n", "<leader>sd", ":lua vim.diagnostic.open_float()<cr>", { silent = false });
+
+-- netrw keybindings
+map("n", "<leader>sf", ":Ex<cr>", { silent = false });
diff --git a/.config/sh/aliases b/.config/sh/aliases
@@ -23,7 +23,7 @@ there curl && alias gip="curl ifconfig.co"
alias ....='cd ../../..'
alias ...='cd ../..'
alias ..='cd ..'
-alias n='cd'
+alias n='cd_and_ls'
alias cf="quickopen cd d"
alias ef="quickopen ${EDITOR} f"
alias vf="quickopen ${VISUAL} f"
@@ -40,5 +40,5 @@ alias f='find . -name '
alias g='git'
alias g=git
alias l=lfcd
-alias v='unset_viminit_nvim'
+alias v='VIMINIT="" nvim'
alias x=extract_archive
diff --git a/.config/sh/functions b/.config/sh/functions
@@ -42,6 +42,7 @@ quickopen() {
fi
}
-unset_viminit_nvim() {
- VIMINIT="" nvim $*
+cd_and_ls() {
+ cd $*
+ ls
}
diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf
@@ -43,9 +43,13 @@ bind P paste-buffer
# Themes
set -g status-bg black
set -g status-fg white
-set -g window-status-current-style "bg=black,fg=red"
+set -g window-status-current-style "bg=black,fg=red,bold"
+set -g window-status-last-style "bg=black,fg=cyan"
set -g pane-active-border-style "fg=red"
-
+set -g pane-border-lines single
+set -g pane-border-status off
+set -g popup-border-style "bg=black,fg=red"
+set -g popup-border-lines single
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
diff --git a/.config/vim/hyper-red.vim b/.config/vim/hyper-red.vim
@@ -1,27 +1,34 @@
" Hyper Red
-" TODO handle tCo lesss that 16 case
+" 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 StatusLine guibg=white ctermbg=white guifg=black ctermfg=black
+ hi StatusLine ctermfg=Black ctermbg=LightBlue guifg=black guibg=white
hi StatusLineNC guibg=lightgray ctermbg=lightgray guifg=black ctermfg=black
else
- hi StatusLine guibg=black ctermbg=black guifg=white ctermfg=white
+ hi StatusLine guibg=darkblue ctermbg=darkblue guifg=white ctermfg=white
hi StatusLineNC guibg=darkgray ctermbg=darkgray guifg=white ctermfg=white
endif
hi LineNr guibg=NONE ctermbg=NONE guifg=DarkGray ctermfg=DarkGray
set fillchars=vert:\│
hi VertSplit term=NONE cterm=NONE gui=NONE
hi SignColumn ctermbg=NONE guibg=NONE
+if empty($DISPLAY)
+hi Comment ctermfg=NONE
+else
hi Comment ctermfg=DarkGray guifg=DarkGray
-hi Statement ctermfg=red guifg=red
+hi Visual ctermbg=DarkGray ctermfg=white guibg=DarkGray guifg=white
hi Type ctermfg=LightGray guifg=LightGray
hi PreProc ctermfg=LightGray guifg=LightGray
-hi Constant ctermfg=red guifg=red
-hi String ctermfg=lightred guifg=lightred
-hi Special ctermfg=red guifg=red
-hi Identifier ctermfg=white guifg=white
-hi Visual ctermbg=DarkGray ctermfg=white guibg=DarkGray guifg=white
+endif
+
+hi Statement ctermfg=Red guifg=LightGreen
+hi Constant ctermfg=Red guifg=Red
+hi String cterm=bold ctermfg=NONE guifg=LightRed
+hi Special cterm=bold ctermfg=LightBlue guifg=LightYellow
+hi Identifier ctermfg=White guifg=White
hi Search ctermbg=Blue ctermfg=White guibg=Blue guifg=White
-hi Todo ctermbg=NONE ctermfg=Yellow guibg=NONE guifg=Yellow
+hi Todo cterm=underline ctermbg=NONE ctermfg=LightYellow guibg=NONE guifg=LightYellow
+
+hi MatchParen ctermbg=NONE cterm=underline ctermfg=Magenta
diff --git a/.gitmodules b/.gitmodules
@@ -97,3 +97,6 @@
[submodule ".local/share/nvim/pack/general/start/vim-unimpaired"]
path = .local/share/nvim/pack/general/start/vim-unimpaired
url = https://github.com/tpope/vim-unimpaired
+[submodule ".local/share/nvim/pack/themes/start/gruvbox-material"]
+ path = .local/share/nvim/pack/themes/start/gruvbox-material
+ url = https://git::@github.com/sainnhe/gruvbox-material.git
diff --git a/.local/share/nvim/pack/themes/start/gruvbox-material b/.local/share/nvim/pack/themes/start/gruvbox-material
@@ -0,0 +1 @@
+Subproject commit d4d5731854b5b029d33130748e33a654c216bfb4