1
0
mirror of https://github.com/chylex/dotfiles.git synced 2026-02-14 15:06:13 +01:00

Compare commits

...

20 Commits

Author SHA1 Message Date
87894a11b5 Update .vimrc (prevent deleting whitespace on empty lines when exiting Normal mode) 2026-01-31 05:32:47 +01:00
d476fb1e73 Update .bashrc (fix tmux mouse and keyboard issues after exiting ssh) 2026-01-15 06:41:14 +01:00
f5c5ce694c Update .vimrc (disable fuzzy completion on old Vim versions) 2026-01-15 05:12:28 +01:00
a2d3fc277d Update .bashrc (improve history with multiple sessions) 2026-01-15 04:52:13 +01:00
ca62ab26f8 Update .bashrc (fix bind warning in non-interactive shells) 2026-01-15 04:33:49 +01:00
31f48f8934 Update .vimrc (disable joinspaces) 2025-12-09 13:36:47 +01:00
fccc21fd41 Update .vimrc (completion bindings) 2025-12-09 13:04:59 +01:00
b7c2d47407 Update .ideavimrc (add binding to pin editor tab) 2025-11-24 09:48:08 +01:00
c17b6235ac Update .ideavimrc (add binding to add caret on all selected lines) 2025-11-24 09:47:43 +01:00
c9c8216e64 Update .ideavimrc (change binding to extend/shrink selection) 2025-09-30 15:37:36 +02:00
21904bbb62 Update .vimrc & .ideavimrc (change binding to navigate to the end of previous word) 2025-09-30 15:37:36 +02:00
d76b82721d Update .vimrc (disable bell sound) 2025-09-10 14:04:01 +02:00
580a47aa9b Update .ideavimrc (work around broken shortcuts in Rider) 2025-08-18 23:38:28 +02:00
946f464aca Update .vimrc (use Ctrl-S to save) 2025-08-17 10:01:24 +02:00
1e5c7a752e Update .vimrc (fix pasting via Ctrl-V in insert mode) 2025-08-17 09:51:13 +02:00
c1fac762be Update .ideavimrc (add bindings to move statement/element) 2025-08-15 18:45:41 +02:00
8cd0b37833 Update .ideavimrc (add bindings to extend/shrink selection) 2025-08-15 02:34:16 +02:00
5cbaf5587d Update .vimrc & .ideavimrc (indent current line with just '<' or '>') 2025-08-06 23:47:48 +02:00
7b5bbf7bb7 Update .vimrc & .ideavimrc (fix 'ů' mapping with matchit) 2025-07-28 02:01:32 +02:00
6d1840a48c Update .vimrc (always show leading and trailing spaces) 2025-07-22 13:34:25 +02:00
3 changed files with 96 additions and 31 deletions

View File

