vim: everything is module...

This commit is contained in:
Fernando Schauenburg 2023-08-17 22:05:07 +02:00
parent a869818ad2
commit 7a293c6024
23 changed files with 587 additions and 551 deletions

View file

@ -1,14 +1,16 @@
return { local M = { 'norcalli/nvim-colorizer.lua' }
'norcalli/nvim-colorizer.lua',
cond = vim.opt.termguicolors:get(), M.cond = vim.opt.termguicolors:get()
event = {
'BufReadPost', M.event = {
'BufNewFile' 'BufReadPost',
}, 'BufNewFile'
config = function()
require('colorizer').setup(nil, {
css = true,
})
end,
} }
M.config = function()
require('colorizer').setup(nil, {
css = true,
})
end
return M

View file

@ -1,5 +1,8 @@
local gruvbox = { 'fschauen/gruvbox.nvim', dev = true, lazy = true }
local solarized = { 'fschauen/solarized.nvim', dev = true, lazy =true }
return { return {
{ 'fschauen/solarized.nvim', dev = true, lazy =true }, gruvbox,
{ 'fschauen/gruvbox.nvim', dev = true, lazy = true }, solarized,
} }

View file

@ -1,9 +1,12 @@
return { local M = { 'tpope/vim-commentary' }
'tpope/vim-commentary',
cmd = 'Commentary', M.cmd = 'Commentary'
keys = {
{ 'gc', '<Plug>Commentary', mode = { 'n', 'x', 'o' }, desc = 'Comment in/out' }, M.keys = {
{ 'gcc', '<Plug>CommentaryLine', desc = 'Comment in/out line' }, { 'gc', '<Plug>Commentary', mode = { 'n', 'x', 'o' }, desc = 'Comment in/out' },
{ 'gcu', '<Plug>Commentary<Plug>Commentary', desc = 'Undo comment in/out' }, { 'gcc', '<Plug>CommentaryLine', desc = 'Comment in/out line' },
}, { 'gcu', '<Plug>Commentary<Plug>Commentary', desc = 'Undo comment in/out' },
} }
return M

View file

@ -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 repeat_mapping = function(value, keys)
local tbl = {} local tbl = {}
for _, k in ipairs(keys) do tbl[k] = value end for _, k in ipairs(keys) do tbl[k] = value end
@ -20,7 +34,7 @@ local cond = function(condition, yes, no)
end end
end end
local config = function() M.config = function()
local cmp = require 'cmp' local cmp = require 'cmp'
local map = cmp.mapping local map = cmp.mapping
@ -154,21 +168,5 @@ local config = function()
cmp.setup.filetype('TelescopePrompt', { enabled = false }) cmp.setup.filetype('TelescopePrompt', { enabled = false })
end end
return { return M
'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',
},
}

View file

@ -1,9 +1,11 @@
return { local M = { 'tpope/vim-fugitive' }
'tpope/vim-fugitive',
cmd = { M.cmd = {
'G', 'G',
'Git', 'Git',
},
keys = require('fschauen.keymap').fugitive
} }
M.keys = require('fschauen.keymap').fugitive
return M

View file

@ -1,19 +1,21 @@
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 chars = { '', '¦', '', '', '', '', '', '', '', '' }
local show_first_level = false local show_first_level = false
return { M.opts = {
'lukas-reineke/indent-blankline.nvim', enabled = false,
keys = require('fschauen.keymap').indent_blankline, use_treesitter = true,
lazy = false, -- trows an error when lazy loading show_first_indent_level = show_first_level,
opts = { show_current_context = true,
enabled = false, show_trailing_blankline_indent = false,
use_treesitter = true, char_list = chars,
show_first_indent_level = show_first_level, context_char_list = chars,
show_current_context = true, indent_level = #chars + (not show_first_level and 1 or 0),
show_trailing_blankline_indent = false,
char_list = chars,
context_char_list = chars,
indent_level = #chars + (not show_first_level and 1 or 0),
},
} }
return M

View file

@ -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. -- Enable rounded borders for LSP handlers and :LspInfo windows.
local border = 'rounded' local border = 'rounded'
for request, handler in pairs { for request, handler in pairs {
@ -86,13 +93,5 @@ local config = function()
} }
end end
return { return M
'neovim/nvim-lspconfig',
config = config,
dependencies = {
'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim',
},
}

View file

