summaryrefslogtreecommitdiff
path: root/lua/plugins
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2024-07-10 23:06:16 -0400
committerBenjamin Chausse <benjamin@chausse.xyz>2024-07-10 23:06:16 -0400
commitb6d670c046baa59f3fa2dc4ef03150da8a1f2693 (patch)
tree5afa9f00e39db338b56e009071ecdb1f5a0ac0e9 /lua/plugins
parente2eca2a163976c6d274983250af44d8a386ae414 (diff)
parent07abc0343bf1f6e2b93b24e3af8655ce81dd2b02 (diff)
Merge branch 'master' of github.com:ChausseBenjamin/neovim-conf
Diffstat (limited to 'lua/plugins')
-rw-r--r--lua/plugins/cmp.lua72
-rw-r--r--lua/plugins/colorscheme.lua176
-rw-r--r--lua/plugins/comments.lua5
-rw-r--r--lua/plugins/copilot.lua10
-rw-r--r--lua/plugins/dadbod.lua10
-rw-r--r--lua/plugins/fugitive.lua35
-rw-r--r--lua/plugins/gitignore.lua2
-rw-r--r--lua/plugins/harpoon.lua105
-rw-r--r--lua/plugins/lsp.lua343
-rw-r--r--lua/plugins/lualine.lua94
-rw-r--r--lua/plugins/orgmode.lua103
-rw-r--r--lua/plugins/resize.lua16
-rw-r--r--lua/plugins/telescope.lua28
-rw-r--r--lua/plugins/whichkey.lua22
14 files changed, 553 insertions, 468 deletions
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({
- ['<C-b>'] = cmp.mapping.scroll_docs(-4),
- ['<C-f>'] = cmp.mapping.scroll_docs(4),
- ['<C-Space>'] = cmp.mapping.complete(),
- ['<C-c>'] = cmp.mapping.abort(),
- ['<CR>'] = 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({
+ ["<C-b>"] = cmp.mapping.scroll_docs(-4),
+ ["<C-f>"] = cmp.mapping.scroll_docs(4),
+ ["<C-Space>"] = cmp.mapping.complete(),
+ ["<C-c>"] = cmp.mapping.abort(),
+ ["<CR>"] = 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 = {
- { "<leader>gs", "<cmd>G<CR>" }, -- G.it S.tatus
- { "<leader>gd", "<cmd>G difftool<CR>" }, -- G.it D.iff
- { "<leader>gm", "<cmd>Gvdiffsplit!<CR>" }, -- G.it M.erge
- { "<leader>gc", "<cmd>G commit<CR>" }, -- G.it C.ommit
- { "<leader>gu", "<cmd>G push<CR>" }, -- G.it push U.pstream
- { "<leader>gp", "<cmd>G pull<CR>" }, -- G.it P.ull
- { "<leader>gf", "<cmd>G fetch<CR>" }, -- G.it F.etch
- { "<leader>ds", "<cmd>Gvdiffsplit!<CR>" },
- { "<leader>dh", "<cmd>diffget //2<CR>" },
- { "<leader>dl", "<cmd>diffget //3<CR>" },
- },
+ lazy = false,
+ "tpope/vim-fugitive",
+ dependencies = "tpope/vim-rhubarb",
+ config = function() end,
+ -- Only load when using one of the following commands:
+ keys = {
+ { "<leader>gs", "<cmd>G<CR>" }, -- G.it S.tatus
+ { "<leader>gd", "<cmd>G difftool<CR>" }, -- G.it D.iff
+ { "<leader>gc", "<cmd>G commit<CR>" }, -- G.it C.ommit
+ { "<leader>gu", "<cmd>G push<CR>" }, -- G.it push U.pstream
+ { "<leader>gp", "<cmd>G pull<CR>" }, -- G.it P.ull
+ { "<leader>gf", "<cmd>G fetch<CR>" }, -- G.it F.etch
+ { "<leader>ds", "<cmd>Gvdiffsplit!<CR>" }, -- G.it D.iff S.plit
+ { "<leader>dh", "<cmd>diffget //2<CR>" },
+ { "<leader>dl", "<cmd>diffget //3<CR>" },
+ },
}
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", "<leader>a", function() harpoon:list():add() end )
- -- vim.keymap.set("n", "<C-e>", function() toggle_telescope(harpoon:list()) end, {desc = "Open harpoon window"} )
- vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end )
-
- vim.keymap.set("n", "<C-h>", function() harpoon:list():select(1)end )
- vim.keymap.set("n", "<C-j>", function() harpoon:list():select(2)end )
- vim.keymap.set("n", "<C-k>", function() harpoon:list():select(3)end )
- vim.keymap.set("n", "<C-l>", function() harpoon:list():select(4)end )
- vim.keymap.set("n", "<C-;>", function() harpoon:list():select(5)end )
-
- vim.keymap.set("n", "<C-S-P>", function() harpoon:list():prev() end)
- vim.keymap.set("n", "<C-S-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", "<leader>a", function()
+ harpoon:list():add()
+ end)
+ -- vim.keymap.set("n", "<C-e>", function() toggle_telescope(harpoon:list()) end, {desc = "Open harpoon window"} )
+ vim.keymap.set("n", "<C-e>", function()
+ harpoon.ui:toggle_quick_menu(harpoon:list())
+ end)
+
+ vim.keymap.set("n", "<C-h>", function()
+ harpoon:list():select(1)
+ end)
+ vim.keymap.set("n", "<C-j>", function()
+ harpoon:list():select(2)
+ end)
+ vim.keymap.set("n", "<C-k>", function()
+ harpoon:list():select(3)
+ end)
+ vim.keymap.set("n", "<C-l>", function()
+ harpoon:list():select(4)
+ end)
+ vim.keymap.set("n", "<C-;>", function()
+ harpoon:list():select(5)
+ end)
+
+ vim.keymap.set("n", "<C-S-P>", function()
+ harpoon:list():prev()
+ end)
+ vim.keymap.set("n", "<C-S-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",
+ "<leader>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", "<leader>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", "<leader>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", "<leader>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
+ "<leader>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 fccd341..a16888e 100644
--- a/lua/plugins/orgmode.lua
+++ b/lua/plugins/orgmode.lua
@@ -1,54 +1,55 @@
return {
- 'nvim-orgmode/orgmode',
- dependencies = {
- { -- Nicely formatted bullet Headings
- "akinsho/org-bullets.nvim",
- dependencies = {
- "nvim-treesitter/nvim-treesitter",
- },
- config = function()
- local bullets = require('org-bullets')
- bullets.setup {
- symbols = {
- -- list items
- list = "",
- checkboxes = {
- done = { "", "OrgDone" }, -- or 
- todo = { "", "OrgTodo" }, -- or 
- half = { "", "OrgHalf" }, -- or 
- },
- },
- }
- end,
- }, { -- Format tables easily
- "dhruvasagar/vim-table-mode",
- },
- },
- event = { "BufEnter", "BufNewFile" },
- 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 = function()
+ local bullets = require("org-bullets")
+ bullets.setup({
+ symbols = {
+ -- list items
+ list = "",
+ checkboxes = {
+ done = { "", "OrgDone" }, -- or 
+ todo = { "", "OrgTodo" }, -- or 
+ half = { "", "OrgHalf" }, -- or 
+ },
+ },
+ })
+ end,
+ },
+ { -- Format tables easily
+ "dhruvasagar/vim-table-mode",
+ },
+ },
+ event = { "BufEnter", "BufNewFile" },
+ 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 = {
- {"<leader><leader>w", "<Cmd>WinResizerStartResize<CR>"}
- }
+ "simeji/winresizer",
+ config = function()
+ vim.g.winresizer_vert_resize = 13
+ vim.g.winresizer_horiz_resize = 10
+ end,
+ keys = {
+ { "<leader><leader>w", "<Cmd>WinResizerStartResize<CR>" },
+ },
}
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
{ "<leader>pv", '<cmd>lua require("telescope.builtin").find_files()<cr>' },
- -- P.aruse B.uffers
- { "<leader>pb", '<cmd>lua require("telescope.builtin").buffers()<cr>' },
- -- P.aruse with G.rep
- { "<leader>pg", '<cmd>lua require("telescope.builtin").live_grep()<cr>' },
+ -- P.aruse B.uffers
+ { "<leader>pb", '<cmd>lua require("telescope.builtin").buffers()<cr>' },
+ -- P.aruse with G.rep
+ { "<leader>pg", '<cmd>lua require("telescope.builtin").live_grep()<cr>' },
-- P.roject S.earch
- { "<leader>ps", '<cmd>lua require("telescope.builtin").grep_string({search = vim.fn.input("Grep > ")})<cr>' },
+ { "<leader>ps", '<cmd>lua require("telescope.builtin").grep_string({search = vim.fn.input("Grep > ")})<cr>' },
-- F.ind Q.uickfix
{ "<leader>qf", '<cmd>lua require("telescope.builtin").quickfix()<cr>' },
-- Find Git (files known to git / not ignored or untracked)
@@ -28,8 +28,8 @@ return {
{ "<leader>fb", '<cmd>lua require("telescope.builtin").grep_branches()<cr>' },
-- F.ix L.ist
{ "<leader>fl", "<cmd>Telescope diagnostics<cr>" },
- -- F.ind R.eferences
- { "<leader>fr", "<cmd>Telescope lsp_references<cr>" }
+ -- F.ind R.eferences
+ { "<leader>fr", "<cmd>Telescope lsp_references<cr>" },
},
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
+ },
}