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

Compare commits

...

11 Commits

3 changed files with 40 additions and 10 deletions

15
.bashrc
View File

@@ -1,8 +1,14 @@
bind "set completion-ignore-case on" if [[ $- = *i* ]]; then
bind "set show-all-if-ambiguous on" bind "set completion-ignore-case 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 -R --mouse'
@@ -34,6 +40,7 @@ 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

@@ -47,18 +47,22 @@ 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-J> a:vim sethandler <A-J> a:vim
sethandler <A-K> a:vim sethandler <A-K> a:vim
sethandler <A-L> a:vim sethandler <A-L> a:vim
sethandler <A-M> a:vim
sethandler <A-N> a:vim sethandler <A-N> a:vim
sethandler <A-O> a:vim sethandler <A-O> a:vim
sethandler <A-P> a:vim sethandler <A-P> a:vim
sethandler <A-S-B> a:vim sethandler <A-S-B> a:vim
sethandler <A-S-E> a:vim
sethandler <A-S-H> a:vim sethandler <A-S-H> a:vim
sethandler <A-S-J> a:vim sethandler <A-S-J> a:vim
sethandler <A-S-K> a:vim sethandler <A-S-K> a:vim
sethandler <A-S-L> a:vim sethandler <A-S-L> a:vim
sethandler <A-S-M> a:vim
sethandler <A-S-O> a:vim sethandler <A-S-O> a:vim
sethandler <A-V> a:vim sethandler <A-V> a:vim
sethandler <A-X> a:vim sethandler <A-X> a:vim
@@ -129,8 +133,8 @@ nnoremap L [w
nnoremap H [b nnoremap H [b
" Navigate to end of previous word " Navigate to end of previous word
noremap <A-b> ge noremap <A-e> ge
noremap <A-S-b> gE noremap <A-S-e> gE
" Navigate unmatched parentheses/braces " Navigate unmatched parentheses/braces
noremap g( [( noremap g( [(
@@ -163,8 +167,8 @@ xnoremap > >gv
xnoremap = =gv xnoremap = =gv
" Extend selection " Extend selection
xmap x <Action>(EditorSelectWord) map <A-m> <Action>(EditorSelectWord)
xmap X <Action>(EditorUnSelectWord) 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
@@ -218,12 +222,15 @@ map <expr> <A-k> pumvisible() ? '<Action>(EditorUp)' : '<Action>(EditorCloneCare
imap <expr> <A-j> pumvisible() ? '<Action>(EditorDown)' : '<Action>(EditorCloneCaretBelow)' imap <expr> <A-j> pumvisible() ? '<Action>(EditorDown)' : '<Action>(EditorCloneCaretBelow)'
imap <expr> <A-k> pumvisible() ? '<Action>(EditorUp)' : '<Action>(EditorCloneCaretAbove)' 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>m <Action>(MoveEditorToOppositeTabGroup)
map <C-w>s <Action>(MoveTabDown) map <C-w>s <Action>(MoveTabDown)
map <C-w>u <Action>(Unsplit) map <C-w>u <Action>(Unsplit)
map <C-w>U <Action>(UnsplitAll) map <C-w>U <Action>(UnsplitAll)
map <C-w>v <Action>(MoveTabRight) map <C-w>v <Action>(MoveTabRight)
map <C-w>p <Action>(PinActiveEditorTab)
noremap <C-w>S <C-w>s noremap <C-w>S <C-w>s
noremap <C-w>V <C-w>v noremap <C-w>V <C-w>v

20
.vimrc
View File

@@ -1,5 +1,6 @@
set autoindent set autoindent
set backspace=indent,eol,start 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 guifont=Cascadia_Mono:h12:cANSI:qDRAFT
set guioptions-=t " Remove menu tearoff set guioptions-=t " Remove menu tearoff
@@ -16,6 +17,7 @@ set modeline
set modelines=2 set modelines=2
set mouse=a set mouse=a
set noerrorbells set noerrorbells
set nojoinspaces
set noshowcmd set noshowcmd
set noshowmode set noshowmode
set nrformats-=octal set nrformats-=octal
@@ -38,6 +40,10 @@ set wildmenu
set winaltkeys=no set winaltkeys=no
set wrap set wrap
if has("patch-9.1.0463")
set completeopt+=fuzzy
endif
" Windows paths " Windows paths
set packpath=$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME set packpath=$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME
set runtimepath=$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME set runtimepath=$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME
@@ -118,8 +124,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-b> ge noremap <M-e> ge
noremap <M-S-b> gE noremap <M-S-e> gE
" Navigate soft-wrapped lines " Navigate soft-wrapped lines
nnoremap <expr> j v:count ? 'j' : 'gj' nnoremap <expr> j v:count ? 'j' : 'gj'
@@ -175,6 +181,16 @@ xnoremap P p
" Clear search highlights " Clear search highlights
nnoremap <Esc> :nohlsearch<Return><Esc> 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 " Use Ctrl for selection and clipboard
nnoremap <C-a> ggVG nnoremap <C-a> ggVG
xnoremap <C-a> ggoG xnoremap <C-a> ggoG