@ -1,106 +1,107 @@
local orange = '#d65d0e' local orange = '#d65d0e'
local bright = '#ffffff' -- alternative: '#f9f5d7' local bright = '#ffffff' -- alternative: '#f9f5d7'
return { local M = { 'nvim-lualine/lualine.nvim' }
'nvim-lualine/lualine.nvim',
config = function()
local window = require 'fschauen.window'
local colored_if_focused = require('fschauen.lualine').colored_if_focused
-- custom components M.config = function()
local C = { local window = require 'fschauen.window'
diagnostics = { local colored_if_focused = require('fschauen.lualine').colored_if_focused
colored_if_focused('diagnostics'),
},
diff = {
colored_if_focused('diff'),
symbols = {
added = '',
modified = '',
removed = '',
},
},
branch = {
'branch',
icon = '󰘬',
cond = window.is_medium,
},
fileformat = {
'fileformat',
cond = window.is_medium,
},
filename = {
require('fschauen.lualine').filename,
padding = {
left = 1,
right = 0,
},
},
filetype = {
colored_if_focused('filetype'),
cond = window.is_medium,
},
mode = require('fschauen.lualine').mode,
paste = {
colored_if_focused(function(has_focus) return has_focus and '' or ' ' end),
color = {
bg = orange,
},
cond = function() return vim.o.paste end
},
searchcount = require('fschauen.lualine').searchcount,
status = {
colored_if_focused(function(_)
local status = ''
if vim.bo.modified then status = status .. '' end
if vim.bo.readonly or not vim.bo.modifiable then status = status .. 'RO' end
return status
end),
color = {
fg = bright,
},
},
trailing_whitespace = {
colored_if_focused(require('fschauen.lualine').trailing_whitespace),
color = {
bg = orange,
},
}
}
local sections = { -- custom components
lualine_a = { C.paste, C.mode }, local C = {
lualine_b = { C.branch }, diagnostics = {
lualine_c = { C.filename, C.status }, colored_if_focused('diagnostics'),
lualine_x = { C.diagnostics, C.searchcount, C.filetype }, },
lualine_y = { C.fileformat, 'progress' }, diff = {
lualine_z = { 'location', C.trailing_whitespace }, colored_if_focused('diff'),
} symbols = {
added = '',
require('lualine').setup { modified = '',
options = { removed = '',
icons_enabled = true,
component_separators = {
left = '',
right = ''
},
section_separators = {
left = '',
right = ''
},
theme = 'gruvbox',
}, },
sections = sections, },
inactive_sections = sections, branch = {
extensions = { 'branch',
'fugitive', icon = '󰘬',
'quickfix', cond = window.is_medium,
'nvim-tree', },
'lazy', fileformat = {
'man', 'fileformat',
'trouble', cond = window.is_medium,
},
filename = {
require('fschauen.lualine').filename,
padding = {
left = 1,
right = 0,
},
},
filetype = {
colored_if_focused('filetype'),
cond = window.is_medium,
},
mode = require('fschauen.lualine').mode,
paste = {
colored_if_focused(function(has_focus) return has_focus and '' or ' ' end),
color = {
bg = orange,
},
cond = function() return vim.o.paste end
},
searchcount = require('fschauen.lualine').searchcount,
status = {
colored_if_focused(function(_)
local status = ''
if vim.bo.modified then status = status .. '' end
if vim.bo.readonly or not vim.bo.modifiable then status = status .. 'RO' end
return status
end),
color = {
fg = bright,
},
},
trailing_whitespace = {
colored_if_focused(require('fschauen.lualine').trailing_whitespace),
color = {
bg = orange,
}, },
} }
end }
}
local sections = {
lualine_a = { C.paste, C.mode },
lualine_b = { C.branch },
lualine_c = { C.filename, C.status },
lualine_x = { C.diagnostics, C.searchcount, C.filetype },
lualine_y = { C.fileformat, 'progress' },
lualine_z = { 'location', C.trailing_whitespace },
}
require('lualine').setup {
options = {
icons_enabled = true,
component_separators = {
left = '',
right = ''
},
section_separators = {
left = '',
right = ''
},
theme = 'gruvbox',
},
sections = sections,
inactive_sections = sections,
extensions = {
'fugitive',
'quickfix',
'nvim-tree',
'lazy',
'man',
'trouble',
},
}
end
return M

View file

@ -1,10 +1,14 @@
return { local M = { 'iamcco/markdown-preview.nvim' }
'iamcco/markdown-preview.nvim',
build = 'cd app && npm install', M.build = 'cd app && npm install'
init = function(_)
vim.g.mkdp_theme = 'dark' M.init = function(_)
end, vim.g.mkdp_theme = 'dark'
event = { end
'FileType markdown',
}, M.event = {
'FileType markdown',
} }
return M

