diff options
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 |