+.config/yt-dlp.conf
[nethome.git] / .vimrc
diff --git a/.vimrc b/.vimrc
index 1ac303d..2322696 100644 (file)
--- a/.vimrc
+++ b/.vimrc
@@ -4,7 +4,7 @@
 if !exists("g:_kratochvil_vimrc")
        let g:_kratochvil_vimrc=1
 
-autocmd! filetypedetect
+"autocmd! filetypedetect
 "remove 'set tw=78':
 autocmd! BufRead *.txt
 
@@ -18,7 +18,7 @@ autocmd! BufRead *.txt
 autocmd BufCreate,VimEnter *                                             let g:BufEnter_ts= 8
 autocmd BufEnter * call BufEnter()
 autocmd VimEnter * call BufEnter()
-set runtimepath=.,$VIMRUNTIME
+set runtimepath+=.,$VIMRUNTIME
 function BufEnter()
        if exists("g:BufEnter_ts")
                unlet g:BufEnter_ts
@@ -39,11 +39,11 @@ function BufReadPost()
        endif
 endfunction
 
-set encoding=utf-8
-set termencoding=utf-8
+"set encoding=utf-8
+"set termencoding=utf-8
 " fileencoding is detected from fileencodings, first one for empty files
 " 'iso-8859-2,euc-jp' really does not work for 'euc-jp'
-set fileencodings=utf-8,euc-jp,iso-8859-2
+"set fileencodings=utf-8,euc-jp,iso-8859-2
 
 set ts=8
 set sw=2
@@ -51,7 +51,9 @@ set sts=2
 ca X x
 syntax off
 let g:loaded_matchparen = 1
-set swapsync=
+if !has('nvim')
+       set swapsync=
+endif
 " vim-7+ only
 silent! set nofsync
 set noerrorbells
@@ -66,6 +68,7 @@ set noincsearch
 set nofoldenable
 set fo=tcq1
 set nojoinspaces
+set clipboard=
 "set textwidth=78
 set viminfo='100,\"1000,:100,/40
 let g:netrw_home = $HOME
@@ -73,37 +76,47 @@ let g:netrw_home = $HOME
 if &term=="xterm" || &term=="xterm-256color"
        set t_Co=8
 endif
+set mouse=
 
 " FIXME: Learn how to do :tag instead of :tselect with :cstag (used by :tag and CTRL-] if set cst)
 set nocst
 set tags=./tags,./TAGS,./../tags,./../TAGS,./../../tags,./../../TAGS,./../../../tags,./../../../TAGS,./../../../../tags,./../../../../TAGS,./../../../../../tags,./../../../../../TAGS,./../../../../../../tags,./../../../../../../TAGS,./../../../../../../../tags,./../../../../../../../TAGS,./../../../../../../../../tags,./../../../../../../../../TAGS,./../../../../../../../../../tags,./../../../../../../../../../TAGS,./../../../../../../../../../../tags,./../../../../../../../../../../TAGS,./../../../../../../../../../../../tags,./../../../../../../../../../../../TAGS,./reactos/tags,./../reactos/tags,./../../reactos/tags,,./../../../reactos/tags,./../../../../reactos/tags,./../../../../../reactos/tags,./../../../../../../reactos/tags,./w32/inc/tags,./../w32/inc/tags,./../../w32/inc/tags,,./../../../w32/inc/tags,./../../../../w32/inc/tags,./../../../../../w32/inc/tags,./../../../../../../w32/inc/tags,./../../../../../../../w32/inc/tags,/usr/src/redhat/BUILD/tags,/usr/src/redhat/BUILD/TAGS,/usr/include/tags,/usr/include/TAGS
 
 noremap <Esc>p :set invpaste paste?<cr>
-noremap <Esc>l :set invlist paste?<cr>
+noremap <Esc>l :set invlist list?<cr>
 noremap <Esc>q @q
 noremap <Esc>: @:
 noremap <C-n> :next<cr>zz<C-g>
 noremap <C-p> :prev<cr>zz<C-g>
 noremap <Esc>N :tn<cr>zz<C-g>
