local function init() -- command! LogPath :lua print(vim.inspect(vim.lsp.get_log_path())) -------------------- Telescope ----------------------------- map('n', 'ff', 'Telescope find_files') map('n', 'fg', 'Telescope live_grep') map('n', 'fb', 'Telescope buffers') map('n', 'fh', 'Telescope help_tags') map('n', 'ps', [[lua require('telescope.builtin').grep_string({ search = vim.fn.input("Grep For >")})]]) -------------------- NvimTreeToggle ------------------------ map('n', '', 'NvimTreeToggle') map('n', '', 'NvimTreeRefresh') -------------------- BarBar -------------------------------- -- Move to previous/next map('n', '', ':BufferPrevious', opts) map('n', '', ':BufferNext', opts) -- Re-order to previous/next map('n', '', ':BufferMovePrevious', opts) map('n', '>', ' :BufferMoveNext', opts) -- Close buffer map('n', '', ':BufferClose', opts) -------------------- LSP ----------------------------------- map('n', ',', 'lua vim.lsp.diagnostic.goto_prev()') map('n', ';', 'lua vim.lsp.diagnostic.goto_next()') map('n', 'a', 'lua vim.lsp.buf.code_action()') map('n', 'd', 'lua vim.lsp.buf.definition()') map('n', 'f', 'lua vim.lsp.buf.formatting()') map('n', 'h', 'lua vim.lsp.buf.hover()') map('n', 'm', 'lua vim.lsp.buf.rename()') map('n', 'r', 'lua vim.lsp.buf.references()') map('n', 's', 'lua vim.lsp.buf.document_symbol()') map('n', 'T', 'lua require\'lsp_extensions\'.inlay_hints()') -------------------- HlsLens ------------------------------- map('n', 'n', "execute('normal! ' . v:count1 . 'n')lua require('hlslens').start()") map('n', 'N', "execute('normal! ' . v:count1 . 'N')lua require('hlslens').start()") map('n', '*', "*lua require('hlslens').start()") map('n', '#', "#lua require('hlslens').start()") map('n', 'g*', "g*lua require('hlslens').start()") map('n', 'g#', "g#lua require('hlslens').start()") -------------------- DAP ----------------------------------- map('n', '', 'lua require\'dap\'.toggle_breakpoint()', opts) map('n', '', 'lua require\'dap\'.set_breakpoint(vim.fn.input(\'Breakpoint condition: \'))', opts) map('n', '', 'lua require\'dap\'.continue()', opts) map('n', '', 'lua require\'dap\'.repl.toggle()', opts) -------------------- FTerm --------------------------------- map('n', '', 'lua require("FTerm").toggle()') map('t', '', 'lua require("FTerm").toggle()') -------------------- LAZYGIT ------------------------------- -- Install docs : https://github.com/jesseduffield/lazygit map('n', '', 'LazyGit') -------------------- OTHER --------------------------------- map('i', '', ':w') -------------------- COMMANDS ------------------------------ cmd 'au TextYankPost * lua vim.highlight.on_yank {on_visual = false}' -- disabled in visual mode end return { init = init }