Compare commits
18 Commits
ddb279da7b
...
708daa10dc
| Author | SHA1 | Date | |
|---|---|---|---|
|
708daa10dc
|
|||
|
6bd13a9b56
|
|||
|
a34cdab694
|
|||
|
456f71d939
|
|||
|
2bceafeb4e
|
|||
|
af0d9e8fd1
|
|||
|
d57fbf0e66
|
|||
|
a23159e50d
|
|||
|
e8a8f9637a
|
|||
|
0e5baf5e36
|
|||
|
fced504674
|
|||
|
a49cbcae21
|
|||
|
9271a293cb
|
|||
|
2e4086500d
|
|||
|
ca15f2399e
|
|||
|
198069fac7
|
|||
|
4c12418b62
|
|||
|
5767210dce
|
@@ -49,6 +49,8 @@
|
||||
[branch]
|
||||
autosetuprebase = always
|
||||
sort = -committerdate
|
||||
[clone]
|
||||
filterSubmodules = yes
|
||||
[color "status"]
|
||||
added = 076
|
||||
untracked = 014
|
||||
@@ -65,8 +67,7 @@
|
||||
[core]
|
||||
abbrev = 12
|
||||
#pager = delta
|
||||
pager = diff-so-fancy \
|
||||
| less --tabs=8 --RAW-CONTROL-CHARS --quit-if-one-screen
|
||||
pager = diff-so-fancy | less --tabs=8 --RAW-CONTROL-CHARS
|
||||
whitespace = trailing-spaces,space-before-tab,indent-with-non-tab
|
||||
[delta]
|
||||
navigate = true
|
||||
@@ -114,7 +115,7 @@
|
||||
[rebase]
|
||||
autostash = true
|
||||
[rerere]
|
||||
enabled = true
|
||||
enabled = false
|
||||
[status]
|
||||
submodulesummary = true
|
||||
[submodule]
|
||||
|
||||
@@ -1763,7 +1763,7 @@ close_on_child_death yes
|
||||
#: special value of ask means that kitty will ask before opening the
|
||||
#: link when clicked.
|
||||
|
||||
# shell_integration enabled
|
||||
shell_integration no-cursor
|
||||
|
||||
#: Enable shell integration on supported shells. This enables features
|
||||
#: such as jumping to previous prompts, browsing the output of the
|
||||
@@ -2521,7 +2521,8 @@ map kitty_mod+shift+backspace change_font_size all 0
|
||||
|
||||
#: Open URL
|
||||
|
||||
map kitty_mod+e open_url_with_hints
|
||||
# map kitty_mod+e open_url_with_hints
|
||||
map kitty_mod+f open_url_with_hints
|
||||
|
||||
#:: Open a currently visible URL using the keyboard. The program used
|
||||
#:: to open the URL is specified in open_url_with.
|
||||
|
||||
@@ -361,10 +361,12 @@ bind S set -w synchronize-panes
|
||||
set -g remain-on-exit on
|
||||
if -F "#{>=:#{version},3.3}" {
|
||||
bind -n C-d if -F "#{pane_dead}" { kill-pane } { send }
|
||||
bind -n Escape if -F "#{pane_dead}" { kill-pane } { send }
|
||||
bind -n Enter if -F "#{pane_dead}" { respawn-pane } { send }
|
||||
} {
|
||||
# omitting the key argument was introduced in 3.3
|
||||
bind -n C-d if -F "#{pane_dead}" { kill-pane } { send C-d }
|
||||
bind -n Escape if -F "#{pane_dead}" { kill-pane } { send Escape }
|
||||
bind -n Enter if -F "#{pane_dead}" { respawn-pane } { send Enter }
|
||||
}
|
||||
|
||||
|
||||
@@ -15,8 +15,10 @@ endfor
|
||||
" needs vim >= 8.1.1719 to support features like popup and text property as well
|
||||
" as nodejs.
|
||||
if ((has('patch-8.1.1719') || has('nvim')) && executable('node'))
|
||||
let g:coc_global_extensions =
|
||||
\ ['coc-clangd', 'coc-sh', 'coc-pyright', 'coc-vimtex', 'coc-vimlsp', 'coc-json']
|
||||
let g:coc_global_extensions = [
|
||||
\ 'coc-clangd', 'coc-sh', 'coc-pyright', 'coc-vimtex',
|
||||
\ 'coc-vimlsp', 'coc-json', 'coc-go'
|
||||
\ ]
|
||||
let g:coc_config_home = $XDG_CONFIG_HOME .. "/vim"
|
||||
packadd coc.nvim
|
||||
endif
|
||||
|
||||
@@ -6,10 +6,6 @@ if !exists('g:did_coc_loaded')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Some servers have issues with backup files, see #649.
|
||||
set nobackup
|
||||
set nowritebackup
|
||||
|
||||
" Always show the signcolumn, otherwise it would shift the text each time
|
||||
" diagnostics appear/become resolved.
|
||||
set signcolumn=yes
|
||||
|
||||
@@ -91,17 +91,20 @@ elseif (has('terminal'))
|
||||
nmap <leader><CR> <Cmd>terminal<CR>
|
||||
endif
|
||||
|
||||
" Plugin specific bindings
|
||||
if (get(g:, 'loaded_fzf'))
|
||||
nmap <leader>f <Cmd>Files<CR>
|
||||
nmap <leader>j <Cmd>Lines<CR>
|
||||
nmap <leader>/ <Cmd>Lines<CR>
|
||||
nmap <leader>h <Cmd>Helptags<CR>
|
||||
" TODO: fix this?
|
||||
if (get(g:, 'loaded_gutentags') || 1)
|
||||
nmap <leader>t <Cmd>Tags<CR>
|
||||
nmap <leader>bt <Cmd>BTags<CR>
|
||||
endif
|
||||
nmap <leader>ff <Cmd>Files<CR>
|
||||
nmap <leader>fj <Cmd>Lines<CR>
|
||||
nmap <leader>f/ <Cmd>Lines<CR>
|
||||
nmap <leader>fh <Cmd>Helptags<CR>
|
||||
nmap <leader>ft <Cmd>Tags<CR>
|
||||
nmap <leader>fbt <Cmd>BTags<CR>
|
||||
" git files that `git status` lists
|
||||
nmap <leader>fgf <Cmd>GFiles?<CR>
|
||||
" 'git log (log?)' and 'git log buffer '
|
||||
map <leader>fgll <Cmd>Commits<CR>
|
||||
map <leader>fglb <Cmd>BCommits<CR>
|
||||
" TODO: <leader>fglb should restrict the log to all staged files when called
|
||||
" in .git/COMMIT_EDITMSG, maybe with an ftplugin?
|
||||
endif
|
||||
|
||||
" Search for selected text.
|
||||
@@ -136,7 +139,8 @@ vmap <leader>/ <Esc><leader>v/
|
||||
|
||||
" Select last pasted text in same visual mode as it was selected (v, V, or ^V)
|
||||
" Taken from: https://vim.fandom.com/wiki/Selecting_your_pasted_text
|
||||
nnoremap <expr> gp '`[' . strpart(getregtype(), 0, 1) . '`]'
|
||||
" TODO: I want the gp default back - find new mapping
|
||||
" nnoremap <expr> gp '`[' . strpart(getregtype(), 0, 1) . '`]'
|
||||
|
||||
" Git bindings
|
||||
|
||||
@@ -153,10 +157,9 @@ nmap <leader>grc :let subject=system('git show -s --date=short --pretty="format:
|
||||
nmap <leader>gso :r!git config --get user.name<CR>:r!git config --get user.email<CR>I<<ESC>A><ESC>kJISigned-off-by: <ESC>
|
||||
|
||||
" Add, stash or checkout the current file
|
||||
" TODO: Conflict with <leader>gf
|
||||
"nmap <leader>gfa <Cmd>!git add -- %<CR>
|
||||
"nmap <leader>gfs <Cmd>!git stash -- %<CR>
|
||||
"nmap <leader>gfu <Cmd>!git checkout -- %<CR>
|
||||
nmap <leader>gfa <Cmd>!git add -- %<CR>
|
||||
nmap <leader>gfs <Cmd>!git stash -- %<CR>
|
||||
nmap <leader>gfu <Cmd>!git checkout -- %<CR>
|
||||
|
||||
if exists('g:loaded_fugitive')
|
||||
" Interactive `git status`
|
||||
@@ -191,19 +194,12 @@ if exists('g:loaded_gitgutter')
|
||||
xmap ih <Plug>(GitGutterTextObjectInnerVisual)
|
||||
xmap ah <Plug>(GitGutterTextObjectOuterVisual)
|
||||
" Same for hunk navigation bindings + center line
|
||||
" TODO: <leader>[h to jump between **all** hunks across all modified
|
||||
" files. (similar to `add -p`)
|
||||
nmap [h <Plug>(GitGutterPrevHunk)zz
|
||||
nmap ]h <Plug>(GitGutterNextHunk)zz
|
||||
endif
|
||||
|
||||
if (get(g:, 'loaded_fzf'))
|
||||
" git files that `git status` lists
|
||||
nmap <leader>gf <Cmd>GFiles?<CR>
|
||||
" 'git log (log?)' and 'git log buffer '
|
||||
map <leader>gll <Cmd>Commits<CR>
|
||||
map <leader>glb <Cmd>BCommits<CR>
|
||||
" TODO: <leader>glb should restrict the log to all staged files when called
|
||||
" in .git/COMMIT_EDITMSG, maybe with an ftplugin?
|
||||
endif
|
||||
|
||||
" Y should behave like D & C does
|
||||
nnoremap Y y$
|
||||
|
||||
@@ -1,6 +1,20 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
git for-each-ref --format='%(upstream),%(refname)' refs/heads refs/remotes \
|
||||
local idx="${@[(ei)--help]}"
|
||||
local flags_end="${@[(ei)--]}"
|
||||
if (( idx < flags_end )); then
|
||||
printf "Usage: $0 [--all] [REMOTE]..."
|
||||
return 0
|
||||
fi
|
||||
|
||||
idx="${@[(ei)--all]}"
|
||||
if (( idx < flags_end )); then
|
||||
# Replace --all flag with empty string. Will be replaced with
|
||||
# refs/remotes/ later so that all remotes are listed
|
||||
set -- "${@[1,$((idx-1))]}" "" "${@[$((idx+1)),-1]}"
|
||||
fi
|
||||
|
||||
git for-each-ref --format='%(upstream),%(refname)' refs/heads "${@/#/refs/remotes/}" \
|
||||
| sort -d \
|
||||
| sed -Ez '
|
||||
s:(^|\n|,)refs/(heads|remotes/):\1:g
|
||||
@@ -8,9 +22,8 @@ git for-each-ref --format='%(upstream),%(refname)' refs/heads refs/remotes \
|
||||
s:,/:,:g
|
||||
s:(^|\n)([^,]+),\n\2:\1\2:g
|
||||
s:(^|\n)([^/,]*)([^\n]*\n\2(,|/))*:\n,\n&:g
|
||||
s:\n,\n+$:\n:
|
||||
' \
|
||||
| (echo remote,local; cat) \
|
||||
s:\n,\n+$:\n:' \
|
||||
| { echo remote,local; cat; } \
|
||||
| sed -E 's:(.*),(.*):\2,\1:g; s:^,: ,:; s:,$:, :' \
|
||||
| column -ts, \
|
||||
| sed '2d; 1{p;s/./―/g}'
|
||||
|
||||
@@ -183,7 +183,7 @@ fi
|
||||
# Default flags
|
||||
add_flags ls --color=auto --group-directories-first -p -v
|
||||
add_flags grep --color=auto --exclude-dir=.git --exclude=tags
|
||||
add_flags cp -i
|
||||
add_flags cp -ia
|
||||
add_flags mv -i
|
||||
# Only add flags if rm is not aliased to a different command (e.g. trash).
|
||||
# NOTE: This also works if rm is not yet aliased.
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
#
|
||||
# Remove ANSI escape sequences.
|
||||
|
||||
env LC_ALL=C sed 's/\[[0-?]*[ -/]*[@-z]//g'
|
||||
env LC_ALL=C sed 's/\[[0-?]*[ -/]*[@-~]//g'
|
||||
|
||||
Reference in New Issue
Block a user