vimrc

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules

commit e570e9dc7d533a6afa1727d6bda6283400f08c34
parent 0eeb5255367ada4551a124f5e9d9d2af97252aa6
Author: Pablo Cárdenas <pablo.cardenas@imca.edu.pe>
Date:   Mon,  7 Jul 2025 15:02:19 -0500

Remove unused packages

Diffstat:
M.gitignore | 5+----
M.gitmodules | 9---------
Mafter/pack/thirdparty/opt/vimtex/plugin/vimtex.vim | 25++++++++++++++++++++-----
Aconfig.vim.example | 47+++++++++++++++++++++++++++++++++++++++++++++++
Mftplugin/tex.vim | 1+
Apack/pablo/opt/snippets/plugin/snippets.vim | 146+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dpack/thirdparty/opt/copilot.vim | 1-
Dpack/thirdparty/opt/ultisnips | 1-
Dpack/thirdparty/opt/vim-indent-object | 1-
Mvimrc | 66+++++++++---------------------------------------------------------
10 files changed, 224 insertions(+), 78 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -1,4 +1 @@ -/undodir -/.netrwhist -/venv -/view +/config.vim diff --git a/.gitmodules b/.gitmodules @@ -4,18 +4,9 @@ [submodule "pack/thirdparty/opt/vim-surround"] path = pack/thirdparty/opt/vim-surround url = https://github.com/tpope/vim-surround.git -[submodule "pack/thirdparty/opt/ultisnips"] - path = pack/thirdparty/opt/ultisnips - url = https://github.com/SirVer/ultisnips.git -[submodule "pack/thirdparty/opt/vim-indent-object"] - path = pack/thirdparty/opt/vim-indent-object - url = https://github.com/michaeljsmith/vim-indent-object.git [submodule "pack/thirdparty/opt/vim-ledger"] path = pack/thirdparty/opt/vim-ledger url = https://github.com/ledger/vim-ledger.git [submodule "pack/thirdparty/opt/vimtex"] path = pack/thirdparty/opt/vimtex url = https://github.com/lervag/vimtex.git -[submodule "pack/thirdparty/opt/copilot.vim"] - path = pack/thirdparty/opt/copilot.vim - url = https://github.com/github/copilot.vim diff --git a/after/pack/thirdparty/opt/vimtex/plugin/vimtex.vim b/after/pack/thirdparty/opt/vimtex/plugin/vimtex.vim @@ -1,10 +1,11 @@ let g:vimtex_fold_enabled = 1 let g:vimtex_fold_manual = 1 -let g:vimtex_indent_enabled = 0 -let g:vimtex_imaps_enabled = 0 +let g:vimtex_mappings_override_existing = 1 +"let g:vimtex_indent_enabled = 0 +"let g:vimtex_imaps_enabled = 0 -"let g:vimtex_compiler_enabled = 0 +let g:vimtex_compiler_enabled = 0 "let g:vimtex_complete_enabled = 0 "let g:vimtex_doc_enabled = 0 "let g:vimtex_fold_bib_enabled = 0 @@ -21,10 +22,24 @@ let g:vimtex_imaps_enabled = 0 "let g:vimtex_view_enabled = 0 -let g:tex_flavor='latex' let g:vimtex_view_method='zathura_simple' let g:vimtex_quickfix_mode=0 -let g:tex_conceal='abdmg' + +let g:vimtex_syntax_conceal = { +\ 'accents': 1, +\ 'ligatures': 1, +\ 'cites': 1, +\ 'fancy': 1, +\ 'spacing': 1, +\ 'greek': 1, +\ 'math_bounds': 0, +\ 'math_delimiters': 1, +\ 'math_fracs': 1, +\ 'math_super_sub': 1, +\ 'math_symbols': 1, +\ 'sections': 0, +\ 'styles': 1, +\} let g:vimtex_delim_toggle_mod_list = [ \ ['\left', '\right'], diff --git a/config.vim.example b/config.vim.example @@ -0,0 +1,47 @@ +" Plugin {{{ +set noloadplugins +" runtime! plugin/getscriptPlugin.vim +" runtime! plugin/gzip.vim +" runtime! plugin/logiPat.vim +" runtime! plugin/manpager.vim +" runtime! plugin/matchparen.vim +" runtime! plugin/netrwPlugin.vim +" runtime! plugin/rrhelper.vim +" runtime! plugin/spellfile.vim +" runtime! plugin/tarPlugin.vim +" runtime! plugin/tohtml.vim +" runtime! plugin/vimballPlugin.vim +" runtime! plugin/zipPlugin.vim +" runtime! plugin/fzf.vim +runtime! plugin/redact_pass.vim +" }}} + +" Packages {{{ + +"" builtin +" packadd comment +" packadd cfilter +" packadd termdebug +" packadd editorconfig +" packadd matchit + +"" thirdparty +" packadd emmet-vim +" packadd vim-ledger +" packadd vim-surround +" packadd vimtex + +"" pablo +" packadd hardmode +" packadd tmux +" packadd lsp +" packadd multiplayer +" packadd snippets +" }}} + +" set wildignore+=*/node_modules/* +" set wildignore+=*/venv/*,*/*.egg-info/*,*.pyc,*/__pycache__/ +" filetype plugin indent on +" syntax enable + +" vim: ft=vim fen fdm=marker diff --git a/ftplugin/tex.vim b/ftplugin/tex.vim @@ -3,6 +3,7 @@ setlocal tabstop=2 setlocal shiftwidth=2 setlocal conceallevel=2 highlight! link Conceal texCmd +let g:tex_conceal='abdmg' highlight ExtraWhitespace ctermbg=1 match ExtraWhitespace /\(\(\\(\)\@<=\s\+\|\s\+\(\\)\)\@=\|\(\S.*\)\@<=\s\s\+\([^ &\\]\)\@=\)/ diff --git a/pack/pablo/opt/snippets/plugin/snippets.vim b/pack/pablo/opt/snippets/plugin/snippets.vim @@ -0,0 +1,146 @@ +vim9script + +autocmd InsertCharPre *.tex call Snippet_InsertCharPre() +autocmd TextChangedI *.tex call Snippet_TextChangedI() + +var command: string = '' + +def g:Snippet_InsertCharPre() + if v:char == '_' && vimtex#syntax#in_mathzone() + var pos = getcharpos('.') + var lnum = pos[1] + var coln = pos[2] + var line = getline('.') + if line[coln - 2] == '_' + command = '__' + endif + elseif v:char == '^' && vimtex#syntax#in_mathzone() + var pos = getcharpos('.') + var lnum = pos[1] + var coln = pos[2] + var line = getline('.') + if line[coln - 2] == '^' + command = '^^' + endif + elseif v:char == '~' && vimtex#syntax#in_mathzone() + var pos = getcharpos('.') + var lnum = pos[1] + var coln = pos[2] + var line = getline('.') + if line[coln - 4 : coln - 2] == 'iid' + command = 'iid~' + endif + elseif v:char == 't' && vimtex#syntax#in_mathzone() + var pos = getcharpos('.') + var lnum = pos[1] + var coln = pos[2] + var line = getline('.') + if line[coln - 2] == 't' + command = 'tt' + endif + elseif v:char == 'k' && !vimtex#syntax#in_mathzone() + var pos = getcharpos('.') + var lnum = pos[1] + var coln = pos[2] + var line = getline('.') + if line[coln - 2] == 'm' + command = '\(...\)' + endif + elseif v:char == 'm' && !vimtex#syntax#in_mathzone() + var pos = getcharpos('.') + var lnum = pos[1] + var coln = pos[2] + var line = getline('.') + if line[coln - 2] == 'd' + command = '\[...\]' + endif + elseif v:char == '=' && vimtex#syntax#in_mathzone() + var pos = getcharpos('.') + var lnum = pos[1] + var coln = pos[2] + var line = getline('.') + if line[coln - 2] == '<' + command = '<=' + endif + endif + + if command != "" + feedkeys("\<C-g>u") + endif +enddef + +def g:Snippet_TextChangedI() + if command != '' + var pos = getcharpos('.') + var lnum = pos[1] + var coln = pos[2] + var line = getline('.') + + if command == '^^' + setline( + ".", + strcharpart(line, 0, coln - 2) .. + '{}<++>' .. + line[coln - 1 : ] + ) + setcharpos('.', [0, lnum, coln, 0]) + elseif command == '__' + setline( + ".", + strcharpart(line, 0, coln - 2) .. + '{}<++>' .. + line[coln - 1 : ] + ) + setcharpos('.', [0, lnum, coln, 0]) + elseif command == 'iid~' + setline( + ".", + strcharpart(line, 0, coln - 5) .. + '\overset{\text{iid}}{\sim}' .. + line[coln - 1 : ] + ) + setcharpos('.', [0, lnum, coln + 26 - 4, 0]) + elseif command == '<=' + setline( + ".", + strcharpart(line, 0, coln - 3) .. + '\le' .. + line[coln - 1 : ] + ) + setcharpos('.', [0, lnum, coln + 3 - 2, 0]) + elseif command == '\(...\)' + setline( + ".", + strcharpart(line, 0, coln - 3) .. + '\(\)<++>' .. + line[coln - 1 : ] + ) + setcharpos('.', [0, lnum, coln + 2 - 2, 0]) + elseif command == '\[...\]' + setline( + ".", + strcharpart(line, 0, coln - 3) .. + '\[' + ) + append(lnum, ["\t", '.\]', '<++>' .. line[coln - 1 : ]]) + setcharpos('.', [0, lnum + 1, 2, 0]) + elseif command == 'tt' + setline( + ".", + strcharpart(line, 0, coln - 3) .. + '\text{}<++>' .. + line[coln - 1 : ] + ) + setcharpos('.', [0, lnum, coln + 6 - 2, 0]) + endif + + command = '' + endif +enddef + +g:surround_insert_tail = "<++>" + +inoremap <silent> <C-J> <Esc>:call search('<++>')<CR>"_c4l +noremap <silent> <C-J> :call search('<++>')<CR>"_c4l + +# vim: et sts=4 sw=4 diff --git a/pack/thirdparty/opt/copilot.vim b/pack/thirdparty/opt/copilot.vim @@ -1 +0,0 @@ -Subproject commit 87038123804796ca7af20d1b71c3428d858a9124 diff --git a/pack/thirdparty/opt/ultisnips b/pack/thirdparty/opt/ultisnips @@ -1 +0,0 @@ -Subproject commit 35252b3327bf0cb55136399dfe615637093a8291 diff --git a/pack/thirdparty/opt/vim-indent-object b/pack/thirdparty/opt/vim-indent-object @@ -1 +0,0 @@ -Subproject commit 8ab36d5ec2a3a60468437a95e142ce994df598c6 diff --git a/vimrc b/vimrc @@ -9,6 +9,7 @@ set swapfile set undofile set backup autocmd BufWinLeave *.* mkview +au BufWritePre * let &backupext = '-' .. strftime("%Y%b%d%X") .. '~' if has('win32') @@ -21,66 +22,17 @@ if has('win32') else set directory=$XDG_CACHE_HOME/vim/swap/ set undodir=$XDG_CACHE_HOME/vim/undo/ - set backupdir=$XDG_CACHE_HOME/vim/backup/ + set backupdir=$XDG_CACHE_HOME/vim/backup// set viewdir=$XDG_CACHE_HOME/vim/view/ + set viminfo+=n$XDG_CACHE_HOME/vim/viminfo endif -if ! isdirectory(expand(&g:directory)) - silent! call mkdir(expand(&g:directory), 'p', 0700) -endif -if ! isdirectory(expand(&g:backupdir)) - silent! call mkdir(expand(&g:backupdir), 'p', 0700) -endif -if ! isdirectory(expand(&g:undodir)) - silent! call mkdir(expand(&g:undodir), 'p', 0700) -endif -if ! isdirectory(expand(&g:viewdir)) - silent! call mkdir(expand(&g:viewdir), 'p', 0700) -endif - +for folder in [&g:directory, &g:backupdir, &g:undodir, &viewdir] + if ! isdirectory(expand(folder)) + silent! call mkdir(expand(folder), 'p', 0700) + endif +endfor set path=, -" set wildignore+=*/node_modules/* -" set wildignore+=*/venv/*,*/*.egg-info/*,*.pyc,*/__pycache__/ - -set noloadplugins - -" runtime! plugin/getscriptPlugin.vim -" runtime! plugin/gzip.vim -" runtime! plugin/logiPat.vim -" runtime! plugin/manpager.vim -" runtime! plugin/matchparen.vim -" runtime! plugin/netrwPlugin.vim -" runtime! plugin/rrhelper.vim -" runtime! plugin/spellfile.vim -" runtime! plugin/tarPlugin.vim -" runtime! plugin/tohtml.vim -" runtime! plugin/vimballPlugin.vim -" runtime! plugin/zipPlugin.vim - -" runtime! plugin/fzf.vim -runtime! plugin/redact_pass.vim - -" packadd comment -" "packadd termdebug -" packadd! cfilter -" packadd! editorconfig -" packadd! matchit - -" packadd copilot.vim -" packadd emmet-vim -" packadd ultisnips -" packadd vim-gitgutter -" packadd vim-indent-object -" packadd vim-ledger -" packadd vim-showmarks -" packadd vim-snippets -" packadd vim-surround -" packadd vimtex - -" packadd hardmode -" packadd tmux -" packadd lsp -" packadd multiplayer -"filetype plugin indent on +source config.vim