From 567bfcc06e56e22da64ce53663227b9f3914aea0 Mon Sep 17 00:00:00 2001 From: Ryan Manseau Date: Thu, 25 May 2023 10:13:34 -0700 Subject: [PATCH] initial commit added a bunch of config to try and get things closer to my doom emacs setup. still not perfect. --- .gitignore | 8 ++ .neoconf.json | 15 +++ README.md | 4 + init.lua | 2 + lazy-lock.json | 54 ++++++++ lua/config/autocmds.lua | 7 + lua/config/keymaps.lua | 39 ++++++ lua/config/lazy.lua | 46 +++++++ lua/config/options.lua | 3 + lua/plugins/example.lua | 266 ++++++++++++++++++++++++++++++++++++++ lua/plugins/mine.lua | 178 +++++++++++++++++++++++++ lua/plugins/telescope.lua | 79 +++++++++++ stylua.toml | 3 + 13 files changed, 704 insertions(+) create mode 100644 .gitignore create mode 100644 .neoconf.json create mode 100644 README.md create mode 100644 init.lua create mode 100644 lazy-lock.json create mode 100644 lua/config/autocmds.lua create mode 100644 lua/config/keymaps.lua create mode 100644 lua/config/lazy.lua create mode 100644 lua/config/options.lua create mode 100644 lua/plugins/example.lua create mode 100644 lua/plugins/mine.lua create mode 100644 lua/plugins/telescope.lua create mode 100644 stylua.toml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cc5457a --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +tt.* +.tests +doc/tags +debug +.repro +foo.* +*.log +data diff --git a/.neoconf.json b/.neoconf.json new file mode 100644 index 0000000..7c48087 --- /dev/null +++ b/.neoconf.json @@ -0,0 +1,15 @@ +{ + "neodev": { + "library": { + "enabled": true, + "plugins": true + } + }, + "neoconf": { + "plugins": { + "lua_ls": { + "enabled": true + } + } + } +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..b6afdb7 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +## nvim conf + +playing with nvim because typescript with doom emacs leaves some to be desired. +built on LazyVim [LazyVim](https://github.com/LazyVim/LazyVim). diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..2514f9e --- /dev/null +++ b/init.lua @@ -0,0 +1,2 @@ +-- bootstrap lazy.nvim, LazyVim and your plugins +require("config.lazy") diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..a1139cb --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,54 @@ +{ + "LazyVim": { "branch": "main", "commit": "25d37a2cdd6202f1d767595454a7f84f77bbd83e" }, + "LuaSnip": { "branch": "master", "commit": "b4bc24c4925aeb05fd47d2ee9b24b7f73f5d7e32" }, + "alpha-nvim": { "branch": "main", "commit": "1838ae926e8d49fe5330d1498ee8289ae2c340bc" }, + "bufferline.nvim": { "branch": "main", "commit": "32d74d5d044f7cc89892d4781a83d55ee4ed552a" }, + "catppuccin": { "branch": "main", "commit": "1d3eda15703ba70f57e94e6451db55914ff7017f" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, + "dressing.nvim": { "branch": "master", "commit": "f19cbd56f7f8cad212c58a7285d09c5d9c273896" }, + "flit.nvim": { "branch": "main", "commit": "f60e4b3d49bb5a5e97cfffe66f2e671eb422078e" }, + "friendly-snippets": { "branch": "main", "commit": "1d0dac346de7c6895ac72528df3276386c6b149b" }, + "gitsigns.nvim": { "branch": "main", "commit": "f868d82a36f7f7f5e110eb0a9659993984f59875" }, + "indent-blankline.nvim": { "branch": "master", "commit": "86d1b71c5c26168c3a3a9ff5f69e833889a09c1d" }, + "lazy.nvim": { "branch": "main", "commit": "67ae8bbbe3985e380b98abeaf6c567c422b29746" }, + "leap.nvim": { "branch": "main", "commit": "6f2912755c9c4ae790abd829f0cf1b07c037b2a4" }, + "lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "90a8bbf106b85b76951a34c542058ffa807de2b1" }, + "mason.nvim": { "branch": "main", "commit": "e634134312bb936f472468a401c9cae6485ab54b" }, + "mini.ai": { "branch": "main", "commit": "aea7f12818a621f1d6f742a50b33e65e0bb82a2e" }, + "mini.bufremove": { "branch": "main", "commit": "14805473144fffbd019d07e51bed2d176e065ee9" }, + "mini.comment": { "branch": "main", "commit": "877acea5b2a32ff55f808fc0ebe9aa898648318c" }, + "mini.indentscope": { "branch": "main", "commit": "f60e9b51a6214c73a170ffc5445ce91560981031" }, + "mini.pairs": { "branch": "main", "commit": "963b800d0524eadd297199207011b98684205ada" }, + "mini.surround": { "branch": "main", "commit": "ea2e9c4cdbddc826dc6eeac69b035f8220f65de5" }, + "neo-tree.nvim": { "branch": "v2.x", "commit": "541f5c92d2492041afb354e2df6e74809094b051" }, + "neoconf.nvim": { "branch": "main", "commit": "bcb5b82255a754735d3721316188f6b6ed4c38f1" }, + "neodev.nvim": { "branch": "main", "commit": "6498a07601702349c31909005bb333003e4687d4" }, + "noice.nvim": { "branch": "main", "commit": "c2a745a26ae562f1faecbf6177ac53377d2658d5" }, + "nui.nvim": { "branch": "main", "commit": "698e75814cd7c56b0dd8af4936bcef2d13807f3c" }, + "null-ls.nvim": { "branch": "main", "commit": "08bb00c7c2cd58c72e02cf54e4b9cbfe14b03e09" }, + "nvim-cmp": { "branch": "main", "commit": "935b4069ce73b60ba9075bf05ee6ab50ed3af1a9" }, + "nvim-lspconfig": { "branch": "master", "commit": "570aae82f8c6bc15fb6e559ed7d5a3fd85374329" }, + "nvim-navic": { "branch": "master", "commit": "15704c607569d6c5cfeab486d3ef9459645a70ce" }, + "nvim-notify": { "branch": "master", "commit": "159c6cf1be25a933f35e97499314c9faab55c98f" }, + "nvim-spectre": { "branch": "master", "commit": "46b9883c0760db6547f152dc97a651611ba6486d" }, + "nvim-treesitter": { "branch": "master", "commit": "39cf5cbcfd71c4fc3edebbcd79b471899f4deb95" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "35a60f093fa15a303874975f963428a5cd24e4a0" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "0bf8fbc2ca8f8cdb6efbd0a9e32740d7a991e4c3" }, + "nvim-web-devicons": { "branch": "master", "commit": "986875b7364095d6535e28bd4aac3a9357e91bbe" }, + "persistence.nvim": { "branch": "main", "commit": "c814fae5c37aa0aba9cd9da05df6e52b88d612c3" }, + "plenary.nvim": { "branch": "master", "commit": "9ac3e9541bbabd9d73663d757e4fe48a675bb054" }, + "telescope-file-browser.nvim": { "branch": "master", "commit": "6cf29d5139601993343c4e70ee2d1f67959d9cc5" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "580b6c48651cabb63455e97d7e131ed557b8c7e2" }, + "telescope.nvim": { "branch": "master", "commit": "d77b37f4520e5fc2cf4c74c12e42ed4b589bd367" }, + "todo-comments.nvim": { "branch": "main", "commit": "8febc60a76feefd8203077ef78b6a262ea1a41f9" }, + "tokyonight.nvim": { "branch": "main", "commit": "df13e3268a44f142999fa166572fe95a650a0b37" }, + "trouble.nvim": { "branch": "main", "commit": "d56bfc0c501ced4002a57cb60433362fb2ce9c4d" }, + "vim-illuminate": { "branch": "master", "commit": "a2907275a6899c570d16e95b9db5fd921c167502" }, + "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, + "vim-startuptime": { "branch": "master", "commit": "5ddaf24df23f4d151970987c1322eaa247f08e69" }, + "which-key.nvim": { "branch": "main", "commit": "5a6c954a5a46023c19acc03a8b6d7c3e57964fc5" } +} \ No newline at end of file diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua new file mode 100644 index 0000000..4b6d46e --- /dev/null +++ b/lua/config/autocmds.lua @@ -0,0 +1,7 @@ +-- Autocmds are automatically loaded on the VeryLazy event +-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua +-- Add any additional autocmds here + +-- autocmd InsertLeave * :normal `^ + +vim.api.nvim_create_autocmd("InsertLeave", { command = ":normal `^" }) diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua new file mode 100644 index 0000000..d268511 --- /dev/null +++ b/lua/config/keymaps.lua @@ -0,0 +1,39 @@ +-- Keymaps are automatically loaded on the VeryLazy event +-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua +-- Add any additional keymaps here + +-- telescope picker shortcuts +vim.keymap.set("n", "", ":Telescope buffers") +vim.keymap.set("n", "", ":Telescope file_browser path=%:p:h select_buffer=true") +vim.keymap.set("n", "fp", ":Telescope find_files cwd=~/.config/nvim", { desc = "Find file in config" }) + +-- hjkl modifiers +vim.keymap.set({ "n", "v" }, "L", "E") +vim.keymap.set({ "n", "v" }, "H", "B") +vim.keymap.set({ "n", "v" }, "J", "4j") +vim.keymap.set({ "n", "v" }, "K", "4k") +vim.keymap.set({ "n", "v" }, "", "8") +vim.keymap.set({ "n", "v" }, "", "8") + +-- join line +vim.keymap.set({ "n", "v" }, "gj", ":join") + +-- jump forward and back +vim.keymap.set({ "n", "v" }, "gf", "") +vim.keymap.set({ "n", "v" }, "gb", "") + +-- file operations +vim.keymap.set({ "n", "v" }, "fs", ":w", { desc = "Save file" }) + +-- window operations +vim.keymap.del({ "n" }, "w|") +vim.keymap.del({ "n" }, "ww") +vim.keymap.set({ "n", "v" }, "w\\", "v", { desc = "Split window vertical" }) +vim.keymap.set({ "n", "v" }, "w-", "s", { desc = "Split window horizontal" }) +vim.keymap.set({ "n", "v" }, "w=", "=", { desc = "Balance windows" }) +vim.keymap.set({ "n", "v", "i" }, "", "w") + +-- git stuff +vim.keymap.del({ "n" }, "gg") +vim.keymap.del({ "n" }, "gG") +vim.keymap.set({ "n" }, "gg", "Neogit", { desc = "Neogit status" }) diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua new file mode 100644 index 0000000..891b190 --- /dev/null +++ b/lua/config/lazy.lua @@ -0,0 +1,46 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + -- bootstrap lazy.nvim + -- stylua: ignore + vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) +end +vim.opt.rtp:prepend(vim.env.LAZY or lazypath) + +require("lazy").setup({ + spec = { + -- add LazyVim and import its plugins + { "LazyVim/LazyVim", import = "lazyvim.plugins" }, + -- import any extras modules here + -- { import = "lazyvim.plugins.extras.lang.typescript" }, + -- { import = "lazyvim.plugins.extras.lang.json" }, + -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, + -- import/override with your plugins + { import = "plugins" }, + }, + defaults = { + -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. + -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. + lazy = false, + -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, + -- have outdated releases, which may break your Neovim install. + version = false, -- always use the latest git commit + -- version = "*", -- try installing the latest stable version for plugins that support semver + }, + install = { colorscheme = { "tokyonight", "habamax" } }, + checker = { enabled = true }, -- automatically check for plugin updates + performance = { + rtp = { + -- disable some rtp plugins + disabled_plugins = { + "gzip", + -- "matchit", + -- "matchparen", + -- "netrwPlugin", + "tarPlugin", + "tohtml", + "tutor", + "zipPlugin", + }, + }, + }, +}) diff --git a/lua/config/options.lua b/lua/config/options.lua new file mode 100644 index 0000000..3ea1454 --- /dev/null +++ b/lua/config/options.lua @@ -0,0 +1,3 @@ +-- Options are automatically loaded before lazy.nvim startup +-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua +-- Add any additional options here diff --git a/lua/plugins/example.lua b/lua/plugins/example.lua new file mode 100644 index 0000000..ecc9567 --- /dev/null +++ b/lua/plugins/example.lua @@ -0,0 +1,266 @@ +-- since this is just an example spec, don't actually load anything here and return an empty spec +-- stylua: ignore +if true then return {} end + +-- every spec file under config.plugins will be loaded automatically by lazy.nvim +-- +-- In your plugin files, you can: +-- * add extra plugins +-- * disable/enabled LazyVim plugins +-- * override the configuration of LazyVim plugins +return { + -- add gruvbox + { "ellisonleao/gruvbox.nvim" }, + + -- Configure LazyVim to load gruvbox + { + "LazyVim/LazyVim", + opts = { + colorscheme = "gruvbox", + }, + }, + + -- change trouble config + { + "folke/trouble.nvim", + -- opts will be merged with the parent spec + opts = { use_diagnostic_signs = true }, + }, + + -- disable trouble + { "folke/trouble.nvim", enabled = false }, + + -- add symbols-outline + { + "simrat39/symbols-outline.nvim", + cmd = "SymbolsOutline", + keys = { { "cs", "SymbolsOutline", desc = "Symbols Outline" } }, + config = true, + }, + + -- override nvim-cmp and add cmp-emoji + { + "hrsh7th/nvim-cmp", + dependencies = { "hrsh7th/cmp-emoji" }, + ---@param opts cmp.ConfigSchema + opts = function(_, opts) + local cmp = require("cmp") + opts.sources = cmp.config.sources(vim.list_extend(opts.sources, { { name = "emoji" } })) + end, + }, + + -- change some telescope options and a keymap to browse plugin files + { + "nvim-telescope/telescope.nvim", + keys = { + -- add a keymap to browse plugin files + -- stylua: ignore + { + "fp", + function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end, + desc = "Find Plugin File", + }, + }, + -- change some options + opts = { + defaults = { + layout_strategy = "horizontal", + layout_config = { prompt_position = "top" }, + sorting_strategy = "ascending", + winblend = 0, + }, + }, + }, + + -- add telescope-fzf-native + { + "telescope.nvim", + dependencies = { + "nvim-telescope/telescope-fzf-native.nvim", + build = "make", + config = function() + require("telescope").load_extension("fzf") + end, + }, + }, + + -- add pyright to lspconfig + { + "neovim/nvim-lspconfig", + ---@class PluginLspOpts + opts = { + ---@type lspconfig.options + servers = { + -- pyright will be automatically installed with mason and loaded with lspconfig + pyright = {}, + }, + }, + }, + + -- add tsserver and setup with typescript.nvim instead of lspconfig + { + "neovim/nvim-lspconfig", + dependencies = { + "jose-elias-alvarez/typescript.nvim", + init = function() + require("lazyvim.util").on_attach(function(_, buffer) + -- stylua: ignore + vim.keymap.set( "n", "co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" }) + vim.keymap.set("n", "cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer }) + end) + end, + }, + ---@class PluginLspOpts + opts = { + ---@type lspconfig.options + servers = { + -- tsserver will be automatically installed with mason and loaded with lspconfig + tsserver = {}, + }, + -- you can do any additional lsp server setup here + -- return true if you don't want this server to be setup with lspconfig + ---@type table + setup = { + -- example to setup with typescript.nvim + tsserver = function(_, opts) + require("typescript").setup({ server = opts }) + return true + end, + -- Specify * to use this function as a fallback for any server + -- ["*"] = function(server, opts) end, + }, + }, + }, + + -- for typescript, LazyVim also includes extra specs to properly setup lspconfig, + -- treesitter, mason and typescript.nvim. So instead of the above, you can use: + { import = "lazyvim.plugins.extras.lang.typescript" }, + + -- add more treesitter parsers + { + "nvim-treesitter/nvim-treesitter", + opts = { + ensure_installed = { + "bash", + "html", + "javascript", + "json", + "lua", + "markdown", + "markdown_inline", + "python", + "query", + "regex", + "tsx", + "typescript", + "vim", + "yaml", + }, + }, + }, + + -- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above + -- would overwrite `ensure_installed` with the new value. + -- If you'd rather extend the default config, use the code below instead: + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + -- add tsx and treesitter + vim.list_extend(opts.ensure_installed, { + "tsx", + "typescript", + }) + end, + }, + + -- the opts function can also be used to change the default opts: + { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + opts = function(_, opts) + table.insert(opts.sections.lualine_x, "😄") + end, + }, + + -- or you can return new options to override all the defaults + { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + opts = function() + return { + --[[add your custom lualine config here]] + } + end, + }, + + -- use mini.starter instead of alpha + { import = "lazyvim.plugins.extras.ui.mini-starter" }, + + -- add jsonls and schemastore ans setup treesitter for json, json5 and jsonc + { import = "lazyvim.plugins.extras.lang.json" }, + + -- add any tools you want to have installed below + { + "williamboman/mason.nvim", + opts = { + ensure_installed = { + "stylua", + "shellcheck", + "shfmt", + "flake8", + }, + }, + }, + + -- Use for completion and snippets (supertab) + -- first: disable default and behavior in LuaSnip + { + "L3MON4D3/LuaSnip", + keys = function() + return {} + end, + }, + -- then: setup supertab in cmp + { + "hrsh7th/nvim-cmp", + dependencies = { + "hrsh7th/cmp-emoji", + }, + ---@param opts cmp.ConfigSchema + opts = function(_, opts) + local has_words_before = function() + unpack = unpack or table.unpack + 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 + + local luasnip = require("luasnip") + local cmp = require("cmp") + + opts.mapping = vim.tbl_extend("force", opts.mapping, { + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() + -- they way you will only jump inside the snippet region + elseif luasnip.expand_or_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" }), + }) + end, + }, +} diff --git a/lua/plugins/mine.lua b/lua/plugins/mine.lua new file mode 100644 index 0000000..740b455 --- /dev/null +++ b/lua/plugins/mine.lua @@ -0,0 +1,178 @@ +return { + { import = "lazyvim.plugins.extras.lang.typescript" }, + { import = "lazyvim.plugins.extras.lang.json" }, + + { "UtkarshVerma/molokai.nvim" }, + + { + "xiyaowong/transparent.nvim", + }, + + { + "neovim/nvim-lspconfig", + init = function() + local keys = require("lazyvim.plugins.lsp.keymaps").get() + keys[#keys + 1] = { "K", false } + keys[#keys + 1] = { "gm", vim.lsp.buf.hover, desc = "Hover" } + keys[#keys + 1] = { "gM", vim.lsp.buf.signature_help, desc = "Signature Help", has = "signatureHelp" } + end, + }, + + { + "ggandor/leap.nvim", + keys = function() -- function overwrites keybinds + return { + { + "gl", + function() + require("leap").leap({ + target_windows = vim.tbl_filter(function(win) + return vim.api.nvim_win_get_config(win).focusable + end, vim.api.nvim_tabpage_list_wins(0)), + }) + end, + mode = { "n", "x", "o" }, + desc = "Leap anywhere", + }, + } + end, + config = false, -- remove lazyvim config, i only want the above binding + }, + + { + "ggandor/flit.nvim", + opts = { + labeled_modes = "", -- Disable labels + }, + }, + + { + "echasnovski/mini.surround", + opts = { + mappings = { + add = "s", -- Add surrounding in Normal and Visual modes + delete = "ds", -- Delete surrounding + replace = "cs", -- Replace surroundng + find = "", -- Find surrounding (to the right) + find_left = "", -- Find surrounding (to the left) + highlight = "", -- Highlight surroundng + update_n_lines = "", -- Update `n_lines` + }, + }, + }, + + { + "folke/which-key.nvim", + opts = function(_, opts) + opts.defaults["gz"] = nil + end, + }, + + { + "hrsh7th/nvim-cmp", + dependencies = { "hrsh7th/cmp-cmdline" }, + lazy = false, + config = function(_, opts) + local cmp = require("cmp") + cmp.setup(opts) + + -- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline({ "/", "?" }, { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = "buffer" }, + }, + }) + + -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline(":", { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = "path" }, + }, { + { name = "cmdline" }, + }), + }) + end, + }, + + { + "folke/noice.nvim", + -- enabled = false, + opts = { + cmdline = { + view = "cmdline", + }, + presets = { + bottom_search = true, + command_palette = true, + long_message_to_split = true, + }, + popupmenu = { + enabled = true, -- enables the Noice popupmenu UI + backend = "cmp", -- backend to use to show regular cmdline completions + kind_icons = {}, -- set to `false` to disable icons + }, + }, + }, + + { + "echasnovski/mini.indentscope", + opts = { + draw = { + delay = 0, + animation = require("mini.indentscope").gen_animation.none(), + priority = 2, + }, + }, + config = function(_, opts) + require("mini.indentscope").setup(opts) + end, + }, + + { + "RRethy/vim-illuminate", + keys = function() + return {} + end, + config = function(_, opts) + require("illuminate").configure(opts) + -- why doesn't this work + -- vim.cmd("hi link IlluminatedWordRead Visual") + end, + }, + + { + "TimUntersberger/neogit", + dependencies = { "nvim-lua/plenary.nvim" }, + -- lazy = false, + event = "VeryLazy", + cmd = "Neogit", + -- keys = { + -- { + -- "gg", + -- "Neogit", + -- -- function() + -- -- require("neogit").open() + -- -- end, + -- desc = "Neogit status", + -- }, + -- }, + -- config = function() + -- local neogit = require("neogit") + -- neogit.setup({}) + -- end, + }, + + { + "LazyVim/LazyVim", + opts = { + colorscheme = "molokai", + }, + }, + + { + "akinsho/bufferline.nvim", + enabled = false, + }, +} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua new file mode 100644 index 0000000..2bc60db --- /dev/null +++ b/lua/plugins/telescope.lua @@ -0,0 +1,79 @@ +return { + { + "nvim-telescope/telescope.nvim", + opts = { + defaults = { + mappings = { + n = { + [""] = function(...) + return require("telescope.actions").close(...) + end, + }, + i = { + [""] = function(...) + return require("telescope.actions").move_selection_next(...) + end, + [""] = function(...) + return require("telescope.actions").move_selection_previous(...) + end, + [""] = function(...) + return require("telescope.actions").close(...) + end, + }, + }, + }, + }, + }, + + { + "nvim-telescope/telescope-file-browser.nvim", + dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" }, + config = function() + local fb_actions = require("telescope._extensions.file_browser.actions") + local t_actions = require("telescope.actions") + local action_state = require("telescope.actions.state") + require("telescope").setup({ + extensions = { + file_browser = { + -- disables netrw and use telescope-file-browser in its place + hijack_netrw = true, + mappings = { + n = { + ["l"] = t_actions.select_default, + ["h"] = fb_actions.backspace, + }, + i = { + [""] = t_actions.select_default, + [""] = fb_actions.backspace, + [""] = t_actions.close, + }, + }, + }, + }, + }) + require("telescope").load_extension("file_browser") + end, + }, + + { + "telescope.nvim", + dependencies = { + "nvim-telescope/telescope-fzf-native.nvim", + build = "make", + config = function() + require("telescope").setup({ + extensions = { + fzf = { + fuzzy = false, -- false will only do exact matching + -- override_generic_sorter = true, -- override the generic sorter + -- override_file_sorter = true, -- override the file sorter + -- case_mode = "smart_case", -- or "ignore_case" or "respect_case" + -- the default case_mode is "smart_case" + }, + }, + }) + require("telescope").load_extension("fzf") + end, + }, + }, +} diff --git a/stylua.toml b/stylua.toml new file mode 100644 index 0000000..5d6c50d --- /dev/null +++ b/stylua.toml @@ -0,0 +1,3 @@ +indent_type = "Spaces" +indent_width = 2 +column_width = 120 \ No newline at end of file