-noremap <Esc>P :tp<cr>zz<C-g>
-"<Esc>P would auto-type random data after starting it on recent distros or Termux.
-"read(0, "\33P1$r0 q\33\\\33[?12;4$y", 4096) = 19
-noremap <Esc>P$r0<Space>q <Nop>
+if $ANDROID_DATA!=#"/data" && $SSH_CLIENT!~"^2a02:2b88:2:1::3b57:[89]f "
+  " It auto-types random data after starting it from Termux
+  " Now all VIM version are affected:
+  noremap <Esc>P :tp<cr>zz<C-g>
+  noremap <Esc>P1$r0<Space>q <Nop>
+endif
+" Termux types <F11>
+noremap! <Esc>[23~ <Nop>
 noremap <Esc>M :cn<cr>zz<C-g>
 noremap <Esc>L :cp<cr>zz<C-g>
-noremap <Esc>f "myiw:grep<Space>-Ew<Space>'<C-r>m'<Space>`git ls-files`
+" dnf install vim-fugitive
+noremap <Esc>f "myiw:Ggrep<Space>-Ew<Space>'<C-r>m'<Space>
+noremap <Esc>F "myiw:grep<Space>-Ew<Space>'<C-r>m'<Space>`git ls-files`
 noremap <Esc>g "myiw:grep<Space>-rEw<Space>'<C-r>m'<Space>.
 noremap <C-]> <C-]>zz<C-g>
 noremap <C-t> <C-t>zz<C-g>
 noremap <C-d> G:r !date '+\%H:\%M:\%S-'<cr>kA
-noremap <Esc>d :set hlsearch<cr>/^[+-]\([^+-].*\\|\)$<cr>
-noremap <Esc>D :set hlsearch<cr>/^[+-][+-]\([^+-].*\\|\)$<cr>
+noremap <Esc>s :set hlsearch<cr>/^[+-]\([^+-].*\\|\)$<cr>
+noremap <Esc>S :set hlsearch<cr>/^[+-][+-]\([^+-].*\\|\)$<cr>
 noremap <Esc>w 0i <Esc>/[^ ]<cr>vf.h"kyf./[^ ]<cr>vf.h"ly0x:r !date -d "`date '+\%Y'`-<C-r>l-<C-r>k" '+\%u'<cr>yypkV:!tr '1234567' 'PUSCPSN'<cr>jV:!tr '1234567' 'otttaoe'<cr>kJxv0xk0llllllplxxjddk0
+noremap <Esc>e :syntax on<cr>:set syntax=wdiff<cr>
 noremap * :let ic_save=&ic<cr>:set noic<cr>*:let &ic=ic_save<cr>
 noremap # :let ic_save=&ic<cr>:set noic<cr>#:let &ic=ic_save<cr>
 noremap <C-k> :w<cr>:!aspell --check '%'<cr>:e<cr>
 noremap gq] gq/^. \?$<cr>
 noremap <Esc>1 :w<cr>:make -j1<cr>
-noremap <Esc>m :w<cr>:make<cr>
+noremap <Esc>3 /^<char-60><char-60><char-60><char-60><char-60><char-60><char-60><cr>kmajd$V/^<bar><bar><bar><bar><bar><bar><bar><cr>k:w! 1<cr>gvxd$V/^=======<cr>k:w! 2<cr>gvxd$V/^<char-62><char-62><char-62><char-62><char-62><char-62><char-62><cr>k:w! 3<cr>gvxdd'a0:!diff -u 2 1;diff -u 2 3<cr>
+noremap <Esc>m :w<cr>:set makeprg=make<cr>:make<cr>
+noremap <Esc>n :w<cr>:set makeprg=ninja<cr>:make<cr>
 
 endif "!exists("g:_kratochvil_vimrc")