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 = {
|
||||
'BufReadPost',
|
||||
'BufNewFile'
|
||||
},
|
||||
config = function()
|
||||
require('colorizer').setup(nil, {
|
||||
css = true,
|
||||
})
|
||||
end,
|
||||
local M = { 'norcalli/nvim-colorizer.lua' }
|
||||
|
||||
M.cond = vim.opt.termguicolors:get()
|
||||
|
||||
M.event = {
|
||||
'BufReadPost',
|
||||
'BufNewFile'
|
||||
}
|
||||
|
||||
M.config = function()
|
||||
require('colorizer').setup(nil, {
|
||||
css = true,
|
||||
})
|
||||
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 = {
|
||||
{ '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' },
|
||||
},
|
||||
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 = {
|
||||
'G',
|
||||
'Git',
|
||||
},
|
||||
keys = require('fschauen.keymap').fugitive
|
||||
local M = { 'tpope/vim-fugitive' }
|
||||
|
||||
M.cmd = {
|
||||
'G',
|
||||
'Git',
|
||||
}
|
||||
|
||||
M.keys = require('fschauen.keymap').fugitive
|
||||
|
||||
return M
|
||||
|
||||
|
|
|
@ -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 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 = {
|
||||
enabled = false,
|
||||
use_treesitter = true,
|
||||
show_first_indent_level = show_first_level,
|
||||
show_current_context = true,
|
||||
show_trailing_blankline_indent = false,
|
||||
char_list = chars,
|
||||
context_char_list = chars,
|
||||
indent_level = #chars + (not show_first_level and 1 or 0),
|
||||
},
|
||||
M.opts = {
|
||||
enabled = false,
|
||||
use_treesitter = true,
|
||||
show_first_indent_level = show_first_level,
|
||||
show_current_context = true,
|
||||
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
|
||||
|
|
|
@ -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,106 +1,107 @@
|
|||
local orange = '#d65d0e'
|
||||
local bright = '#ffffff' -- alternative: '#f9f5d7'
|
||||
|
||||
return {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
config = function()
|
||||
local window = require 'fschauen.window'
|
||||
local colored_if_focused = require('fschauen.lualine').colored_if_focused
|
||||
local M = { 'nvim-lualine/lualine.nvim' }
|
||||
|
||||
-- custom components
|
||||
local C = {
|
||||
diagnostics = {
|
||||
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,
|
||||
},
|
||||
}
|
||||
}
|
||||
M.config = function()
|
||||
local window = require 'fschauen.window'
|
||||
local colored_if_focused = require('fschauen.lualine').colored_if_focused
|
||||
|
||||
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',
|
||||
-- custom components
|
||||
local C = {
|
||||
diagnostics = {
|
||||
colored_if_focused('diagnostics'),
|
||||
},
|
||||
diff = {
|
||||
colored_if_focused('diff'),
|
||||
symbols = {
|
||||
added = '',
|
||||
modified = '',
|
||||
removed = '',
|
||||
},
|
||||
sections = sections,
|
||||
inactive_sections = sections,
|
||||
extensions = {
|
||||
'fugitive',
|
||||
'quickfix',
|
||||
'nvim-tree',
|
||||
'lazy',
|
||||
'man',
|
||||
'trouble',
|
||||
},
|
||||
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,
|
||||
},
|
||||
}
|
||||
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
|
||||
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
return {
|
||||
'iamcco/markdown-preview.nvim',
|
||||
build = 'cd app && npm install',
|
||||
init = function(_)
|
||||
vim.g.mkdp_theme = 'dark'
|
||||
end,
|
||||
event = {
|
||||
'FileType markdown',
|
||||
},
|
||||
local M = { 'iamcco/markdown-preview.nvim' }
|
||||
|
||||
M.build = 'cd app && npm install'
|
||||
|
||||
M.init = function(_)
|
||||
vim.g.mkdp_theme = 'dark'
|
||||
end
|
||||
|
||||
M.event = {
|
||||
'FileType markdown',
|
||||
}
|
||||
|
||||
return M
|
||||
|
||||
|
|
|
@ -1,18 +1,21 @@
|
|||
return {
|
||||
'NeogitOrg/neogit',
|
||||
keys = require('fschauen.keymap').neogit,
|
||||
opts = {
|
||||
disable_hint = true,
|
||||
signs = {
|
||||
section = { '', '' },
|
||||
item = { '', '' },
|
||||
hunk = { '', '' },
|
||||
},
|
||||
mappings = {
|
||||
status = {
|
||||
o = 'GoToFile',
|
||||
['<space>'] = 'Toggle',
|
||||
},
|
||||
local M = { 'NeogitOrg/neogit' }
|
||||
|
||||
M.keys = require('fschauen.keymap').neogit
|
||||
|
||||
M.opts = {
|
||||
disable_hint = true,
|
||||
signs = {
|
||||
section = { '', '' },
|
||||
item = { '', '' },
|
||||
hunk = { '', '' },
|
||||
},
|
||||
mappings = {
|
||||
status = {
|
||||
o = 'GoToFile',
|
||||
['<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,70 +1,73 @@
|
|||
return {
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
dependencies = {
|
||||
'nvim-tree/nvim-web-devicons'
|
||||
local M = { 'nvim-tree/nvim-tree.lua' }
|
||||
|
||||
M.dependencies = {
|
||||
'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,
|
||||
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
|
||||
},
|
||||
view = {
|
||||
adaptive_size = true, -- resize the window based on the longest line
|
||||
width = 35, -- a little wider than the default 30
|
||||
},
|
||||
filters = {
|
||||
dotfiles = false, -- show files starting with a .
|
||||
custom = { '^\\.git' }, -- don't show .git directory
|
||||
},
|
||||
renderer = {
|
||||
add_trailing = true, -- add trailing / to folders
|
||||
highlight_git = true, -- enable highlight based on git attributes
|
||||
icons = {
|
||||
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 = '◌',
|
||||
},
|
||||
view = {
|
||||
adaptive_size = true, -- resize the window based on the longest line
|
||||
width = 35, -- a little wider than the default 30
|
||||
},
|
||||
filters = {
|
||||
dotfiles = false, -- show files starting with a .
|
||||
custom = { '^\\.git' }, -- don't show .git directory
|
||||
},
|
||||
renderer = {
|
||||
add_trailing = true, -- add trailing / to folders
|
||||
highlight_git = true, -- enable highlight based on git attributes
|
||||
icons = {
|
||||
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
|
||||
|
||||
|
|
|
@ -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 ={
|
||||
'AddTabularPattern',
|
||||
'AddTabularPipeline',
|
||||
'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,
|
||||
local M = { 'godlygeek/tabular' }
|
||||
|
||||
M.cmd ={
|
||||
'AddTabularPattern',
|
||||
'AddTabularPipeline',
|
||||
'Tabularize',
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
|
|
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,100 +1,93 @@
|
|||
return {
|
||||
{
|
||||
'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 M = { 'nvim-telescope/telescope.nvim' }
|
||||
|
||||
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,
|
||||
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.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',
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
|
|
|
@ -1,23 +1,27 @@
|
|||
return {
|
||||
'folke/todo-comments.nvim',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim'
|
||||
},
|
||||
keys = require('fschauen.keymap').todo_comments,
|
||||
event = {
|
||||
'BufReadPost',
|
||||
'BufNewFile'
|
||||
},
|
||||
opts = {
|
||||
keywords = {
|
||||
TODO = { icon = ' ' },
|
||||
FIX = { icon = ' ' },
|
||||
HACK = { icon = ' ' },
|
||||
WARN = { icon = ' ' },
|
||||
PERF = { icon = ' ' },
|
||||
NOTE = { icon = '' },
|
||||
TEST = { icon = ' ' },
|
||||
},
|
||||
local M = { 'folke/todo-comments.nvim' }
|
||||
|
||||
M.dependencies = {
|
||||
'nvim-lua/plenary.nvim'
|
||||
}
|
||||
|
||||
M.keys = require('fschauen.keymap').todo_comments
|
||||
|
||||
M.event = {
|
||||
'BufReadPost',
|
||||
'BufNewFile'
|
||||
}
|
||||
|
||||
M.opts = {
|
||||
keywords = {
|
||||
TODO = { icon = ' ' },
|
||||
FIX = { icon = ' ' },
|
||||
HACK = { icon = ' ' },
|
||||
WARN = { icon = ' ' },
|
||||
PERF = { icon = ' ' },
|
||||
NOTE = { icon = '' },
|
||||
TEST = { icon = ' ' },
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
|
||||
|
|
|
@ -1,100 +1,106 @@
|
|||
return {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter-refactor',
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
'nvim-treesitter/playground',
|
||||
local M = { 'nvim-treesitter/nvim-treesitter' }
|
||||
|
||||
M.dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter-refactor',
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
'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,
|
||||
event = {
|
||||
'BufReadPost',
|
||||
'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',
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = {
|
||||
'vimdoc',
|
||||
'yaml',
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = {
|
||||
'vimdoc',
|
||||
},
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
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,
|
||||
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
|
||||
smart_rename = 'grr',
|
||||
},
|
||||
},
|
||||
refactor = {
|
||||
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 = {
|
||||
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,
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
return {
|
||||
'folke/trouble.nvim',
|
||||
dependencies = {
|
||||
'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
|
||||
},
|
||||
local M = { 'folke/trouble.nvim' }
|
||||
|
||||
M.dependencies = {
|
||||
'nvim-tree/nvim-web-devicons'
|
||||
}
|
||||
|
||||
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,15 +1,18 @@
|
|||
return {
|
||||
'mbbill/undotree',
|
||||
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
|
||||
vim.g.undotree_TreeNodeShape = ''
|
||||
vim.g.undotree_TreeVertShape = '│'
|
||||
vim.g.undotree_TreeSplitShape = '╱'
|
||||
vim.g.undotree_TreeReturnShape = '╲'
|
||||
end,
|
||||
keys = require('fschauen.keymap').undotree,
|
||||
config = false,
|
||||
}
|
||||
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
|
||||
vim.g.undotree_TreeNodeShape = ''
|
||||
vim.g.undotree_TreeVertShape = '│'
|
||||
vim.g.undotree_TreeSplitShape = '╱'
|
||||
vim.g.undotree_TreeReturnShape = '╲'
|
||||
end
|
||||
|
||||
M.keys = require('fschauen.keymap').undotree
|
||||
|
||||
M.config = false
|
||||
|
||||
return M
|
||||
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
return {
|
||||
'lukas-reineke/virt-column.nvim',
|
||||
event = {
|
||||
'BufReadPost',
|
||||
'BufNewFile'
|
||||
},
|
||||
keys = require('fschauen.keymap').virt_column,
|
||||
opts = {
|
||||
char = '│',
|
||||
},
|
||||
local M = { 'lukas-reineke/virt-column.nvim' }
|
||||
|
||||
M.event = {
|
||||
'BufReadPost',
|
||||
'BufNewFile'
|
||||
}
|
||||
|
||||
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,19 +1,23 @@
|
|||
return {
|
||||
'ntpeters/vim-better-whitespace',
|
||||
init = function()
|
||||
vim.g.better_whitespace_filetypes_blacklist = {
|
||||
'diff',
|
||||
'fugitive',
|
||||
'git',
|
||||
'gitcommit',
|
||||
'help',
|
||||
}
|
||||
end,
|
||||
keys = require('fschauen.keymap').whitespace,
|
||||
event = {
|
||||
'BufReadPost',
|
||||
'BufNewFile'
|
||||
},
|
||||
config = false,
|
||||
local M = { 'ntpeters/vim-better-whitespace' }
|
||||
|
||||
M.init = function()
|
||||
vim.g.better_whitespace_filetypes_blacklist = {
|
||||
'diff',
|
||||
'fugitive',
|
||||
'git',
|
||||
'gitcommit',
|
||||
'help',
|
||||
}
|
||||
end
|
||||
|
||||
M.keys = require('fschauen.keymap').whitespace
|
||||
|
||||
M.event = {
|
||||
'BufReadPost',
|
||||
'BufNewFile'
|
||||
}
|
||||
|
||||
M.config = false
|
||||
|
||||
return M
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue