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]
|
[branch]
|
||||||
autosetuprebase = always
|
autosetuprebase = always
|
||||||
sort = -committerdate
|
sort = -committerdate
|
||||||
|
[clone]
|
||||||
|
filterSubmodules = yes
|
||||||
[color "status"]
|
[color "status"]
|
||||||
added = 076
|
added = 076
|
||||||
untracked = 014
|
untracked = 014
|
||||||
@@ -65,8 +67,7 @@
|
|||||||
[core]
|
[core]
|
||||||
abbrev = 12
|
abbrev = 12
|
||||||
#pager = delta
|
#pager = delta
|
||||||
pager = diff-so-fancy \
|
pager = diff-so-fancy | less --tabs=8 --RAW-CONTROL-CHARS
|
||||||
| less --tabs=8 --RAW-CONTROL-CHARS --quit-if-one-screen
|
|
||||||
whitespace = trailing-spaces,space-before-tab,indent-with-non-tab
|
whitespace = trailing-spaces,space-before-tab,indent-with-non-tab
|
||||||
[delta]
|
[delta]
|
||||||
navigate = true
|
navigate = true
|
||||||
@@ -114,7 +115,7 @@
|
|||||||
[rebase]
|
[rebase]
|
||||||
autostash = true
|
autostash = true
|
||||||
[rerere]
|
[rerere]
|
||||||
enabled = true
|
enabled = false
|
||||||
[status]
|
[status]
|
||||||
submodulesummary = true
|
submodulesummary = true
|
||||||
[submodule]
|
[submodule]
|
||||||
|
|||||||
@@ -1763,7 +1763,7 @@ close_on_child_death yes
|
|||||||
#: special value of ask means that kitty will ask before opening the
|
#: special value of ask means that kitty will ask before opening the
|
||||||
#: link when clicked.
|
#: link when clicked.
|
||||||
|
|
||||||
# shell_integration enabled
|
shell_integration no-cursor
|
||||||
|
|
||||||
#: Enable shell integration on supported shells. This enables features
|
#: Enable shell integration on supported shells. This enables features
|
||||||
#: such as jumping to previous prompts, browsing the output of the
|
#: 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
|
#: 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
|
#:: Open a currently visible URL using the keyboard. The program used
|
||||||
#:: to open the URL is specified in open_url_with.
|
#:: 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
|
set -g remain-on-exit on
|
||||||
if -F "#{>=:#{version},3.3}" {
|
if -F "#{>=:#{version},3.3}" {
|
||||||
bind -n C-d if -F "#{pane_dead}" { kill-pane } { send }
|
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 }
|
bind -n Enter if -F "#{pane_dead}" { respawn-pane } { send }
|
||||||
} {
|
} {
|
||||||
# omitting the key argument was introduced in 3.3
|
# omitting the key argument was introduced in 3.3
|
||||||
bind -n C-d if -F "#{pane_dead}" { kill-pane } { send C-d }
|
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 }
|
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
|
" needs vim >= 8.1.1719 to support features like popup and text property as well
|
||||||
" as nodejs.
|
" as nodejs.
|
||||||
if ((has('patch-8.1.1719') || has('nvim')) && executable('node'))
|
if ((has('patch-8.1.1719') || has('nvim')) && executable('node'))
|
||||||
let g:coc_global_extensions =
|
let g:coc_global_extensions = [
|
||||||
\ ['coc-clangd', 'coc-sh', 'coc-pyright', 'coc-vimtex', 'coc-vimlsp', 'coc-json']
|
\ 'coc-clangd', 'coc-sh', 'coc-pyright', 'coc-vimtex',
|
||||||
|
\ 'coc-vimlsp', 'coc-json', 'coc-go'
|
||||||
|
\ ]
|
||||||
let g:coc_config_home = $XDG_CONFIG_HOME .. "/vim"
|
let g:coc_config_home = $XDG_CONFIG_HOME .. "/vim"
|
||||||
packadd coc.nvim
|
packadd coc.nvim
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -6,10 +6,6 @@ if !exists('g:did_coc_loaded')
|
|||||||
finish
|
finish
|
||||||
endif
|
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
|
" Always show the signcolumn, otherwise it would shift the text each time
|
||||||
" diagnostics appear/become resolved.
|
" diagnostics appear/become resolved.
|
||||||
set signcolumn=yes
|
set signcolumn=yes
|
||||||
|
|||||||
@@ -91,17 +91,20 @@ elseif (has('terminal'))
|
|||||||
nmap <leader><CR> <Cmd>terminal<CR>
|
nmap <leader><CR> <Cmd>terminal<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Plugin specific bindings
|
|
||||||
if (get(g:, 'loaded_fzf'))
|
if (get(g:, 'loaded_fzf'))
|
||||||
nmap <leader>f <Cmd>Files<CR>
|
nmap <leader>ff <Cmd>Files<CR>
|
||||||
nmap <leader>j <Cmd>Lines<CR>
|
nmap <leader>fj <Cmd>Lines<CR>
|
||||||
nmap <leader>/ <Cmd>Lines<CR>
|
nmap <leader>f/ <Cmd>Lines<CR>
|
||||||
nmap <leader>h <Cmd>Helptags<CR>
|
nmap <leader>fh <Cmd>Helptags<CR>
|
||||||
" TODO: fix this?
|
nmap <leader>ft <Cmd>Tags<CR>
|
||||||
if (get(g:, 'loaded_gutentags') || 1)
|
nmap <leader>fbt <Cmd>BTags<CR>
|
||||||
nmap <leader>t <Cmd>Tags<CR>
|
" git files that `git status` lists
|
||||||
nmap <leader>bt <Cmd>BTags<CR>
|
nmap <leader>fgf <Cmd>GFiles?<CR>
|
||||||
endif
|
" '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
|
endif
|
||||||
|
|
||||||
" Search for selected text.
|
" 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)
|
" 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
|
" 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
|
" 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>
|
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
|
" Add, stash or checkout the current file
|
||||||
" TODO: Conflict with <leader>gf
|
nmap <leader>gfa <Cmd>!git add -- %<CR>
|
||||||
"nmap <leader>gfa <Cmd>!git add -- %<CR>
|
nmap <leader>gfs <Cmd>!git stash -- %<CR>
|
||||||
"nmap <leader>gfs <Cmd>!git stash -- %<CR>
|
nmap <leader>gfu <Cmd>!git checkout -- %<CR>
|
||||||
"nmap <leader>gfu <Cmd>!git checkout -- %<CR>
|
|
||||||
|
|
||||||
if exists('g:loaded_fugitive')
|
if exists('g:loaded_fugitive')
|
||||||
" Interactive `git status`
|
" Interactive `git status`
|
||||||
@@ -191,19 +194,12 @@ if exists('g:loaded_gitgutter')
|
|||||||
xmap ih <Plug>(GitGutterTextObjectInnerVisual)
|
xmap ih <Plug>(GitGutterTextObjectInnerVisual)
|
||||||
xmap ah <Plug>(GitGutterTextObjectOuterVisual)
|
xmap ah <Plug>(GitGutterTextObjectOuterVisual)
|
||||||
" Same for hunk navigation bindings + center line
|
" 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>(GitGutterPrevHunk)zz
|
||||||
nmap ]h <Plug>(GitGutterNextHunk)zz
|
nmap ]h <Plug>(GitGutterNextHunk)zz
|
||||||
endif
|
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
|
" Y should behave like D & C does
|
||||||
nnoremap Y y$
|
nnoremap Y y$
|
||||||
|
|||||||
@@ -1,6 +1,20 @@
|
|||||||
#!/usr/bin/env zsh
|
#!/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 \
|
| sort -d \
|
||||||
| sed -Ez '
|
| sed -Ez '
|
||||||
s:(^|\n|,)refs/(heads|remotes/):\1:g
|
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:,/:,:g
|
||||||
s:(^|\n)([^,]+),\n\2:\1\2:g
|
s:(^|\n)([^,]+),\n\2:\1\2:g
|
||||||
s:(^|\n)([^/,]*)([^\n]*\n\2(,|/))*:\n,\n&:g
|
s:(^|\n)([^/,]*)([^\n]*\n\2(,|/))*:\n,\n&:g
|
||||||
s:\n,\n+$:\n:
|
s:\n,\n+$:\n:' \
|
||||||
' \
|
| { echo remote,local; cat; } \
|
||||||
| (echo remote,local; cat) \
|
|
||||||
| sed -E 's:(.*),(.*):\2,\1:g; s:^,: ,:; s:,$:, :' \
|
| sed -E 's:(.*),(.*):\2,\1:g; s:^,: ,:; s:,$:, :' \
|
||||||
| column -ts, \
|
| column -ts, \
|
||||||
| sed '2d; 1{p;s/./―/g}'
|
| sed '2d; 1{p;s/./―/g}'
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ fi
|
|||||||
# Default flags
|
# Default flags
|
||||||
add_flags ls --color=auto --group-directories-first -p -v
|
add_flags ls --color=auto --group-directories-first -p -v
|
||||||
add_flags grep --color=auto --exclude-dir=.git --exclude=tags
|
add_flags grep --color=auto --exclude-dir=.git --exclude=tags
|
||||||
add_flags cp -i
|
add_flags cp -ia
|
||||||
add_flags mv -i
|
add_flags mv -i
|
||||||
# Only add flags if rm is not aliased to a different command (e.g. trash).
|
# 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.
|
# NOTE: This also works if rm is not yet aliased.
|
||||||
|
|||||||
@@ -4,4 +4,4 @@
|
|||||||
#
|
#
|
||||||
# Remove ANSI escape sequences.
|
# 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