diff options
author | Urbain Vaes <urbain@vaes.uk> | 2022-08-18 10:01:29 +0200 |
---|---|---|
committer | Urbain Vaes <urbain@vaes.uk> | 2022-08-18 10:01:29 +0200 |
commit | 2226b04eec38c0e3bd40337cba07834009a5c5af (patch) | |
tree | bc6c5a042b85dc774b814282202688d23e1de5ab /vim | |
parent | 29cef079e9b3fba66956a947e6f65fb1330047b0 (diff) |
Improve vim label
Diffstat (limited to 'vim')
-rw-r--r-- | vim/.vim/after/plugin/status.vim | 4 | ||||
-rw-r--r-- | vim/.vimrc | 20 |
2 files changed, 18 insertions, 6 deletions
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]':''}") @@ -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 <right> :setf txt<cr>i\begin{align}<cr><cr><esc>0i\end{align}<up> nmap <c-c> m`gcc<esc>`` " Pilot @@ -323,7 +324,7 @@ nnoremap Y y$ " Formatting nnoremap <Leader>fw m`:silent! keeppattern %s/\s\+$//<cr>``:update<cr> -nnoremap <Leader>ft m`:silent! keeppattern %s/^ \+//g<cr>``:update<cr> +nnoremap <Leader>ft m`:silent! keeppattern %s/ / /g<cr>``:update<cr> nmap <Leader>ff <Leader>fw<Leader>ft " Swap <c-p>/<c-n> and <up>/<down> @@ -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 <silent> <expr> <c-g> Remembrall('<c-g>') @@ -451,3 +452,14 @@ let g:ripple_repls = { " Vim sensible fix inoremap <c-w> <c-w> + +" 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 |