local function open_nvim_tree() -- open the tree require("nvim-tree.api").tree.open() end -- Functional wrapper for mapping custom keybindings local function map(mode, lhs, rhs, opts) local options = { noremap = true } if opts then options = vim.tbl_extend("force", options, opts) end vim.api.nvim_set_keymap(mode, lhs, rhs, options) end --mardown preview settings vim.cmd [[ let g:mkdp_echo_preview_url = 1 ]] ---------------------- -- general setup start ---------------------- -- open nvim tree on start vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree }) -- disabling virtual text VIRTUAL_TEXT_ENABLED = true function switch_virtual_text() VIRTUAL_TEXT_ENABLED = not VIRTUAL_TEXT_ENABLED vim.diagnostic.config({ virtual_text = VIRTUAL_TEXT_ENABLED, }) end map("n", "vt", ":lua switch_virtual_text()") map("c", "", ":Telescope command_history") map("n", "gs", ":Telescope git_status") map("n", "gc", ":Telescope git_commits") map("n", "gb", ":Telescope git_branches") map("n", "ng", ":Neogit") map("n", "bc", ":bufdo bd") -- dap map("n", "db", ":lua require'dap'.toggle_breakpoint()") map("n", "dc", ":lua require'dap'.continue()") map("n", "dg", ":lua require'dapui'.toggle()") -- tab lines in normal and visual mode map("n", "", ">>") map("n", "", "<<") map("i", "", "<", ">>") map("v", "", ">gv") map("v", "", " does the right thing vim.opt.expandtab = true -- converts tabs to white space vim.opt.shiftwidth = 4 -- width for autoindents vim.filetype.add({ extension = { sls = "sls.yaml.jinja", jinja = 'jinja', jinja2 = 'jinja', j2 = 'jinja', }, }) vim.cmd [[ colorscheme gruvbox autocmd BufRead,BufNewFile *{namespace,policy,middleware,configmap,role,deployment,cron,service,volume,secret,ingress,svc,pvc}*.yaml,*.tpl,*.gotmpl,helmfile*.yaml set ft=helm ]]