vim: everything is module...
This commit is contained in:
parent
a869818ad2
commit
7a293c6024
23 changed files with 587 additions and 551 deletions
|
@ -1,14 +1,16 @@
|
|||
return {
|
||||
'norcalli/nvim-colorizer.lua',
|
||||
cond = vim.opt.termguicolors:get(),
|
||||
event = {
|
||||
local M = { 'norcalli/nvim-colorizer.lua' }
|
||||
|
||||
M.cond = vim.opt.termguicolors:get()
|
||||
|
||||
M.event = {
|
||||
'BufReadPost',
|
||||
'BufNewFile'
|
||||
},
|
||||
config = function()
|
||||
}
|
||||
|
||||
M.config = function()
|
||||
require('colorizer').setup(nil, {
|
||||
css = true,
|
||||
})
|
||||
end,
|
||||
}
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
local gruvbox = { 'fschauen/gruvbox.nvim', dev = true, lazy = true }
|
||||
local solarized = { 'fschauen/solarized.nvim', dev = true, lazy =true }
|
||||
|
||||
return {
|
||||
{ 'fschauen/solarized.nvim', dev = true, lazy =true },
|
||||
{ 'fschauen/gruvbox.nvim', dev = true, lazy = true },
|
||||
gruvbox,
|
||||
solarized,
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
return {
|
||||
'tpope/vim-commentary',
|
||||
cmd = 'Commentary',
|
||||
keys = {
|
||||
local M = { 'tpope/vim-commentary' }
|
||||
|
||||
M.cmd = 'Commentary'
|
||||
|
||||
M.keys = {
|
||||
{ 'gc', '<Plug>Commentary', mode = { 'n', 'x', 'o' }, desc = 'Comment in/out' },
|
||||
{ 'gcc', '<Plug>CommentaryLine', desc = 'Comment in/out line' },
|
||||
{ 'gcu', '<Plug>Commentary<Plug>Commentary', desc = 'Undo comment in/out' },
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
|
||||
|
|
|
@ -1,3 +1,17 @@
|
|||
local M = { 'hrsh7th/nvim-cmp' }
|
||||
|
||||
M.dependencies = {
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'hrsh7th/cmp-nvim-lua',
|
||||
'hrsh7th/cmp-path',
|
||||
'hrsh7th/cmp-buffer',
|
||||
'hrsh7th/cmp-cmdline',
|
||||
'onsails/lspkind-nvim',
|
||||
|
||||
'L3MON4D3/LuaSnip',
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
}
|
||||
|
||||
local repeat_mapping = function(value, keys)
|
||||
local tbl = {}
|
||||
for _, k in ipairs(keys) do tbl[k] = value end
|
||||
|
@ -20,7 +34,7 @@ local cond = function(condition, yes, no)
|
|||
end
|
||||
end
|
||||
|
||||
local config = function()
|
||||
M.config = function()
|
||||
local cmp = require 'cmp'
|
||||
local map = cmp.mapping
|
||||
|
||||
|
@ -154,21 +168,5 @@ local config = function()
|
|||
cmp.setup.filetype('TelescopePrompt', { enabled = false })
|
||||
end
|
||||
|
||||
return {
|
||||
'hrsh7th/nvim-cmp',
|
||||
|
||||
config = config,
|
||||
|
||||
dependencies = {
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'hrsh7th/cmp-nvim-lua',
|
||||
'hrsh7th/cmp-path',
|
||||
'hrsh7th/cmp-buffer',
|
||||
'hrsh7th/cmp-cmdline',
|
||||
'onsails/lspkind-nvim',
|
||||
|
||||
'L3MON4D3/LuaSnip',
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
},
|
||||
}
|
||||
return M
|
||||
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
return {
|
||||
'tpope/vim-fugitive',
|
||||
cmd = {
|
||||
local M = { 'tpope/vim-fugitive' }
|
||||
|
||||
M.cmd = {
|
||||
'G',
|
||||
'Git',
|
||||
},
|
||||
keys = require('fschauen.keymap').fugitive
|
||||
}
|
||||
|
||||
M.keys = require('fschauen.keymap').fugitive
|
||||
|
||||
return M
|
||||
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
local M = { 'lukas-reineke/indent-blankline.nvim' }
|
||||
|
||||
M.keys = require('fschauen.keymap').indent_blankline
|
||||
|
||||
M.lazy = false -- trows an error when lazy loading
|
||||
|
||||
local chars = { '│', '¦', '┆', '┊', '┊', '┊', '┊', '┊', '┊', '┊' }
|
||||
local show_first_level = false
|
||||
|
||||
return {
|
||||
'lukas-reineke/indent-blankline.nvim',
|
||||
keys = require('fschauen.keymap').indent_blankline,
|
||||
lazy = false, -- trows an error when lazy loading
|
||||
opts = {
|
||||
M.opts = {
|
||||
enabled = false,
|
||||
use_treesitter = true,
|
||||
show_first_indent_level = show_first_level,
|
||||
|
@ -14,6 +16,6 @@ return {
|
|||
char_list = chars,
|
||||
context_char_list = chars,
|
||||
indent_level = #chars + (not show_first_level and 1 or 0),
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
|
|
|
@ -1,4 +1,11 @@
|
|||
local config = function()
|
||||
local M = { 'neovim/nvim-lspconfig' }
|
||||
|
||||
M.dependencies = {
|
||||
'williamboman/mason.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
}
|
||||
|
||||
M.config = function()
|
||||
-- Enable rounded borders for LSP handlers and :LspInfo windows.
|
||||
local border = 'rounded'
|
||||
for request, handler in pairs {
|
||||
|
@ -86,13 +93,5 @@ local config = function()
|
|||
}
|
||||
end
|
||||
|
||||
return {
|
||||
'neovim/nvim-lspconfig',
|
||||
|
||||
config = config,
|
||||
dependencies = {
|
||||
'williamboman/mason.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
},
|
||||
}
|
||||
return M
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
local orange = '#d65d0e'
|
||||
local bright = '#ffffff' -- alternative: '#f9f5d7'
|
||||
|
||||
return {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
config = function()
|
||||
local M = { 'nvim-lualine/lualine.nvim' }
|
||||
|
||||
M.config = function()
|
||||
local window = require 'fschauen.window'
|
||||
local colored_if_focused = require('fschauen.lualine').colored_if_focused
|
||||
|
||||
|
@ -102,5 +102,6 @@ return {
|
|||
},
|
||||
}
|
||||
end
|
||||
}
|
||||
|
||||
return M
|
||||
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
return {
|
||||
'iamcco/markdown-preview.nvim',
|
||||
build = 'cd app && npm install',
|
||||
init = function(_)
|
||||
local M = { 'iamcco/markdown-preview.nvim' }
|
||||
|
||||
M.build = 'cd app && npm install'
|
||||
|
||||
M.init = function(_)
|
||||
vim.g.mkdp_theme = 'dark'
|
||||
end,
|
||||
event = {
|
||||
end
|
||||
|
||||
M.event = {
|
||||
'FileType markdown',
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
return {
|
||||
'NeogitOrg/neogit',
|
||||
keys = require('fschauen.keymap').neogit,
|
||||
opts = {
|
||||
local M = { 'NeogitOrg/neogit' }
|
||||
|
||||
M.keys = require('fschauen.keymap').neogit
|
||||
|
||||
M.opts = {
|
||||
disable_hint = true,
|
||||
signs = {
|
||||
section = { '', '' },
|
||||
|
@ -14,5 +15,7 @@ return {
|
|||
['<space>'] = 'Toggle',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
return {
|
||||
'chr4/nginx.vim',
|
||||
ft = 'nginx',
|
||||
}
|
||||
local M = { 'chr4/nginx.vim' }
|
||||
|
||||
M.ft = 'nginx'
|
||||
|
||||
return M
|
||||
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
return {
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
dependencies = {
|
||||
local M = { 'nvim-tree/nvim-tree.lua' }
|
||||
|
||||
M.dependencies = {
|
||||
'nvim-tree/nvim-web-devicons'
|
||||
},
|
||||
keys = require('fschauen.keymap').nvim_tree,
|
||||
opts = {
|
||||
}
|
||||
|
||||
M.keys = require('fschauen.keymap').nvim_tree
|
||||
|
||||
M.opts = {
|
||||
disable_netrw = true, -- replace netrw with nvim-tree
|
||||
hijack_cursor = true, -- keep the cursor on begin of the filename
|
||||
sync_root_with_cwd = true, -- watch for `DirChanged` and refresh the tree
|
||||
|
@ -65,6 +67,7 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
return {
|
||||
'keith/swift.vim',
|
||||
ft = 'swift',
|
||||
}
|
||||
local M = { 'keith/swift.vim' }
|
||||
|
||||
M.ft = 'swift'
|
||||
|
||||
return M
|
||||
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
return {
|
||||
'godlygeek/tabular',
|
||||
cmd ={
|
||||
local M = { 'godlygeek/tabular' }
|
||||
|
||||
M.cmd ={
|
||||
'AddTabularPattern',
|
||||
'AddTabularPipeline',
|
||||
'Tabularize',
|
||||
},
|
||||
config = function()
|
||||
}
|
||||
|
||||
M.config = function()
|
||||
if vim.fn.exists('g:tabular_loaded') == 1 then
|
||||
vim.cmd [[ AddTabularPattern! first_comma /^[^,]*\zs,/ ]]
|
||||
vim.cmd [[ AddTabularPattern! first_colon /^[^:]*\zs:/ ]]
|
||||
vim.cmd [[ AddTabularPattern! first_equal /^[^=]*\zs=/ ]]
|
||||
end
|
||||
end,
|
||||
}
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
|
|
14
config/nvim/lua/fschauen/plugins/telescope-file-browser.lua
Normal file
14
config/nvim/lua/fschauen/plugins/telescope-file-browser.lua
Normal file
|
@ -0,0 +1,14 @@
|
|||
local M = { 'nvim-telescope/telescope-file-browser.nvim' }
|
||||
|
||||
M.dependencies = {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
}
|
||||
|
||||
M.keys = require('fschauen.keymap').telescope_file_browser
|
||||
|
||||
M.config = function()
|
||||
require('telescope').load_extension 'file_browser'
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
@ -1,15 +1,17 @@
|
|||
return {
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
dependencies = {
|
||||
local M = { 'nvim-telescope/telescope.nvim' }
|
||||
|
||||
M.dependencies = {
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release ' ..
|
||||
'&& cmake --build build --config Release ' ..
|
||||
'&& cmake --install build --prefix build',
|
||||
},
|
||||
cmd = 'Telescope',
|
||||
keys = require('fschauen.keymap').telescope,
|
||||
opts = function()
|
||||
}
|
||||
|
||||
M.cmd = 'Telescope'
|
||||
|
||||
M.keys = require('fschauen.keymap').telescope
|
||||
|
||||
M.opts = function()
|
||||
local actions = require('telescope.actions')
|
||||
local layout = require('telescope.actions.layout')
|
||||
local trouble = vim.F.npcall(require, 'trouble.providers.telescope') or {}
|
||||
|
@ -73,8 +75,9 @@ return {
|
|||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
config = function(_, opts)
|
||||
end
|
||||
|
||||
M.config = function(_, opts)
|
||||
require('telescope').setup(opts)
|
||||
require('telescope').load_extension 'fzf'
|
||||
|
||||
|
@ -85,16 +88,6 @@ return {
|
|||
command = 'setlocal number'
|
||||
})
|
||||
end
|
||||
},
|
||||
{
|
||||
'nvim-telescope/telescope-file-browser.nvim',
|
||||
dependencies = {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
},
|
||||
keys = require('fschauen.keymap').telescope_file_browser,
|
||||
config = function()
|
||||
require('telescope').load_extension 'file_browser'
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
|
||||
|
|
|
@ -1,14 +1,17 @@
|
|||
return {
|
||||
'folke/todo-comments.nvim',
|
||||
dependencies = {
|
||||
local M = { 'folke/todo-comments.nvim' }
|
||||
|
||||
M.dependencies = {
|
||||
'nvim-lua/plenary.nvim'
|
||||
},
|
||||
keys = require('fschauen.keymap').todo_comments,
|
||||
event = {
|
||||
}
|
||||
|
||||
M.keys = require('fschauen.keymap').todo_comments
|
||||
|
||||
M.event = {
|
||||
'BufReadPost',
|
||||
'BufNewFile'
|
||||
},
|
||||
opts = {
|
||||
}
|
||||
|
||||
M.opts = {
|
||||
keywords = {
|
||||
TODO = { icon = ' ' },
|
||||
FIX = { icon = ' ' },
|
||||
|
@ -18,6 +21,7 @@ return {
|
|||
NOTE = { icon = '' },
|
||||
TEST = { icon = ' ' },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
|
||||
|
|
|
@ -1,16 +1,19 @@
|
|||
return {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
dependencies = {
|
||||
local M = { 'nvim-treesitter/nvim-treesitter' }
|
||||
|
||||
M.dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter-refactor',
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
'nvim-treesitter/playground',
|
||||
},
|
||||
keys = require('fschauen.keymap').treesitter,
|
||||
event = {
|
||||
}
|
||||
|
||||
M.keys = require('fschauen.keymap').treesitter
|
||||
|
||||
M.event = {
|
||||
'BufReadPost',
|
||||
'BufNewFile'
|
||||
},
|
||||
cmd = {
|
||||
}
|
||||
|
||||
M.cmd = {
|
||||
'TSInstall',
|
||||
'TSUninstall',
|
||||
'TSUpdate',
|
||||
|
@ -18,9 +21,11 @@ return {
|
|||
'TSInstallInfo',
|
||||
'TSInstallSync',
|
||||
'TSInstallFromGrammar',
|
||||
},
|
||||
main = 'nvim-treesitter.configs',
|
||||
opts = {
|
||||
}
|
||||
|
||||
M.main = 'nvim-treesitter.configs'
|
||||
|
||||
M.opts = {
|
||||
ensure_installed = {
|
||||
'bash',
|
||||
'c',
|
||||
|
@ -95,6 +100,7 @@ return {
|
|||
playground = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
return {
|
||||
'folke/trouble.nvim',
|
||||
dependencies = {
|
||||
local M = { 'folke/trouble.nvim' }
|
||||
|
||||
M.dependencies = {
|
||||
'nvim-tree/nvim-web-devicons'
|
||||
},
|
||||
keys = require('fschauen.keymap').trouble,
|
||||
opts = {
|
||||
}
|
||||
|
||||
M.keys = require('fschauen.keymap').trouble
|
||||
|
||||
M.opts = {
|
||||
padding = false, -- don't add an extra new line of top of the list
|
||||
auto_preview = false, -- don't preview automatically
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
return {
|
||||
'mbbill/undotree',
|
||||
init = function()
|
||||
local M = { 'mbbill/undotree' }
|
||||
|
||||
M.init = function()
|
||||
vim.g.undotree_WindowLayout = 2 -- tree: left, diff: bottom
|
||||
vim.g.undotree_DiffAutoOpen = 0 -- don't open diff by default
|
||||
vim.g.undotree_SetFocusWhenToggle = 1
|
||||
|
@ -8,8 +8,11 @@ return {
|
|||
vim.g.undotree_TreeVertShape = '│'
|
||||
vim.g.undotree_TreeSplitShape = '╱'
|
||||
vim.g.undotree_TreeReturnShape = '╲'
|
||||
end,
|
||||
keys = require('fschauen.keymap').undotree,
|
||||
config = false,
|
||||
}
|
||||
end
|
||||
|
||||
M.keys = require('fschauen.keymap').undotree
|
||||
|
||||
M.config = false
|
||||
|
||||
return M
|
||||
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
return {
|
||||
'lukas-reineke/virt-column.nvim',
|
||||
event = {
|
||||
local M = { 'lukas-reineke/virt-column.nvim' }
|
||||
|
||||
M.event = {
|
||||
'BufReadPost',
|
||||
'BufNewFile'
|
||||
},
|
||||
keys = require('fschauen.keymap').virt_column,
|
||||
opts = {
|
||||
char = '│',
|
||||
},
|
||||
}
|
||||
|
||||
M.keys = require('fschauen.keymap').virt_column
|
||||
|
||||
M.opts = {
|
||||
char = '│',
|
||||
}
|
||||
|
||||
return M
|
||||
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
return {
|
||||
'mg979/vim-visual-multi',
|
||||
init = function()
|
||||
vim.g.VM_leader = '\\'
|
||||
vim.g.VM_silent_exit = 1
|
||||
end,
|
||||
}
|
||||
|
||||
|
||||
-- Component for lualine:
|
||||
-- function()
|
||||
-- local info = vim.F.npcall(vim.fn.VMInfos)
|
||||
-- if info and info.status then
|
||||
-- return info.current .. '/' .. info.total .. ' ' .. info.status
|
||||
-- else
|
||||
-- return ''
|
||||
-- end
|
||||
-- end,
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
return {
|
||||
'ntpeters/vim-better-whitespace',
|
||||
init = function()
|
||||
local M = { 'ntpeters/vim-better-whitespace' }
|
||||
|
||||
M.init = function()
|
||||
vim.g.better_whitespace_filetypes_blacklist = {
|
||||
'diff',
|
||||
'fugitive',
|
||||
|
@ -8,12 +8,16 @@ return {
|
|||
'gitcommit',
|
||||
'help',
|
||||
}
|
||||
end,
|
||||
keys = require('fschauen.keymap').whitespace,
|
||||
event = {
|
||||
end
|
||||
|
||||
M.keys = require('fschauen.keymap').whitespace
|
||||
|
||||
M.event = {
|
||||
'BufReadPost',
|
||||
'BufNewFile'
|
||||
},
|
||||
config = false,
|
||||
}
|
||||
|
||||
M.config = false
|
||||
|
||||
return M
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue