nvim: new bind (:w!!) and enable linewrap in markdown files (aucmd)
This commit is contained in:
parent
ad99e0a852
commit
5697225533
1 changed files with 6 additions and 0 deletions
|
@ -67,6 +67,9 @@ vim.cmd 'command! Term tabnew | term'
|
||||||
-- Genereate ctags
|
-- Genereate ctags
|
||||||
vim.cmd 'command! MakeTags !ctags -R .'
|
vim.cmd 'command! MakeTags !ctags -R .'
|
||||||
|
|
||||||
|
-- Write buffer as root
|
||||||
|
vim.cmd 'cmap w!! w !sudo tee > /dev/null %'
|
||||||
|
|
||||||
-- Press Alt h to toggle highlighting on/off, and show current value.
|
-- Press Alt h to toggle highlighting on/off, and show current value.
|
||||||
vim.cmd 'nnoremap <M-h> <cmd>noh<CR>'
|
vim.cmd 'nnoremap <M-h> <cmd>noh<CR>'
|
||||||
vim.cmd 'inoremap <M-h> <cmd>noh<CR>'
|
vim.cmd 'inoremap <M-h> <cmd>noh<CR>'
|
||||||
|
@ -113,6 +116,9 @@ vim.cmd 'let g:markdown_fenced_languages = [ "bash=sh", "javascript", "cpp=cpp",
|
||||||
vim.cmd 'autocmd FileType crontab set commentstring=#%s'
|
vim.cmd 'autocmd FileType crontab set commentstring=#%s'
|
||||||
-- vim.cmd 'autocmd FileType rmd set commentstring=<!--\\ %s\\ -->'
|
-- vim.cmd 'autocmd FileType rmd set commentstring=<!--\\ %s\\ -->'
|
||||||
|
|
||||||
|
-- Enable linewrap in markdown files
|
||||||
|
vim.cmd [[ autocmd FileType markdown setlocal wrap ]]
|
||||||
|
|
||||||
-- Automatically jump to the last position in a file when opening
|
-- Automatically jump to the last position in a file when opening
|
||||||
vim.cmd [[ au BufReadPost * if expand('%:p') !~# '\m/\.git/' && line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif ]]
|
vim.cmd [[ au BufReadPost * if expand('%:p') !~# '\m/\.git/' && line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif ]]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue