From 07abc0343bf1f6e2b93b24e3af8655ce81dd2b02 Mon Sep 17 00:00:00 2001 From: Benjamin Chaussé Date: Wed, 10 Jul 2024 14:59:42 -0400 Subject: Stylua formatting + conform.nvim --- lua/plugins/cmp.lua | 72 +++++----- lua/plugins/colorscheme.lua | 176 ++++++++++++----------- lua/plugins/comments.lua | 5 +- lua/plugins/copilot.lua | 10 +- lua/plugins/dadbod.lua | 10 +- lua/plugins/fugitive.lua | 35 +++-- lua/plugins/gitignore.lua | 2 +- lua/plugins/harpoon.lua | 105 ++++++++------ lua/plugins/lsp.lua | 343 ++++++++++++++++++++++++++------------------ lua/plugins/lualine.lua | 94 ++++++------ lua/plugins/orgmode.lua | 78 +++++----- lua/plugins/resize.lua | 16 +-- lua/plugins/telescope.lua | 28 ++-- lua/plugins/whichkey.lua | 22 +-- 14 files changed, 540 insertions(+), 456 deletions(-) (limited to 'lua/plugins') diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 3a4be2a..3914e80 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -1,39 +1,39 @@ return { - "hrsh7th/nvim-cmp", - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "L3MON4D3/LuaSnip", - "saadparwaiz1/cmp_luasnip", - }, - config = function() - local cmp = require("cmp") - local luasnip = require("luasnip") + "hrsh7th/nvim-cmp", + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "L3MON4D3/LuaSnip", + "saadparwaiz1/cmp_luasnip", + }, + config = function() + local cmp = require("cmp") + local luasnip = require("luasnip") - cmp.setup({ - completion = { - completeopt = "menu,menuone,noselect", - }, - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm({ select = true }), -- accept item under cursor when pressing enter - }), - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - { name = 'orgmode' }, - { name = 'buffer' }, - { name = 'path' } - }) - }) - end + cmp.setup({ + completion = { + completeopt = "menu,menuone,noselect", + }, + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), -- accept item under cursor when pressing enter + }), + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "orgmode" }, + { name = "buffer" }, + { name = "path" }, + }), + }) + end, } diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua index 48f327b..5aeec35 100644 --- a/lua/plugins/colorscheme.lua +++ b/lua/plugins/colorscheme.lua @@ -1,88 +1,92 @@ return { - { -- No nonsense, very stoic - "aktersnurra/no-clown-fiesta.nvim", - dependencies = { - { "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - config = function() - local configs = require("nvim-treesitter.configs") ----@diagnostic disable-next-line: missing-fields - configs.setup({ - -- List of languages in-> :h - ensure_installed = { - "c", - "go", - "bash", - "lua", - "python", - "vim", - "vimdoc", - "gitignore", - "mermaid", - "markdown", - "rnoweb", - "r", - "rust", - "dockerfile", - "graphql", - "yaml", - "json", - "xml", - "sxhkdrc", - "zathurarc", - }, - ignore_install = { - "javascript", "typescript" - }, - sync_install = false, - highlight = {enable = true}, - indent = {enable = false}, - additional_vim_regex_highlighting = false, - }) - end, - }, - }, - lazy = false, - priority = 1000, - config = function() - require("no-clown-fiesta").setup({ - transparent = true, - styles = { - -- You can set any of the style values specified for `:h nvim_set_hl` - type = { bold = true }, - lsp = { underline = true }, - keywords = { italic = true }, - }, - }) - local fullbg = "#111a1f" - vim.cmd.colorscheme('no-clown-fiesta') - vim.api.nvim_set_hl(0,"LineNr",{fg="#727272"}) - -- vim.api.nvim_set_hl(0,"Visual",{bg="#171717"}) - -- vim.api.nvim_set_hl(0,"Visual",{bg="#829e9c"}) - vim.api.nvim_set_hl(0,"@markup.strong",{bold=true}) - vim.api.nvim_set_hl(0,"Visual",{bg="#84493b"}) - vim.api.nvim_set_hl(0,"Folded",{bg="none"}) - vim.api.nvim_set_hl(0,"VertSplit",{bg="none",fg="#727272"}) - vim.api.nvim_set_hl(0,"WinSeparator",{bg="none",fg="#727272"}) - vim.api.nvim_set_hl(0,"StatusLine",{bg="none",fg="#727272"}) - vim.api.nvim_set_hl(0,"LazyNormal",{bg=fullbg}) - -- vim.api.nvim_set_hl(0,"MasonNormal",{bg=fullbg}) - vim.api.nvim_set_hl(0,"NormalFloat",{bg=fullbg}) - vim.api.nvim_set_hl(0,"FloatBorder",{bg="none",fg=fullbg}) - end, - }, { - "neanias/everforest-nvim", - version = false, - priority = 1000, - config = function() - require("everforest").setup({ - background = "hard", - transparent_background_level=2 - }) - end, - }, { - "ChausseBenjamin/friffle-vim", - version = false, - priority = 1000, - } + { -- No nonsense, very stoic + "aktersnurra/no-clown-fiesta.nvim", + dependencies = { + { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function() + local configs = require("nvim-treesitter.configs") + ---@diagnostic disable-next-line: missing-fields + configs.setup({ + -- List of languages in-> :h + ensure_installed = { + "c", + "go", + "bash", + "lua", + "python", + "vim", + "vimdoc", + "gitignore", + "mermaid", + "markdown", + "rnoweb", + "r", + "rust", + "dockerfile", + "graphql", + "yaml", + "json", + "xml", + "sxhkdrc", + "zathurarc", + }, + ignore_install = { + "javascript", + "typescript", + }, + sync_install = false, + highlight = { enable = true }, + indent = { enable = false }, + additional_vim_regex_highlighting = false, + }) + end, + }, + }, + lazy = false, + priority = 1000, + config = function() + require("no-clown-fiesta").setup({ + transparent = true, + styles = { + -- You can set any of the style values specified for `:h nvim_set_hl` + type = { bold = true }, + lsp = { underline = true }, + keywords = { italic = true }, + }, + }) + local fullbg = "#111a1f" + vim.cmd.colorscheme("no-clown-fiesta") + vim.api.nvim_set_hl(0, "LineNr", { fg = "#727272" }) + -- vim.api.nvim_set_hl(0,"Visual",{bg="#171717"}) + -- vim.api.nvim_set_hl(0,"Visual",{bg="#829e9c"}) + vim.api.nvim_set_hl(0, "@markup.strong", { bold = true }) + vim.api.nvim_set_hl(0, "Visual", { bg = "#84493b" }) + vim.api.nvim_set_hl(0, "Folded", { bg = "none" }) + vim.api.nvim_set_hl(0, "VertSplit", { bg = "none", fg = "#727272" }) + vim.api.nvim_set_hl(0, "WinSeparator", { bg = "none", fg = "#727272" }) + vim.api.nvim_set_hl(0, "StatusLine", { bg = "none", fg = "#727272" }) + vim.api.nvim_set_hl(0, "LazyNormal", { bg = fullbg }) + -- vim.api.nvim_set_hl(0,"MasonNormal",{bg=fullbg}) + vim.api.nvim_set_hl(0, "NormalFloat", { bg = fullbg }) + vim.api.nvim_set_hl(0, "FloatBorder", { bg = "none", fg = fullbg }) + end, + }, + { + "neanias/everforest-nvim", + version = false, + priority = 1000, + config = function() + require("everforest").setup({ + background = "hard", + transparent_background_level = 2, + }) + end, + }, + { + "ChausseBenjamin/friffle-vim", + version = false, + priority = 1000, + }, } diff --git a/lua/plugins/comments.lua b/lua/plugins/comments.lua index 5da4b3e..f15d094 100644 --- a/lua/plugins/comments.lua +++ b/lua/plugins/comments.lua @@ -1,5 +1,4 @@ return { - 'tpope/vim-commentary', - event = { 'BufReadPre', 'BufNewFile' }, + "tpope/vim-commentary", + event = { "BufReadPre", "BufNewFile" }, } - diff --git a/lua/plugins/copilot.lua b/lua/plugins/copilot.lua index f53bb48..f720ddb 100644 --- a/lua/plugins/copilot.lua +++ b/lua/plugins/copilot.lua @@ -1,7 +1,7 @@ return { - "github/copilot.vim", - event = "VeryLazy", - build = function() - vim.cmd([[Copilot setup]]) - end, + "github/copilot.vim", + event = "VeryLazy", + build = function() + vim.cmd([[Copilot setup]]) + end, } diff --git a/lua/plugins/dadbod.lua b/lua/plugins/dadbod.lua index 84526f4..2e71f4a 100644 --- a/lua/plugins/dadbod.lua +++ b/lua/plugins/dadbod.lua @@ -1,7 +1,7 @@ return { - "tpope/vim-dadbod", - dependencies = { - "kristijanhusak/vim-dadbod-ui", - "kristijanhusak/vim-dadbod-completion", - }, + "tpope/vim-dadbod", + dependencies = { + "kristijanhusak/vim-dadbod-ui", + "kristijanhusak/vim-dadbod-completion", + }, } diff --git a/lua/plugins/fugitive.lua b/lua/plugins/fugitive.lua index 6bb5190..71d7c0a 100644 --- a/lua/plugins/fugitive.lua +++ b/lua/plugins/fugitive.lua @@ -1,21 +1,18 @@ return { - lazy = false, - "tpope/vim-fugitive", - dependencies = "tpope/vim-rhubarb", - config = function() - - end, - -- Only load when using one of the following commands: - keys = { - { "gs", "G" }, -- G.it S.tatus - { "gd", "G difftool" }, -- G.it D.iff - { "gm", "Gvdiffsplit!" }, -- G.it M.erge - { "gc", "G commit" }, -- G.it C.ommit - { "gu", "G push" }, -- G.it push U.pstream - { "gp", "G pull" }, -- G.it P.ull - { "gf", "G fetch" }, -- G.it F.etch - { "ds", "Gvdiffsplit!" }, - { "dh", "diffget //2" }, - { "dl", "diffget //3" }, - }, + lazy = false, + "tpope/vim-fugitive", + dependencies = "tpope/vim-rhubarb", + config = function() end, + -- Only load when using one of the following commands: + keys = { + { "gs", "G" }, -- G.it S.tatus + { "gd", "G difftool" }, -- G.it D.iff + { "gc", "G commit" }, -- G.it C.ommit + { "gu", "G push" }, -- G.it push U.pstream + { "gp", "G pull" }, -- G.it P.ull + { "gf", "G fetch" }, -- G.it F.etch + { "ds", "Gvdiffsplit!" }, -- G.it D.iff S.plit + { "dh", "diffget //2" }, + { "dl", "diffget //3" }, + }, } diff --git a/lua/plugins/gitignore.lua b/lua/plugins/gitignore.lua index 08188a3..06ea935 100644 --- a/lua/plugins/gitignore.lua +++ b/lua/plugins/gitignore.lua @@ -3,5 +3,5 @@ return { dependencies = { { "nvim-telescope/telescope.nvim" }, }, - cmd = "Gitignore", + cmd = "Gitignore", } diff --git a/lua/plugins/harpoon.lua b/lua/plugins/harpoon.lua index 6f15fc4..3fb4661 100644 --- a/lua/plugins/harpoon.lua +++ b/lua/plugins/harpoon.lua @@ -1,46 +1,63 @@ return { - "theprimeagen/harpoon", - branch = "harpoon2", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-telescope/telescope.nvim" - }, - config = function() - - -- Cd to git root on startup to retain harpoons wherever vim starts - local function is_git_repo() - local git_dir = vim.fn.systemlist("git rev-parse --show-toplevel") - if vim.v.shell_error ~= 0 then - return false - end - return git_dir[1] - end - - local function cd_to_git_root() - local git_root = is_git_repo() - if git_root then - vim.cmd('tcd ' .. git_root) - end - end - - cd_to_git_root() - - local harpoon = require("harpoon") - - harpoon:setup() - - -- harpoon keybindings - vim.keymap.set("n", "a", function() harpoon:list():add() end ) - -- vim.keymap.set("n", "", function() toggle_telescope(harpoon:list()) end, {desc = "Open harpoon window"} ) - vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end ) - - vim.keymap.set("n", "", function() harpoon:list():select(1)end ) - vim.keymap.set("n", "", function() harpoon:list():select(2)end ) - vim.keymap.set("n", "", function() harpoon:list():select(3)end ) - vim.keymap.set("n", "", function() harpoon:list():select(4)end ) - vim.keymap.set("n", "", function() harpoon:list():select(5)end ) - - vim.keymap.set("n", "", function() harpoon:list():prev() end) - vim.keymap.set("n", "", function() harpoon:list():next() end) - end, + "theprimeagen/harpoon", + branch = "harpoon2", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-telescope/telescope.nvim", + }, + config = function() + -- Cd to git root on startup to retain harpoons wherever vim starts + local function is_git_repo() + local git_dir = vim.fn.systemlist("git rev-parse --show-toplevel") + if vim.v.shell_error ~= 0 then + return false + end + return git_dir[1] + end + + local function cd_to_git_root() + local git_root = is_git_repo() + if git_root then + vim.cmd("tcd " .. git_root) + end + end + + cd_to_git_root() + + local harpoon = require("harpoon") + + harpoon:setup() + + -- harpoon keybindings + vim.keymap.set("n", "a", function() + harpoon:list():add() + end) + -- vim.keymap.set("n", "", function() toggle_telescope(harpoon:list()) end, {desc = "Open harpoon window"} ) + vim.keymap.set("n", "", function() + harpoon.ui:toggle_quick_menu(harpoon:list()) + end) + + vim.keymap.set("n", "", function() + harpoon:list():select(1) + end) + vim.keymap.set("n", "", function() + harpoon:list():select(2) + end) + vim.keymap.set("n", "", function() + harpoon:list():select(3) + end) + vim.keymap.set("n", "", function() + harpoon:list():select(4) + end) + vim.keymap.set("n", "", function() + harpoon:list():select(5) + end) + + vim.keymap.set("n", "", function() + harpoon:list():prev() + end) + vim.keymap.set("n", "", function() + harpoon:list():next() + end) + end, } diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index d0b3712..ad14988 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -1,151 +1,218 @@ return { - { - "williamboman/mason.nvim", - dependencies = { - "williamboman/mason-lspconfig.nvim", - }, - config = function() - local mason = require('mason') - local mlsp = require('mason-lspconfig') - mason.setup({ - ui = { - icons = { - package_installed = "", - package_not_installed = "", - package_pending = "", - } - } - }) - -- Global so it can be used by both mason and lspconfig ;) - local myServers = { - "gopls", - "golangci_lint_ls", - "lua_ls", - "bashls", - "graphql", - "texlab", - "clangd", - "marksman", - "dockerls", - "ruff_lsp", - "docker_compose_language_service", - "rust_analyzer", - } - mlsp.setup({ - ensure_installed = myServers, - automatic_installation = false, - }) - end, - }, - { - "neovim/nvim-lspconfig", - veryLazy = true, - dependencies = { - "hrsh7th/nvim-cmp", - "hrsh7th/cmp-nvim-lsp", - "nvim-telescope/telescope.nvim", - }, - config = function() + { + "williamboman/mason.nvim", + dependencies = { + "williamboman/mason-lspconfig.nvim", + }, + config = function() + local mason = require("mason") + local mlsp = require("mason-lspconfig") + mason.setup({ + ui = { + icons = { + package_installed = "", + package_not_installed = "", + package_pending = "", + }, + }, + }) + -- Global so it can be used by both mason and lspconfig ;) + local myServers = { + -- LSPs: + "gopls", + "golangci_lint_ls", + "lua_ls", + "bashls", + "graphql", + "texlab", + "clangd", + "marksman", + "dockerls", + "ruff_lsp", + "docker_compose_language_service", + "rust_analyzer", + } + mlsp.setup({ + ensure_installed = myServers, + automatic_installation = false, + }) + end, + }, + { + "neovim/nvim-lspconfig", + veryLazy = true, + dependencies = { + "hrsh7th/nvim-cmp", + "hrsh7th/cmp-nvim-lsp", + "nvim-telescope/telescope.nvim", + }, + config = function() + -- Use icons in the sidebar + local signs = { Error = "", Warn = "", Hint = "󰈈", Info = "" } + for type, icon in pairs(signs) do + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) + end + -- Hide inline virtual text and use only the icons for debbuging/tips + vim.diagnostic.config({ + virtual_text = false, + signs = true, + underline = true, + }) - -- Use icons in the sidebar - local signs = { Error="", Warn ="", Hint ="󰈈", Info ="" } - for type, icon in pairs(signs) do - local hl = "DiagnosticSign" .. type - vim.fn.sign_define(hl, {text = icon, texthl = hl, numhl = ""}) - end - -- Hide inline virtual text and use only the icons for debbuging/tips - vim.diagnostic.config({ - virtual_text = false, - signs = true, - underline = true - }) + local lsp = require("lspconfig") + local lspCaps = require("cmp_nvim_lsp").default_capabilities() + local lspMaps = function() + vim.keymap.set("n", "K", vim.lsp.buf.hover, { + buffer = 0, + desc = "Show object description on hover", + }) - local lsp = require('lspconfig') - local lspCaps = require('cmp_nvim_lsp').default_capabilities() - local lspMaps = function() + vim.keymap.set( + "n", + "r", + vim.lsp.buf.rename, + { buffer = 0, desc = "Rename object across all occurences" } + ) - vim.keymap.set("n", "K", vim.lsp.buf.hover, {buffer=0, - desc = "Show object description on hover"}) + vim.keymap.set( + "n", + "gd", + vim.lsp.buf.definition, + { buffer = 0, desc = "Go to the location where the object is defined" } + ) - vim.keymap.set("n", "r", vim.lsp.buf.rename, {buffer=0, - desc = "Rename object across all occurences"}) + vim.keymap.set( + "n", + "gt", + vim.lsp.buf.type_definition, + { buffer = 0, desc = "Go to the definition of the objects type" } + ) - vim.keymap.set("n", "gd", vim.lsp.buf.definition, {buffer=0, - desc = "Go to the location where the object is defined"}) + vim.keymap.set( + "n", + "gi", + vim.lsp.buf.implementation, + { buffer = 0, desc = "Go to the method implementation" } + ) - vim.keymap.set("n", "gt", vim.lsp.buf.type_definition, {buffer=0, - desc = "Go to the definition of the objects type"}) + vim.keymap.set( + "n", + "gr", + vim.lsp.buf.references, + { buffer = 0, desc = "Go to references of the object" } + ) - vim.keymap.set("n", "gi", vim.lsp.buf.implementation, {buffer=0, - desc = "Go to the method implementation"}) + vim.keymap.set("n", "fa", vim.lsp.buf.code_action, { buffer = 0, desc = "" }) + vim.keymap.set( + "n", + "]d", + vim.diagnostic.goto_next, + { buffer = 0, desc = "Go to the next diagnostic/issue" } + ) - vim.keymap.set("n", "gr", vim.lsp.buf.references, {buffer=0, - desc = "Go to references of the object"}) + vim.keymap.set( + "n", + "[d", + vim.diagnostic.goto_prev, + { buffer = 0, desc = "Go to the previous diagnostic/issue" } + ) - vim.keymap.set("n", "fa", vim.lsp.buf.code_action, {buffer=0, - desc = ""}) - vim.keymap.set("n", "]d", vim.diagnostic.goto_next, {buffer=0, - desc = "Go to the next diagnostic/issue"}) + -- S is the same as cc, I'd rather use it for something more useful + vim.keymap.set( + "n", + "S", + vim.diagnostic.open_float, + { buffer = 0, desc = "View diagnostics information in a floating window" } + ) + end - vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, {buffer=0, - desc = "Go to the previous diagnostic/issue"}) + -- Configure every lsp installed and managed by mason + -- TODO: automate this with a global myServers table + local myServers = { + "gopls", + "golangci_lint_ls", + "lua_ls", + "bashls", + "dockerls", + "docker_compose_language_service", + "graphql", + "texlab", + "ruff_lsp", + "clangd", + "marksman", + } + for _, server in ipairs(myServers) do + lsp[server].setup({ + capabilities = lspCaps, + on_attach = lspMaps, + }) + end - -- S is the same as cc, I'd rather use it for something more useful - vim.keymap.set("n", "S", vim.diagnostic.open_float, {buffer=0, - desc = "View diagnostics information in a floating window"}) - - end - - -- Configure every lsp installed and managed by mason - -- TODO: automate this with a global myServers table - local myServers = { - "gopls", - "golangci_lint_ls", - "lua_ls", - "bashls", - "dockerls", - "docker_compose_language_service", - "graphql", - "texlab", - "ruff_lsp", - "clangd", - "marksman", - } - for _, server in ipairs(myServers) do - lsp[server].setup({ - capabilities = lspCaps, - on_attach = lspMaps - }) - end - - -- Non standard language settings: - lsp.lua_ls.setup({ - capabilities = lspCaps, - on_attach = lspMaps, - settings = { - Lua = { - runtime = { - -- Tell the language server which version of Lua you're using - -- -- (most likely LuaJIT in the case of Neovim) - version = 'LuaJIT' - }, - diagnostic = { - -- Get the language server to recognize the `vim` global - globals = { - 'vim', - 'require' - } - }, - workspace = { - checkThirdParty = false, - library = vim.api.nvim_get_runtime_file("", true), - }, - telemetry = { - enable = false - } - } - } - }) - end, - }, + -- Non standard language settings: + lsp.lua_ls.setup({ + capabilities = lspCaps, + on_attach = lspMaps, + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using + -- -- (most likely LuaJIT in the case of Neovim) + version = "LuaJIT", + }, + diagnostic = { + -- Get the language server to recognize the `vim` global + globals = { + "vim", + "require", + }, + }, + workspace = { + checkThirdParty = false, + library = vim.api.nvim_get_runtime_file("", true), + }, + telemetry = { + enable = false, + }, + }, + }, + }) + end, + }, + { + "stevearc/conform.nvim", + event = { "BufWritePre" }, + cmd = { "ConformInfo" }, + keys = { + { + -- Customize or remove this keymap to your liking + "f", + function() + require("conform").format({ async = true, lsp_format = "fallback" }) + end, + mode = "", + desc = "Format buffer", + }, + }, + -- Everything in opts will be passed to setup() + opts = { + -- Define your formatters + formatters_by_ft = { + lua = { "stylua" }, + go = { "gofumpt", "gci", "goimports" }, + }, + -- Set up format-on-save + format_on_save = { timeout_ms = 500, lsp_format = "fallback" }, + -- Customize formatters + formatters = { + shfmt = { + prepend_args = { "-i", "2" }, + }, + }, + }, + init = function() + -- If you want the formatexpr, here is the place to set it + vim.o.formatexpr = "v:lua.require'conform'.formatexpr()" + end, + }, } diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index e41d998..445f056 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -1,49 +1,49 @@ return { - "nvim-lualine/lualine.nvim", - dependencies = "nvim-tree/nvim-web-devicons", - event = { "BufReadPre", "BufNewFile" }, - config = function() - require("lualine").setup({ - options = { - theme = "no-clown-fiesta", - icons_enabled = true, - section_separators = { left = "", right = "" }, - component_separators = { left = "", right = "" }, - globalstatus = false, - ignore_focus = {}, - always_divide_middle = true, - refresh = { - statusline = 500, - tabline = 500, - winbar = 500, - }, - }, - sections = { - lualine_a = { "mode" }, - lualine_b = { "branch" }, - lualine_c = { "filename" }, - lualine_x = { "filetype" }, - lualine_y = { "progress" }, - lualine_z = { "location" }, - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = { "filename" }, - lualine_x = { "location" }, - lualine_y = {}, - lualine_z = {}, - }, - tabline = {}, - winbar = {}, - extensions = {'fugitive'}, - }) - -- Remove duplicate information that clutters the bottom of the screen - -- "-- INSERT --" on the left: - vim.opt.showmode = false - -- "100%" linenr/col on the right: - vim.opt.ruler = false - -- commands on the right: - vim.opt.showcmd = false - end, + "nvim-lualine/lualine.nvim", + dependencies = "nvim-tree/nvim-web-devicons", + event = { "BufReadPre", "BufNewFile" }, + config = function() + require("lualine").setup({ + options = { + theme = "no-clown-fiesta", + icons_enabled = true, + section_separators = { left = "", right = "" }, + component_separators = { left = "", right = "" }, + globalstatus = false, + ignore_focus = {}, + always_divide_middle = true, + refresh = { + statusline = 500, + tabline = 500, + winbar = 500, + }, + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { "branch" }, + lualine_c = { "filename" }, + lualine_x = { "filetype" }, + lualine_y = { "progress" }, + lualine_z = { "location" }, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { "filename" }, + lualine_x = { "location" }, + lualine_y = {}, + lualine_z = {}, + }, + tabline = {}, + winbar = {}, + extensions = { "fugitive" }, + }) + -- Remove duplicate information that clutters the bottom of the screen + -- "-- INSERT --" on the left: + vim.opt.showmode = false + -- "100%" linenr/col on the right: + vim.opt.ruler = false + -- commands on the right: + vim.opt.showcmd = false + end, } diff --git a/lua/plugins/orgmode.lua b/lua/plugins/orgmode.lua index fa1281a..83deb26 100644 --- a/lua/plugins/orgmode.lua +++ b/lua/plugins/orgmode.lua @@ -1,42 +1,42 @@ return { - 'nvim-orgmode/orgmode', - dependencies = { - { -- Nicely formatted bullet Headings - "akinsho/org-bullets.nvim", - dependencies = { - "nvim-treesitter/nvim-treesitter", - }, - config = true, - }, - { - "dhruvasagar/vim-table-mode", - }, - }, - event = 'VeryLazy', - ft = { 'org' }, - config = function() - -- This is bound to org-modern: - -- local Menu = require("org-modern.menu") - -- Setup orgmode - require('orgmode').setup({ - -- win_split_mode = {'float', 0.9}, - -- win_split_mode = 'float', - org_agenda_files = '~/Dropbox/org/**/*', - org_default_notes_file = '~/Dropbox/org/index.org', - calendar_week_start_day = 0, - emacs_config = { - -- executable_path = '/opt/homebrew/bin/emacs', - config_path = '$HOME/.config/emacs/early-init.el', - }, - }) - vim.opt.conceallevel = 2 - vim.opt.concealcursor = 'v' + "nvim-orgmode/orgmode", + dependencies = { + { -- Nicely formatted bullet Headings + "akinsho/org-bullets.nvim", + dependencies = { + "nvim-treesitter/nvim-treesitter", + }, + config = true, + }, + { + "dhruvasagar/vim-table-mode", + }, + }, + event = "VeryLazy", + ft = { "org" }, + config = function() + -- This is bound to org-modern: + -- local Menu = require("org-modern.menu") + -- Setup orgmode + require("orgmode").setup({ + -- win_split_mode = {'float', 0.9}, + -- win_split_mode = 'float', + org_agenda_files = "~/Dropbox/org/**/*", + org_default_notes_file = "~/Dropbox/org/index.org", + calendar_week_start_day = 0, + emacs_config = { + -- executable_path = '/opt/homebrew/bin/emacs', + config_path = "$HOME/.config/emacs/early-init.el", + }, + }) + vim.opt.conceallevel = 2 + vim.opt.concealcursor = "v" - -- NOTE: If you are using nvim-treesitter with `ensure_installed = "all"` option - -- add `org` to ignore_install - -- require('nvim-treesitter.configs').setup({ - -- ensure_installed = 'all', - -- ignore_install = { 'org' }, - -- }) - end, + -- NOTE: If you are using nvim-treesitter with `ensure_installed = "all"` option + -- add `org` to ignore_install + -- require('nvim-treesitter.configs').setup({ + -- ensure_installed = 'all', + -- ignore_install = { 'org' }, + -- }) + end, } diff --git a/lua/plugins/resize.lua b/lua/plugins/resize.lua index b08ca4c..0c5dcd1 100644 --- a/lua/plugins/resize.lua +++ b/lua/plugins/resize.lua @@ -1,10 +1,10 @@ return { - "simeji/winresizer", - config = function() - vim.g.winresizer_vert_resize = 13 - vim.g.winresizer_horiz_resize = 10 - end, - keys = { - {"w", "WinResizerStartResize"} - } + "simeji/winresizer", + config = function() + vim.g.winresizer_vert_resize = 13 + vim.g.winresizer_horiz_resize = 10 + end, + keys = { + { "w", "WinResizerStartResize" }, + }, } diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 4aac81d..b1d3a74 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -3,23 +3,23 @@ return { branch = "0.1.x", dependencies = { { "nvim-lua/plenary.nvim" }, - { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }, - { "stevearc/dressing.nvim" }, + { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, + { "stevearc/dressing.nvim" }, }, - config = function() - local telescope = require("telescope") - local actions = require("telescope.actions") - telescope.load_extension("fzf") - end, + config = function() + local telescope = require("telescope") + local actions = require("telescope.actions") + telescope.load_extension("fzf") + end, keys = { -- P.aruse F.iles { "pv", 'lua require("telescope.builtin").find_files()' }, - -- P.aruse B.uffers - { "pb", 'lua require("telescope.builtin").buffers()' }, - -- P.aruse with G.rep - { "pg", 'lua require("telescope.builtin").live_grep()' }, + -- P.aruse B.uffers + { "pb", 'lua require("telescope.builtin").buffers()' }, + -- P.aruse with G.rep + { "pg", 'lua require("telescope.builtin").live_grep()' }, -- P.roject S.earch - { "ps", 'lua require("telescope.builtin").grep_string({search = vim.fn.input("Grep > ")})' }, + { "ps", 'lua require("telescope.builtin").grep_string({search = vim.fn.input("Grep > ")})' }, -- F.ind Q.uickfix { "qf", 'lua require("telescope.builtin").quickfix()' }, -- Find Git (files known to git / not ignored or untracked) @@ -28,8 +28,8 @@ return { { "fb", 'lua require("telescope.builtin").grep_branches()' }, -- F.ix L.ist { "fl", "Telescope diagnostics" }, - -- F.ind R.eferences - { "fr", "Telescope lsp_references" } + -- F.ind R.eferences + { "fr", "Telescope lsp_references" }, }, cmd = { "Telescope", diff --git a/lua/plugins/whichkey.lua b/lua/plugins/whichkey.lua index 6f820e0..6a14c8a 100644 --- a/lua/plugins/whichkey.lua +++ b/lua/plugins/whichkey.lua @@ -1,13 +1,13 @@ return { - "folke/which-key.nvim", - event = "VeryLazy", - init = function() - vim.o.timeout = true - vim.o.timeoutlen = 300 - end, - opts = { - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below - } + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 300 + end, + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + }, } -- cgit v1.2.3