1
0
mirror of https://github.com/chylex/dotfiles.git synced 2025-08-17 17:31:45 +02:00

Compare commits

...

11 Commits

2 changed files with 94 additions and 27 deletions

View File

@@ -55,6 +55,10 @@ sethandler <A-N> a:vim
sethandler <A-O> a:vim
sethandler <A-P> a:vim
sethandler <A-S-B> 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-O> a:vim
sethandler <A-V> a:vim
sethandler <A-X> a:vim
@@ -98,10 +102,19 @@ map í 9
map é 0
" Move some commands closer on Czech keyboard layout
nnoremap ú @@
noremap § ;
map ů %
map gů g%
nnoremap ú @@
noremap , +
noremap § `
noremap §§ ``
nnoremap m§ m
sunmap ů
sunmap §
" Enter visual block mode
map <A-v> <C-v>
" Navigate camel humps
noremap L [w
@@ -130,20 +143,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
xmap x <Action>(EditorSelectWord)
xmap X <Action>(EditorUnSelectWord)
" Turn capital letters into opposite actions
" nnoremap U :redo<CR> " Handled by custom version of IdeaVIM
@@ -182,6 +198,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)'

84
.vimrc
View File

@@ -1,5 +1,8 @@
set autoindent
set backspace=indent,eol,start
set encoding=utf-8
set guifont=Cascadia_Mono:h12:cANSI:qDRAFT
set guioptions-=t " Remove menu tearoff
set history=1024
set hlsearch
set ignorecase
@@ -7,19 +10,22 @@ 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 noshowcmd
set noshowmode
set number
set nrformats-=octal
set number
set relativenumber
set scrolloff=999
set shiftwidth=0
set showbreak=
set shortmess-=S " Show search count
set shortmess-=l " Show full description for lines and bytes
set showbreak=↪\
set showmatch
set sidescrolloff=999
set smartcase
@@ -27,22 +33,38 @@ set tabstop=4
set ttimeout
set ttimeoutlen=50
set ttymouse=xterm2
set virtualedit=onemore
set wildmenu
set winaltkeys=no
set wrap
" Show full description for lines and bytes
set shortmess-=l
" Show search count
set shortmess-=S
" Windows paths
set packpath=$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME
set runtimepath=$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME
" Color scheme
syntax enable
colorscheme custom
highlight LineNr ctermfg=244
highlight IncSearch ctermfg=251 ctermbg=238
highlight Search ctermfg=251 ctermbg=238
highlight Visual ctermfg=240 ctermbg=250
if has("gui_running")
colorscheme retrobox
highlight NonText ctermfg=14 guifg=#7c6f64
else
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")
au GUIEnter * simalt ~x " Maximize window
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)
@@ -68,11 +90,19 @@ map í 9
map é 0
" Move some commands closer on Czech keyboard layout
nnoremap ú @@
noremap § ;
map ů %
map g%
nnoremap ú @@
noremap , +
noremap § `
noremap §§ ``
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
@@ -117,14 +147,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
map <M-v> <C-v>
nnoremap < <<
nnoremap > >>
" Indent keeping selection
xnoremap < <gv
@@ -144,6 +173,21 @@ xnoremap P p
" Clear search highlights
nnoremap <Esc> :nohlsearch<Return><Esc>
" 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