Skip to content

Commit

Permalink
Migrating to lazy.nvim
Browse files Browse the repository at this point in the history
  • Loading branch information
richban committed May 26, 2024
1 parent 690c1ef commit d0a463e
Show file tree
Hide file tree
Showing 22 changed files with 583 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.DS_Store
.cfg
packer_compiled.vim
dotfiles/config/nvim/plugin/
.vscode/
result
.direnv/
Expand Down
9 changes: 9 additions & 0 deletions dotfiles/config/nvim/lua/rb/plugins/autopairs.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
return {
{
"windwp/nvim-autopairs",
event = "InsertEnter",
opts = {
disable_filetype = { "TelescopePrompt", "vim" },
},
},
}
7 changes: 7 additions & 0 deletions dotfiles/config/nvim/lua/rb/plugins/colorizer.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
return {
{
"norcalli/nvim-colorizer.lua",
event = { "BufReadPost", "BufNewFile" },
opts = {},
},
}
18 changes: 18 additions & 0 deletions dotfiles/config/nvim/lua/rb/plugins/colorscheme.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
local M = {
"catppuccin/nvim",
name = "catppuccin",
priority = 100,
config = function()
require("catppuccin").setup({
flavour = "mocha",
background = {
light = "latte",
dark = "mocha",
},
})

vim.cmd.colorscheme("catppuccin")
end,
}

return M
23 changes: 23 additions & 0 deletions dotfiles/config/nvim/lua/rb/plugins/completion.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
return {
{
"hrsh7th/nvim-cmp",
lazy = false,
priority = 100,
dependencies = {
"onsails/lspkind.nvim",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-path",
"hrsh7th/cmp-buffer",
{
"L3MON4D3/LuaSnip",
dependencies = { "rafamadriz/friendly-snippets" },
build = "make install_jsregexp",
},
"saadparwaiz1/cmp_luasnip",
"windwp/nvim-autopairs",
},
config = function()
require("rb.nvim-cmp")
end,
},
}
40 changes: 40 additions & 0 deletions dotfiles/config/nvim/lua/rb/plugins/conform.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
return {
"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_fallback = true })
end,
mode = "",
desc = "Format buffer",
},
},
-- Everything in opts will be passed to setup()
opts = {
-- Define your formatters
formatters_by_ft = {
lua = { "stylua" },
-- Conform will run multiple formatters sequentially
python = { "ruff" },
-- Use a sub-list to run only the first available formatter
javascript = { { "prettierd", "prettier" } },
nix = { "alejandra" },
},
-- Set up format-on-save
format_on_save = { timeout_ms = 500, lsp_fallback = true },
-- 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,
}
65 changes: 65 additions & 0 deletions dotfiles/config/nvim/lua/rb/plugins/copilot.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
local M = {
"zbirenbaum/copilot.lua",
enabled = true,
event = "InsertEnter",
}

function M.config()
require("copilot").setup({
event = "InsertEnter",
panel = {
enabled = true,
auto_refresh = true,
keymap = {
jump_prev = "[[",
jump_next = "]]",
accept = "<CR>",
refresh = "gr",
open = "<M-CR>",
},
layout = {
position = "bottom", -- | top | left | right
ratio = 0.4,
},
},
suggestion = {
enabled = true,
auto_trigger = false,
debounce = 75,
keymap = {
accept = "<M-l>",
accept_word = false,
accept_line = false,
next = "<M-]>",
prev = "<M-[>",
dismiss = "<C-]>",
},
},
filetypes = {
python = true,
yaml = false,
markdown = false,
help = false,
gitcommit = true,
gitrebase = false,
hgcommit = false,
svn = false,
cvs = false,
["."] = false,
},
copilot_node_command = "node", -- Node.js version must be > 18.x
server_opts_overrides = {
trace = "verbose",
settings = {
advanced = {
listCount = 10, -- #completions for panel
inlineSuggestCount = 3, -- #completions for getCompletions
},
},
},
})
end

function M.test() end

