diff --git a/README.md b/README.md index 3075c29..44cdaa6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ # dotfiles -Dotfiles and default setup \ No newline at end of file +Dotfiles and default setup + +clone the repo cd into it and run + +``` +stow --target=$HOME --verbose=2 */ +``` diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua new file mode 100644 index 0000000..4ee4c7f --- /dev/null +++ b/nvim/.config/nvim/init.lua @@ -0,0 +1,3 @@ +require("joe.core") +require("joe.lazy") + diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..7396c44 --- /dev/null +++ b/nvim/.config/nvim/lazy-lock.json @@ -0,0 +1,31 @@ +{ + "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, + "LuaSnip": { "branch": "master", "commit": "a7a4b4682c4b3e2ba82b82a4e6e5f5a0e79dec32" }, + "alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" }, + "bufferline.nvim": { "branch": "main", "commit": "64e2c5def50dfd6b6f14d96a45fa3d815a4a1eef" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "conform.nvim": { "branch": "master", "commit": "bf109f061fc3cd75394b7823923187ae045cbf22" }, + "dressing.nvim": { "branch": "master", "commit": "18e5beb3845f085b6a33c24112b37988f3f93c06" }, + "friendly-snippets": { "branch": "main", "commit": "dcd4a586439a1c81357d5b9d26319ae218cc9479" }, + "gitsigns.nvim": { "branch": "main", "commit": "078041e9d060a386b0c9d3a8c7a7b019a35d3fb0" }, + "lazy.nvim": { "branch": "main", "commit": "3132d7d27d56d6bb4bdd0a09623d162b3cf1c588" }, + "lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, + "lualine.nvim": { "branch": "master", "commit": "b5e8bb642138f787a2c1c5aedc2a78cb2cebbd67" }, + "monokai.nvim": { "branch": "master", "commit": "b8bd44d5796503173627d7a1fc51f77ec3a08a63" }, + "nvim-autopairs": { "branch": "master", "commit": "dbfc1c34bed415906395db8303c71039b3a3ffb4" }, + "nvim-cmp": { "branch": "main", "commit": "630cdf7d547c4461ef6d7362c3794a08abfad4fb" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, + "nvim-surround": { "branch": "main", "commit": "d47001f8ddf9646c24f16d2732d4d0255acd2121" }, + "nvim-tree.lua": { "branch": "master", "commit": "f7c09bd72e50e1795bd3afb9e2a2b157b4bfb3c3" }, + "nvim-treesitter": { "branch": "master", "commit": "6e7b41106e9b15a5b47d149378d53482c9d9c7a3" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "d2a4ffc22d9d38d44edb73da007b3cf43451e9b4" }, + "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "7ab799a9792f7cf3883cf28c6a00ad431f3d382a" }, + "nvim-web-devicons": { "branch": "master", "commit": "cb0c967c9723a76ccb1be0cc3a9a10e577d2f6ec" }, + "plenary.nvim": { "branch": "master", "commit": "f7adfc4b3f4f91aab6caebf42b3682945fbc35be" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, + "telescope.nvim": { "branch": "0.1.x", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, + "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } +} \ No newline at end of file diff --git a/nvim/.config/nvim/lua/joe/core/init.lua b/nvim/.config/nvim/lua/joe/core/init.lua new file mode 100644 index 0000000..3b9ae2a --- /dev/null +++ b/nvim/.config/nvim/lua/joe/core/init.lua @@ -0,0 +1,22 @@ +require("joe.core.keymaps") +require("joe.core.options") + +-- automatically open nvim-tree. In file without focus, in dir with focus +local function open_nvim_tree(data) + -- buffer is a directory + local dir = string.find(data.file, "NvimTree") + + print(vim.inspect(dir)) + + if dir then + -- open + require("nvim-tree.api").tree.open() + else + -- open the tree without focus + require("nvim-tree.api").tree.toggle({ + focus = false, + }) + end +end + +vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree }) diff --git a/nvim/.config/nvim/lua/joe/core/keymaps.lua b/nvim/.config/nvim/lua/joe/core/keymaps.lua new file mode 100644 index 0000000..db46566 --- /dev/null +++ b/nvim/.config/nvim/lua/joe/core/keymaps.lua @@ -0,0 +1,13 @@ +-- set leader key to space +vim.g.mapleader = " " + +local keymap = vim.keymap -- for conciseness + +--------------------- +-- General Keymaps ------------------- + +-- use jk to exit insert mode +keymap.set("i", "jk", "", { desc = "Exit insert mode with jk" }) + +-- delete single character without copying into register +keymap.set("n", "x", '"_x') diff --git a/nvim/.config/nvim/lua/joe/core/options.lua b/nvim/.config/nvim/lua/joe/core/options.lua new file mode 100644 index 0000000..ddd0a54 --- /dev/null +++ b/nvim/.config/nvim/lua/joe/core/options.lua @@ -0,0 +1,45 @@ +local opt = vim.opt -- for conciseness + +-- line numbers +opt.relativenumber = true -- show relative line numbers +opt.number = true -- shows absolute line number on cursor line (when relative number is on) + +-- tabs & indentation +opt.tabstop = 2 -- 2 spaces for tabs (prettier default) +opt.shiftwidth = 2 -- 2 spaces for indent width +opt.expandtab = true -- expand tab to spaces +opt.autoindent = true -- copy indent from current line when starting new one + +-- line wrapping +--opt.wrap = false -- disable line wrapping + +-- search settings +opt.ignorecase = true -- ignore case when searching +opt.smartcase = true -- if you include mixed case in your search, assumes you want case-sensitive + +-- cursor line +opt.cursorline = true -- highlight the current cursor line + +-- appearance + +-- turn on termguicolors for nightfly colorscheme to work +-- (have to use iterm2 or any other true color terminal) +opt.termguicolors = true +opt.background = "dark" -- colorschemes that can be light or dark will be made dark +opt.signcolumn = "yes" -- show sign column so that text doesn't shift + +-- backspace +opt.backspace = "indent,eol,start" -- allow backspace on indent, end of line or insert mode start position + +-- clipboard +opt.clipboard:append("unnamedplus") -- use system clipboard as default register + +-- split windows +opt.splitright = true -- split vertical window to the right +opt.splitbelow = true -- split horizontal window to the bottom + +-- turn off swapfile +opt.swapfile = false + +-- turn of mouse +opt.mouse="" diff --git a/nvim/.config/nvim/lua/joe/lazy.lua b/nvim/.config/nvim/lua/joe/lazy.lua new file mode 100644 index 0000000..16f1dd0 --- /dev/null +++ b/nvim/.config/nvim/lua/joe/lazy.lua @@ -0,0 +1,16 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup('joe.plugins') + + diff --git a/nvim/.config/nvim/lua/joe/plugins/alpha-nvim.lua b/nvim/.config/nvim/lua/joe/plugins/alpha-nvim.lua new file mode 100644 index 0000000..c5d49e1 --- /dev/null +++ b/nvim/.config/nvim/lua/joe/plugins/alpha-nvim.lua @@ -0,0 +1,37 @@ +return { + "goolord/alpha-nvim", + event = "VimEnter", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + local alpha = require("alpha") + local dashboard = require("alpha.themes.dashboard") + + -- Set header + dashboard.section.header.val = { + " ", + " ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ", + " ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ", + " ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ", + " ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ", + " ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ", + " ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ", + " ", + } + + -- Set menu + dashboard.section.buttons.val = { + dashboard.button("e", " > New File", "ene"), + dashboard.button("SPC ee", " > Toggle file explorer", "NvimTreeToggle"), + dashboard.button("SPC ff", "󰱼 > Find File", "Telescope find_files"), + dashboard.button("SPC fs", " > Find Word", "Telescope live_grep"), + dashboard.button("SPC wr", "󰁯 > Restore Session For Current Directory", "SessionRestore"), + dashboard.button("q", " > Quit NVIM", "qa"), + } + + -- Send config to alpha + alpha.setup(dashboard.opts) + + -- Disable folding on alpha buffer + vim.cmd([[autocmd FileType alpha setlocal nofoldenable]]) + end, +} diff --git a/nvim/.config/nvim/lua/joe/plugins/autopairs.lua b/nvim/.config/nvim/lua/joe/plugins/autopairs.lua new file mode 100644 index 0000000..b1a0232 --- /dev/null +++ b/nvim/.config/nvim/lua/joe/plugins/autopairs.lua @@ -0,0 +1,31 @@ +return { + "windwp/nvim-autopairs", + event = { "InsertEnter" }, + dependencies = { + "hrsh7th/nvim-cmp", + }, + config = function() + -- import nvim-autopairs + local autopairs = require("nvim-autopairs") + + -- configure autopairs + autopairs.setup({ + check_ts = true, -- enable treesitter + ts_config = { + lua = { "string" }, -- don't add pairs in lua string treesitter nodes + javascript = { "template_string" }, -- don't add pairs in javscript template_string treesitter nodes + java = false, -- don't check treesitter on java + }, + }) + + + -- import nvim-autopairs completion functionality + local cmp_autopairs = require("nvim-autopairs.completion.cmp") + + -- import nvim-cmp plugin (completions plugin) + local cmp = require("cmp") + + -- make autopairs and completion work together + cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) + end, +} diff --git a/nvim/.config/nvim/lua/joe/plugins/bufferline.lua b/nvim/.config/nvim/lua/joe/plugins/bufferline.lua new file mode 100644 index 0000000..ec340e9 --- /dev/null +++ b/nvim/.config/nvim/lua/joe/plugins/bufferline.lua @@ -0,0 +1,11 @@ +return { + "akinsho/bufferline.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + version = "*", + opts = { + options = { + mode = "tabs", + separator_style = "slant", + }, + }, +} diff --git a/nvim/.config/nvim/lua/joe/plugins/colorizer.lua b/nvim/.config/nvim/lua/joe/plugins/colorizer.lua new file mode 100644 index 0000000..a65b5cc --- /dev/null +++ b/nvim/.config/nvim/lua/joe/plugins/colorizer.lua @@ -0,0 +1,5 @@ +return { + "NvChad/nvim-colorizer.lua", + event = { "BufReadPre", "BufNewFile" }, + config = true, +} diff --git a/nvim/.config/nvim/lua/joe/plugins/colorscheme.lua b/nvim/.config/nvim/lua/joe/plugins/colorscheme.lua new file mode 100644 index 0000000..ce392fb --- /dev/null +++ b/nvim/.config/nvim/lua/joe/plugins/colorscheme.lua @@ -0,0 +1,15 @@ +return { + "tanvirtin/monokai.nvim", + priority = 1000, + config = function() + vim.cmd([[colorscheme monokai]]) + -- vim.cmd([[colorscheme monokai_pro]]) + -- vim.cmd([[colorscheme monokai_soda]]) + -- vim.cmd([[colorscheme monokai_ristretto]]) + end, +} + +--require('monokai').setup {} +--require('monokai').setup { palette = require('monokai').pro } +--require('monokai').setup { palette = require('monokai').soda } +--require('monokai').setup { palette = require('monokai').ristretto } diff --git a/nvim/.config/nvim/lua/joe/plugins/comment.lua b/nvim/.config/nvim/lua/joe/plugins/comment.lua new file mode 100644 index 0000000..8f5f9fc --- /dev/null +++ b/nvim/.config/nvim/lua/joe/plugins/comment.lua @@ -0,0 +1,19 @@ +return { + "numToStr/Comment.nvim", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + "JoosepAlviste/nvim-ts-context-commentstring", + }, + config = function() + -- import comment plugin safely + local comment = require("Comment") + + local ts_context_commentstring = require("ts_context_commentstring.integrations.comment_nvim") + + -- enable comment + comment.setup({ + -- for commenting tsx and jsx files + pre_hook = ts_context_commentstring.create_pre_hook(), + }) + end, +} diff --git a/nvim/.config/nvim/lua/joe/plugins/dressing.lua b/nvim/.config/nvim/lua/joe/plugins/dressing.lua new file mode 100644 index 0000000..2fe4e2d --- /dev/null +++ b/nvim/.config/nvim/lua/joe/plugins/dressing.lua @@ -0,0 +1,7 @@ +return { + "stevearc/dressing.nvim", + event = "VeryLazy", + -- config = function() + -- local d = require("dressing") + -- end +} diff --git a/nvim/.config/nvim/lua/joe/plugins/formatting.lua b/nvim/.config/nvim/lua/joe/plugins/formatting.lua new file mode 100644 index 0000000..05a9a81 --- /dev/null +++ b/nvim/.config/nvim/lua/joe/plugins/formatting.lua @@ -0,0 +1,39 @@ +return { + "stevearc/conform.nvim", + lazy = true, + event = { "BufReadPre", "BufNewFile" }, -- to disable, comment this out + config = function() + local conform = require("conform") + + conform.setup({ + formatters_by_ft = { + javascript = { "prettier" }, + typescript = { "prettier" }, + javascriptreact = { "prettier" }, + typescriptreact = { "prettier" }, + svelte = { "prettier" }, + css = { "prettier" }, + html = { "prettier" }, + json = { "prettier" }, + yaml = { "prettier" }, + markdown = { "prettier" }, + graphql = { "prettier" }, + lua = { "stylua" }, + python = { "isort", "black" }, + }, + format_on_save = { + lsp_fallback = true, + async = false, + timeout_ms = 1000, + }, + }) + + vim.keymap.set({ "n", "v" }, "mp", function() + conform.format({ + lsp_fallback = true, + async = false, + timeout_ms = 1000, + }) + end, { desc = "Format file or range (in visual mode)" }) + end, +} diff --git a/nvim/.config/nvim/lua/joe/plugins/gitsigns.lua b/nvim/.config/nvim/lua/joe/plugins/gitsigns.lua new file mode 100644 index 0000000..eaf7ae7 --- /dev/null +++ b/nvim/.config/nvim/lua/joe/plugins/gitsigns.lua @@ -0,0 +1,5 @@ +return { + "lewis6991/gitsigns.nvim", + event = { "BufReadPre", "BufNewFile" }, + config = true, +} diff --git a/nvim/.config/nvim/lua/joe/plugins/init.lua b/nvim/.config/nvim/lua/joe/plugins/init.lua new file mode 100644 index 0000000..5c8e41c --- /dev/null +++ b/nvim/.config/nvim/lua/joe/plugins/init.lua @@ -0,0 +1,4 @@ +-- addons without configuration +return { + +} diff --git a/nvim/.config/nvim/lua/joe/plugins/nvim-cmp.lua b/nvim/.config/nvim/lua/joe/plugins/nvim-cmp.lua new file mode 100644 index 0000000..35fe5bc --- /dev/null +++ b/nvim/.config/nvim/lua/joe/plugins/nvim-cmp.lua @@ -0,0 +1,56 @@ +return { + "hrsh7th/nvim-cmp", + event = "InsertEnter", + dependencies = { + "hrsh7th/cmp-buffer", -- source for text in buffer + "hrsh7th/cmp-path", -- source for file system paths + "L3MON4D3/LuaSnip", -- snippet engine + "saadparwaiz1/cmp_luasnip", -- for autocompletion + "rafamadriz/friendly-snippets", -- useful snippets + "onsails/lspkind.nvim", -- vs-code like pictograms + }, + config = function() + local cmp = require("cmp") + + local luasnip = require("luasnip") + + local lspkind = require("lspkind") + + -- loads vscode style snippets from installed plugins (e.g. friendly-snippets) + require("luasnip.loaders.from_vscode").lazy_load() + + cmp.setup({ + completion = { + completeopt = "menu,menuone,preview,noselect", + }, + snippet = { -- configure how nvim-cmp interacts with snippet engine + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.select_prev_item(), -- previous suggestion + [""] = cmp.mapping.select_next_item(), -- next suggestion + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), -- show completion suggestions + [""] = cmp.mapping.abort(), -- close completion window + [""] = cmp.mapping.confirm({ select = false }), + }), + -- sources for autocompletion + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, -- snippets + { name = "buffer" }, -- text within current buffer + { name = "path" }, -- file system paths + }), + -- configure lspkind for vs-code like pictograms in completion menu + formatting = { + format = lspkind.cmp_format({ + maxwidth = 50, + ellipsis_char = "...", + }), + }, + }) + end, +} diff --git a/nvim/.config/nvim/lua/joe/plugins/nvim-tree.lua b/nvim/.config/nvim/lua/joe/plugins/nvim-tree.lua new file mode 100644 index 0000000..ab345a3 --- /dev/null +++ b/nvim/.config/nvim/lua/joe/plugins/nvim-tree.lua @@ -0,0 +1,61 @@ +return { + "nvim-tree/nvim-tree.lua", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function () + local nvimtree = require("nvim-tree") + + -- recommended settings from nvim-tree documentation + vim.g.loaded_netrw = 1 + vim.g.loaded_netrwPlugin = 1 + + -- change color for arrows in tree to light blue + vim.cmd([[ highlight NvimTreeFolderArrowClosed guifg=#3FC5FF ]]) + vim.cmd([[ highlight NvimTreeFolderArrowOpen guifg=#3FC5FF ]]) + + -- configure nvim-tree + nvimtree.setup({ + view = { + width = 35, + relativenumber = true, + }, + -- change folder arrow icons + renderer = { + indent_markers = { + enable = true, + }, + icons = { + glyphs = { + folder = { + arrow_closed = "", -- arrow when folder is closed + arrow_open = "", -- arrow when folder is open + }, + }, + }, + }, + -- disable window_picker for + -- explorer to work well with + -- window splits + actions = { + open_file = { + window_picker = { + enable = false, + }, + }, + }, + filters = { + custom = { ".DS_Store" }, + }, + git = { + ignore = false, + }, + }) + + -- set keymaps + local keymap = vim.keymap -- for conciseness + + keymap.set("n", "ee", "NvimTreeToggle", { desc = "Toggle file explorer" }) -- toggle file explorer + keymap.set("n", "ef", "NvimTreeFindFileToggle", { desc = "Toggle file explorer on current file" }) -- toggle file explorer on current file + keymap.set("n", "ec", "NvimTreeCollapse", { desc = "Collapse file explorer" }) -- collapse file explorer + keymap.set("n", "er", "NvimTreeRefresh", { desc = "Refresh file explorer" }) -- refresh file explorer + end, +} diff --git a/nvim/.config/nvim/lua/joe/plugins/nvim-treesitter.lua b/nvim/.config/nvim/lua/joe/plugins/nvim-treesitter.lua new file mode 100644 index 0000000..48a3a96 --- /dev/null +++ b/nvim/.config/nvim/lua/joe/plugins/nvim-treesitter.lua @@ -0,0 +1,60 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + event = { "BufReadPre", "BufNewFile" }, + build = ":TSUpdate", + dependencies = { + "nvim-treesitter/nvim-treesitter-textobjects", + "windwp/nvim-ts-autotag", + }, + config = function() + -- import nvim-treesitter plugin + local treesitter = require("nvim-treesitter.configs") + + -- configure treesitter + treesitter.setup({ -- enable syntax highlighting + highlight = { + enable = true, + }, + -- enable indentation + indent = { enable = true }, + -- enable autotagging (w/ nvim-ts-autotag plugin) + autotag = { + enable = true, + }, + -- ensure these language parsers are installed + ensure_installed = { + "json", + "javascript", + "typescript", + "tsx", + "yaml", + "html", + "css", + "markdown", + "markdown_inline", + "svelte", + "graphql", + "bash", + "lua", + "vim", + "dockerfile", + "gitignore", + "query", + }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "", + node_incremental = "", + scope_incremental = false, + node_decremental = "", + }, + }, + }) + + -- enable nvim-ts-context-commentstring plugin for commenting tsx and jsx + require('ts_context_commentstring').setup {} + end, + }, +} diff --git a/nvim/.config/nvim/lua/joe/plugins/statusline.lua b/nvim/.config/nvim/lua/joe/plugins/statusline.lua new file mode 100644 index 0000000..3698644 --- /dev/null +++ b/nvim/.config/nvim/lua/joe/plugins/statusline.lua @@ -0,0 +1,71 @@ +return { + "nvim-lualine/lualine.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + local lualine = require("lualine") + local lazy_status = require("lazy.status") -- to configure lazy pending updates count + + local colors = { + blue = "#65D1FF", + green = "#3EFFDC", + violet = "#FF61EF", + yellow = "#FFDA7B", + red = "#FF4A4A", + fg = "#c3ccdc", + bg = "#112638", + inactive_bg = "#2c3043", + } + + local my_lualine_theme = { + normal = { + a = { bg = colors.blue, fg = colors.bg, gui = "bold" }, + b = { bg = colors.bg, fg = colors.fg }, + c = { bg = colors.bg, fg = colors.fg }, + }, + insert = { + a = { bg = colors.green, fg = colors.bg, gui = "bold" }, + b = { bg = colors.bg, fg = colors.fg }, + c = { bg = colors.bg, fg = colors.fg }, + }, + visual = { + a = { bg = colors.violet, fg = colors.bg, gui = "bold" }, + b = { bg = colors.bg, fg = colors.fg }, + c = { bg = colors.bg, fg = colors.fg }, + }, + command = { + a = { bg = colors.yellow, fg = colors.bg, gui = "bold" }, + b = { bg = colors.bg, fg = colors.fg }, + c = { bg = colors.bg, fg = colors.fg }, + }, + replace = { + a = { bg = colors.red, fg = colors.bg, gui = "bold" }, + b = { bg = colors.bg, fg = colors.fg }, + c = { bg = colors.bg, fg = colors.fg }, + }, + inactive = { + a = { bg = colors.inactive_bg, fg = colors.semilightgray, gui = "bold" }, + b = { bg = colors.inactive_bg, fg = colors.semilightgray }, + c = { bg = colors.inactive_bg, fg = colors.semilightgray }, + }, + } + + -- configure lualine with modified theme + lualine.setup({ + options = { + theme = my_lualine_theme, + }, + sections = { + lualine_x = { + { + lazy_status.updates, + cond = lazy_status.has_updates, + color = { fg = "#ff9e64" }, + }, + { "encoding" }, + { "fileformat" }, + { "filetype" }, + }, + }, + }) + end, +} diff --git a/nvim/.config/nvim/lua/joe/plugins/surround.lua b/nvim/.config/nvim/lua/joe/plugins/surround.lua new file mode 100644 index 0000000..77f5073 --- /dev/null +++ b/nvim/.config/nvim/lua/joe/plugins/surround.lua @@ -0,0 +1,6 @@ +return { + "kylechui/nvim-surround", + event = { "BufReadPre", "BufNewFile" }, + version = "*", -- Use for stability; omit to use `main` branch for the latest features + config = true, +} diff --git a/nvim/.config/nvim/lua/joe/plugins/telescope.lua b/nvim/.config/nvim/lua/joe/plugins/telescope.lua new file mode 100644 index 0000000..908724e --- /dev/null +++ b/nvim/.config/nvim/lua/joe/plugins/telescope.lua @@ -0,0 +1,36 @@ +return { + "nvim-telescope/telescope.nvim", + branch = "0.1.x", + dependencies = { + "nvim-lua/plenary.nvim", + { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, + "nvim-tree/nvim-web-devicons", + }, + config = function() + local telescope = require("telescope") + local actions = require("telescope.actions") + + telescope.setup({ + defaults = { + path_display = { "truncate " }, + mappings = { + i = { + [""] = actions.move_selection_previous, -- move to prev result + [""] = actions.move_selection_next, -- move to next result + [""] = actions.send_selected_to_qflist + actions.open_qflist, + }, + }, + }, + }) + + telescope.load_extension("fzf") + + -- set keymaps + local keymap = vim.keymap -- for conciseness + + keymap.set("n", "ff", "Telescope find_files", { desc = "Fuzzy find files in cwd" }) + keymap.set("n", "fr", "Telescope oldfiles", { desc = "Fuzzy find recent files" }) + keymap.set("n", "fs", "Telescope live_grep", { desc = "Find string in cwd" }) + keymap.set("n", "fc", "Telescope grep_string", { desc = "Find string under cursor in cwd" }) + end, +} diff --git a/nvim/.config/nvim/lua/joe/plugins/which-key.lua b/nvim/.config/nvim/lua/joe/plugins/which-key.lua new file mode 100644 index 0000000..d004051 --- /dev/null +++ b/nvim/.config/nvim/lua/joe/plugins/which-key.lua @@ -0,0 +1,13 @@ +return { + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 500 + end, + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + }, +}