nvim: added latexindent with 2 space indent

master
tiyn 10 months ago
parent f789c139cb
commit abed395a87

@ -1,4 +1,5 @@
Bonitur Bonitur
Königinnensubstanz Königinnensubstanz
Magazinbeute Magazinbeute
Magazinbeuten
Pollenhose Pollenhose

@ -20,43 +20,43 @@ m.nname("<leader>s", "Substitute")
m.nname("<leader>t", "Terminal") m.nname("<leader>t", "Terminal")
-- unmap unwanted commands -- unmap unwanted commands
m.nnoremap("Zt", '<NOP>') m.nnoremap("Zt", '<NOP>')
m.nnoremap("ZT", '<NOP>') m.nnoremap("ZT", '<NOP>')
m.nnoremap("<Space>", '<NOP>') m.nnoremap("<Space>", '<NOP>')
m.inoremap("<F2>", '<NOP>') m.inoremap("<F2>", '<NOP>')
m.inoremap("<F3>", '<NOP>') m.inoremap("<F3>", '<NOP>')
m.inoremap("<F4>", '<NOP>') m.inoremap("<F4>", '<NOP>')
m.inoremap("<F5>", '<NOP>') m.inoremap("<F5>", '<NOP>')
m.inoremap("<F6>", '<NOP>') m.inoremap("<F6>", '<NOP>')
m.inoremap("<F8>", '<NOP>') m.inoremap("<F8>", '<NOP>')
m.inoremap("<F9>", '<NOP>') m.inoremap("<F9>", '<NOP>')
m.nnoremap("<F9>", '<NOP>') m.nnoremap("<F9>", '<NOP>')
m.inoremap("<F10>", '<NOP>') m.inoremap("<F10>", '<NOP>')
m.nnoremap("<F10>", '<NOP>') m.nnoremap("<F10>", '<NOP>')
m.inoremap("<F11>", '<NOP>') m.inoremap("<F11>", '<NOP>')
m.nnoremap("<F11>", '<NOP>') m.nnoremap("<F11>", '<NOP>')
m.inoremap("<F12>", '<NOP>') m.inoremap("<F12>", '<NOP>')
m.nnoremap("<F12>", '<NOP>') m.nnoremap("<F12>", '<NOP>')
-- shortcut for split navigation -- shortcut for split navigation
m.nnoremap("<C-h>", '<C-w>h', 'Navigation: go to left split') m.nnoremap("<C-h>", '<C-w>h', 'Navigation: go to left split')
m.nnoremap("<C-j>", '<C-w>j', 'Navigation: go to lower split') m.nnoremap("<C-j>", '<C-w>j', 'Navigation: go to lower split')
m.nnoremap("<C-k>", '<C-w>k', 'Navigation: go to upper split') m.nnoremap("<C-k>", '<C-w>k', 'Navigation: go to upper split')
m.nnoremap("<C-l>", '<C-w>l', 'Navigation: go to right split') m.nnoremap("<C-l>", '<C-w>l', 'Navigation: go to right split')
-- remap for dealing with word wrap -- remap for dealing with word wrap
m.nmap('j', "v:count == 0 ? 'gj' : 'j'", { "expr", "silent" }, 'Navigation: go down in wrapped lines') m.nmap('j', "v:count == 0 ? 'gj' : 'j'", { "expr", "silent" }, 'Navigation: go down in wrapped lines')
m.nmap('k', "v:count == 0 ? 'gk' : 'k'", { "expr", "silent" }, 'Navigation: go up in wrapped lines') m.nmap('k', "v:count == 0 ? 'gk' : 'k'", { "expr", "silent" }, 'Navigation: go up in wrapped lines')
-- compiler for languages -- compiler for languages
m.nnoremap("<leader>c", ':w! | !compiler <c-r>%<CR>', 'Compile: current file') m.nnoremap("<leader>c", ':w! | !compiler <c-r>%<CR>', 'Compile: current file')
-- save file as sudo on files that require root permission -- save file as sudo on files that require root permission
m.cnoremap("w!!", 'execute "silent! write !sudo tee % >/dev/null" <bar> edit!', 'Write: overwrite file over with sudo') m.cnoremap("w!!", 'execute "silent! write !sudo tee % >/dev/null" <bar> edit!', 'Write: overwrite file over with sudo')
-- tpope/vim-abolish -- tpope/vim-abolish
m.nnoremap("<leader>sa", ':%S//g<Left><Left>', 'Substitute: free form') m.nnoremap("<leader>sa", ':%S//g<Left><Left>', 'Substitute: free form')
m.nnoremap("<leader>ss", ':%S/\\<<C-r><C-w>\\>//g<Left><Left>', 'Substitute: word under cursor') m.nnoremap("<leader>ss", ':%S/\\<<C-r><C-w>\\>//g<Left><Left>', 'Substitute: word under cursor')
-- stevearc/aerial.nvim -- stevearc/aerial.nvim
m.nmap('<F3>', ':AerialToggle!<CR>', 'CTags: toggle') m.nmap('<F3>', ':AerialToggle!<CR>', 'CTags: toggle')
@ -98,10 +98,10 @@ m.nnoremap("<F8>", function() require("conform").format({ async = true, lsp_fall
m.nnoremap("<F5>", require("renamer").rename, "LSP: rename") m.nnoremap("<F5>", require("renamer").rename, "LSP: rename")
-- nvim-telescope/telescope.nvim -- nvim-telescope/telescope.nvim
m.nnoremap("<F4>", ':Telescope find_files<CR>', "Telescope: find files") m.nnoremap("<F4>", ':Telescope find_files<CR>', "Telescope: find files")
-- kamykn/spelunker.vim -- kamykn/spelunker.vim
m.nnoremap("<F6>", ':call spelunker#toggle()<CR>', "Spelling: toggle spell check") m.nnoremap("<F6>", ':call spelunker#toggle()<CR>', "Spelling: toggle spell check")
-- kevinhwang91/nvim-ufo -- kevinhwang91/nvim-ufo
m.nnoremap("K", function() m.nnoremap("K", function()

@ -2,11 +2,17 @@ return {
-- improved refactoring -- improved refactoring
{ {
'stevearc/conform.nvim', 'stevearc/conform.nvim',
opts = { config = function()
formatters_by_ft = { require("conform").setup({
python = { "isort", "black" }, formatters_by_ft = {
markdown = { "mdformat" }, python = { "isort", "black" },
markdown = { "mdformat" },
tex = { "latexindent" },
}
})
require("conform").formatters.latexindent = {
prepend_args = { "-y=defaultIndent: ' '" },
} }
} end
} }
} }

@ -13,6 +13,8 @@ return {
require("null-ls").builtins.formatting.black, require("null-ls").builtins.formatting.black,
-- markdown -- markdown
require("null-ls").builtins.formatting.mdformat, require("null-ls").builtins.formatting.mdformat,
-- latex
require("null-ls").builtins.formatting.latexindent,
} }
}) })
end end
@ -22,7 +24,10 @@ return {
opts = { opts = {
automatic_installation = true, automatic_installation = true,
ensure_installed = { ensure_installed = {
"isort", "black", "mdformat" "black",
"isort",
"latexindent",
"mdformat",
} }
} }
} }

Loading…
Cancel
Save