return M
19 changes: 19 additions & 0 deletions dotfiles/config/nvim/lua/rb/plugins/diffview.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
return {
"sindrets/diffview.nvim",
lazy = true,
opts = {},
keys = {
{
"<leader>v",
mode = "n",
function()
if next(require("diffview.lib").views) == nil then
vim.cmd("DiffviewOpen")
else
vim.cmd("DiffviewClose")
end
end,
desc = "diffview",
},
},
}
6 changes: 6 additions & 0 deletions dotfiles/config/nvim/lua/rb/plugins/fidget.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
return {
"j-hui/fidget.nvim",
tag = "legacy",
event = "LspAttach",
opts = {},
}
11 changes: 11 additions & 0 deletions dotfiles/config/nvim/lua/rb/plugins/gitsigns.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
return {
{
"lewis6991/gitsigns.nvim",
lazy = true,
tag = "v0.8.0",
event = { "BufReadPost" },
config = function()
require("rb.gitsigns")
end,
},
}
12 changes: 12 additions & 0 deletions dotfiles/config/nvim/lua/rb/plugins/indent.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
return {
{
"lukas-reineke/indent-blankline.nvim",
tag = "v2.20.8",
event = { "BufReadPost", "BufNewFile" },
opts = {
space_char_blankline = " ",
show_current_context = true,
show_current_context_start = true,
},
},
}
19 changes: 19 additions & 0 deletions dotfiles/config/nvim/lua/rb/plugins/neogit.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-- neogit.lua
local M = {
"TimUntersberger/neogit",
dependencies = {
"nvim-lua/plenary.nvim",
"sindrets/diffview.nvim",
},
config = function()
require("neogit").setup({
disable_commit_confirmation = true,
integrations = {
diffview = true,
},
})
vim.api.nvim_set_keymap("n", "<leader>gs", "<cmd>Neogit kind=tab<CR>", { noremap = true, silent = true })
end,
}

return M
6 changes: 6 additions & 0 deletions dotfiles/config/nvim/lua/rb/plugins/neoscroll.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
return {
"karb94/neoscroll.nvim",
config = function()
require("neoscroll").setup({})
end,
}
10 changes: 10 additions & 0 deletions dotfiles/config/nvim/lua/rb/plugins/notify.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
return {
{
"rcarriga/nvim-notify",
lazy = true,
opts = {
render = "compact",
background_colour = "#000000",
},
},
}
14 changes: 14 additions & 0 deletions dotfiles/config/nvim/lua/rb/plugins/nvim-tree.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
return {
{
"nvim-tree/nvim-tree.lua",
config = function()
local key_map = vim.api.nvim_set_keymap
-- following options are the default
-- each of these are documented in `:help nvim-tree.OPTION_NAME`
require("nvim-tree").setup()

key_map("n", "<leader>b", ":NvimTreeToggle<CR>", { noremap = true, silent = true })
key_map("n", "<leader>br", ":NvimTreeRefresh<CR>", { noremap = true, silent = false })
end,
},
}
24 changes: 24 additions & 0 deletions dotfiles/config/nvim/lua/rb/plugins/oil.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
return {
{
"stevearc/oil.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require("oil").setup({
columns = { "icon" },
keymaps = {
["<C-h>"] = false,
["<M-h>"] = "actions.select_split",
},
view_options = {
show_hidden = true,
},
})

-- Open parent directory in current window
vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })

-- Open parent directory in floating window
vim.keymap.set("n", "<space>-", require("oil").toggle_float)
end,
},
}
6 changes: 6 additions & 0 deletions dotfiles/config/nvim/lua/rb/plugins/projections.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
return {
"gnikdroy/projections.nvim",
config = function()
require("rb.projections")
end,
}
9 changes: 9 additions & 0 deletions dotfiles/config/nvim/lua/rb/plugins/todo.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
return {
"folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
},
}
46 changes: 46 additions & 0 deletions dotfiles/config/nvim/lua/rb/plugins/trouble.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
return {
{
"folke/trouble.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
lazy = true,
opts = {},
keys = {
{
"<leader>xx",
mode = "n",
"<cmd>TroubleToggle<cr>",
desc = "TroubleToggle",
},
{
"<leader>xw",
mode = "n",
"<cmd>TroubleToggle workspace_diagnostics<cr>",
desc = "TroubleToggle workspace_diagnostics",
},
{
"<leader>xd",
mode = "n",
"<cmd>TroubleToggle document_diagnostics<cr>",
desc = "TroubleToggle document_diagnostics",
},
{
"<leader>xl",
mode = "n",
"<cmd>TroubleToggle loclist<cr>",
desc = "TroubleToggle loclist",
},
{
"<leader>xq",
mode = "n",
"<cmd>TroubleToggle quickfix<cr>",
desc = "TroubleToggle quickfix",
},
{
"<leader>xR",
mode = "n",
"<cmd>TroubleToggle lsp_references<cr>",
desc = "TroubleToggle lsp_references",
},
},
},
}
Loading

0 comments on commit d0a463e

Please sign in to comment.