return require('packer').startup(function() use 'hashivim/vim-terraform' use 'pierreglaser/folding-nvim' use 'tjdevries/colorbuddy.vim' use 'wbthomason/packer.nvim' use 'ray-x/lsp_signature.nvim' use 'jose-elias-alvarez/nvim-lsp-ts-utils' use 'rafamadriz/friendly-snippets' use { "rcarriga/nvim-dap-ui", requires = {"mfussenegger/nvim-dap"} } use {'ray-x/guihua.lua', run = 'cd lua/fzy && make'} use { 'theHamsta/nvim-dap-virtual-text', config = function() require("nvim-dap-virtual-text").setup { commented = true, } end } use({ "jose-elias-alvarez/null-ls.nvim", requires = { "nvim-lua/plenary.nvim" }, config = function() require("plugins/null-ls") end, }) use { 'b3nj5m1n/kommentary', config = function() require('kommentary.config').use_extended_mappings() vim.api.nvim_set_keymap("n", "", "kommentary_line_default", {}) -- C-/ vim.api.nvim_set_keymap("v", "", "kommentary_visual_default", {}) -- C-/ require('kommentary.config').configure_language("default", { prefer_single_line_comments = true, }) end } use { 'L3MON4D3/LuaSnip', config = function() require("luasnip/loaders/from_vscode").lazy_load() end } use { 'hrsh7th/nvim-cmp', requires = { 'andersevenrud/cmp-tmux', 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-buffer', 'hrsh7th/cmp-path', 'hrsh7th/cmp-cmdline', 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip', }, config = function() local cmp = require'cmp' local luasnip = require'luasnip' local has_words_before = function() local line, col = unpack(vim.api.nvim_win_get_cursor(0)) return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match('%s') == nil end cmp.setup({ formatting = { format = require('lspkind').cmp_format({ with_text = true, menu = { buffer = "[Buffer]", tmux = "[Tmux]", luasnip = "[LuaSnip]", nvim_lsp = "[LSP]", nvim_lua = "[Lua]", path = "[Path]", }, }), }, documentation = { border = 'rounded' }, snippet = { expand = function(args) luasnip.lsp_expand(args.body) end, }, mapping = { [''] = cmp.mapping(cmp.mapping.select_prev_item(), { 'i', 'c' }), [''] = cmp.mapping(cmp.mapping.select_next_item(), { 'i', 'c' }), [""] = cmp.mapping.scroll_docs(-4), [""] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping({ i = cmp.mapping.abort(), c = cmp.mapping.close(), }), [''] = cmp.mapping(cmp.mapping.confirm({ select = false }), { 'i', 'c' }), [''] = cmp.mapping(cmp.mapping.confirm({ select = false }), { 'i', 'c' }), [''] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }), [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() elseif luasnip.expand_or_locally_jumpable() then luasnip.expand_or_jump() elseif has_words_before() then cmp.complete() else fallback() end end, { "i", "s" }), [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_prev_item() elseif luasnip.jumpable(-1) then luasnip.jump(-1) else fallback() end end, { "i", "s" }), }, sources = cmp.config.sources({ { name = 'buffer', priority = 1, }, { name = 'luasnip', priority = 4, }, { name = 'tmux', priority = 2, option = { all_panes = true, trigger_characters = {}, } }, { name = 'nvim_lsp', priority = 3, }, }) }) end } use { 'lewis6991/gitsigns.nvim', requires = { 'nvim-lua/plenary.nvim' }, config = function() require('gitsigns').setup { numhl = true, signs = { add = {hl = 'GitSignsAdd' , text = '▌', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'}, change = {hl = 'GitSignsChange', text = '▌', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, delete = {hl = 'GitSignsDelete', text = '▖', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, topdelete = {hl = 'GitSignsDelete', text = '▘', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, changedelete = {hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, }, } end } use { "lukas-reineke/indent-blankline.nvim", branch = "master", config = function() -- vim.wo.colorcolumn = "100" vim.g.indent_blankline_char = "│" vim.g.indent_blankline_space_char = "⬝" vim.g.indent_blankline_space_char_highlight_list = { 'IndentSpace' } -- vim.g.indent_blankline_char_list = {'|', '¦', '┆', '┊'} vim.g.indent_blankline_buftype_exclude = {"help", "terminal"} vim.g.indent_blankline_filetype_exclude = {"text", "markdown"} -- vim.g.indent_blankline_show_end_of_line = true vim.g.indent_blankline_show_first_indent_level = true vim.g.indent_blankline_show_trailing_blankline_indent = true vim.g.indent_blankline_char_highlight_list = { 'Indent1', 'Indent2', 'Indent3', 'Indent4', 'Indent5', 'Indent6'} end } use { 'neovim/nvim-lspconfig', config = function() require('dln.lsp-config') local map = require('dln.utils').map map('n', 'K', 'lua vim.lsp.buf.hover()') map('i', '', 'lua vim.lsp.buf.signature_help()') map('n', '1gd', 'lua vim.lsp.buf.type_definition()') map('n', 'gf', 'lua vim.lsp.buf.formatting()') map('n', 'rn', 'lua vim.lsp.buf.rename()') map('n', '[d', 'lua vim.lsp.diagnostic.goto_prev()') map('n', ']d', 'lua vim.lsp.diagnostic.goto_next()') map('n', 'gwa', 'lua vim.lsp.buf.add_workspace_folder()') map('n', 'gwr', 'lua vim.lsp.buf.add_workspace_folder()') map('n', 'gwl', 'lua vim.lsp.buf.add_workspace_folder()') end } use { 'nvim-telescope/telescope.nvim', requires = { 'nvim-lua/popup.nvim', 'nvim-lua/plenary.nvim', 'nvim-telescope/telescope-fzy-native.nvim', 'nvim-telescope/telescope-github.nvim', 'nvim-telescope/telescope-dap.nvim' }, config = function() require('dln.telescope') local map = require('dln.utils').map map('n', 'b', 'lua require("telescope.builtin").buffers()') map('n', 'f', 'lua require("telescope.builtin").oldfiles()') map('n', '', 'lua require("telescope.builtin").oldfiles()') map('n', 'e', 'lua require("telescope.builtin").git_files()') map('n', 'g', 'lua require("telescope.builtin").git_status()') map('n', 'a', 'lua require("telescope.builtin").lsp_code_actions()') map('n', 'm', 'lua require("telescope.builtin").marks()') map('n', 's', 'lua require("telescope.builtin").lsp_document_symbols()') map('n', 't', 'lua require("telescope.builtin").treesitter()') map('n', '/', 'lua require("telescope.builtin").live_grep()') map('n', '.', 'lua require("telescope.builtin").file_browser()') map('n', 'p', 'lua require("telescope.builtin").registers()') map('n', 'gr', 'lua require("telescope.builtin").lsp_references()') map('n', 'gd', 'lua require("telescope.builtin").lsp_definitions()') map('n', 'g/', 'lua require("telescope.builtin").lsp_document_symbols()') map('n', 'g?', 'lua require("telescope.builtin").lsp_workspace_symbols()') map('n', 'ge', 'lua require("telescope.builtin").lsp_document_diagnostics()') map('n', 'Db', 'lua require("telescope").extensions.dap.list_breakpoints()') map('n', 'Dcc', 'lua require("telescope").extensions.dap.commands()') map('n', 'Df', 'lua require("telescope").extensions.dap.frames()') map('n', 'Dv', 'lua require("telescope").extensions.dap.variables()') end } use { "nvim-treesitter/nvim-treesitter", run = ":TSUpdate", requires = { "nvim-treesitter/playground", "nvim-treesitter/nvim-treesitter-textobjects", "windwp/nvim-ts-autotag" }, config = function() require("dln.treesitter") vim.wo.foldmethod = "expr" vim.wo.foldexpr = "nvim_treesitter#foldexpr()" end } use { "ray-x/go.nvim", config = function() require('go').setup({ comment_placeholder = '', icons = {breakpoint = '🧘', currentpos = '🏃'}, dap_debug_gui = false }) vim.cmd("autocmd FileType go nmap c :lua require('go.comment').gen()") vim.cmd("autocmd BufWritePre *.go :silent! lua require('go.format').gofmt()") vim.cmd('autocmd BufWritePre (InsertLeave?) lua vim.lsp.buf.formatting_sync(nil,500)') end } use { "onsails/lspkind-nvim", config = function() require('lspkind').init({ }) end } -- marks use { "chentau/marks.nvim", config = function() require("plugins/marks") end, } -- dap use { 'mfussenegger/nvim-dap', config = function() require("plugins/dap") end, } -- go use { "leoluz/nvim-dap-go", config = function() require("plugins/nvim-dap-go") end, } -- zenbones use { "mcchrish/zenbones.nvim", requires = { "rktjmp/lush.nvim", }, config = function() require("plugins/zenbones") end, } end)