From 672976c8b10f3a3157e690e7cea325db36bd86e4 Mon Sep 17 00:00:00 2001 From: mjhika <1zzt6ovh@mojica.anonaddy.com> Date: Wed, 21 Feb 2024 18:35:02 -0500 Subject: [PATCH] wip: add things back to init.lua --- init.lua | 92 ++++++++++++++++++++++++++++++++- lua/custom/plugins/whichkey.lua | 10 ---- 2 files changed, 91 insertions(+), 11 deletions(-) delete mode 100644 lua/custom/plugins/whichkey.lua diff --git a/init.lua b/init.lua index 86db69ed..319f0b93 100644 --- a/init.lua +++ b/init.lua @@ -36,7 +36,97 @@ vim.opt.rtp:prepend(lazypath) -- configure plugins in the following require('lazy').setup({ - require 'kickstart.plugins.autoformat', + 'tpope/vim-sleuth', + + { + 'stevearc/conform.nvim', + event = 'VeryLazy', + opts = { + format_on_save = { + timeout_ms = 500, + lsp_fallback = true, + }, + formatters_by_ft = { + lua = { 'stylua' }, + clojure = { 'cljfmt' }, + go = { 'gofmt', 'goimports' }, + c = { 'clang_format' }, + } + } + }, + + { -- Useful plugin to show you pending keybinds. + 'folke/which-key.nvim', + event = 'VeryLazy', + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 350 + end, + config = function() + require('which-key').setup() + + -- document existing key chains + require('which-key').register { + ['c'] = { name = '[C]ode', _ = 'which_key_ignore' }, + ['d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, + ['g'] = { name = '[G]it', _ = 'which_key_ignore' }, + ['h'] = { name = 'Git [H]unk', _ = 'which_key_ignore' }, + ['r'] = { name = '[R]ename', _ = 'which_key_ignore' }, + ['s'] = { name = '[S]earch', _ = 'which_key_ignore' }, + ['t'] = { name = '[T]oggle', _ = 'which_key_ignore' }, + ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, + } + end, + }, + + { + 'nvim-telescope/telescope.nvim', + event = 'VeryLazy', + branch = '0.1.x', + dependencies = { + 'nvim-lua/plenary.nvim', + { -- If encountering errors, see telescope-fzf-native README for install instructions + 'nvim-telescope/telescope-fzf-native.nvim', + -- NOTE: `build` is used to run some command when the plugin is installed/updated. + -- This is only run then, not every time Neovim starts up. + build = 'make', + + -- NOTE: `cond` is a condition used to determine whether this plugin should be + -- installed and loaded. + cond = function() + return vim.fn.executable 'make' == 1 + end, + }, + { 'nvim-telescope/telescope-ui-select.nvim' }, + + -- Useful for getting pretty icons, but requires special font. + -- If you already have a Nerd Font, or terminal set up with fallback fonts + -- you can enable this + -- { 'nvim-tree/nvim-web-devicons' } + }, + config = function() + require('telescope').setup { + defaults = { + mappings = { + i = { + [''] = false, + [''] = false, + } + } + }, + extensions = { + ['ui-select'] = { + require('telescope.themes').get_dropdown(), + } + }, + } + + pcall(require('telescop').load_extension, 'fzf') + pcall(require('telescop').load_extension, 'fzf') + end + }, + + -- require 'kickstart.plugins.autoformat', -- require 'kickstart.plugins.debug', { import = 'custom.plugins' }, }, {}) diff --git a/lua/custom/plugins/whichkey.lua b/lua/custom/plugins/whichkey.lua deleted file mode 100644 index 79d7f580..00000000 --- a/lua/custom/plugins/whichkey.lua +++ /dev/null @@ -1,10 +0,0 @@ --- Useful plugin to show you pending keybinds. -return { - 'folke/which-key.nvim', - event = "VeryLazy", - init = function() - vim.o.timeout = true - vim.o.timeoutlen = 300 - end, - opts = {}, -}