From be82bb7ac3e4ca1ac7deea0c8efc6cf5f98bcdc2 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Sun, 27 Feb 2022 23:39:57 +0100 Subject: [PATCH] Adding gfold --- nvim/nvim/config/nvim.ln/init.lua | 1 - .../config/nvim.ln/lua/user/autocommands.lua | 3 +- .../config/nvim.ln/lua/user/autopairs.lua | 33 ------------------- nvim/nvim/config/nvim.ln/lua/user/keymaps.lua | 3 +- nvim/nvim/config/nvim.ln/lua/user/options.lua | 6 ++-- nvim/nvim/config/nvim.ln/lua/user/plugins.lua | 21 ++++++++---- .../nvim/config/nvim.ln/lua/user/whichkey.lua | 4 +-- nvim/packages.txt | 1 + 8 files changed, 23 insertions(+), 49 deletions(-) delete mode 100644 nvim/nvim/config/nvim.ln/lua/user/autopairs.lua diff --git a/nvim/nvim/config/nvim.ln/init.lua b/nvim/nvim/config/nvim.ln/init.lua index 4ef9d40..2ceb96f 100644 --- a/nvim/nvim/config/nvim.ln/init.lua +++ b/nvim/nvim/config/nvim.ln/init.lua @@ -6,7 +6,6 @@ require "user.cmp" require "user.lsp" require "user.telescope" require "user.treesitter" -require "user.autopairs" require "user.comment" require "user.gitsigns" require "user.nvim-tree" diff --git a/nvim/nvim/config/nvim.ln/lua/user/autocommands.lua b/nvim/nvim/config/nvim.ln/lua/user/autocommands.lua index a7be1e5..a0044de 100644 --- a/nvim/nvim/config/nvim.ln/lua/user/autocommands.lua +++ b/nvim/nvim/config/nvim.ln/lua/user/autocommands.lua @@ -1,5 +1,4 @@ -vim.cmd [[ - augroup _general_settings +vim.cmd [[ augroup _general_settings autocmd! autocmd FileType qf,help,man,lspinfo nnoremap q :close autocmd FileType qf,help,man,lspinfo set cc="" diff --git a/nvim/nvim/config/nvim.ln/lua/user/autopairs.lua b/nvim/nvim/config/nvim.ln/lua/user/autopairs.lua deleted file mode 100644 index eeeb765..0000000 --- a/nvim/nvim/config/nvim.ln/lua/user/autopairs.lua +++ /dev/null @@ -1,33 +0,0 @@ --- Setup nvim-cmp. -local status_ok, npairs = pcall(require, "nvim-autopairs") -if not status_ok then - return -end - -npairs.setup { - check_ts = true, - ts_config = { - lua = { "string", "source" }, - javascript = { "string", "template_string" }, - }, - enable_check_bracket_line = false, - disable_filetype = { "TelescopePrompt", "spectre_panel" }, - fast_wrap = { - map = "", - chars = { "{", "[", "(", '"', "'" }, - pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""), - offset = 0, -- Offset from pattern match - end_key = "$", - keys = "qwertyuiopzxcvbnmasdfghjkl", - check_comma = true, - highlight = "PmenuSel", - highlight_grey = "LineNr", - }, -} - -local cmp_autopairs = require "nvim-autopairs.completion.cmp" -local cmp_status_ok, cmp = pcall(require, "cmp") -if not cmp_status_ok then - return -end -cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done { map_char = { tex = "" } }) diff --git a/nvim/nvim/config/nvim.ln/lua/user/keymaps.lua b/nvim/nvim/config/nvim.ln/lua/user/keymaps.lua index 20c1933..6e9028f 100644 --- a/nvim/nvim/config/nvim.ln/lua/user/keymaps.lua +++ b/nvim/nvim/config/nvim.ln/lua/user/keymaps.lua @@ -12,10 +12,11 @@ keymap("o", ")", "]", {silent = true}) keymap("o", "(", "[", {silent = true}) keymap("n", "_", "\\", {silent = true}) ---Remap space as leader key +--Remap space and enter as leader key keymap("", "", "", opts) vim.g.mapleader = " " vim.g.maplocalleader = " " +keymap("n", "", "", {silent = true}) -- Modes -- normal_mode = "n", diff --git a/nvim/nvim/config/nvim.ln/lua/user/options.lua b/nvim/nvim/config/nvim.ln/lua/user/options.lua index a86ca82..00cb2aa 100644 --- a/nvim/nvim/config/nvim.ln/lua/user/options.lua +++ b/nvim/nvim/config/nvim.ln/lua/user/options.lua @@ -1,7 +1,7 @@ local options = { backup = false, -- creates a backup file clipboard = "unnamedplus", -- allows neovim to access the system clipboard - cmdheight = 2, -- more space in the neovim command line for displaying messages + cmdheight = 1, -- more space in the neovim command line for displaying messages completeopt = { "menuone", "noselect" }, -- mostly just for cmp conceallevel = 0, -- so that `` is visible in markdown files fileencoding = "utf-8", -- the encoding written to a file @@ -23,7 +23,7 @@ local options = { writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited expandtab = false, -- convert tabs to spaces shiftwidth = 4, -- the number of spaces inserted for each indentation - tabstop = 4, -- insert 2 spaces for a tab + tabstop = 4, -- insert 4 spaces for a tab cursorline = true, -- highlight the current line number = true, -- set numbered lines relativenumber = true, -- set relative numbered lines @@ -44,7 +44,6 @@ local options = { fillchars = { diff = "╱", }, - cc = "80,120" } vim.opt.shortmess:append "c" @@ -61,4 +60,3 @@ vim.g.colorizer_nomap = 1 vim.g.targets_gracious = 1 -- for wellle/targets.vim --- require("virt-column").setup({ char = "▏" }) diff --git a/nvim/nvim/config/nvim.ln/lua/user/plugins.lua b/nvim/nvim/config/nvim.ln/lua/user/plugins.lua index f8f5e0a..0d5bb08 100644 --- a/nvim/nvim/config/nvim.ln/lua/user/plugins.lua +++ b/nvim/nvim/config/nvim.ln/lua/user/plugins.lua @@ -47,14 +47,14 @@ return packer.startup(function(use) use "tpope/vim-repeat" use "tpope/vim-surround" + use "tpope/vim-abolish" + use "tpope/vim-unimpaired" use "wellle/targets.vim" use "justinmk/vim-sneak" - use "mg979/vim-visual-multi" - use {"RRethy/vim-hexokinase", run = "make hexokinase"} - use "lukas-reineke/virt-column.nvim" - use "windwp/nvim-autopairs" -- Autopairs, integrates with both cmp and treesitter - use "numToStr/Comment.nvim" -- Easily comment stuff + use "numToStr/Comment.nvim" use "nishigori/increment-activator" + use {'ZhiyuanLck/smart-pairs', event = 'InsertEnter', config = function() require('pairs'):setup() end} + use "moll/vim-bbye" use "Pocco81/AutoSave.nvim" @@ -62,7 +62,6 @@ return packer.startup(function(use) use "lukas-reineke/indent-blankline.nvim" use "goolord/alpha-nvim" use "antoinemadec/FixCursorHold.nvim" -- This is needed to fix lsp doc highlight - use "folke/which-key.nvim" -- Colorschemes use "folke/tokyonight.nvim" @@ -71,6 +70,16 @@ return packer.startup(function(use) use "kyazdani42/nvim-web-devicons" use "kyazdani42/nvim-tree.lua" use "petertriho/nvim-scrollbar" + use "folke/which-key.nvim" + use {'stevearc/dressing.nvim'} + use { + "AckslD/nvim-gfold.lua", + config = function() + require('gfold').setup() + end, + } + use {"RRethy/vim-hexokinase", run = "make hexokinase"} + -- use "lukas-reineke/virt-column.nvim" -- cmp plugins use "hrsh7th/nvim-cmp" -- The completion plugin diff --git a/nvim/nvim/config/nvim.ln/lua/user/whichkey.lua b/nvim/nvim/config/nvim.ln/lua/user/whichkey.lua index 5c56f5b..3c2ee5b 100644 --- a/nvim/nvim/config/nvim.ln/lua/user/whichkey.lua +++ b/nvim/nvim/config/nvim.ln/lua/user/whichkey.lua @@ -92,9 +92,9 @@ local mappings = { "Find files", }, ["F"] = { "Telescope live_grep theme=ivy", "Find Text" }, - -- ["P"] = { "lua require('telescope').extensions.projects.projects()", "Projects" }, + ["p"] = { "lua require('gfold').pick_repo()", "Projects" }, - p = { + P = { name = "Packer", c = { "PackerCompile", "Compile" }, i = { "PackerInstall", "Install" }, diff --git a/nvim/packages.txt b/nvim/packages.txt index bad3f17..f4f7410 100644 --- a/nvim/packages.txt +++ b/nvim/packages.txt @@ -1,3 +1,4 @@ neovim ripgrep fd +gfold