@@ -1,8 +1,14 @@
if [[ $- = *i* ]]; then
bind "set completion-ignore-case on"
bind "set show-all-if-ambiguous on"
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
fi
shopt -s histappend
HISTCONTROL=ignoreboth
PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
alias gh='history|grep'
alias less='less -R --mouse'
@@ -34,6 +40,7 @@ function ssh() {
tmux rename-window -t"${TMUX_PANE}" "$*"
command ssh "$@"
tmux set-window-option automatic-rename "on"
vim +q # Fix terminal
else
command ssh "$@"
fi

View File

@@ -47,14 +47,22 @@ sethandler <C-Y> a:ide
sethandler <C-\> a:ide
sethandler <A-B> a:vim
sethandler <A-E> a:vim
sethandler <A-H> a:vim
sethandler <A-J> a:vim
sethandler <A-K> a:vim
sethandler <A-L> a:vim
sethandler <A-M> a:vim
sethandler <A-N> a:vim
sethandler <A-O> a:vim
sethandler <A-P> a:vim
sethandler <A-S-B> a:vim
sethandler <A-S-E> a:vim
sethandler <A-S-H> a:vim
sethandler <A-S-J> a:vim
sethandler <A-S-K> a:vim
sethandler <A-S-L> a:vim
sethandler <A-S-M> a:vim
sethandler <A-S-O> a:vim
sethandler <A-V> a:vim
sethandler <A-X> a:vim
@@ -72,6 +80,12 @@ sethandler <C-Right> a:vim
sethandler <S-Left> a:vim
sethandler <S-Right> a:vim
if &ide =~? 'rider'
" These shortcuts are broken in Rider for some reason...
sethandler <A-S-H> a:ide
sethandler <A-S-L> a:ide
endif
" Enable plugins (https://github.com/JetBrains/ideavim/wiki/IdeaVim-Plugins)
Plug 'argtextobj.vim'
Plug 'vim-exchange'
@@ -98,8 +112,8 @@ map í 9
map é 0
" Move some commands closer on Czech keyboard layout
map ů %
nnoremap ú @@
noremap ů %
noremap , +
noremap § `
@@ -109,6 +123,9 @@ nnoremap m§ m
sunmap ů
sunmap §
" Enter visual block mode
map <A-v> <C-v>
" Navigate camel humps
noremap L [w
noremap H [b
@@ -116,8 +133,8 @@ nnoremap L [w
nnoremap H [b
" Navigate to end of previous word
noremap <A-b> ge
noremap <A-S-b> gE
noremap <A-e> ge
noremap <A-S-e> gE
" Navigate unmatched parentheses/braces
noremap g( [(
@@ -136,20 +153,23 @@ nnoremap go o<Esc>$
nnoremap gO O<Esc>$
nnoremap g<CR> i<CR><Esc>l
" Delete lines
" Edit current line
nnoremap C cc
xnoremap C cc
nnoremap D dd
xnoremap D dd
" Enter visual block mode
map <A-v> <C-v>
nnoremap < <<
nnoremap > >>
" Indent keeping selection
xnoremap < <gv
xnoremap > >gv
xnoremap = =gv
" Extend selection
map <A-m> <Action>(EditorSelectWord)
map <A-S-m> <Action>(EditorUnSelectWord)
" Turn capital letters into opposite actions
" nnoremap U :redo<CR> " Handled by custom version of IdeaVIM
@@ -188,6 +208,13 @@ map ] <Action>(MethodDown)
map { <Plug>(ParagraphPrevMotion)$
map } <Plug>(ParagraphNextMotion)$
" Move statement/element
map <A-S-h> <Action>(MoveElementLeft)
map <A-S-l> <Action>(MoveElementRight)
map <A-S-j> <Action>(MoveStatementDown)
map <A-S-k> <Action>(MoveStatementUp)
" Multiple carets
map <expr> <A-j> pumvisible() ? '<Action>(EditorDown)' : '<Action>(EditorCloneCaretBelow)'
map <expr> <A-k> pumvisible() ? '<Action>(EditorUp)' : '<Action>(EditorCloneCaretAbove)'
@@ -195,12 +222,15 @@ map <expr> <A-k> pumvisible() ? '<Action>(EditorUp)' : '<Action>(EditorCloneCare
imap <expr> <A-j> pumvisible() ? '<Action>(EditorDown)' : '<Action>(EditorCloneCaretBelow)'
imap <expr> <A-k> pumvisible() ? '<Action>(EditorUp)' : '<Action>(EditorCloneCaretAbove)'
xmap gl <Action>(EditorAddCaretPerSelectedLine)
" Manage editor tabs
map <C-w>m <Action>(MoveEditorToOppositeTabGroup)
map <C-w>s <Action>(MoveTabDown)
map <C-w>u <Action>(Unsplit)
map <C-w>U <Action>(UnsplitAll)
map <C-w>v <Action>(MoveTabRight)
map <C-w>p <Action>(PinActiveEditorTab)
noremap <C-w>S <C-w>s
noremap <C-w>V <C-w>v

68
.vimrc
View File

@@ -1,5 +1,6 @@
set autoindent
set backspace=indent,eol,start
set completeopt=menuone,preview
set encoding=utf-8
set guifont=Cascadia_Mono:h12:cANSI:qDRAFT
set guioptions-=t " Remove menu tearoff
@@ -10,11 +11,13 @@ set incsearch
set infercase
set laststatus=2
set linebreak
set listchars=space,tab:>·,trail:~,extends:>,precedes:<
set list
set listchars=lead,trail,tab:→\ ,extends:>,precedes:<
set modeline
set modelines=2
set mouse=a
set noerrorbells
set nojoinspaces
set noshowcmd
set noshowmode
set nrformats-=octal
@@ -37,6 +40,10 @@ set wildmenu
set winaltkeys=no
set wrap
if has("patch-9.1.0463")
set completeopt+=fuzzy
endif
" Windows paths
set packpath=$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME
set runtimepath=$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME
@@ -55,9 +62,14 @@ else
highlight Visual ctermfg=240 ctermbg=250
endif
highlight SpecialKey ctermfg=8 guifg=#584f46
" Windows GUI
if has("win32") && has("gui_running")
au GUIEnter * simalt ~x " Maximize window
autocmd GUIEnter * simalt ~x " Maximize window
autocmd GUIEnter * set visualbell t_vb= " Disable bell sound
set listchars+=tab:▶\
set renderoptions=type:directx " Fix unicode rendering
set showbreak=→\
endif
@@ -86,8 +98,8 @@ map í 9
map é 0
" Move some commands closer on Czech keyboard layout
map ů %
nnoremap ú @@
noremap ů %
noremap , +
noremap § `
@@ -97,6 +109,9 @@ nnoremap m§ m
sunmap ů
sunmap §
" Enter visual block mode
noremap <M-v> <C-v>
" Navigate camel humps (https://github.com/vim-scripts/camelcasemotion)
map L <Plug>CamelCaseMotion_w
map H <Plug>CamelCaseMotion_b
@@ -109,8 +124,8 @@ omap iH <Plug>CamelCaseMotion_ib
xmap iH <Plug>CamelCaseMotion_ib
" Navigate to end of previous word
noremap <M-b> ge
noremap <M-S-b> gE
noremap <M-e> ge
noremap <M-S-e> gE
" Navigate soft-wrapped lines
nnoremap <expr> j v:count ? 'j' : 'gj'
@@ -140,25 +155,13 @@ nnoremap go o<Esc>$
nnoremap gO O<Esc>$
nnoremap g<CR> i<CR><Esc>l
" Delete lines
" Edit current line
nnoremap C cc
xnoremap C cc
nnoremap D dd
xnoremap D dd
" Enter visual block mode
noremap <M-v> <C-v>
" Use Ctrl for selection and clipboard
nnoremap <C-a> ggVG
xnoremap <C-a> ggoG
xnoremap <C-c> "+y
xnoremap <C-x> "+x
noremap <C-v> "+gP
inoremap <C-v> <Esc>:set paste<CR>i<C-r>+<Esc>:set nopaste<CR>i
cnoremap <C-v> <C-r>+
nnoremap < <<
nnoremap > >>
" Indent keeping selection
xnoremap < <gv
@@ -178,6 +181,31 @@ xnoremap P p
" Clear search highlights
nnoremap <Esc> :nohlsearch<Return><Esc>
" Prevent deleting whitespace on empty lines when exiting Normal mode
inoremap <silent> <Esc> <C-O>:stopinsert<CR>
" Completion
inoremap <C-Space> <C-n>
inoremap <expr> j pumvisible() ? '<C-n>' : 'j'
inoremap <expr> k pumvisible() ? '<C-p>' : 'k'
inoremap <expr> <Esc> pumvisible() ? '<C-e>' : '<Esc>'
inoremap <expr> <Enter> pumvisible() ? '<C-y>' : '<Enter>'
" Use Ctrl for selection and clipboard
nnoremap <C-a> ggVG
xnoremap <C-a> ggoG
xnoremap <C-c> "+y
xnoremap <C-x> "+x
noremap <C-v> "+gP
inoremap <C-v> <C-o>:set paste<CR><C-r>+<C-o>:set nopaste<CR>
cnoremap <C-v> <C-r>+
nnoremap <C-s> :w<CR>
xnoremap <C-s> :<C-U>w<CR>gv
inoremap <C-s> <C-o>:w<CR>
" Update search register when using f/t
function FindChar(action, reverse, search_affix)
let t:reverse_search = a:reverse