1
0
mirror of https://github.com/chylex/dotfiles.git synced 2026-05-01 06:50:38 +02:00

Compare commits

..

1 Commits

5 changed files with 188 additions and 420 deletions

19
.bashrc
View File

@@ -1,20 +1,12 @@
if [[ $- = *i* ]]; then bind "set completion-ignore-case on"
bind "set completion-ignore-case on" bind "set show-all-if-ambiguous on"
bind "set show-all-if-ambiguous on"
bind '"\e[A": history-search-backward' bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward' 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 gh='history|grep'
alias less='less -R --mouse' alias less='less --mouse'
alias zless='zless -R --mouse'
alias lsa='ls -l -v --all --human-readable --group-directories-first --color=auto' alias lsa='ls -l -v --all --human-readable --group-directories-first --color=auto'
alias vim='vim -p'
alias d='docker' alias d='docker'
alias dc='docker compose' alias dc='docker compose'
@@ -40,7 +32,6 @@ function ssh() {
tmux rename-window -t"${TMUX_PANE}" "$*" tmux rename-window -t"${TMUX_PANE}" "$*"
command ssh "$@" command ssh "$@"
tmux set-window-option automatic-rename "on" tmux set-window-option automatic-rename "on"
vim +q # Fix terminal
else else
command ssh "$@" command ssh "$@"
fi fi

View File

@@ -1,5 +1,3 @@
set clipboard-=ideaput
set hlsearch
set ignorecase set ignorecase
set incsearch set incsearch
set number set number
@@ -25,75 +23,45 @@ set ideajoin
set idearefactormode=visual set idearefactormode=visual
" Configure IDE keybindings (https://github.com/JetBrains/ideavim/wiki/sethandler) " Configure IDE keybindings (https://github.com/JetBrains/ideavim/wiki/sethandler)
sethandler <C-a> a:ide sethandler <C-A> a:ide
sethandler <C-b> a:ide sethandler <C-B> a:ide
sethandler <C-c> a:ide sethandler <C-C> a:ide
sethandler <C-e> a:ide sethandler <C-E> a:ide
sethandler <C-f> a:ide sethandler <C-F> a:ide
sethandler <C-g> a:ide sethandler <C-G> a:ide
sethandler <C-h> a:ide sethandler <C-I> a:ide
sethandler <C-i> a:ide sethandler <C-H> a:ide
sethandler <C-j> a:ide sethandler <C-J> a:ide
sethandler <C-k> a:ide sethandler <C-K> a:ide
sethandler <C-l> a:ide sethandler <C-L> a:ide
sethandler <C-m> a:ide sethandler <C-M> a:ide
sethandler <C-r> a:ide sethandler <C-R> a:ide
sethandler <C-s> a:ide sethandler <C-S> a:ide
sethandler <C-t> a:ide sethandler <C-T> a:ide
sethandler <C-v> a:ide sethandler <C-V> a:ide
sethandler <C-w> a:ide sethandler <C-X> a:ide
sethandler <C-x> a:ide sethandler <C-Y> a:ide
sethandler <C-y> a:ide
sethandler <C-\> a:ide sethandler <C-\> a:ide
sethandler <A-b> a:vim sethandler <A-B> a:vim
sethandler <A-e> a:vim sethandler <A-H> a:vim
sethandler <A-h> a:vim sethandler <A-L> a:vim
sethandler <A-j> a:vim sethandler <A-P> a:vim
sethandler <A-k> a:vim sethandler <A-S-B> a:vim
sethandler <A-l> a:vim sethandler <A-X> a:vim
sethandler <A-m> a:vim sethandler <C-D> a:vim
sethandler <A-n> a:vim sethandler <C-I> a:vim
sethandler <A-o> a:vim sethandler <C-N> a:vim
sethandler <A-p> a:vim sethandler <C-O> a:vim
sethandler <A-S-b> a:vim sethandler <C-P> a:vim
sethandler <A-S-e> a:vim sethandler <C-U> a:vim
sethandler <A-S-h> a:vim sethandler <C-W> a:vim
sethandler <A-S-j> a:vim sethandler <C-S-W> 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
sethandler <C-A-S-d> a:vim
sethandler <C-A-S-s> a:vim
sethandler <C-d> a:vim
sethandler <C-i> a:vim
sethandler <C-n> a:vim
sethandler <C-o> a:vim
sethandler <C-p> a:vim
sethandler <C-S-w> a:vim
sethandler <C-u> a:vim
sethandler <D-S-d> a:vim
sethandler <D-S-s> a:vim
sethandler <S-BS> a:vim sethandler <S-BS> a:vim
sethandler <C-Enter> a:vim
sethandler <D-Enter> a:vim
sethandler <C-Left> a:vim
sethandler <S-Left> a:vim
sethandler <C-Right> 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) " Enable plugins (https://github.com/JetBrains/ideavim/wiki/IdeaVim-Plugins)
Plug 'argtextobj.vim' Plug 'argtextobj.vim'
Plug 'nerdtree'
Plug 'vim-exchange' Plug 'vim-exchange'
Plug 'vim-highlightedyank' Plug 'vim-highlightedyank'
Plug 'vim-indent-object' Plug 'vim-indent-object'
@@ -118,66 +86,52 @@ map í 9
map é 0 map é 0
" Move some commands closer on Czech keyboard layout " Move some commands closer on Czech keyboard layout
map ů %
nnoremap ú @@ nnoremap ú @@
noremap , + noremap ů ;
map § %
noremap § ` " Camel humps
noremap §§ ``
nnoremap m§ m
sunmap ů
sunmap §
" Enter visual block mode
map <A-v> <C-v>
" Navigate camel humps
noremap L [w noremap L [w
noremap H [b noremap H [b
nnoremap L [w xnoremap L ]w
nnoremap H [b xnoremap H ]b
" Navigate to end of previous word " Navigate to end of previous word
noremap <A-e> ge noremap <A-b> ge
noremap <A-S-e> gE noremap <A-S-b> gE
" Navigate unmatched parentheses/braces " Navigate editor tabs
noremap g( [( noremap <C-h> gT
noremap g) ]) noremap <C-l> gt
noremap g{ [{ inoremap <C-h> <C-o>gT
noremap g} ]} inoremap <C-l> <C-o>gt
" Increment/decrement numbers
noremap <Bar>+ <C-a>
noremap <Bar>- <C-x>
" Edit from cursor to start/end of parenthesized block " Edit from cursor to start/end of parenthesized block
nnoremap c) c]) nnoremap c) c])
nnoremap d) d]) nnoremap d) d])
nnoremap c( c[(( nnoremap c( c[((
nnoremap d( c[((<Esc>l nnoremap d( c[((<ESC>l
" Create lines " Delete lines
nnoremap go o<Esc>$
nnoremap gO O<Esc>$
nnoremap g<CR> i<CR><Left><Esc>
" Edit current line
nnoremap C cc nnoremap C cc
xnoremap C cc xnoremap C cc
nnoremap D dd nnoremap D dd
xnoremap D dd xnoremap D dd
nnoremap < <<
nnoremap > >> " Enter visual block mode
xnoremap v <C-V>
" Indent keeping selection " Indent keeping selection
xnoremap < <gv xnoremap < <gv
xnoremap > >gv 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 " Turn capital letters into opposite actions
" nnoremap U :redo<CR> " Handled by custom version of IdeaVIM " nnoremap U :redo<CR> " Handled by custom version of IdeaVim
" Reselect pasted text " Reselect pasted text
nnoremap gp `[v`] nnoremap gp `[v`]
@@ -186,167 +140,147 @@ nnoremap gp `[v`]
xnoremap p P xnoremap p P
xnoremap P p xnoremap P p
" Clear search highlights
nnoremap <Esc> :nohlsearch<Return><Esc>
" Code completion
if &ide !~? 'rider'
imap <expr> ! pumvisible() ? '<Action>(EditorChooseLookupItem)<Esc>mzF.bi!<Esc>`zla' : '!'
endif
" Show parameter info " Show parameter info
nmap <A-p> <Action>(ParameterInfo) nmap <A-p> <Action>(ParameterInfo)
imap <A-p> <Action>(ParameterInfo) imap <A-p> <Action>(ParameterInfo)
" Navigate back/forward " Navigate back/forward
map <BS> <Action>(Back) nmap <BS> <Action>(Back)
map <S-BS> <Action>(Forward) nmap <S-BS> <Action>(Forward)
" Navigate inspection highlights " Navigate inspection highlights
map ( <Action>(GotoPreviousError) nmap ( :raction GotoPreviousError<CR>
map ) <Action>(GotoNextError) nmap ) :raction GotoNextError<CR>
map <C-A-S-s> <Action>(KM.GotoPreviousErrorInOtherMode)
map <D-S-s> <Action>(KM.GotoPreviousErrorInOtherMode)
map <C-A-S-d> <Action>(KM.GotoNextErrorInOtherMode)
map <D-S-d> <Action>(KM.GotoNextErrorInOtherMode)
" Navigate to previous/next method " Navigate to previous/next method
map [ <Action>(MethodUp) nmap [[ :raction MethodUp<CR>
map ] <Action>(MethodDown) nmap ]] :raction MethodDown<CR>
" Navigate paragraphs at indentation " Navigate paragraphs at indentation
map { <Plug>(ParagraphPrevMotion)$ map { <Plug>(ParagraphPrevMotion)$
map } <Plug>(ParagraphNextMotion)$ 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)'
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 " Manage editor tabs
map <C-w>m <Action>(MoveEditorToOppositeTabGroup) map <C-w> <Action>(CloseContent)
map <C-w>s <Action>(MoveTabDown) map <C-S-w> <Action>(ReopenClosedTab)
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>
noremap <C-w>V <C-w>v
map <C-w><C-w>a <Action>(CloseAllEditors) noremap \\m :action MoveEditorToOppositeTabGroup<CR>
map <C-w><C-w>h <Action>(CloseAllToTheLeft) noremap \\s :action MoveTabDown<CR>
map <C-w><C-w>l <Action>(CloseAllToTheRight) noremap \\S <C-w>s
map <C-w><C-w>o <Action>(CloseAllEditorsButActive) noremap \\u :action Unsplit<CR>
noremap \\U :action UnsplitAll<CR>
noremap \\v :action MoveTabRight<CR>
noremap \\V <C-w>v
map \\ <C-w> noremap \\\\a :action CloseAllEditors<CR>
map \\\\ <C-w><C-w> noremap \\\\h :action CloseAllToTheLeft<CR>
noremap \\\\l :action CloseAllToTheRight<CR>
noremap \\\\o :action CloseAllEditorsButActive<CR>
" Rebind repurposed commands " Rebind repurposed commands
noremap g] ] nnoremap GG G
noremap g[ [ nnoremap dG dG
nnoremap cG cG
nnoremap M m nnoremap M m
nnoremap Z z nnoremap Z z
" Repurpose 'Enter' for statement completion ('isactionenabled' requires a custom version of IdeaVIM) " Repurpose 'Enter' for statement completion (requires a custom version of IdeaVIM)
nmap <Enter> <Action>(EditorCompleteStatement) nmap <Enter> <Action>(EditorCompleteStatement)
imap <expr> <C-Enter> isactionenabled('Console.Jdbc.Execute')? '<Action>(Console.Jdbc.Execute)' : '<Action>(EditorCompleteStatement)' " Repurpose 'g' for navigation (:raction requires a custom version of IdeaVIM)
imap <expr> <D-Enter> isactionenabled('Console.Jdbc.Execute')? '<Action>(Console.Jdbc.Execute)' : '<Action>(EditorCompleteStatement)' nmap gb :raction GotoNextBookmark<CR>
nmap gB :raction GotoPreviousBookmark<CR>
nmap gD <Action>(GotoTypeDeclaration)
nmap ge :raction VcsShowNextChangeMarker<CR>
nmap gE :raction VcsShowPrevChangeMarker<CR>
nmap gf <Action>(VimJumpToSource)<Action>(HideActiveWindow) " VimJumpToSource requires a custom version of IdeaVIM
nmap gi <Action>(GotoImplementation)
map gj :raction EditorCloneCaretBelow<CR>
map gk :raction EditorCloneCaretAbove<CR>
nmap gr <Action>(RecentLocations)
nmap gR <Action>(RecentChangedFiles)
nmap gs <Action>(GotoSuperMethod)
nmap gS <Action>(ShowSiblings)
map gt :raction KM.GotoNextTypeInFile<CR>
map gT :raction KM.GotoPreviousTypeInFile<CR>
nmap gu <Action>(ShowUsages)
nmap gU <Action>(FindUsages)
nmap g( :raction KM.GotoPreviousErrorInOtherMode<CR>
nmap g) :raction KM.GotoNextErrorInOtherMode<CR>
nmap <C-Enter> <Action>(Console.Jdbc.Execute) " Make bidirectional 'g' commands work with 'G' too
nmap <D-Enter> <Action>(Console.Jdbc.Execute) nmap Gb gb
vmap <C-Enter> <Action>(Console.Jdbc.Execute) nmap GB gB
vmap <D-Enter> <Action>(Console.Jdbc.Execute) nmap Ge ge
nmap GE gE
" Repurpose 'g' for navigation (VimJumpToSource requires a custom version of IdeaVIM) map Gj gj
map gb <Action>(GotoNextBookmark) map Gk gk
map gB <Action>(GotoPreviousBookmark) nmap Gt gt
map gD <Action>(GotoTypeDeclaration) nmap GT gT
map ge <Action>(VcsShowNextChangeMarker) map Gz gz
map gE <Action>(VcsShowPrevChangeMarker) map GZ gZ
map gf <Action>(VimJumpToSource)<Action>(HideActiveWindow)
map gi <Action>(GotoImplementation)
map gr <Action>(RecentLocations)
map gR <Action>(RecentChangedFiles)
map gs <Action>(GotoSuperMethod)
map gS <Action>(ShowSiblings)
map gt gg<Action>(KM.GotoNextTypeInFile)
map gT <Action>(KM.GotoNextTypeInFile)
map gu <Action>(ShowUsages)
map gU <Action>(FindUsages)
" Repurpose 'z' for view actions and debugger " Repurpose 'z' for view actions and debugger
map za <Action>(Annotate) map za <Action>(Annotate)
map zb <Action>(ViewBreakpoints) map zb <Action>(ViewBreakpoints)
map zc <Action>(EditorContextInfo) map zc <Action>(EditorContextInfo)
map zd <Action>(CompareClipboardWithSelection) map zd <Action>(QuickJavaDoc)
map ze <Action>(ShowErrorDescription) map ze <Action>(ShowErrorDescription)
map zf <Action>(SelectInProjectView) map zf <Action>(SelectInProjectView)
map zi <Action>(ShowHoverInfo)
map zm <Action>(ShowBookmarks)
map zp <Action>(QuickImplementations)
map zP <Action>(QuickTypeDefinition)
map zr <Action>(RunToCursor)
map zR <Action>(ForceRunToCursor)
map zs <Action>(osmedile.intellij.stringmanip.PopupChoiceAction)
map zt <Action>(ExpressionTypeInfo)
map zx <Action>(EvaluateExpression)
map zht <Action>(TypeHierarchy) map zht <Action>(TypeHierarchy)
map zhm <Action>(MethodHierarchy) map zhm <Action>(MethodHierarchy)
map zhc <Action>(CallHierarchy)
if &ide =~? 'rider'
map zhc <Action>(RiderShowIncomingCalls)
else
map zhc <Action>(CallHierarchy)
endif
nmap zhl <Action>(LocalHistory.ShowHistory) nmap zhl <Action>(LocalHistory.ShowHistory)
xmap zhl <Action>(LocalHistory.ShowSelectionHistory) xmap zhl <Action>(LocalHistory.ShowSelectionHistory)
nmap zhg <Action>(Vcs.ShowTabbedFileHistory) nmap zhg <Action>(Vcs.ShowTabbedFileHistory)
xmap zhg <Action>(Vcs.ShowHistoryForBlock) xmap zhg <Action>(Vcs.ShowHistoryForBlock)
" Repurpose 'm' for refactoring map zm <Action>(ShowBookmarks)
map mc <Action>(IntroduceConstant) map zp <Action>(QuickImplementations)
map md <Action>(SafeDelete) map zP <Action>(QuickTypeDefinition)
map me <Action>(Move)
map mf <Action>(IntroduceField)
map mg <Action>(Generate)
map mi <Action>(Inline)
map mm <Action>(ExtractMethod)
map mM <Action>(ExtractFunction)
map mn <Action>(RenameElement)
map mo <Action>(OverrideMethods)
map mp <Action>(IntroduceParameter)
map mP <Action>(IntroduceProperty)
map mr <Action>(Refactorings.QuickListPopupAction)
map ms <Action>(ChangeSignature)
map mS <Action>(NewScratchFile)
map mt <Action>(InsertLiveTemplate)
map mv <Action>(IntroduceVariable)
map mw <Action>(SurroundWith)
" Remap NERDTree bindings map zr <Action>(RunToCursor)
let g:NERDTreeMapOpenVSplit = 'v' map zR <Action>(ForceRunToCursor)
let g:NERDTreeMapPreviewVSplit = 'gv'
let g:NERDTreeMapOpenSplit = 's' map zt <Action>(ExpressionTypeInfo)
let g:NERDTreeMapPreviewSplit = 'gs' map zx <Action>(EvaluateExpression)
" Repurpose 'm' for refactoring (normal mode)
nmap md <Action>(SafeDelete)
nmap me <Action>(Move)
nmap mg <Action>(Generate)
nmap mi <Action>(Inline)
nmap mn <Action>(RenameElement)
nmap mo <Action>(OverrideMethods)
nmap ms <Action>(ChangeSignature)
nmap mS <Action>(NewScratchFile)
" Repurpose 'm' for refactoring (normal / visual mode)
nmap mc <Action>(IntroduceConstant)
xmap mc <Action>(IntroduceConstant)
nmap mf <Action>(IntroduceField)
xmap mf <Action>(IntroduceField)
nmap mm <Action>(ExtractMethod)
xmap mm <Action>(ExtractMethod)
nmap mM <Action>(ExtractFunction)
xmap mM <Action>(ExtractFunction)
nmap mp <Action>(IntroduceParameter)
xmap mp <Action>(IntroduceParameter)
nmap mP <Action>(IntroduceProperty)
xmap mP <Action>(IntroduceProperty)
nmap mr <Action>(Refactorings.QuickListPopupAction)
xmap mr <Action>(Refactorings.QuickListPopupAction)
nmap mt <Action>(InsertLiveTemplate)
xmap mt <Action>(SurroundWithLiveTemplate)
nmap mv <Action>(IntroduceVariable)
xmap mv <Action>(IntroduceVariable)
nmap mw <Action>(SurroundWith)
xmap mw <Action>(SurroundWith)
" Actions for custom version of AceJump " Actions for custom version of AceJump
set acejump set acejump
map <Space> <Action>(AceVimAction_JumpAllEditors) map <Space> <Action>(AceVimAction_JumpAllEditors)
map g<Space> <Action>(AceVimAction_JumpAllEditors_GoToDeclaration)

View File

@@ -6,8 +6,6 @@ set -g mouse on
set-window-option -g mode-keys vi set-window-option -g mode-keys vi
bind -T copy-mode-vi v send -X begin-selection bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi C-v send -X rectangle-toggle
bind -T copy-mode-vi M-v send -X rectangle-toggle
bind -T copy-mode-vi Enter send -X copy-selection-and-cancel bind -T copy-mode-vi Enter send -X copy-selection-and-cancel
unbind -T copy-mode-vi MouseDragEnd1Pane unbind -T copy-mode-vi MouseDragEnd1Pane

190
.vimrc
View File

@@ -1,9 +1,5 @@
set autoindent set autoindent
set backspace=indent,eol,start
set completeopt=menuone,preview
set encoding=utf-8 set encoding=utf-8
set guifont=Cascadia_Mono:h12:cANSI:qDRAFT
set guioptions-=t " Remove menu tearoff
set history=1024 set history=1024
set hlsearch set hlsearch
set ignorecase set ignorecase
@@ -11,79 +7,39 @@ set incsearch
set infercase set infercase
set laststatus=2 set laststatus=2
set linebreak set linebreak
set list set listchars=space,tab:>·,trail:~,extends:>,precedes:<
set listchars=lead,trail,tab:→\ ,extends:>,precedes:<
set modeline
set modelines=2
set mouse=a set mouse=a
set noerrorbells set noerrorbells
set nojoinspaces set nomodeline
set noshowcmd set noshowcmd
set noshowmode set noshowmode
set nrformats-=octal
set number set number
set nrformats-=octal
set relativenumber set relativenumber
set scrolloff=999 set scrolloff=999
set shiftwidth=0 set shiftwidth=0
set shortmess-=S " Show search count set showbreak=
set shortmess-=l " Show full description for lines and bytes
set showbreak=↪\
set showmatch set showmatch
set sidescrolloff=999 set sidescrolloff=999
set smartcase set smartcase
set tabstop=4 set tabstop=4
set ttimeout
set ttimeoutlen=50
set ttymouse=xterm2 set ttymouse=xterm2
set virtualedit=onemore
set wildmenu set wildmenu
set winaltkeys=no
set wrap set wrap
if has("patch-9.1.0463") " Show full description for lines and bytes
set completeopt+=fuzzy set shortmess-=l
endif
" Windows paths " Show search count
set packpath=$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME set shortmess-=S
set runtimepath=$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME
" Color scheme " Color scheme
syntax enable syntax enable
colorscheme custom
if has("gui_running") highlight LineNr ctermfg=244
colorscheme retrobox highlight IncSearch ctermfg=251 ctermbg=238
highlight NonText ctermfg=14 guifg=#7c6f64 highlight Search ctermfg=251 ctermbg=238
else highlight Visual ctermfg=240 ctermbg=250
colorscheme custom
highlight LineNr ctermfg=244
highlight IncSearch ctermfg=251 ctermbg=238
highlight Search ctermfg=251 ctermbg=238
highlight Visual ctermfg=240 ctermbg=250
endif
highlight SpecialKey ctermfg=8 guifg=#584f46
" Windows GUI
if has("win32") && has("gui_running")
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
" Fix Alt mappings (https://github.com/vim/vim/issues/2588#issuecomment-697959290)
for ord in range(65, 90) + range(97, 122)
let char = nr2char(ord)
exec printf("set <m-%s>=\<esc>%s", char, char)
exec printf("tnoremap <silent> <m-%s> <esc>%s", char, char)
endfor
" Navigate editor tabs
noremap <M-h> gT
noremap <M-l> gt
" Map top row on Czech keyboard layout to digits " Map top row on Czech keyboard layout to digits
map + 1 map + 1
@@ -98,21 +54,12 @@ map í 9
map é 0 map é 0
" Move some commands closer on Czech keyboard layout " Move some commands closer on Czech keyboard layout
map ů %
nnoremap ú @@ nnoremap ú @@
noremap , + noremap ů ;
map § %
noremap § `
noremap §§ ``
nnoremap m§ m
sunmap ů
sunmap § sunmap §
" Enter visual block mode " Camel humps (https://github.com/vim-scripts/camelcasemotion)
noremap <M-v> <C-v>
" Navigate camel humps (https://github.com/vim-scripts/camelcasemotion)
map L <Plug>CamelCaseMotion_w map L <Plug>CamelCaseMotion_w
map H <Plug>CamelCaseMotion_b map H <Plug>CamelCaseMotion_b
sunmap L sunmap L
@@ -124,8 +71,8 @@ omap iH <Plug>CamelCaseMotion_ib
xmap iH <Plug>CamelCaseMotion_ib xmap iH <Plug>CamelCaseMotion_ib
" Navigate to end of previous word " Navigate to end of previous word
noremap <M-e> ge noremap <A-b> ge
noremap <M-S-e> gE noremap <A-S-b> gE
" Navigate soft-wrapped lines " Navigate soft-wrapped lines
nnoremap <expr> j v:count ? 'j' : 'gj' nnoremap <expr> j v:count ? 'j' : 'gj'
@@ -133,35 +80,20 @@ xnoremap <expr> j v:count ? 'j' : 'gj'
nnoremap <expr> k v:count ? 'k' : 'gk' nnoremap <expr> k v:count ? 'k' : 'gk'
xnoremap <expr> k v:count ? 'k' : 'gk' xnoremap <expr> k v:count ? 'k' : 'gk'
nnoremap gj j
xnoremap gj j
nnoremap gk k
xnoremap gk k
" Navigate unmatched parentheses/braces
noremap g( [(
noremap g) ])
noremap g{ [{
noremap g} ]}
" Edit from cursor to start/end of parenthesized block " Edit from cursor to start/end of parenthesized block
nnoremap c) c]) nnoremap c) c])
nnoremap d) d]) nnoremap d) d])
nnoremap c( c[(( nnoremap c( c[((
nnoremap d( c[((<Esc>l nnoremap d( c[((<ESC>l
" Create lines " Delete lines
nnoremap go o<Esc>$
nnoremap gO O<Esc>$
nnoremap g<CR> i<CR><Esc>l
" Edit current line
nnoremap C cc nnoremap C cc
xnoremap C cc xnoremap C cc
nnoremap D dd nnoremap D dd
xnoremap D dd xnoremap D dd
nnoremap < <<
nnoremap > >> " Enter visual block mode
xnoremap v <C-V>
" Indent keeping selection " Indent keeping selection
xnoremap < <gv xnoremap < <gv
@@ -178,81 +110,6 @@ nnoremap gp `[v`]
xnoremap p P xnoremap p P
xnoremap P p 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
let char = nr2char(getchar())
if char == '\'
let query = '\\'
else
let query = '\C\V'.char.'\v'
endif
if a:reverse
call setreg('/', query.a:search_affix)
else
call setreg('/', a:search_affix.query)
endif
nohlsearch
execute 'normal! '.a:action.char
endfunction
function FindCharVisual(action, reverse, search_affix)
normal gv
call FindChar(a:action, a:reverse, a:search_affix)
endfunction
function! ResetReverseSearchFlag()
if getcmdtype() =~ "[/?]"
let t:reverse_search = 0
endif
endfunction
nmap f :call FindChar('f', 0, '')<CR>
nmap F :call FindChar('F', 1, '')<CR>
nmap t :call FindChar('t', 0, '\zs.\ze')<CR>
nmap T :call FindChar('T', 1, '\zs.\ze')<CR>
xmap f :call FindCharVisual('f', 0, '')<CR>
xmap F :call FindCharVisual('F', 1, '')<CR>
xmap t :call FindCharVisual('t', 0, '\zs.\ze')<CR>
xmap T :call FindCharVisual('T', 1, '\zs.\ze')<CR>
noremap <expr> n 'nN'[t:reverse_search]
noremap <expr> N 'Nn'[t:reverse_search]
cnoremap <CR> <cmd>call ResetReverseSearchFlag()<CR><CR>
" Plugin: https://github.com/easymotion/vim-easymotion.git " Plugin: https://github.com/easymotion/vim-easymotion.git
nmap <Space> <Plug>(easymotion-overwin-f) nmap <Space> <Plug>(easymotion-overwin-f)
xmap <Space> <Plug>(easymotion-s) xmap <Space> <Plug>(easymotion-s)
@@ -263,3 +120,4 @@ let g:highlightedyank_highlight_duration = 500
" Plugin: https://github.com/luochen1990/rainbow " Plugin: https://github.com/luochen1990/rainbow
let g:rainbow_active = 1 let g:rainbow_active = 1

View File

@@ -57,10 +57,6 @@
/* Tabs & toolbars */ /* Tabs & toolbars */
#navigator-toolbox {
border-bottom: none !important;
}
#toolbar-menubar { #toolbar-menubar {
min-height: 21px !important; min-height: 21px !important;
} }
@@ -108,33 +104,23 @@
padding: 0 1px !important; padding: 0 1px !important;
} }
/* Tab playback icons */
.tabbrowser-tab:not([pinned]) .tab-icon-stack:is([muted], [soundplaying], [activemedia-blocked]) {
grid-template-areas: "a s";
}
.tabbrowser-tab:not([pinned]) .tab-icon-overlay:is([muted], [soundplaying], [activemedia-blocked]) {
grid-area: a !important;
}
.tabbrowser-tab:not([pinned]) .tab-icon-stack[indicator-replaces-favicon] > :not(&) {
opacity: 1 !important;
grid-area: s;
}
/* Address bar */ /* Address bar */
#urlbar-container { #urlbar-container {
--urlbar-container-height: 34px !important; --urlbar-container-height: 34px !important;
margin-top: -2px !important;
margin-inline: 3px !important; margin-inline: 3px !important;
} }
#urlbar {
margin: 1px 0 !important;
}
#urlbar .urlbarView-row-inner { #urlbar .urlbarView-row-inner {
padding-block: 4px !important; padding-block: 4px !important;
} }
#urlbar .search-one-offs:not([hidden]) { #urlbar .search-one-offs:not([hidden]){
padding-block: 4px !important; padding-block: 4px !important;
} }
@@ -154,6 +140,7 @@
padding: 0 !important; padding: 0 !important;
-moz-padding-start: 0 !important; -moz-padding-start: 0 !important;
-moz-padding-end: 0 !important; -moz-padding-end: 0 !important;
border-top: 1px solid var(--chrome-content-separator-color) !important;
background-color: #0E0E0E !important; background-color: #0E0E0E !important;
z-index: 1000 !important; z-index: 1000 !important;
} }