Compare commits
20 Commits
7f83427749
...
4f2a74e546
| Author | SHA1 | Date | |
|---|---|---|---|
|
4f2a74e546
|
|||
|
cb1821ba33
|
|||
|
5128d15251
|
|||
|
2b31632914
|
|||
|
27791acf50
|
|||
|
8aa76b3ee6
|
|||
|
6b866f5474
|
|||
|
4f6929bcce
|
|||
|
2495d835b4
|
|||
|
dda2ff640e
|
|||
|
87398bf712
|
|||
|
0a5b6d0767
|
|||
|
5b8f54b0cb
|
|||
|
ef5b2911bf
|
|||
|
768cb4ed4a
|
|||
|
f2ce78b6b3
|
|||
|
a3d2bf985c
|
|||
|
e8c5ec93f1
|
|||
|
ae52ba20d2
|
|||
|
ea2867fc9f
|
@@ -185,3 +185,6 @@ EXEC 01;92
|
||||
*.opus 00;36
|
||||
*.spx 00;36
|
||||
*.xspf 00;36
|
||||
|
||||
## Others
|
||||
*.pdf 01;95
|
||||
|
||||
@@ -79,6 +79,8 @@ bindsym $mod+Shift+v split horizontal
|
||||
bindsym $mod+f fullscreen toggle
|
||||
|
||||
# change container layout (stacked, tabbed, toggle split)
|
||||
#bindsym $mod+s layout stacking
|
||||
#bindsym $mod+w layout tabbed
|
||||
bindsym $mod+e layout toggle split
|
||||
|
||||
# toggle tiling / floating
|
||||
@@ -104,9 +106,7 @@ bindsym $mod+0 exec ~/.config/i3/multi-monitor-workspaces.sh -s 0
|
||||
|
||||
# switch back to the previous workspace
|
||||
workspace_auto_back_and_forth yes
|
||||
bindsym $mod+Tab exec i3-msg workspace "$( \
|
||||
i3-msg -t get_workspaces | \
|
||||
jq -r '.[] | select(.focused).name')"
|
||||
bindsym $mod+Tab workspace back_and_forth
|
||||
|
||||
# Switch visible workspaces (e.g. multi monitor setup)
|
||||
bindsym $mod+Shift+Tab exec i3-msg workspace "$( \
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#: <https://sw.kovidgoyal.net/kitty/kittens/choose-fonts/#font-spec-
|
||||
#: syntax>.
|
||||
|
||||
# font_size 11.0
|
||||
font_size 12.0
|
||||
|
||||
#: Font size (in pts).
|
||||
|
||||
@@ -630,7 +630,7 @@ mouse_hide_wait -1
|
||||
#: If empty (default) select_by_word_characters will be used for both
|
||||
#: directions.
|
||||
|
||||
# click_interval -1.0
|
||||
click_interval 0.4
|
||||
|
||||
#: The interval between successive clicks to detect double/triple
|
||||
#: clicks (in seconds). Negative numbers will use the system default
|
||||
|
||||
@@ -6,11 +6,17 @@
|
||||
# NOTE: the current file can be edited with `v` already, but this doesn't work
|
||||
# when reading from stdin
|
||||
# NOTE: ^P omits the "done" message
|
||||
# NOTE: '' jumps back to the previous position
|
||||
#
|
||||
# edit in vim without any ANSI SGR sequences (e.g. color)
|
||||
e noaction g|$no-ansi-sgr | nvim -\n
|
||||
# edit in vim without any ANSI escape sequences (e.g. color)
|
||||
e noaction g|$no-ansi | nvim -\n''
|
||||
# edit in vim while keeping them
|
||||
E noaction g|$nvim -\n
|
||||
E noaction g|$nvim -\n''
|
||||
# edit current screen in vim
|
||||
^E noaction |.no-ansi | nvim -\n
|
||||
|
||||
# copy whole file
|
||||
^Y noaction g|$xclip -selection clipboard\n''
|
||||
|
||||
#env
|
||||
# NOTE: Lines need a trailing space when concatenating
|
||||
|
||||
@@ -3,6 +3,9 @@ setlocal colorcolumn+=51
|
||||
setlocal textwidth=72
|
||||
" Spell checking always enabled
|
||||
setlocal spell spelllang=en
|
||||
" Disable C-indentation as it messes up formatting of paragraphs containing
|
||||
" parentheses
|
||||
setlocal nocindent
|
||||
|
||||
" Disable gutentags as it seems to regenerate the entire tags file when editing
|
||||
" git-commits...
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
" Turn on line-wrapping
|
||||
setlocal wrap
|
||||
" Disable C-indentation as it messes up formatting of paragraphs containing
|
||||
" parentheses
|
||||
setlocal nocindent
|
||||
|
||||
" Fold by sections
|
||||
function! MdSectionFold()
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
" Turn on line-wrapping
|
||||
setlocal wrap
|
||||
" Disable C-indentation as it messes up formatting of paragraphs containing
|
||||
" parentheses
|
||||
setlocal nocindent
|
||||
|
||||
" Close the quickfix window after a cursor movement
|
||||
let g:vimtex_quickfix_autoclose_after_keystrokes = 1
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
" Disable C-indentation as it messes up formatting of paragraphs containing
|
||||
" parentheses
|
||||
setlocal nocindent
|
||||
|
||||
" Don't highlight Unicode table separator (e.g. vertical box drawing character).
|
||||
" See vimrc.d/looks.vim for w:ignore_non_ascii_chars
|
||||
if vimwiki#vars#get_syntaxlocal('rxTableSep') !~ '[\d0-\d127]'
|
||||
|
||||
@@ -38,6 +38,12 @@ if (exists("g:loaded_tmux_navigator"))
|
||||
let g:tmux_navigator_disable_when_zoomed = 1
|
||||
endif
|
||||
|
||||
if (get(g:, 'loaded_fzf_vim'))
|
||||
let g:fzf_vim = {}
|
||||
" Use location list instead of quickfix list
|
||||
let g:fzf_vim.listproc = { list -> fzf#vim#listproc#location(list) }
|
||||
endif
|
||||
|
||||
if (get(g:, 'loaded_vimwiki'))
|
||||
" Use vertical box drawing character as table separator
|
||||
call vimwiki#vars#set_syntaxlocal('rxTableSep', '│')
|
||||
|
||||
@@ -64,7 +64,7 @@ endif
|
||||
|
||||
" Make <CR> to accept selected completion item or notify coc.nvim to format
|
||||
" <C-g>u starts a new undo break, please make your own choice.
|
||||
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
|
||||
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#_select_confirm()
|
||||
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
|
||||
|
||||
" Use `[g` and `]g` to navigate diagnostics
|
||||
|
||||
@@ -108,26 +108,39 @@ if (get(g:, 'loaded_fzf'))
|
||||
endif
|
||||
|
||||
" Search for selected text.
|
||||
" Modified from https://vim.fandom.com/wiki/Search_for_visually_selected_text
|
||||
function! GetVisualSelection()
|
||||
let l:old_reg = getreg('"')
|
||||
let l:old_regtype = getregtype('"')
|
||||
" Modified version of:
|
||||
" https://vim.fandom.com/wiki/Search_for_visually_selected_text
|
||||
" and https://github.com/neovim/neovim/blob/08847a9ea15a/runtime/lua/vim/_defaults.lua#L73-L79
|
||||
function! GetVisualSelection(escape = "", byteescape = 'n')
|
||||
let l:save_reg = getreginfo('"')
|
||||
norm gvy
|
||||
let l:sel = getreg('"')
|
||||
call setreg('"', l:old_reg, l:old_regtype)
|
||||
call setreg('"', l:save_reg)
|
||||
|
||||
let l:sel = l:sel->escape(a:escape)
|
||||
for l:char in a:byteescape
|
||||
let l:sel = l:sel->substitute('\'..l:char, '\\'..l:char, 'g')
|
||||
endfor
|
||||
|
||||
return l:sel
|
||||
endfunction
|
||||
|
||||
vmap * /\V<C-R>=escape(GetVisualSelection(),'/\')<CR><CR>
|
||||
vmap # ?\V<C-R>=escape(GetVisualSelection(),'?\')<CR><CR>
|
||||
" In case these do not exist already (At the time of writing only Neovim adds
|
||||
" mappings for these)
|
||||
if maparg('*', 'v', 0, 1) == {}
|
||||
vmap * /\V<C-R>=GetVisualSelection('/\')<CR><CR>
|
||||
vmap # ?\V<C-R>=GetVisualSelection('?\')<CR><CR>
|
||||
endif
|
||||
|
||||
" Extended `*`. Starts vim search (without jump) and ripgrep
|
||||
nmap <leader>* :let @/ = '\<' . expand('<cword>') . '\>' <bar>
|
||||
\ set hlsearch <bar>
|
||||
\ Rg \b<C-R>=expand('<cword>')<CR>\b<CR>
|
||||
vmap <leader>* :<C-U>let @/ = "\\V<C-R>=escape(escape(GetVisualSelection(), '\'), '"\')<CR>" <bar>
|
||||
" TODO: pass --multiline to rg when multiple lines selected
|
||||
" TODO: Use ^ and $ anchors in visual-line mode
|
||||
vmap <leader>* :<C-U>let @/ = "\\V<C-R>=escape(GetVisualSelection('\'), '"\')<CR>" <bar>
|
||||
\ set hlsearch <bar>
|
||||
\ Rg <C-R>=escape(GetVisualSelection(), '.\[]<bar>*+?{}^$()')<CR><CR>
|
||||
\ Rg <C-R>=GetVisualSelection('.\[]<bar>*+?{}^$()', 'nt')<CR><CR>
|
||||
nmap <leader>g* :let @/ = expand('<cword>') <bar>
|
||||
\ set hlsearch <bar>
|
||||
\ Rg <C-R>=expand('<cword>')<CR><CR>
|
||||
@@ -168,6 +181,8 @@ if exists('g:loaded_fugitive')
|
||||
nmap <leader>gcc <Cmd>G commit<CR>
|
||||
" Amend the current commit and open the message in a split
|
||||
nmap <leader>gca <Cmd>G commit --amend<CR>
|
||||
" Commit with the last commit message as template
|
||||
nmap <leader>gclm <Cmd>G commit-last-msg<CR>
|
||||
" Move to root of directory
|
||||
nmap <leader>gcd <Cmd>Gcd<CR>
|
||||
" git blame in scroll bound vertical split (only the commit hashes, see
|
||||
@@ -437,7 +452,7 @@ vnoremap <leader><C-L> gu
|
||||
" `ExpandVisualSelection(1)` which results in a block selection that spans over
|
||||
" all other TODOs as well.
|
||||
function! ExpandVisualSelection(direction)
|
||||
let l:sel = escape(GetVisualSelection(), '\')
|
||||
let l:sel = GetVisualSelection('\')
|
||||
normal gv
|
||||
|
||||
" Move the cursor onto the side of the selection that points in the
|
||||
|
||||
@@ -3,5 +3,26 @@
|
||||
# Copyright (c) 2025 Julian Prein
|
||||
#
|
||||
# Remove ANSI escape sequences.
|
||||
#
|
||||
# Additionally to the general form `\e[ -/]*[0-~]` this also tries to cover
|
||||
# sequences that are followed by additional bytes (e.g. CSI, OSC). This script
|
||||
# covers no C1 sequences.
|
||||
#
|
||||
# The patterns cover the following escape sequences (from top to bottom):
|
||||
# - CSI
|
||||
# - OSC, DCS, PM & APC
|
||||
# - SOS
|
||||
# - All remaining sequences
|
||||
#
|
||||
# See:
|
||||
# - https://en.wikipedia.org/wiki/ANSI_escape_code
|
||||
# - https://www.ecma-international.org/wp-content/uploads/ECMA-35_6th_edition_december_1994.pdf
|
||||
# - https://www.ecma-international.org/wp-content/uploads/ECMA-48_5th_edition_june_1991.pdf
|
||||
|
||||
env LC_ALL=C sed 's/\[[0-?]*[ -/]*[@-~]//g'
|
||||
env LC_ALL=C sed -E "$(printf "%b" \
|
||||
's/' \
|
||||
'\033\\[[0-?]*[ -/]*[@-~]' '|' \
|
||||
'\033[]P^_][\010-\015 -~]*\033\\\\' '|' \
|
||||
'\033X([^\033]|\033+[^\033X\\])*\033+\\\\' '|' \
|
||||
'\033[ -/]*[0-~]' \
|
||||
'//g')"
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
# Remove ANSI SGR (Select Graphic Rendition) escape sequences, e.g. setting
|
||||
# color or bold font.
|
||||
|
||||
env LC_ALL=C sed 's/\[[0-?]*[ -/]*m//g'
|
||||
env LC_ALL=C sed "$(printf 's/\033\\[[0-?]*[ -/]*m//g')"
|
||||
|
||||
Reference in New Issue
Block a user