summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrNuget <drnuget@outlook.com>2025-01-20 00:39:08 +0200
committerDrNuget <drnuget@outlook.com>2025-01-20 00:39:08 +0200
commitb9f9db9457946e08df8064ae46fbc27f190477b0 (patch)
treeaa9d560b823109d635293a05cafab28d755744ca
parent4d7d01c74d8488e6101bef87a204dce8fb509373 (diff)
vimrc latex jump marker macro
-rw-r--r--.config/nvim/init.lua11
1 files changed, 7 insertions, 4 deletions
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua
index 82614f6..26480b3 100644
--- a/.config/nvim/init.lua
+++ b/.config/nvim/init.lua
@@ -12,6 +12,8 @@ vim.cmd([[
set splitbelow splitright
+ let g:tex_flavor='latex'
+
" Insert mode hjkl
inoremap <C-h> <left>
inoremap <C-j> <down>
@@ -25,6 +27,8 @@ vim.cmd([[
nnoremap <leader>t :NvimTreeOpen<enter>
+ nnoremap <tab> <esc>/<++><enter>vf>da
+
" Some C Macros
autocmd Filetype c inoremap im<tab> int<space>main()<space>{<enter><enter>return<space>0;<enter>}<up><up><tab>
autocmd Filetype c inoremap I<tab> #include<space><><left>
@@ -33,15 +37,15 @@ vim.cmd([[
" LaTex Macros
autocmd Filetype tex inoremap up<tab> \usepackage{}<left>
- autocmd Filetype tex inoremap equ<tab> \begin{equation*}<enter><enter>\end{equation*}<up><tab>
+ autocmd Filetype tex inoremap equ<tab> \begin{equation*}<enter><enter>\end{equation*}<enter><++><up><up><tab>
autocmd Filetype tex inoremap ig<tab> \includegraphics{}<left>
- autocmd Filetype tex inoremap b<tab> \begin{}<enter>\end{}<esc>kf{a
+ autocmd Filetype tex inoremap b<tab> \begin{}<enter>\end{}<enter><++><esc>2kf{a
autocmd Filetype tex inoremap e<tab> <esc>0f{lvf}hyj0f{pO
autocmd Filetype tex inoremap s<tab> \section{}<left>
autocmd Filetype tex inoremap ss<tab> \subsection{}<left>
autocmd Filetype tex inoremap sss<tab> \subsubsection{}<left>
autocmd Filetype tex inoremap tf<tab> {}<esc>yy4pki\titleformat<right>
-
+ autocmd Filetype tex inoremap fr<tab> \frac{}{<++>}<esc>6hi
]])
vim.g.loaded_netrw = 1
@@ -100,4 +104,3 @@ require("pckr").add{
"vimwiki/vimwiki"
}
}
-