From 2226b04eec38c0e3bd40337cba07834009a5c5af Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Thu, 18 Aug 2022 10:01:29 +0200 Subject: Improve vim label --- latexmk/.latexmkrc | 2 +- vim/.vim/after/plugin/status.vim | 4 ++-- vim/.vimrc | 20 ++++++++++++++++---- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/latexmk/.latexmkrc b/latexmk/.latexmkrc index ba864d7..5f4570a 100644 --- a/latexmk/.latexmkrc +++ b/latexmk/.latexmkrc @@ -3,4 +3,4 @@ $pdflatex = 'pdflatex --shell-escape'; $pdf_previewer = 'zathura -s -x "vim --servername SYNC --remote +%{line} %{input}" %O %S'; $out_dir = 'build'; $clean_ext = "synctex.gz synctex.gz(busy) bbl dvi nav run run.xml snm"; -$new_viewer_always [0]; +$new_viewer_always; diff --git a/vim/.vim/after/plugin/status.vim b/vim/.vim/after/plugin/status.vim index 54c5bb7..78949fb 100644 --- a/vim/.vim/after/plugin/status.vim +++ b/vim/.vim/after/plugin/status.vim @@ -35,8 +35,8 @@ augroup myflags highlight MyGlobals ctermfg=255 ctermbg=240 autocmd! - autocmd CmdwinEnter,BufEnter,BufRead,BufWritePost * let b:trailing=search('\s\+$','n') - autocmd CmdwinEnter,BufEnter,BufRead,BufWritePost * let b:mixed=Mixed_indent() + autocmd FileReadPost,CmdwinEnter,BufEnter,BufRead,BufWritePost * let b:trailing=search('\s\+$','n') + autocmd FileReadPost,CmdwinEnter,BufEnter,BufRead,BufWritePost * let b:mixed=Mixed_indent() autocmd User Flags call Hoist("buffer", "%{FugitiveHead('') != '' ? '['.FugitiveHead('').']' : ''}") autocmd User Flags call Hoist("buffer", "%{b:trailing?'[tw]':''}") autocmd User Flags call Hoist("buffer", "%{b:mixed?'[mixed]':''}") diff --git a/vim/.vimrc b/vim/.vimrc index da2a427..5381268 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -48,6 +48,7 @@ Plug 'tpope/vim-repeat' Plug 'tpope/vim-rsi' Plug 'tpope/vim-scriptease' Plug 'tpope/vim-sensible' +Plug 'tpope/vim-speeddating' Plug 'tpope/vim-surround' Plug 'tpope/vim-unimpaired' Plug 'troydm/zoomwintab.vim' @@ -65,7 +66,8 @@ endif if has("nvim") && hostname() != "peuplier" Plug '~/dotfiles/plugins/nvim-i3scratchpad' Plug 'neovim/nvim-lspconfig' - " Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} + " Plug 'nvim-treesitter/nvim-treesitter' + " Plug 'hrsh7th/nvim-cmp', { 'branch': 'main' } " Plug 'nvim-treesitter/playground' endif @@ -197,7 +199,6 @@ let g:vimtex_delim_toggle_mod_list = [ \ ['\Biggl', '\Biggr'], \] -nmap :setf txti\begin{align}0i\end{align} nmap m`gcc`` " Pilot @@ -323,7 +324,7 @@ nnoremap Y y$ " Formatting nnoremap fw m`:silent! keeppattern %s/\s\+$//``:update -nnoremap ft m`:silent! keeppattern %s/^ \+//g``:update +nnoremap ft m`:silent! keeppattern %s/ / /g``:update nmap ff fwft " Swap / and / @@ -419,7 +420,7 @@ endif if has("nvim") && hostname() != "peuplier" try " lua require('lspconfig').pyls.setup{} - " lua require('lspconfig').julials.setup{} + lua require('lspconfig').julials.setup{} " autocmd Filetype python setlocal omnifunc=v:lua.vim.lsp.omnifunc autocmd Filetype julia setlocal omnifunc=v:lua.vim.lsp.omnifunc nnoremap Remembrall('') @@ -451,3 +452,14 @@ let g:ripple_repls = { " Vim sensible fix inoremap + +" For latex snippet +function! Get_surrounding() + let dict = { 'equation': 'eq', 'align': 'eq'} + let env = vimtex#env#get_surrounding("normal")[0]['name'] + if has_key(dict, env) + return dict[env] + else + return env + endif +endfunction -- cgit v1.2.3