From 3141de1d5fe5b8365a0c1f3d2100d0a93d04128b Mon Sep 17 00:00:00 2001 From: sevi-kun Date: Wed, 12 Jul 2023 22:31:54 +0200 Subject: [PATCH] cleanup --- after/plugin/autoclose.lua | 24 ++++++++++++++++++++++- after/plugin/barbecue.lua | 1 + after/plugin/harpoon.lua | 1 + after/plugin/lsp.lua | 1 + after/plugin/telescope.lua | 1 + after/plugin/treesitter.lua | 1 + after/plugin/undotree.lua | 1 + lua/sevi-kun/packer.lua | 38 ++++++++++++++++++++++--------------- 8 files changed, 52 insertions(+), 16 deletions(-) diff --git a/after/plugin/autoclose.lua b/after/plugin/autoclose.lua index 5c99d79..fa03714 100644 --- a/after/plugin/autoclose.lua +++ b/after/plugin/autoclose.lua @@ -1 +1,23 @@ -require("autoclose").setup() +-- Close brackets +local config = { + keys = { + ["("] = { escape = false, close = true, pair = "()", disabled_filetypes = {} }, + ["["] = { escape = false, close = true, pair = "[]", disabled_filetypes = {} }, + ["{"] = { escape = false, close = true, pair = "{}", disabled_filetypes = {} }, + + [">"] = { escape = true, close = false, pair = "<>", disabled_filetypes = {} }, + [")"] = { escape = true, close = false, pair = "()", disabled_filetypes = {} }, + ["]"] = { escape = true, close = false, pair = "[]", disabled_filetypes = {} }, + ["}"] = { escape = true, close = false, pair = "{}", disabled_filetypes = {} }, + + ['"'] = { escape = true, close = true, pair = '""', disabled_filetypes = {} }, + ["'"] = { escape = true, close = true, pair = "''", disabled_filetypes = {} }, + ["`"] = { escape = true, close = true, pair = "``", disabled_filetypes = {} }, + }, + options = { + disabled_filetypes = { "text", "markdown" }, + disable_when_touch = false, + pair_spaces = false, + auto_indent = true, + }, +} diff --git a/after/plugin/barbecue.lua b/after/plugin/barbecue.lua index 03cd303..20fc00b 100644 --- a/after/plugin/barbecue.lua +++ b/after/plugin/barbecue.lua @@ -1,3 +1,4 @@ +-- pretty location at the top require("barbecue").setup({ ---Whether to attach navic to language servers automatically. --- diff --git a/after/plugin/harpoon.lua b/after/plugin/harpoon.lua index f814167..a4a99a6 100644 --- a/after/plugin/harpoon.lua +++ b/after/plugin/harpoon.lua @@ -1,3 +1,4 @@ +-- fast switching between files local mark = require("harpoon.mark") local ui = require("harpoon.ui") diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua index 645b0a3..c40cc3b 100644 --- a/after/plugin/lsp.lua +++ b/after/plugin/lsp.lua @@ -1,3 +1,4 @@ +-- language server manager (via Mason) local lsp = require('lsp-zero').preset({}) lsp.on_attach(function(client, bufnr) diff --git a/after/plugin/telescope.lua b/after/plugin/telescope.lua index 06070b6..606f49b 100644 --- a/after/plugin/telescope.lua +++ b/after/plugin/telescope.lua @@ -1,3 +1,4 @@ +-- finding files in working dir and repo local builtin = require('telescope.builtin') vim.keymap.set('n', 'ff', builtin.find_files, {}) vim.keymap.set('n', 'pf', builtin.git_files, {}) diff --git a/after/plugin/treesitter.lua b/after/plugin/treesitter.lua index 52e9827..345a78c 100644 --- a/after/plugin/treesitter.lua +++ b/after/plugin/treesitter.lua @@ -1,3 +1,4 @@ +-- parsing and highlighting require'nvim-treesitter.configs'.setup { -- A list of parser names, or "all" (the five listed parsers should always be installed) ensure_installed = { "python", "javascript", "typescript", "php", "c", "rust", "bash", "lua", "vim", "vimdoc", "query" }, diff --git a/after/plugin/undotree.lua b/after/plugin/undotree.lua index b6b9276..ac2c495 100644 --- a/after/plugin/undotree.lua +++ b/after/plugin/undotree.lua @@ -1 +1,2 @@ +-- advanced undo history vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) diff --git a/lua/sevi-kun/packer.lua b/lua/sevi-kun/packer.lua index 6d3a922..0c1c828 100644 --- a/lua/sevi-kun/packer.lua +++ b/lua/sevi-kun/packer.lua @@ -8,37 +8,44 @@ return require('packer').startup(function(use) use 'wbthomason/packer.nvim' - -- treesitter - use('nvim-treesitter/nvim-treesitter', {run = ':TSUpdate'}) - use('nvim-treesitter/playground') - use('nvim-treesitter/nvim-treesitter-context') + use ('nvim-treesitter/nvim-treesitter', {run = ':TSUpdate'}) + use ('nvim-treesitter/playground') + use ('nvim-treesitter/nvim-treesitter-context') + -- useful use { 'nvim-telescope/telescope.nvim', tag = '0.1.1', requires = { {'nvim-lua/plenary.nvim'} } } - use('ThePrimeagen/harpoon') - use('mbbill/undotree') - use('m4xshen/autoclose.nvim') + + use { + 'ThePrimeagen/harpoon', + requires = 'nvim-lua/plenary.nvim' + } + use { 'NeogitOrg/neogit', requires = 'nvim-lua/plenary.nvim' } + use ('mbbill/undotree') + + use ('m4xshen/autoclose.nvim') + + -- pretty - use({ + use { 'catppuccin/nvim', as = 'mocha', config = function() vim.cmd('colorscheme catppuccin-mocha') end - }) + } - use({ - "utilyre/barbecue.nvim", - tag = "*", + use { + "utilyre/barbecue.nvim", tag = "*", requires = { "SmiteshP/nvim-navic", "nvim-tree/nvim-web-devicons", -- optional dependency @@ -47,10 +54,11 @@ return require('packer').startup(function(use) config = function() require("barbecue").setup() end, - }) + } + -- lsp - use ({ + use { 'VonHeikemen/lsp-zero.nvim', branch = 'v2.x', requires = { @@ -69,5 +77,5 @@ return require('packer').startup(function(use) {'hrsh7th/cmp-nvim-lsp'}, -- Required {'L3MON4D3/LuaSnip'}, -- Required } - }) + } end)