View file

@ -1,18 +1,21 @@
return { local M = { 'NeogitOrg/neogit' }
'NeogitOrg/neogit',
keys = require('fschauen.keymap').neogit, M.keys = require('fschauen.keymap').neogit
opts = {
disable_hint = true, M.opts = {
signs = { disable_hint = true,
section = { '', '' }, signs = {
item = { '', '' }, section = { '', '' },
hunk = { '', '' }, item = { '', '' },
}, hunk = { '', '' },
mappings = { },
status = { mappings = {
o = 'GoToFile', status = {
['<space>'] = 'Toggle', o = 'GoToFile',
}, ['<space>'] = 'Toggle',
}, },
}, },
} }
return M

View file

@ -1,5 +1,6 @@
return { local M = { 'chr4/nginx.vim' }
'chr4/nginx.vim',
ft = 'nginx', M.ft = 'nginx'
}
return M

View file

@ -1,70 +1,73 @@
return { local M = { 'nvim-tree/nvim-tree.lua' }
'nvim-tree/nvim-tree.lua',
dependencies = { M.dependencies = {
'nvim-tree/nvim-web-devicons' 'nvim-tree/nvim-web-devicons'
}
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
on_attach = function(bufnr)
local api = require('nvim-tree.api')
api.config.mappings.default_on_attach(bufnr)
local opts = function(desc)
return { desc = 'nvim-tree: ' .. desc, buffer = bufnr, silent = true }
end
vim.keymap.set('n', 'l', api.node.open.edit, opts('open'))
vim.keymap.set('n', '<CR>', api.node.open.edit, opts('open'))
vim.keymap.set('n', 'o', api.node.open.edit, opts('open'))
vim.keymap.set('n', 'h', api.node.navigate.parent_close, opts('close directory'))
end,
git = {
ignore = false, -- don't hide files from .gitignore
}, },
keys = require('fschauen.keymap').nvim_tree, view = {
opts = { adaptive_size = true, -- resize the window based on the longest line
disable_netrw = true, -- replace netrw with nvim-tree width = 35, -- a little wider than the default 30
hijack_cursor = true, -- keep the cursor on begin of the filename },
sync_root_with_cwd = true, -- watch for `DirChanged` and refresh the tree filters = {
dotfiles = false, -- show files starting with a .
on_attach = function(bufnr) custom = { '^\\.git' }, -- don't show .git directory
local api = require('nvim-tree.api') },
api.config.mappings.default_on_attach(bufnr) renderer = {
add_trailing = true, -- add trailing / to folders
local opts = function(desc) highlight_git = true, -- enable highlight based on git attributes
return { desc = 'nvim-tree: ' .. desc, buffer = bufnr, silent = true } icons = {
end git_placement = 'after',
glyphs = {
vim.keymap.set('n', 'l', api.node.open.edit, opts('open')) default = '',
vim.keymap.set('n', '<CR>', api.node.open.edit, opts('open')) symlink = '',
vim.keymap.set('n', 'o', api.node.open.edit, opts('open')) modified = '',
vim.keymap.set('n', 'h', api.node.navigate.parent_close, opts('close directory')) folder = {
end, arrow_closed = '', --   
arrow_open = '', --   
git = { default = '', --  
ignore = false, -- don't hide files from .gitignore open = '', --  
}, empty = '',
view = { empty_open = '',
adaptive_size = true, -- resize the window based on the longest line symlink = '',
width = 35, -- a little wider than the default 30 symlink_open = '',
}, },
filters = { git = {
dotfiles = false, -- show files starting with a . untracked = '?', -- ★
custom = { '^\\.git' }, -- don't show .git directory unstaged = '', -- ✗
}, staged = '', -- ✓
renderer = { deleted = '',
add_trailing = true, -- add trailing / to folders unmerged = '',
highlight_git = true, -- enable highlight based on git attributes renamed = '',
icons = { ignored = '',
git_placement = 'after',
glyphs = {
default = '',
symlink = '',
modified = '',
folder = {
arrow_closed = '', --   
arrow_open = '', --   
default = '', --  
open = '', --  
empty = '',
empty_open = '',
symlink = '',
symlink_open = '',
},
git = {
untracked = '?', -- ★
unstaged = '', -- ✗
staged = '', -- ✓
deleted = '',
unmerged = '',
renamed = '',
ignored = '',
},
}, },
}, },
}, },
}, },
} }
return M

