Skip to content

Commit 7f6cc18

Browse files
moved custom plugins to seperate folder
1 parent 65c7566 commit 7f6cc18

File tree

8 files changed

+126
-116
lines changed

8 files changed

+126
-116
lines changed

init.lua

Lines changed: 1 addition & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -707,121 +707,6 @@ require('lazy').setup({
707707
}
708708
end,
709709
},
710-
711-
-- Vim Razor
712-
{
713-
'jlcrochet/vim-razor',
714-
lazy = false,
715-
ft = 'cshtml'
716-
},
717-
718-
-- Prime's Harpoon2
719-
{
720-
'ThePrimeagen/harpoon',
721-
branch = 'harpoon2',
722-
dependencies = {
723-
'nvim-lua/plenary.nvim',
724-
},
725-
lazy = false,
726-
config = function()
727-
require('harpoon'):setup({})
728-
end,
729-
keys = {
730-
{
731-
'<leader>a',
732-
function()
733-
require('harpoon'):list():add()
734-
end,
735-
mode = 'n',
736-
desc = '[A]dd to Harpoon',
737-
},
738-
{
739-
'<C-e>',
740-
function()
741-
local files = require('harpoon'):list() or {}
742-
require('harpoon').ui:toggle_quick_menu(files)
743-
end,
744-
desc = 'Toggle Harpoon [E]xplorer',
745-
},
746-
},
747-
},
748-
-- neoconf.nvim
749-
{
750-
'folke/neoconf.nvim',
751-
lazy = false,
752-
},
753-
-- Copilot
754-
{
755-
'github/copilot.vim',
756-
lazy = false,
757-
},
758-
-- Autopairs
759-
{
760-
'windwp/nvim-autopairs',
761-
event = 'InsertEnter',
762-
config = true,
763-
},
764-
-- LazyGit
765-
{
766-
'kdheepak/lazygit.nvim',
767-
lazy = false,
768-
keys = {
769-
{
770-
'<leader>lg',
771-
'<cmd>LazyGit<CR>',
772-
desc = '[L]azy [G]it',
773-
},
774-
},
775-
},
776-
{
777-
-- Autoformat
778-
'stevearc/conform.nvim',
779-
event = { 'BufWritePre' },
780-
cmd = { 'ConformInfo' },
781-
keys = {
782-
{
783-
'<leader>f',
784-
function()
785-
require('conform').format { async = true, lsp_format = 'fallback' }
786-
end,
787-
mode = '',
788-
desc = '[F]ormat buffer',
789-
},
790-
},
791-
opts = {
792-
notify_on_error = false,
793-
format_on_save = function(bufnr)
794-
-- Disable "format_on_save lsp_fallback" for languages that don't
795-
-- have a well-standardized coding style. Add more languages here if needed.
796-
local disable_filetypes = { c = true, cpp = true }
797-
798-
if vim.g.disable_auto_format or disable_filetypes[vim.bo[bufnr].filetype] then
799-
return false
800-
end
801-
802-
-- Determine lsp_format option based on filetype
803-
local lsp_format_opt
804-
if disable_filetypes[vim.bo[bufnr].filetype] then
805-
lsp_format_opt = 'never'
806-
else
807-
lsp_format_opt = 'fallback'
808-
end
809-
810-
return {
811-
timeout_ms = 500,
812-
lsp_format = lsp_format_opt,
813-
}
814-
end,
815-
formatters_by_ft = {
816-
lua = { 'stylua' },
817-
-- Conform can also run multiple formatters sequentially
818-
-- python = { "isort", "black" },
819-
-- You can use 'stop_after_first' to run the first available formatter from the list
820-
-- javascript = { "prettierd", "prettier", stop_after_first = true },
821-
},
822-
},
823-
},
824-
825710
{ -- You can easily change to a different colorscheme.
826711
-- Change the name of the colorscheme plugin below, and then
827712
-- change the command in the config to whatever the name of that colorscheme is.
@@ -927,7 +812,7 @@ require('lazy').setup({
927812
-- This is the easiest way to modularize your config.
928813
--
929814
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
930-
-- { import = 'custom.plugins' },
815+
{ import = 'custom.plugins' },
931816
--
932817
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
933818
-- Or use telescope!

lua/custom/plugins/autoformat.lua

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
2+
return {
3+
{
4+
-- Autoformat
5+
'stevearc/conform.nvim',
6+
event = { 'BufWritePre' },
7+
cmd = { 'ConformInfo' },
8+
keys = {
9+
{
10+
'<leader>f',
11+
function()
12+
require('conform').format { async = true, lsp_format = 'fallback' }
13+
end,
14+
mode = '',
15+
desc = '[F]ormat buffer',
16+
},
17+
},
18+
opts = {
19+
notify_on_error = false,
20+
format_on_save = function(bufnr)
21+
-- Disable "format_on_save lsp_fallback" for languages that don't
22+
-- have a well-standardized coding style. Add more languages here if needed.
23+
local disable_filetypes = { c = true, cpp = true }
24+
25+
if vim.g.disable_auto_format or disable_filetypes[vim.bo[bufnr].filetype] then
26+
return false
27+
end
28+
29+
-- Determine lsp_format option based on filetype
30+
local lsp_format_opt
31+
if disable_filetypes[vim.bo[bufnr].filetype] then
32+
lsp_format_opt = 'never'
33+
else
34+
lsp_format_opt = 'fallback'
35+
end
36+
37+
return {
38+
timeout_ms = 500,
39+
lsp_format = lsp_format_opt,
40+
}
41+
end,
42+
formatters_by_ft = {
43+
lua = { 'stylua' },
44+
-- Conform can also run multiple formatters sequentially
45+
-- python = { "isort", "black" },
46+
-- You can use 'stop_after_first' to run the first available formatter from the list
47+
-- javascript = { "prettierd", "prettier", stop_after_first = true },
48+
},
49+
},
50+
}
51+
}

lua/custom/plugins/autopairs.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
return {
2+
-- Autopairs
3+
{
4+
'windwp/nvim-autopairs',
5+
event = 'InsertEnter',
6+
config = true,
7+
}
8+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
return {
2+
-- Copilot
3+
{
4+
'github/copilot.vim',
5+
lazy = false,
6+
},
7+
}

lua/custom/plugins/harpoon.lua

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
return {
2+
'ThePrimeagen/harpoon',
3+
branch = 'harpoon2',
4+
dependencies = {
5+
'nvim-lua/plenary.nvim',
6+
},
7+
lazy = false,
8+
config = function()
9+
require('harpoon'):setup({})
10+
end,
11+
keys = {
12+
{
13+
'<leader>a',
14+
function()
15+
require('harpoon'):list():add()
16+
end,
17+
mode = 'n',
18+
desc = '[A]dd to Harpoon',
19+
},
20+
{
21+
'<C-e>',
22+
function()
23+
local files = require('harpoon'):list() or {}
24+
require('harpoon').ui:toggle_quick_menu(files)
25+
end,
26+
desc = 'Toggle Harpoon [E]xplorer',
27+
},
28+
},
29+
}
30+

lua/custom/plugins/lazygit.lua

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
return {
2+
-- LazyGit
3+
{
4+
'kdheepak/lazygit.nvim',
5+
lazy = false,
6+
keys = {
7+
{
8+
'<leader>lg',
9+
'<cmd>LazyGit<CR>',
10+
desc = '[L]azy [G]it',
11+
},
12+
},
13+
},
14+
}

lua/custom/plugins/neoconf.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
return {
2+
-- neoconf.nvim
3+
{
4+
'folke/neoconf.nvim',
5+
lazy = false,
6+
}
7+
}

lua/custom/plugins/vim-razor.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
return {
2+
{
3+
'jlcrochet/vim-razor',
4+
lazy = false,
5+
ft = 'cshtml'
6+
}
7+
}
8+

0 commit comments

Comments
 (0)