mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-09 23:22:57 +00:00
Some key remapping for vim with the leader
This commit is contained in:
parent
59160eb247
commit
184015cfb2
@ -91,9 +91,6 @@ command Vimrc edit ~/.config/nvim/init.vim " Edit .vimrc (this file)
|
|||||||
" Map the leader key
|
" Map the leader key
|
||||||
map <Space> <Leader>
|
map <Space> <Leader>
|
||||||
|
|
||||||
" Jump to the next occurence of <> and replace it with insert mode
|
|
||||||
nnoremap <Leader><Space> /<><Esc>:noh<CR>c2l
|
|
||||||
|
|
||||||
"This unsets the `last search pattern` register by hitting return
|
"This unsets the `last search pattern` register by hitting return
|
||||||
nnoremap <silent> <CR> :noh<CR><CR>
|
nnoremap <silent> <CR> :noh<CR><CR>
|
||||||
|
|
||||||
@ -112,6 +109,12 @@ nnoremap <Leader>fs :write<cr>
|
|||||||
" Open file in this directory
|
" Open file in this directory
|
||||||
nnoremap <Leader>ff :Files<cr>
|
nnoremap <Leader>ff :Files<cr>
|
||||||
|
|
||||||
|
" Change directory to this file
|
||||||
|
nnoremap <silent> <Leader>fd :lcd %:p:h<cr>
|
||||||
|
|
||||||
|
" Back up directory
|
||||||
|
nnoremap <silent> <Leader>fu :lcd ..<cr>
|
||||||
|
|
||||||
" Open a recent file
|
" Open a recent file
|
||||||
nnoremap <Leader>fr :History<cr>
|
nnoremap <Leader>fr :History<cr>
|
||||||
|
|
||||||
@ -202,6 +205,8 @@ xmap <silent> <C-s> <Plug>(coc-range-select)
|
|||||||
|
|
||||||
" LaTeX Hotkeys
|
" LaTeX Hotkeys
|
||||||
autocmd FileType tex inoremap ;bf \textbf{}<Esc>i
|
autocmd FileType tex inoremap ;bf \textbf{}<Esc>i
|
||||||
|
" Jump to the next occurence of <> and replace it with insert mode
|
||||||
|
autocmd FileType tex nnoremap <Leader><Space> /<><Esc>:noh<CR>c2l
|
||||||
|
|
||||||
" Autocompile LaTeX on save
|
" Autocompile LaTeX on save
|
||||||
autocmd BufWritePost *.tex silent! execute "!pdflatex -output-directory=%:p:h % >/dev/null 2>&1" | redraw!
|
autocmd BufWritePost *.tex silent! execute "!pdflatex -output-directory=%:p:h % >/dev/null 2>&1" | redraw!
|
||||||
|
Loading…
Reference in New Issue
Block a user