feat: Initial commit
This commit is contained in:
21
.config/nvim/lua/plugins/additions.lua
Normal file
21
.config/nvim/lua/plugins/additions.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
return {
|
||||
{
|
||||
'smjonas/inc-rename.nvim',
|
||||
keys = { {
|
||||
'<leader>cn',
|
||||
':IncRename ',
|
||||
} },
|
||||
config = function()
|
||||
require('inc_rename').setup({
|
||||
input_buffer_type = 'dressing',
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
'aznhe21/actions-preview.nvim',
|
||||
config = function()
|
||||
require('actions-preview').setup({})
|
||||
vim.keymap.set('n', '<leader>ca', require('actions-preview').code_actions)
|
||||
end,
|
||||
},
|
||||
}
|
||||
21
.config/nvim/lua/plugins/deco.lua
Normal file
21
.config/nvim/lua/plugins/deco.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
return {
|
||||
{ 'nvim-tree/nvim-web-devicons' },
|
||||
{ 'stevearc/dressing.nvim', opts = {} },
|
||||
{
|
||||
'folke/todo-comments.nvim',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
config = function()
|
||||
require('todo-comments').setup()
|
||||
end,
|
||||
},
|
||||
{ 'norcalli/nvim-colorizer.lua', opts = {} },
|
||||
{
|
||||
'OXY2DEV/markview.nvim',
|
||||
dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' },
|
||||
ft = 'markdown',
|
||||
config = function()
|
||||
require('markview')
|
||||
vim.api.nvim_set_hl(0, 'MarkviewLayer', { fg = '#2a2a2a', bg = '#373737' })
|
||||
end,
|
||||
},
|
||||
}
|
||||
63
.config/nvim/lua/plugins/fold.lua
Normal file
63
.config/nvim/lua/plugins/fold.lua
Normal file
@@ -0,0 +1,63 @@
|
||||
return {
|
||||
{
|
||||
'kevinhwang91/nvim-ufo',
|
||||
dependencies = {
|
||||
{
|
||||
'kevinhwang91/promise-async',
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
-- Implement custom marker provider.
|
||||
local CustomMarkerProvider = {}
|
||||
|
||||
function CustomMarkerProvider.getFolds(bufnr)
|
||||
local buf = require('ufo.bufmanager'):get(bufnr)
|
||||
if not buf then
|
||||
return
|
||||
end
|
||||
|
||||
local openRegex = '#region'
|
||||
local closeRegex = '#endregion'
|
||||
|
||||
local summaryRegx = openRegex .. '%s*(.*)'
|
||||
|
||||
local ranges = {}
|
||||
local stack = {}
|
||||
local lines = buf:lines(1, -1)
|
||||
|
||||
for lnum, line in ipairs(lines) do
|
||||
-- Check for start marker
|
||||
if line:match(openRegex) then
|
||||
table.insert(stack, lnum)
|
||||
-- Check for end marker
|
||||
elseif line:match(closeRegex) then
|
||||
local startLnum = table.remove(stack)
|
||||
if startLnum then
|
||||
local summary = lines[startLnum]:match(summaryRegx)
|
||||
table.insert(ranges, require('ufo.model.foldingrange').new(startLnum - 1, lnum - 1, summary))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return ranges
|
||||
end
|
||||
|
||||
local function customizeSelector(bufnr)
|
||||
local ranges = CustomMarkerProvider.getFolds(bufnr)
|
||||
local maybe_additional_ranges = require('ufo').getFolds(bufnr, 'treesitter')
|
||||
if next(maybe_additional_ranges) ~= nil then
|
||||
ranges = vim.list_extend(ranges, maybe_additional_ranges)
|
||||
else
|
||||
ranges = vim.list_extend(ranges, require('ufo').getFolds(bufnr, 'indent'))
|
||||
end
|
||||
return ranges
|
||||
end
|
||||
|
||||
require('ufo').setup({
|
||||
provider_selector = function(bufnr, filetype, buftype)
|
||||
return customizeSelector
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
91
.config/nvim/lua/plugins/format.lua
Normal file
91
.config/nvim/lua/plugins/format.lua
Normal file
@@ -0,0 +1,91 @@
|
||||
return {
|
||||
{
|
||||
'tjex/formatter.nvim',
|
||||
branch = 'fix-305-index-out-of-bounds',
|
||||
config = function()
|
||||
local util = require('formatter.util')
|
||||
|
||||
local function prettier()
|
||||
return {
|
||||
exe = 'prettier',
|
||||
args = {
|
||||
'--config-precedence',
|
||||
'prefer-file',
|
||||
'--single-quote',
|
||||
'--use-tabs',
|
||||
'--trailing-comma',
|
||||
'es5',
|
||||
'--bracket-same-line',
|
||||
'--insert-pragma',
|
||||
'--stdin-filepath',
|
||||
vim.fn.shellescape(vim.api.nvim_buf_get_name(0)),
|
||||
},
|
||||
stdin = true,
|
||||
}
|
||||
end
|
||||
|
||||
require('formatter').setup({
|
||||
filetype = {
|
||||
javascript = {
|
||||
prettier,
|
||||
},
|
||||
typescript = {
|
||||
prettier,
|
||||
},
|
||||
markdown = {
|
||||
prettier,
|
||||
},
|
||||
css = {
|
||||
prettier,
|
||||
},
|
||||
json = {
|
||||
prettier,
|
||||
},
|
||||
html = {
|
||||
prettier,
|
||||
},
|
||||
scss = {
|
||||
prettier,
|
||||
},
|
||||
|
||||
lua = {
|
||||
function()
|
||||
return {
|
||||
exe = 'stylua',
|
||||
args = {
|
||||
'--indent-type',
|
||||
'Tabs',
|
||||
'--line-endings',
|
||||
'Unix',
|
||||
'--quote-style',
|
||||
'AutoPreferSingle',
|
||||
'--column-width',
|
||||
vim.api.nvim_command_output('echo &columns'),
|
||||
'-',
|
||||
},
|
||||
stdin = true,
|
||||
}
|
||||
end,
|
||||
},
|
||||
['*'] = {
|
||||
function()
|
||||
if vim.lsp.buf.formatting then
|
||||
vim.lsp.buf.format()
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
local augroup = vim.api.nvim_create_augroup
|
||||
local autocmd = vim.api.nvim_create_autocmd
|
||||
augroup('__formatter__', {
|
||||
clear = true,
|
||||
})
|
||||
autocmd('BufWritePost', {
|
||||
group = '__formatter__',
|
||||
command = ':FormatWrite',
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
20
.config/nvim/lua/plugins/lsp.lua
Normal file
20
.config/nvim/lua/plugins/lsp.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
return {
|
||||
-- Mason
|
||||
{ 'williamboman/mason.nvim', opts = {}, cmd = 'Mason' },
|
||||
{ 'williamboman/mason-lspconfig.nvim', opts = {} },
|
||||
|
||||
-- Lsp configuration
|
||||
{ 'VonHeikemen/lsp-zero.nvim' },
|
||||
{ 'neovim/nvim-lspconfig' },
|
||||
|
||||
-- Completion
|
||||
{ 'hrsh7th/nvim-cmp', dependencies = { 'hrsh7th/cmp-calc', 'L3MON4D3/LuaSnip', 'hrsh7th/cmp-nvim-lsp', 'onsails/lspkind.nvim' } },
|
||||
|
||||
-- Additions
|
||||
{ 'ray-x/lsp_signature.nvim', event = 'VeryLazy', opts = {
|
||||
hint_prefix = '',
|
||||
} },
|
||||
|
||||
-- Rust
|
||||
{ 'mrcjkb/rustaceanvim' },
|
||||
}
|
||||
33
.config/nvim/lua/plugins/nav.lua
Normal file
33
.config/nvim/lua/plugins/nav.lua
Normal file
@@ -0,0 +1,33 @@
|
||||
return {
|
||||
-- Telescope
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
keys = {
|
||||
{ '<leader>ff', function() require('telescope.builtin').find_files({ show_hidden = true }) end },
|
||||
{ '<leader>fs', require('telescope.builtin').live_grep },
|
||||
{ '<leader>bb', require('telescope.builtin').buffers },
|
||||
},
|
||||
},
|
||||
{ 'nvim-lua/plenary.nvim' },
|
||||
|
||||
-- Oil
|
||||
{
|
||||
'stevearc/oil.nvim',
|
||||
opts = {
|
||||
default_file_explorer = true,
|
||||
view_options = {
|
||||
show_hidden = true,
|
||||
},
|
||||
},
|
||||
lazy = false,
|
||||
keys = {
|
||||
{
|
||||
'<leader>ex',
|
||||
function()
|
||||
vim.cmd('Oil')
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
13
.config/nvim/lua/plugins/theme.lua
Normal file
13
.config/nvim/lua/plugins/theme.lua
Normal file
@@ -0,0 +1,13 @@
|
||||
return {
|
||||
{
|
||||
'loctvl842/monokai-pro.nvim',
|
||||
-- lazy = true,
|
||||
priority = 999,
|
||||
config = function()
|
||||
require('monokai-pro').setup({
|
||||
filter = 'spectrum',
|
||||
})
|
||||
vim.cmd.colorscheme('monokai-pro')
|
||||
end,
|
||||
},
|
||||
}
|
||||
20
.config/nvim/lua/plugins/treesitter.lua
Normal file
20
.config/nvim/lua/plugins/treesitter.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
return {
|
||||
-- Highlighting
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
config = function()
|
||||
vim.cmd('TSUpdate')
|
||||
require('nvim-treesitter.configs').setup({
|
||||
ensure_installed = { 'lua', 'markdown', 'typescript', 'javascript', 'rust', 'json', 'toml' },
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
|
||||
auto_install = true,
|
||||
|
||||
-- additional_vim_regex_highlighting = true,
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user