diff --git a/modules/common/neovim/init.lua b/modules/common/neovim/init.lua deleted file mode 100644 index d3d3ec6..0000000 --- a/modules/common/neovim/init.lua +++ /dev/null @@ -1,4 +0,0 @@ -require("packer_init") -require("settings") -require("keybinds") -require("background") diff --git a/modules/common/neovim/lua/keybinds.lua b/modules/common/neovim/lua/keybinds.lua deleted file mode 100644 index e405bd1..0000000 --- a/modules/common/neovim/lua/keybinds.lua +++ /dev/null @@ -1,78 +0,0 @@ --- =========================================================================== --- Key Mapping --- =========================================================================== - --- Function to cut down config boilerplate -local key = function(mode, key_sequence, action, params) - params = params or {} - vim.keymap.set(mode, key_sequence, action, params) -end - --- Remap space as leader key -key("", "", "", { silent = true }) -vim.g.mapleader = " " -vim.g.maplocalleader = " " - --- Keep selection when changing indentation -key("v", "<", "", ">gv") - --- Clear search register -key("n", "", ":noh", { silent = true }) - --- Shuffle lines around -key("n", "", ":m .+1==") -key("n", "", ":m .-2==") -key("v", "", ":m '>+1gv=gv") -key("v", "", ":m '<-2gv=gv") - --- Better window navigation -key("n", "", "h") -key("n", "", "j") -key("n", "", "k") -key("n", "", "l") - --- File commands -key("n", "q", ":quit") -key("n", "Q", ":quitall") -key("n", "fs", ":write") -key("n", "fd", ":lcd %:p:h", { silent = true }) -key("n", "fu", ":lcd ..", { silent = true }) -key("n", "", ":b#", { silent = true }) -key("n", "gr", ":!gh repo view -w", { silent = true }) -key("n", "tt", [[exe 'edit $NOTES_PATH/journal/'.strftime("%Y-%m-%d_%a").'.md']]) -key("n", "jj", ":!journal:e") - --- Window commands -key("n", "wv", ":vsplit") -key("n", "wh", ":split") -key("n", "wm", ":only") - --- Vimrc editing -key("n", "rr", ":luafile $HOME/.config/nvim/init.lua") -key("n", "rp", ":luafile $HOME/.config/nvim/init.lua:PackerInstall:") -key("n", "rc", ":luafile $HOME/.config/nvim/init.lua:PackerCompile") - --- Keep cursor in place -key("n", "n", "nzz") -key("n", "N", "Nzz") -key("n", "J", "mzJ`z") --- Mark and jump back to it - --- Add undo breakpoints -key("i", ",", ",u") -key("i", ".", ".u") -key("i", "!", "!u") -key("i", "?", "?u") - --- Resize with arrows -key("n", "", ":resize +2", { silent = true }) -key("n", "", ":resize -2", { silent = true }) -key("n", "", ":vertical resize -2", { silent = true }) -key("n", "", ":vertical resize +2", { silent = true }) - --- Other -key("n", "", ":noh", { silent = true }) --- Clear search in VimWiki -key("n", "Y", "y$") --- Copy to end of line -key("v", "", "y:%s/+//gc") --- Substitute selected -key("v", "D", "y'>gp") --- Duplicate selected -key("x", "p", '"_dP') --- Paste but keep register diff --git a/modules/common/neovim/lua/packer/completion.lua b/modules/common/neovim/lua/packer/completion.lua deleted file mode 100644 index be8fc1c..0000000 --- a/modules/common/neovim/lua/packer/completion.lua +++ /dev/null @@ -1,164 +0,0 @@ --- ======================================================================= --- Completion System --- ======================================================================= - -local M = {} - -M.packer = function(use) - -- Completion sources - use("hrsh7th/cmp-nvim-lsp") --- Language server completion plugin - use("hrsh7th/cmp-buffer") --- Generic text completion - use("hrsh7th/cmp-path") --- Local file completion - use("hrsh7th/cmp-cmdline") --- Command line completion - use("hrsh7th/cmp-nvim-lua") --- Nvim lua api completion - use("saadparwaiz1/cmp_luasnip") --- Luasnip completion - use("lukas-reineke/cmp-rg") --- Ripgrep completion - use("rafamadriz/friendly-snippets") -- Lots of pre-generated snippets - - -- Completion engine - use({ - "hrsh7th/nvim-cmp", - requires = { "L3MON4D3/LuaSnip" }, - config = function() - local cmp = require("cmp") - - local kind_icons = { - Text = "", - Method = "m", - Function = "", - Constructor = "", - Field = "", - Variable = "", - Class = "", - Interface = "", - Module = "", - Property = "", - Unit = "", - Value = "", - Enum = "", - Keyword = "", - Snippet = "", - Color = "", - File = "", - Reference = "", - Folder = "", - EnumMember = "", - Constant = "", - Struct = "", - Event = "", - Operator = "", - TypeParameter = "", - } - - cmp.setup({ - - -- Only enable on non-prompt buffers - -- So don't use in telescope - enabled = function() - if vim.bo.buftype == "prompt" then - return false - end - return true - end, - - -- Setup snippet completion - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, - - -- Setup completion keybinds - mapping = { - [""] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.abort(), { "i", "c" }), - [""] = function(_) - cmp.mapping({ - i = cmp.mapping.abort(), - c = cmp.mapping.close(), - }) - vim.cmd("stopinsert") --- Abort and leave insert mode - end, - [""] = cmp.mapping.confirm({ - behavior = cmp.ConfirmBehavior.Insert, - select = true, - }), - [""] = cmp.mapping.confirm({ - behavior = cmp.ConfirmBehavior.Replace, - select = true, - }), - [""] = cmp.mapping(function(_) - if require("luasnip").expand_or_jumpable() then - require("luasnip").expand_or_jump() - end - end, { "i", "s" }), - }, - - -- Setup completion engines - sources = { - { name = "nvim_lua" }, - { name = "nvim_lsp" }, - { name = "luasnip" }, - { name = "path" }, - { name = "buffer", keyword_length = 3, max_item_count = 10 }, - { - name = "rg", - keyword_length = 6, - max_item_count = 10, - option = { additional_arguments = "--ignore-case" }, - }, - }, - - -- Visual presentation - formatting = { - fields = { "kind", "abbr", "menu" }, - format = function(entry, vim_item) - vim_item.kind = string.format("%s", kind_icons[vim_item.kind]) - vim_item.menu = ({ - luasnip = "[Snippet]", - buffer = "[Buffer]", - path = "[Path]", - rg = "[Grep]", - nvim_lsp = "[LSP]", - nvim_lua = "[Lua]", - })[entry.source.name] - return vim_item - end, - }, - - -- Docs - -- window = { - -- completion = cmp.config.window.bordered(), - -- documentation = cmp.config.window.bordered(), - -- }, - - -- Extra features - experimental = { - native_menu = false, --- Use cmp menu instead of Vim menu - ghost_text = true, --- Show preview auto-completion - }, - }) - - -- Use buffer source for `/` - cmp.setup.cmdline("/", { - sources = { - { name = "buffer", keyword_length = 5 }, - }, - }) - - -- Use cmdline & path source for ':' - cmp.setup.cmdline(":", { - sources = cmp.config.sources({ - { name = "path" }, - }, { - { name = "cmdline" }, - }), - }) - end, - }) -end - -return M diff --git a/modules/common/neovim/lua/packer/lsp.lua b/modules/common/neovim/lua/packer/lsp.lua deleted file mode 100644 index 82dd205..0000000 --- a/modules/common/neovim/lua/packer/lsp.lua +++ /dev/null @@ -1,153 +0,0 @@ --- ======================================================================= --- Language Server --- ======================================================================= - -local M = {} - -M.packer = function(use) - -- Language server engine - use({ - "neovim/nvim-lspconfig", - requires = { "hrsh7th/cmp-nvim-lsp" }, - config = function() - local function on_path(program) - return vim.fn.executable(program) == 1 - end - - local capabilities = require("cmp_nvim_lsp").default_capabilities() - if on_path("lua-language-server") then - require("lspconfig").sumneko_lua.setup({ - capabilities = capabilities, - -- Turn off errors for vim global variable - settings = { - Lua = { - diagnostics = { - globals = { "vim", "hs" }, - }, - }, - }, - }) - end - if on_path("rust-analyzer") then - require("lspconfig").rust_analyzer.setup({ capabilities = capabilities }) - end - if on_path("tflint") then - require("lspconfig").tflint.setup({ capabilities = capabilities }) - end - if on_path("terraform-ls") then - require("lspconfig").terraformls.setup({ capabilities = capabilities }) - end - if on_path("pyright") then - require("lspconfig").pyright.setup({ - on_attach = function() - -- set keymaps (requires 0.7.0) - -- vim.keymap.set("n", "", "", {buffer=0}) - end, - capabilities = capabilities, - }) - end - if on_path("nil") then - require("lspconfig").nil_ls.setup({ capabilities = capabilities }) - end - - vim.keymap.set("n", "gd", vim.lsp.buf.definition) - vim.keymap.set("n", "gT", vim.lsp.buf.type_definition) - vim.keymap.set("n", "gi", vim.lsp.buf.implementation) - vim.keymap.set("n", "gh", vim.lsp.buf.hover) - -- vim.keymap.set("n", "gr", telescope.lsp_references) - vim.keymap.set("n", "R", vim.lsp.buf.rename) - vim.keymap.set("n", "]e", vim.diagnostic.goto_next) - vim.keymap.set("n", "[e", vim.diagnostic.goto_prev) - vim.keymap.set("n", "de", vim.diagnostic.open_float) - vim.keymap.set("n", "E", vim.lsp.buf.code_action) - end, - }) - - -- Pretty highlights - use("folke/lsp-colors.nvim") - - -- Linting - use({ - "jose-elias-alvarez/null-ls.nvim", - branch = "main", - requires = { - "nvim-lua/plenary.nvim", - "neovim/nvim-lspconfig", - }, - config = function() - local function on_path(program) - return vim.fn.executable(program) == 1 - end - - local augroup = vim.api.nvim_create_augroup("LspFormatting", {}) - require("null-ls").setup({ - sources = { - require("null-ls").builtins.formatting.stylua.with({ - condition = function() - return on_path("stylua") - end, - }), - require("null-ls").builtins.formatting.black.with({ - condition = function() - return on_path("black") - end, - }), - require("null-ls").builtins.diagnostics.flake8.with({ - condition = function() - return on_path("flake8") - end, - }), - require("null-ls").builtins.formatting.fish_indent.with({ - condition = function() - return on_path("fish_indent") - end, - }), - require("null-ls").builtins.formatting.nixfmt.with({ - condition = function() - return on_path("nixfmt") - end, - }), - require("null-ls").builtins.formatting.rustfmt.with({ - condition = function() - return on_path("rustfmt") - end, - }), - require("null-ls").builtins.diagnostics.shellcheck.with({ - condition = function() - return on_path("shellcheck") - end, - }), - require("null-ls").builtins.formatting.shfmt.with({ - extra_args = { "-i", "4", "-ci" }, - condition = function() - return on_path("shfmt") - end, - }), - require("null-ls").builtins.formatting.terraform_fmt.with({ - condition = function() - return on_path("terraform") - end, - }), - -- require("null-ls").builtins.diagnostics.luacheck, - -- require("null-ls").builtins.diagnostics.markdownlint, - -- require("null-ls").builtins.diagnostics.pylint, - }, - -- Format on save - on_attach = function(client, bufnr) - if client.supports_method("textDocument/formatting") then - vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) - vim.api.nvim_create_autocmd("BufWritePre", { - group = augroup, - buffer = bufnr, - callback = function() - vim.lsp.buf.format({ bufnr = bufnr }) - end, - }) - end - end, - }) - end, - }) -end - -return M diff --git a/modules/common/neovim/lua/packer/misc.lua b/modules/common/neovim/lua/packer/misc.lua deleted file mode 100644 index 017fef1..0000000 --- a/modules/common/neovim/lua/packer/misc.lua +++ /dev/null @@ -1,67 +0,0 @@ -local M = {} - -M.packer = function(use) - -- Important tweaks - use("tpope/vim-surround") --- Manipulate parentheses - - -- Convenience tweaks - use("tpope/vim-eunuch") --- File manipulation in Vim - use("tpope/vim-vinegar") --- Fixes netrw file explorer - use("tpope/vim-fugitive") --- Git commands and syntax - use("tpope/vim-repeat") --- Actually repeat using . - - -- Use gc or gcc to add comments - use({ - "numToStr/Comment.nvim", - config = function() - require("Comment").setup() - end, - }) - - -- Alignment tool - use({ - "godlygeek/tabular", - config = function() - vim.keymap.set("", "ta", ":Tabularize /") - vim.keymap.set("", "t#", ":Tabularize /#") - vim.keymap.set("", "tl", ":Tabularize /---") - end, - }) - - -- Markdown renderer / wiki notes - -- use("vimwiki/vimwiki") - use({ - "jakewvincent/mkdnflow.nvim", - config = function() - require("mkdnflow").setup({ - modules = { - bib = false, - conceal = true, - folds = false, - }, - perspective = { - priority = "current", - fallback = "first", - nvim_wd_heel = false, -- Don't change working dir - }, - links = { - style = "markdown", - conceal = true, - }, - wrap = true, - to_do = { - symbols = { " ", "-", "x" }, - }, - }) - vim.api.nvim_create_autocmd("FileType", { - pattern = "markdown", - callback = function() - vim.o.autowriteall = true -- Save in new buffer - vim.o.wrapmargin = 79 -- Wrap text automatically - end, - }) - end, - }) -end - -return M diff --git a/modules/common/neovim/lua/packer/speed.lua b/modules/common/neovim/lua/packer/speed.lua deleted file mode 100644 index 57222e2..0000000 --- a/modules/common/neovim/lua/packer/speed.lua +++ /dev/null @@ -1,13 +0,0 @@ -local M = {} - -M.packer = function(use) - -- Startup speed hacks - use({ - "lewis6991/impatient.nvim", - config = function() - require("impatient") - end, - }) -end - -return M diff --git a/modules/common/neovim/lua/packer/syntax.lua b/modules/common/neovim/lua/packer/syntax.lua deleted file mode 100644 index 1a28bc7..0000000 --- a/modules/common/neovim/lua/packer/syntax.lua +++ /dev/null @@ -1,72 +0,0 @@ --- ======================================================================= --- Syntax --- ======================================================================= - -local M = {} - -M.packer = function(use) - -- Syntax engine - use({ - "nvim-treesitter/nvim-treesitter", - commit = "9ada5f70f98d51e9e3e76018e783b39fd1cd28f7", - run = ":TSUpdate", - config = function() - require("nvim-treesitter.configs").setup({ - ensure_installed = { - "hcl", - "python", - "lua", - "nix", - "fish", - "toml", - "yaml", - "json", - }, - auto_install = true, - highlight = { enable = true }, - indent = { enable = true }, - }) - end, - }) - - -- Syntax-aware Textobjects - use({ - "nvim-treesitter/nvim-treesitter-textobjects", - requires = { "nvim-treesitter/nvim-treesitter" }, - config = function() - require("nvim-treesitter.configs").setup({ - textobjects = { - select = { - enable = true, - lookahead = true, -- Jump forward automatically - keymaps = { - ["af"] = "@function.outer", - ["if"] = "@function.inner", - ["ac"] = "@class.outer", - ["ic"] = "@class.inner", - ["al"] = "@loop.outer", - ["il"] = "@loop.inner", - ["aa"] = "@call.outer", - ["ia"] = "@call.inner", - ["ar"] = "@parameter.outer", - ["ir"] = "@parameter.inner", - ["aC"] = "@comment.outer", - ["iC"] = "@comment.outer", - ["a/"] = "@comment.outer", - ["i/"] = "@comment.outer", - ["a;"] = "@statement.outer", - ["i;"] = "@statement.outer", - }, - }, - }, - }) - end, - }) - - -- Additional syntax sources - use("chr4/nginx.vim") --- Nginx syntax - use("towolf/vim-helm") --- Helm syntax - use("rodjek/vim-puppet") --- Puppet syntax -end - -return M diff --git a/modules/common/neovim/lua/packer/telescope.lua b/modules/common/neovim/lua/packer/telescope.lua deleted file mode 100644 index e6416c7..0000000 --- a/modules/common/neovim/lua/packer/telescope.lua +++ /dev/null @@ -1,139 +0,0 @@ --- ======================================================================= --- Fuzzy Launcher --- ======================================================================= - -local M = {} - -M.packer = function(use) - use({ - "nvim-telescope/telescope.nvim", - branch = "master", - requires = { "nvim-lua/plenary.nvim" }, - config = function() - -- Telescope: quit instantly with escape - local actions = require("telescope.actions") - require("telescope").setup({ - defaults = { - mappings = { - i = { - [""] = actions.close, - [""] = "which_key", - }, - }, - }, - pickers = { - find_files = { theme = "ivy" }, - oldfiles = { theme = "ivy" }, - buffers = { theme = "dropdown" }, - }, - extensions = { - fzy_native = {}, - zoxide = {}, - project = { - base_dirs = { "~/dev" }, - }, - }, - }) - - local telescope = require("telescope.builtin") - - vim.keymap.set("n", "k", telescope.keymaps) - vim.keymap.set("n", "/", telescope.live_grep) - vim.keymap.set("n", "ff", telescope.find_files) - vim.keymap.set("n", "fp", telescope.git_files) - vim.keymap.set("n", "fw", telescope.grep_string) - vim.keymap.set("n", "b", telescope.buffers) - vim.keymap.set("n", "hh", telescope.help_tags) - vim.keymap.set("n", "fr", telescope.oldfiles) - vim.keymap.set("n", "cc", telescope.commands) - vim.keymap.set("n", "gc", telescope.git_commits) - vim.keymap.set("n", "gf", telescope.git_bcommits) - vim.keymap.set("n", "gb", telescope.git_branches) - vim.keymap.set("n", "gs", telescope.git_status) - vim.keymap.set("n", "s", telescope.current_buffer_fuzzy_find) - - vim.keymap.set("n", "N", function() - local opts = { - prompt_title = "Search Notes", - cwd = "$NOTES_PATH", - } - telescope.live_grep(opts) - end) - - vim.keymap.set("n", "fN", function() - local opts = { - prompt_title = "Find Notes", - cwd = "$NOTES_PATH", - } - telescope.find_files(opts) - end) - - vim.keymap.set("n", "cr", function() - local opts = require("telescope.themes").get_ivy({ - layout_config = { - bottom_pane = { - height = 15, - }, - }, - }) - telescope.command_history(opts) - end) - end, - }) - - -- Faster sorting - use("nvim-telescope/telescope-fzy-native.nvim") - - -- Jump around tmux sessions - -- use("camgraff/telescope-tmux.nvim") - - -- Jump directories - use({ - "jvgrootveld/telescope-zoxide", - requires = { "nvim-lua/popup.nvim", "nvim-telescope/telescope.nvim" }, - config = function() - vim.keymap.set("n", "fz", require("telescope").extensions.zoxide.list) - end, - }) - - -- Jump projects - use({ - "nvim-telescope/telescope-project.nvim", - requires = { "nvim-telescope/telescope.nvim" }, - config = function() - require("telescope").load_extension("project") - - vim.keymap.set("n", "", function() - local opts = require("telescope.themes").get_ivy({ - layout_config = { - bottom_pane = { - height = 10, - }, - }, - }) - require("telescope").extensions.project.project(opts) - end) - end, - }) - - -- File browser - use({ - "nvim-telescope/telescope-file-browser.nvim", - requires = { "nvim-telescope/telescope.nvim" }, - config = function() - require("telescope").load_extension("file_browser") - - vim.keymap.set("n", "fa", require("telescope").extensions.file_browser.file_browser) - - vim.keymap.set("n", "fD", function() - local opts = { - prompt_title = "Find Downloads", - cwd = "~/downloads", - } - require("telescope").extensions.file_browser.file_browser(opts) - end) - end, - }) -end - -return M diff --git a/modules/common/neovim/lua/packer/toggleterm.lua b/modules/common/neovim/lua/packer/toggleterm.lua deleted file mode 100644 index a185e94..0000000 --- a/modules/common/neovim/lua/packer/toggleterm.lua +++ /dev/null @@ -1,79 +0,0 @@ -local M = {} - -M.packer = function(use) - use({ - "akinsho/toggleterm.nvim", - tag = "v2.1.0", - config = function() - require("toggleterm").setup({ - open_mapping = [[]], - hide_numbers = true, - direction = "float", - }) - - vim.keymap.set("t", "", "") --- Exit terminal mode - - -- Only set these keymaps for toggleterm - vim.api.nvim_create_autocmd("TermOpen", { - pattern = "term://*toggleterm#*", - callback = function() - -- vim.keymap.set("t", "", "") --- Exit terminal mode - vim.keymap.set("t", "", "h") - vim.keymap.set("t", "", "j") - vim.keymap.set("t", "", "k") - vim.keymap.set("t", "", "l") - end, - }) - - local terminal = require("toggleterm.terminal").Terminal - - local basicterminal = terminal:new() - function TERM_TOGGLE() - basicterminal:toggle() - end - - local nixpkgs = terminal:new({ cmd = "nix repl ''" }) - function NIXPKGS_TOGGLE() - nixpkgs:toggle() - end - - local gitwatch = terminal:new({ cmd = "fish --interactive --init-command 'gh run watch'" }) - function GITWATCH_TOGGLE() - gitwatch:toggle() - end - - local k9s = terminal:new({ cmd = "k9s" }) - function K9S_TOGGLE() - k9s:toggle() - end - - vim.keymap.set("n", "t", TERM_TOGGLE) - vim.keymap.set("n", "P", NIXPKGS_TOGGLE) - vim.keymap.set("n", "gw", GITWATCH_TOGGLE) - vim.keymap.set("n", "9", K9S_TOGGLE) - end, - }) - - -- Connect to telescope - -- use({ - -- "https://git.sr.ht/~havi/telescope-toggleterm.nvim", - -- event = "TermOpen", - -- requires = { - -- "akinsho/nvim-toggleterm.lua", - -- "nvim-telescope/telescope.nvim", - -- "nvim-lua/popup.nvim", - -- "nvim-lua/plenary.nvim", - -- }, - -- config = function() - -- require("telescope").load_extension("toggleterm") - -- require("telescope-toggleterm").setup({ - -- telescope_mappings = { - -- -- : kill the terminal buffer (default) . - -- [""] = require("telescope-toggleterm").actions.exit_terminal, - -- }, - -- }) - -- end, - -- }) -end - -return M diff --git a/modules/common/neovim/lua/packer/visuals.lua b/modules/common/neovim/lua/packer/visuals.lua deleted file mode 100644 index bca77b3..0000000 --- a/modules/common/neovim/lua/packer/visuals.lua +++ /dev/null @@ -1,164 +0,0 @@ -local M = {} - -M.packer = function(use) - -- Git next to line numbers - use({ - "lewis6991/gitsigns.nvim", - branch = "main", - requires = { "nvim-lua/plenary.nvim" }, - config = function() - local gitsigns = require("gitsigns") - gitsigns.setup() - vim.keymap.set("n", "gB", gitsigns.blame_line) - vim.keymap.set("n", "gp", gitsigns.preview_hunk) - vim.keymap.set("v", "gp", gitsigns.preview_hunk) - vim.keymap.set("n", "gd", gitsigns.diffthis) - vim.keymap.set("v", "gd", gitsigns.diffthis) - vim.keymap.set("n", "rgf", gitsigns.reset_buffer) - vim.keymap.set("v", "hs", gitsigns.stage_hunk) - vim.keymap.set("v", "hr", gitsigns.reset_hunk) - vim.keymap.set("v", "hr", gitsigns.reset_hunk) - - -- Navigation - vim.keymap.set("n", "]g", function() - if vim.wo.diff then - return "]g" - end - vim.schedule(function() - gitsigns.next_hunk() - end) - return "" - end, { expr = true }) - - vim.keymap.set("n", "[g", function() - if vim.wo.diff then - return "[g" - end - vim.schedule(function() - gitsigns.prev_hunk() - end) - return "" - end, { expr = true }) - end, - }) - - -- Status bar - use({ - "hoob3rt/lualine.nvim", - requires = { "kyazdani42/nvim-web-devicons", opt = true }, - config = function() - require("lualine").setup({ - options = { - theme = "gruvbox", - icons_enabled = true, - }, - }) - end, - }) - - -- Buffer line ("tabs") - use({ - "akinsho/bufferline.nvim", - tag = "v2.4.0", - requires = { "kyazdani42/nvim-web-devicons", "moll/vim-bbye" }, - config = function() - require("bufferline").setup({ - options = { - diagnostics = "nvim_lsp", - always_show_bufferline = false, - separator_style = "slant", - offsets = { { filetype = "NvimTree" } }, - }, - }) - -- Move buffers - vim.keymap.set("n", "L", ":BufferLineCycleNext", { silent = true }) - vim.keymap.set("n", "H", ":BufferLineCyclePrev", { silent = true }) - - -- Kill buffer - vim.keymap.set("n", "x", " :Bdelete", { silent = true }) - - -- Shift buffers - -- vim.keymap.set("n", "", ":BufferLineMoveNext") - -- vim.keymap.set("i", "", ":BufferLineMoveNexti") - -- vim.keymap.set("n", "", ":BufferLineMovePrev") - -- vim.keymap.set("i", "", ":BufferLineMovePrevi") - end, - }) - - -- File explorer - use({ - "kyazdani42/nvim-tree.lua", - requires = { "kyazdani42/nvim-web-devicons" }, - config = function() - require("nvim-tree").setup({ - disable_netrw = true, - hijack_netrw = true, - update_focused_file = { - enable = true, - update_cwd = true, - ignore_list = {}, - }, - diagnostics = { - enable = true, - icons = { - hint = "", - info = "", - warning = "", - error = "", - }, - }, - renderer = { - icons = { - glyphs = { - git = { - unstaged = "~", - staged = "+", - unmerged = "", - renamed = "➜", - deleted = "", - untracked = "?", - ignored = "◌", - }, - }, - }, - }, - view = { - width = 30, - hide_root_folder = false, - side = "left", - mappings = { - custom_only = false, - list = { - { - key = { "l", "", "o" }, - cb = require("nvim-tree.config").nvim_tree_callback("edit"), - }, - { key = "h", cb = require("nvim-tree.config").nvim_tree_callback("close_node") }, - { key = "v", cb = require("nvim-tree.config").nvim_tree_callback("vsplit") }, - }, - }, - number = false, - relativenumber = false, - }, - }) - vim.keymap.set("n", "e", ":NvimTreeFindFileToggle", { silent = true }) - - -- https://github.com/kyazdani42/nvim-tree.lua/commit/fb8735e96cecf004fbefb086ce85371d003c5129 - vim.g.loaded = 1 - vim.g.loaded_netrwPlugin = 1 - end, - }) - - -- Markdown pretty view - use("ellisonleao/glow.nvim") - - -- Hex color previews - use({ - "norcalli/nvim-colorizer.lua", - config = function() - require("colorizer").setup() - end, - }) -end - -return M diff --git a/modules/common/neovim/lua/packer_init.lua b/modules/common/neovim/lua/packer_init.lua deleted file mode 100644 index 519c893..0000000 --- a/modules/common/neovim/lua/packer_init.lua +++ /dev/null @@ -1,34 +0,0 @@ --- Bootstrap the Packer plugin manager -local fn = vim.fn -local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim" -if fn.empty(fn.glob(install_path)) > 0 then - PACKER_BOOTSTRAP = fn.system({ - "git", - "clone", - "--depth", - "1", - "https://github.com/wbthomason/packer.nvim", - install_path, - }) -end - -require("packer").startup(function(use) - -- Maintain plugin manager - use("wbthomason/packer.nvim") - - -- Include other files initialized by packer - require("packer.speed").packer(use) - require("packer.misc").packer(use) - require("packer.colors").packer(use) - require("packer.visuals").packer(use) - require("packer.lsp").packer(use) - require("packer.completion").packer(use) - require("packer.syntax").packer(use) - require("packer.telescope").packer(use) - require("packer.toggleterm").packer(use) - - -- Auto-install after bootstrapping - if PACKER_BOOTSTRAP then - require("packer").sync() - end -end) diff --git a/modules/common/neovim/lua/settings.lua b/modules/common/neovim/lua/settings.lua deleted file mode 100644 index 7748d55..0000000 --- a/modules/common/neovim/lua/settings.lua +++ /dev/null @@ -1,17 +0,0 @@ --- =========================================================================== --- Settings --- =========================================================================== - -vim.filetype.add({ - pattern = { - [".*%.tfvars"] = "hcl", - -- [".*%.tf"] = "hcl", - }, -}) - -vim.api.nvim_create_autocmd("FileType", { - pattern = "*.eml", - callback = function() - vim.o.wrapmargin = 79 -- Wrap text automatically - end, -})