View file

@ -1,5 +1,6 @@
return { local M = { 'keith/swift.vim' }
'keith/swift.vim',
ft = 'swift', M.ft = 'swift'
}
return M

View file

@ -1,16 +1,18 @@
return { local M = { 'godlygeek/tabular' }
'godlygeek/tabular',
cmd ={ M.cmd ={
'AddTabularPattern', 'AddTabularPattern',
'AddTabularPipeline', 'AddTabularPipeline',
'Tabularize', 'Tabularize',
},
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,
} }
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
return M

View 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

View file

@ -1,100 +1,93 @@
return { local M = { 'nvim-telescope/telescope.nvim' }
{
'nvim-telescope/telescope.nvim',
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()
local actions = require('telescope.actions')
local layout = require('telescope.actions.layout')
local trouble = vim.F.npcall(require, 'trouble.providers.telescope') or {}
local mappings = { M.dependencies = {
['<c-j>'] = actions.cycle_history_next, 'nvim-telescope/telescope-fzf-native.nvim',
['<c-k>'] = actions.cycle_history_prev, build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release ' ..
['<s-down>'] = actions.preview_scrolling_down, '&& cmake --build build --config Release ' ..
['<s-up>'] = actions.preview_scrolling_up, '&& cmake --install build --prefix build',
['<c-y>'] = layout.cycle_layout_next,
['<c-o>'] = layout.toggle_mirror,
['<c-c>'] = actions.close,
['<c-q>'] = actions.smart_send_to_qflist + actions.open_qflist,
['<c-l>'] = actions.smart_send_to_loclist + actions.open_loclist,
['<c-b>'] = trouble.smart_open_with_trouble,
}
return {
defaults = {
mappings = {
i = mappings,
n = mappings,
},
prompt_prefix = '', -- Alternatives: 
selection_caret = '', -- Alternatives:  ➔ 
multi_icon = '󰄬 ', -- Alternatives: 󰄬  
scroll_strategy = 'limit', -- Don't wrap around in results.
dynamic_preview_title = true,
layout_strategy = 'flex',
layout_config = {
width = 0.9,
height = 0.9,
flex = { flip_columns = 130 },
horizontal = { preview_width = 0.5, preview_cutoff = 130 },
vertical = { preview_height = 0.5 },
},
cycle_layout_list = { 'horizontal', 'vertical' },
},
pickers = {
buffers = {
mappings = {
n = {
x = actions.delete_buffer,
},
},
},
colorscheme = {
theme = 'dropdown',
},
spell_suggest = {
theme = 'cursor',
},
},
extensions = {
file_browser = {
theme = 'ivy'
},
},
}
end,
config = function(_, opts)
require('telescope').setup(opts)
require('telescope').load_extension 'fzf'
vim.api.nvim_create_autocmd('User', {
desc = 'Enable line number in Telescope previewers.',
group = vim.api.nvim_create_augroup('fschauen.telescope', { clear = true } ),
pattern = 'TelescopePreviewerLoaded',
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,
},
} }
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 {}
local mappings = {
['<c-j>'] = actions.cycle_history_next,
['<c-k>'] = actions.cycle_history_prev,
['<s-down>'] = actions.preview_scrolling_down,
['<s-up>'] = actions.preview_scrolling_up,
['<c-y>'] = layout.cycle_layout_next,
['<c-o>'] = layout.toggle_mirror,
['<c-c>'] = actions.close,
['<c-q>'] = actions.smart_send_to_qflist + actions.open_qflist,
['<c-l>'] = actions.smart_send_to_loclist + actions.open_loclist,
['<c-b>'] = trouble.smart_open_with_trouble,
}
return {
defaults = {
mappings = {
i = mappings,
n = mappings,
},
prompt_prefix = '', -- Alternatives: 
selection_caret = '', -- Alternatives:  ➔ 
multi_icon = '󰄬 ', -- Alternatives: 󰄬  
scroll_strategy = 'limit', -- Don't wrap around in results.
dynamic_preview_title = true,
layout_strategy = 'flex',
layout_config = {
width = 0.9,
height = 0.9,
flex = { flip_columns = 130 },
horizontal = { preview_width = 0.5, preview_cutoff = 130 },
vertical = { preview_height = 0.5 },
},
cycle_layout_list = { 'horizontal', 'vertical' },
},
pickers = {
buffers = {
mappings = {
n = {
x = actions.delete_buffer,
},
},
},
colorscheme = {
theme = 'dropdown',
},
spell_suggest = {
theme = 'cursor',
},
},
extensions = {
file_browser = {
theme = 'ivy'
},
},
}
end
M.config = function(_, opts)
require('telescope').setup(opts)
require('telescope').load_extension 'fzf'
vim.api.nvim_create_autocmd('User', {
desc = 'Enable line number in Telescope previewers.',
group = vim.api.nvim_create_augroup('fschauen.telescope', { clear = true } ),
pattern = 'TelescopePreviewerLoaded',
command = 'setlocal number'
})
end
return M

View file

@ -1,23 +1,27 @@
return { local M = { 'folke/todo-comments.nvim' }
'folke/todo-comments.nvim',
dependencies = { M.dependencies = {
'nvim-lua/plenary.nvim' 'nvim-lua/plenary.nvim'
}, }
keys = require('fschauen.keymap').todo_comments,
event = { M.keys = require('fschauen.keymap').todo_comments
'BufReadPost',
'BufNewFile' M.event = {
}, 'BufReadPost',
opts = { 'BufNewFile'
keywords = { }
TODO = { icon = '󰄬 ' },
FIX = { icon = '' }, M.opts = {
HACK = { icon = '' }, keywords = {
WARN = { icon = '' }, TODO = { icon = '󰄬 ' },
PERF = { icon = '󰓅 ' }, FIX = { icon = '' },
NOTE = { icon = '' }, HACK = { icon = '' },
TEST = { icon = '󰙨 ' }, WARN = { icon = '' },
}, PERF = { icon = '󰓅 ' },
NOTE = { icon = '' },
TEST = { icon = '󰙨 ' },
}, },
} }
return M

View file

@ -1,100 +1,106 @@
return { local M = { 'nvim-treesitter/nvim-treesitter' }
'nvim-treesitter/nvim-treesitter',
dependencies = { M.dependencies = {
'nvim-treesitter/nvim-treesitter-refactor', 'nvim-treesitter/nvim-treesitter-refactor',
'nvim-treesitter/nvim-treesitter-textobjects', 'nvim-treesitter/nvim-treesitter-textobjects',
'nvim-treesitter/playground', 'nvim-treesitter/playground',
}
M.keys = require('fschauen.keymap').treesitter
M.event = {
'BufReadPost',
'BufNewFile'
}
M.cmd = {
'TSInstall',
'TSUninstall',
'TSUpdate',
'TSUpdateSync',
'TSInstallInfo',
'TSInstallSync',
'TSInstallFromGrammar',
}
M.main = 'nvim-treesitter.configs'
M.opts = {
ensure_installed = {
'bash',
'c',
'cpp',
'haskell',
'html',
'javascript',
'latex',
'lua',
'make',
'markdown',
'markdown_inline',
'python',
'query',
'toml',
'vim',
'vimdoc',
'yaml',
}, },
keys = require('fschauen.keymap').treesitter, highlight = {
event = { enable = true,
'BufReadPost', disable = {
'BufNewFile'
},
cmd = {
'TSInstall',
'TSUninstall',
'TSUpdate',
'TSUpdateSync',
'TSInstallInfo',
'TSInstallSync',
'TSInstallFromGrammar',
},
main = 'nvim-treesitter.configs',
opts = {
ensure_installed = {
'bash',
'c',
'cpp',
'haskell',
'html',
'javascript',
'latex',
'lua',
'make',
'markdown',
'markdown_inline',
'python',
'query',
'toml',
'vim',
'vimdoc', 'vimdoc',
'yaml',
}, },
highlight = { },
enable = true, incremental_selection = {
disable = { enable = true,
'vimdoc', keymaps = {
}, init_selection = 'gnn', -- mapped in normal mode
node_incremental = '<CR>', -- mapped in visual mode
node_decremental = '<BS>', -- mapped in visual mode
scope_incremental = nil, -- disabled, normally mapped in visual mode
}, },
incremental_selection = { },
refactor = {
highlight_definitions = { enable = true },
highlight_current_scope = { enable = false },
smart_rename = {
enable = true, enable = true,
keymaps = { keymaps = {
init_selection = 'gnn', -- mapped in normal mode smart_rename = 'grr',
node_incremental = '<CR>', -- mapped in visual mode
node_decremental = '<BS>', -- mapped in visual mode
scope_incremental = nil, -- disabled, normally mapped in visual mode
}, },
}, },
refactor = { navigation = {
highlight_definitions = { enable = true },
highlight_current_scope = { enable = false },
smart_rename = {
enable = true,
keymaps = {
smart_rename = 'grr',
},
},
navigation = {
enable = true,
keymaps = {
goto_definition = 'gd', -- default: 'gnd'
list_definitions = nil, -- disabled, default: 'gnD'
list_definitions_toc = 'gO',
goto_next_usage = '<a-*>',
goto_previous_usage = '<a-#>',
},
},
},
textobjects = {
select = {
enable = true,
keymaps = {
['ab'] = '@block.outer',
['ib'] = '@block.inner',
['ac'] = '@conditional.outer',
['ic'] = '@conditional.inner',
['af'] = '@function.outer',
['if'] = '@function.inner',
['al'] = '@loop.outer',
['il'] = '@loop.inner',
['aa'] = '@parameter.outer',
['ia'] = '@parameter.inner',
},
},
},
playground = {
enable = true, enable = true,
keymaps = {
goto_definition = 'gd', -- default: 'gnd'
list_definitions = nil, -- disabled, default: 'gnD'
list_definitions_toc = 'gO',
goto_next_usage = '<a-*>',
goto_previous_usage = '<a-#>',
},
}, },
}, },
textobjects = {
select = {
enable = true,
keymaps = {
['ab'] = '@block.outer',
['ib'] = '@block.inner',
['ac'] = '@conditional.outer',
['ic'] = '@conditional.inner',
['af'] = '@function.outer',
['if'] = '@function.inner',
['al'] = '@loop.outer',
['il'] = '@loop.inner',
['aa'] = '@parameter.outer',
['ia'] = '@parameter.inner',
},
},
},
playground = {
enable = true,
},
} }
return M

View file

@ -1,11 +1,15 @@
return { local M = { 'folke/trouble.nvim' }
'folke/trouble.nvim',
dependencies = { M.dependencies = {
'nvim-tree/nvim-web-devicons' 'nvim-tree/nvim-web-devicons'
},
keys = require('fschauen.keymap').trouble,
opts = {
padding = false, -- don't add an extra new line of top of the list
auto_preview = false, -- don't preview automatically
},
} }
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

View file

@ -1,15 +1,18 @@
return { local M = { 'mbbill/undotree' }
'mbbill/undotree',
init = function() M.init = function()
vim.g.undotree_WindowLayout = 2 -- tree: left, diff: bottom vim.g.undotree_WindowLayout = 2 -- tree: left, diff: bottom
vim.g.undotree_DiffAutoOpen = 0 -- don't open diff by default vim.g.undotree_DiffAutoOpen = 0 -- don't open diff by default
vim.g.undotree_SetFocusWhenToggle = 1 vim.g.undotree_SetFocusWhenToggle = 1
vim.g.undotree_TreeNodeShape = '' vim.g.undotree_TreeNodeShape = ''
vim.g.undotree_TreeVertShape = '' vim.g.undotree_TreeVertShape = ''
vim.g.undotree_TreeSplitShape = '' vim.g.undotree_TreeSplitShape = ''
vim.g.undotree_TreeReturnShape = '' vim.g.undotree_TreeReturnShape = ''
end, end
keys = require('fschauen.keymap').undotree,
config = false, M.keys = require('fschauen.keymap').undotree
}
M.config = false
return M

View file

@ -1,12 +1,15 @@
return { local M = { 'lukas-reineke/virt-column.nvim' }
'lukas-reineke/virt-column.nvim',
event = { M.event = {
'BufReadPost', 'BufReadPost',
'BufNewFile' 'BufNewFile'
},
keys = require('fschauen.keymap').virt_column,
opts = {
char = '',
},
} }
M.keys = require('fschauen.keymap').virt_column
M.opts = {
char = '',
}
return M

View file

@ -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,

View file

@ -1,19 +1,23 @@
return { local M = { 'ntpeters/vim-better-whitespace' }
'ntpeters/vim-better-whitespace',
init = function() M.init = function()
vim.g.better_whitespace_filetypes_blacklist = { vim.g.better_whitespace_filetypes_blacklist = {
'diff', 'diff',
'fugitive', 'fugitive',
'git', 'git',
'gitcommit', 'gitcommit',
'help', 'help',
} }
end, end
keys = require('fschauen.keymap').whitespace,
event = { M.keys = require('fschauen.keymap').whitespace
'BufReadPost',
'BufNewFile' M.event = {
}, 'BufReadPost',
config = false, 'BufNewFile'
} }
M.config = false
return M