Reorganize plugins dir
This commit is contained in:
29
lua/plugins/bufferline.lua
Normal file
29
lua/plugins/bufferline.lua
Normal file
@@ -0,0 +1,29 @@
|
||||
function conf()
|
||||
--- Ensure plugin is avaiable
|
||||
local bufferline = require("bufferline");
|
||||
|
||||
--- Bufferline options
|
||||
opts = {
|
||||
options = {
|
||||
-- mode = "tabs",
|
||||
separator_style = "slant",
|
||||
},
|
||||
}
|
||||
|
||||
--- Load bufferline
|
||||
bufferline.setup(opts)
|
||||
|
||||
--- Override keymaps
|
||||
local km = vim.keymap.set
|
||||
km("n", "<Tab>", ":BufferLineCycleNext<cr>")
|
||||
km("n", "<S-Tab>", ":BufferLineCyclePrev<cr>")
|
||||
km("n", "<C-n>", ":BufferLineMoveNext<cr>")
|
||||
km("n", "<C-p>", ":BufferLineMovePrev<cr>")
|
||||
end
|
||||
|
||||
return {
|
||||
"akinsho/bufferline.nvim",
|
||||
version = "*",
|
||||
dependencies = "nvim-tree/nvim-web-devicons",
|
||||
config = conf
|
||||
}
|
||||
12
lua/plugins/comment.lua
Normal file
12
lua/plugins/comment.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
function conf()
|
||||
--- Ensure plugin is avaiable
|
||||
local comment = require('Comment')
|
||||
|
||||
comment.setup()
|
||||
end
|
||||
|
||||
return {
|
||||
"numToStr/Comment.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = conf
|
||||
}
|
||||
11
lua/plugins/gitsigns.lua
Normal file
11
lua/plugins/gitsigns.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
function conf()
|
||||
--- Ensure plugin is avaiable
|
||||
local gitsigns = require('gitsigns')
|
||||
|
||||
gitsigns.setup()
|
||||
end
|
||||
|
||||
return {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
config = conf
|
||||
}
|
||||
11
lua/plugins/indent-blankline.lua
Normal file
11
lua/plugins/indent-blankline.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
function conf()
|
||||
--- Ensure plugin is avaiable
|
||||
local ibl = require("ibl")
|
||||
ibl.setup()
|
||||
end
|
||||
|
||||
|
||||
return {
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
config = conf,
|
||||
}
|
||||
33
lua/plugins/lualine.lua
Normal file
33
lua/plugins/lualine.lua
Normal file
@@ -0,0 +1,33 @@
|
||||
function conf()
|
||||
--- Ensure plugins are avaiable
|
||||
local lualine = require("lualine")
|
||||
local lazy_status = require("lazy.status")
|
||||
|
||||
opts = {
|
||||
options = {
|
||||
theme = "onedark",
|
||||
},
|
||||
sections = {
|
||||
lualine_x = {
|
||||
{
|
||||
lazy_status.updates,
|
||||
cond = lazy_status.has_updates,
|
||||
color = { fg = "#ff9e64" },
|
||||
},
|
||||
{ "encoding" },
|
||||
{ "fileformat" },
|
||||
{ "filetype" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
lualine.setup(opts)
|
||||
end
|
||||
|
||||
return {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
dependencies = {
|
||||
'nvim-tree/nvim-web-devicons', opt = true
|
||||
},
|
||||
config = conf
|
||||
}
|
||||
11
lua/plugins/nvim-autopairs.lua
Normal file
11
lua/plugins/nvim-autopairs.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
function conf()
|
||||
--- Ensure plugin is avaiable
|
||||
local nvimautopairs = require("nvim-autopairs")
|
||||
nvimautopairs.setup()
|
||||
end
|
||||
|
||||
return {
|
||||
'windwp/nvim-autopairs',
|
||||
event = "InsertEnter",
|
||||
config = conf
|
||||
}
|
||||
61
lua/plugins/nvim-tree.lua
Normal file
61
lua/plugins/nvim-tree.lua
Normal file
@@ -0,0 +1,61 @@
|
||||
function conf()
|
||||
--- Ensure nvim-tree is avaiable
|
||||
local nvimtree = require("nvim-tree")
|
||||
|
||||
--- Unload netrw
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
--- Nvimtree options
|
||||
local opts = {
|
||||
sort = {
|
||||
-- sorter = "case_sensitive",
|
||||
},
|
||||
view = {
|
||||
width = 30,
|
||||
},
|
||||
renderer = {
|
||||
group_empty = true,
|
||||
indent_markers = {
|
||||
enable = true,
|
||||
},
|
||||
icons = {
|
||||
glyphs = {
|
||||
folder = {
|
||||
arrow_closed = "", -- arrow when folder is closed
|
||||
arrow_open = "", -- arrow when folder is open
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
filters = {
|
||||
dotfiles = false,
|
||||
},
|
||||
}
|
||||
|
||||
nvimtree.setup(opts)
|
||||
|
||||
--- Override keymap
|
||||
local wk = require("which-key")
|
||||
wk.register({
|
||||
e = {
|
||||
name = "NvimTree", -- optional group name
|
||||
},
|
||||
}, { prefix = "<leader>" })
|
||||
local km = vim.keymap.set
|
||||
km('n', '<C-e>', ':NvimTreeFocus<cr>')
|
||||
km('n', '<leader>ee', ':NvimTreeToggle<cr>')
|
||||
km('n', '<leader>ef', ':NvimTreeFindFileToggle<cr>')
|
||||
km('n', '<leader>ec', ':NvimTreeCollapse<cr>')
|
||||
km('n', '<leader>er', ':NvimTreeRefresh<cr>')
|
||||
end
|
||||
|
||||
return {
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
version = "*",
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
config = conf
|
||||
}
|
||||
55
lua/plugins/nvim-treesitter.lua
Normal file
55
lua/plugins/nvim-treesitter.lua
Normal file
@@ -0,0 +1,55 @@
|
||||
function conf()
|
||||
--- Ensure plugin is avaiable
|
||||
local treesitter = require("nvim-treesitter.configs")
|
||||
|
||||
--- nvim-treesitter options
|
||||
opts = {
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
-- enable indentation
|
||||
autotag = {
|
||||
enable = true,
|
||||
},
|
||||
ensure_installed = {
|
||||
"json",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"tsx",
|
||||
"yaml",
|
||||
"html",
|
||||
"css",
|
||||
"prisma",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"svelte",
|
||||
"graphql",
|
||||
"bash",
|
||||
"lua",
|
||||
"vim",
|
||||
"dockerfile",
|
||||
"gitignore",
|
||||
"query",
|
||||
"rst",
|
||||
"php",
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<leader>ss",
|
||||
node_incremental = false,
|
||||
scope_incremental = false,
|
||||
node_decremental = false,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
--- Load plugin
|
||||
treesitter.setup(opts)
|
||||
end
|
||||
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = conf
|
||||
}
|
||||
10
lua/plugins/onedark.lua
Normal file
10
lua/plugins/onedark.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
function conf()
|
||||
require('onedark').load()
|
||||
end
|
||||
|
||||
return {
|
||||
"navarasu/onedark.nvim",
|
||||
lazy=false,
|
||||
priority = 1000,
|
||||
config = conf
|
||||
}
|
||||
33
lua/plugins/rainbow-delimiters.lua
Normal file
33
lua/plugins/rainbow-delimiters.lua
Normal file
@@ -0,0 +1,33 @@
|
||||
function conf()
|
||||
local rainbow_delimiters = require 'rainbow-delimiters'
|
||||
|
||||
vim.g.rainbow_delimiters = {
|
||||
strategy = {
|
||||
[''] = rainbow_delimiters.strategy['global'],
|
||||
vim = rainbow_delimiters.strategy['local'],
|
||||
},
|
||||
query = {
|
||||
[''] = 'rainbow-delimiters',
|
||||
lua = 'rainbow-blocks',
|
||||
},
|
||||
priority = {
|
||||
[''] = 110,
|
||||
lua = 210,
|
||||
},
|
||||
highlight = {
|
||||
'RainbowDelimiterYellow',
|
||||
'RainbowDelimiterBlue',
|
||||
'RainbowDelimiterOrange',
|
||||
'RainbowDelimiterGreen',
|
||||
'RainbowDelimiterViolet',
|
||||
'RainbowDelimiterCyan',
|
||||
'RainbowDelimiterRed',
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
return {
|
||||
"hiphish/rainbow-delimiters.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = conf
|
||||
}
|
||||
21
lua/plugins/which-key.lua
Normal file
21
lua/plugins/which-key.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
function conf ()
|
||||
--- Global options
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 300
|
||||
|
||||
--- Override keymap
|
||||
local km = vim.keymap.set
|
||||
km('n', '<C-s>', ':WhichKey<cr>', { desc = "Which-key" })
|
||||
local wk = require("which-key")
|
||||
wk.register({
|
||||
n = {
|
||||
name = "nohl",
|
||||
},
|
||||
}, { prefix = "<leader>" })
|
||||
end
|
||||
|
||||
return {
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
config = conf,
|
||||
}
|
||||
Reference in New Issue
Block a user