.config/nvim/lua/config/maps.lua

changeset 1158
0e7310186a57
parent 1153
57809d2642ff
child 1175
7907b9c30399
equal deleted inserted replaced
1157:a237720efee9 1158:0e7310186a57
64 map("n", "<leader>ta", ":Tabularize first_arrow<CR>") 64 map("n", "<leader>ta", ":Tabularize first_arrow<CR>")
65 map("n", "<leader>te", ":Tabularize first_eq<CR>") 65 map("n", "<leader>te", ":Tabularize first_eq<CR>")
66 map("n", "<leader>tc", ":Tabularize first_colon<CR>") 66 map("n", "<leader>tc", ":Tabularize first_colon<CR>")
67 map("n", "<leader>tm", ":Tabularize methods<CR>") 67 map("n", "<leader>tm", ":Tabularize methods<CR>")
68 68
69 map("n", "<leader>a", ":call vimrc#AutoFmtToggle()<CR>") 69 map("n", "<leader>a", function()
70 local fo = vim.bo.formatoptions
71 if fo:find("a") then
72 vim.bo.formatoptions = fo:gsub("a", "")
73 vim.print("-a")
74 else
75 vim.bo.formatoptions = fo .. "a"
76 vim.print("+a")
77 end
78 end)
70 79
71 -- LSP features 80 -- LSP features
72 81
73 vim.api.nvim_create_autocmd("LspAttach", { 82 vim.api.nvim_create_autocmd("LspAttach", {
74 group = vim.api.nvim_create_augroup("lsp_attach", { clear = true }), 83 group = vim.api.nvim_create_augroup("lsp_attach", { clear = true }),

mercurial