vim: lazy load as many plugins as possible
This commit is contained in:
parent
f495dd984c
commit
dc5f34260e
18 changed files with 305 additions and 290 deletions
|
@ -10,3 +10,5 @@ require 'fschauen.filetypes'
|
|||
require 'fschauen.diagnostics'
|
||||
require 'fschauen.lazy'
|
||||
|
||||
vim.cmd [[colorscheme gruvbox]]
|
||||
|
||||
|
|
|
@ -3,6 +3,8 @@ return {
|
|||
|
||||
cond = vim.opt.termguicolors:get(),
|
||||
|
||||
event = { 'BufReadPost', 'BufNewFile' },
|
||||
|
||||
config = function()
|
||||
require('colorizer').setup(nil, {
|
||||
mode = 'foreground',
|
||||
|
|
|
@ -1,14 +1,5 @@
|
|||
return {
|
||||
{
|
||||
'fschauen/solarized.nvim',
|
||||
dev = true,
|
||||
},
|
||||
{
|
||||
'fschauen/gruvbox.nvim',
|
||||
dev = true,
|
||||
config = function ()
|
||||
vim.cmd [[colorscheme gruvbox]]
|
||||
end,
|
||||
},
|
||||
{ 'fschauen/solarized.nvim', dev = true, lazy =true },
|
||||
{ 'fschauen/gruvbox.nvim', dev = true, lazy = true },
|
||||
}
|
||||
|
||||
|
|
|
@ -1,39 +1,38 @@
|
|||
return {
|
||||
'numToStr/Comment.nvim',
|
||||
|
||||
config = function()
|
||||
require('Comment').setup {
|
||||
padding = true, -- Add a space between comment and the line
|
||||
sticky = true, -- Whether the cursor should stay at its position
|
||||
ignore = nil, -- Lines to be ignored while (un)comment
|
||||
lazy = false, -- recommended in the README
|
||||
|
||||
-- NORMAL mode mappings
|
||||
toggler = {
|
||||
line = 'gcc', -- Line-comment toggle keymap
|
||||
block = 'gbc', -- Block-comment toggle keymap
|
||||
},
|
||||
opts = {
|
||||
padding = true, -- Add a space between comment and the line
|
||||
sticky = true, -- Whether the cursor should stay at its position
|
||||
ignore = nil, -- Lines to be ignored while (un)comment
|
||||
|
||||
-- NORMAL and VISUAL mode mappings
|
||||
opleader = {
|
||||
line = 'gc', -- Line-comment keymap
|
||||
block = 'gb', -- Block-comment keymap
|
||||
},
|
||||
-- NORMAL mode mappings
|
||||
toggler = {
|
||||
line = 'gcc', -- Line-comment toggle keymap
|
||||
block = 'gbc', -- Block-comment toggle keymap
|
||||
},
|
||||
|
||||
extra = {
|
||||
above = 'gcO', -- Add comment on the line above
|
||||
below = 'gco', -- Add comment on the line below
|
||||
eol = 'gcA', -- Add comment at the end of line
|
||||
},
|
||||
-- NORMAL and VISUAL mode mappings
|
||||
opleader = {
|
||||
line = 'gc', -- Line-comment keymap
|
||||
block = 'gb', -- Block-comment keymap
|
||||
},
|
||||
|
||||
-- Enable keybindings
|
||||
mappings = {
|
||||
basic = true, -- Operator-pending mapping; `gcc` `gbc` `gc[count]{motion}` `gb[count]{motion}`
|
||||
extra = true, -- Extra mapping; `gco`, `gcO`, `gcA`
|
||||
},
|
||||
extra = {
|
||||
above = 'gcO', -- Add comment on the line above
|
||||
below = 'gco', -- Add comment on the line below
|
||||
eol = 'gcA', -- Add comment at the end of line
|
||||
},
|
||||
|
||||
pre_hook = nil, -- Function to call before (un)comment
|
||||
post_hook = nil, -- Function to call after (un)comment
|
||||
}
|
||||
end
|
||||
-- Enable keybindings
|
||||
mappings = {
|
||||
basic = true, -- Operator-pending mapping; `gcc` `gbc` `gc[count]{motion}` `gb[count]{motion}`
|
||||
extra = true, -- Extra mapping; `gco`, `gcO`, `gcA`
|
||||
},
|
||||
|
||||
pre_hook = nil, -- Function to call before (un)comment
|
||||
post_hook = nil, -- Function to call after (un)comment
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
return {
|
||||
'tpope/vim-fugitive',
|
||||
|
||||
config = function()
|
||||
vim.keymap.set('n', '<leader>gg', ':Git ')
|
||||
vim.keymap.set('n', '<leader>gs', '<cmd>tab Git<cr>')
|
||||
vim.keymap.set('n', '<leader>gb', '<cmd>Git blame<cr>')
|
||||
end,
|
||||
keys = {
|
||||
{ '<leader>gg', ':Git ' },
|
||||
{ '<leader>gs', '<cmd>tab Git<cr>' },
|
||||
{ '<leader>gb', '<cmd>Git blame<cr>' }
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
return {
|
||||
'lukas-reineke/indent-blankline.nvim',
|
||||
|
||||
lazy = false, -- trows an error when lazy loading
|
||||
|
||||
config = function()
|
||||
require('indent_blankline').setup {
|
||||
enabled = false,
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
return {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'milisims/nvim-luaref',
|
||||
'keith/swift.vim',
|
||||
'chr4/nginx.vim',
|
||||
}
|
||||
|
||||
|
|
|
@ -1,23 +1,22 @@
|
|||
return {
|
||||
'NeogitOrg/neogit',
|
||||
|
||||
config = function()
|
||||
require('neogit').setup {
|
||||
disable_hint = true,
|
||||
signs = {
|
||||
section = { '', ''},
|
||||
item = { '', ''},
|
||||
hunk = { '', ''},
|
||||
opts = {
|
||||
disable_hint = true,
|
||||
signs = {
|
||||
section = { '', '' },
|
||||
item = { '', '' },
|
||||
hunk = { '', '' },
|
||||
},
|
||||
mappings = {
|
||||
status = {
|
||||
o = 'GoToFile',
|
||||
['<space>'] = 'Toggle',
|
||||
},
|
||||
mappings = {
|
||||
status = {
|
||||
o = 'GoToFile',
|
||||
['<space>'] = 'Toggle',
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
vim.keymap.set('n', '<leader>gn', '<cmd>Neogit<cr>')
|
||||
end,
|
||||
keys = {
|
||||
{ '<leader>gn', '<cmd>Neogit<cr>' },
|
||||
},
|
||||
}
|
||||
|
||||
|
|
5
config/nvim/lua/fschauen/plugins/nginx.lua
Normal file
5
config/nvim/lua/fschauen/plugins/nginx.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
'chr4/nginx.vim',
|
||||
|
||||
ft = 'nginx',
|
||||
}
|
|
@ -1,5 +1,9 @@
|
|||
local config = function()
|
||||
require('nvim-tree').setup {
|
||||
return {
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
|
||||
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
|
||||
|
@ -37,16 +41,12 @@ local config = function()
|
|||
group_empty = true, -- folders that contain only one folder are grouped
|
||||
highlight_git = true, -- enable highlight based on git attributes
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
vim.keymap.set('n', '<leader>nn', '<cmd>NvimTreeOpen<cr>')
|
||||
vim.keymap.set('n', '<leader>nf', '<cmd>NvimTreeFindFile<cr>')
|
||||
vim.keymap.set('n', '<leader>nc', '<cmd>NvimTreeClose<cr>')
|
||||
end
|
||||
|
||||
return {
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
config = config,
|
||||
keys = {
|
||||
{ '<leader>nn', '<cmd>NvimTreeOpen<cr>' },
|
||||
{ '<leader>nf', '<cmd>NvimTreeFindFile<cr>' },
|
||||
{ '<leader>nc', '<cmd>NvimTreeClose<cr>' },
|
||||
},
|
||||
}
|
||||
|
||||
|
|
6
config/nvim/lua/fschauen/plugins/swift.lua
Normal file
6
config/nvim/lua/fschauen/plugins/swift.lua
Normal file
|
@ -0,0 +1,6 @@
|
|||
return {
|
||||
'keith/swift.vim',
|
||||
|
||||
ft = 'swift',
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
T = {
|
||||
return {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
|
||||
dependencies = {
|
||||
|
@ -11,180 +11,176 @@ T = {
|
|||
},
|
||||
},
|
||||
|
||||
trigger = '<leader>f', -- my addition, not used by lazy.nvim
|
||||
}
|
||||
config = function()
|
||||
local telescope = require 'telescope'
|
||||
local actions = require 'telescope.actions'
|
||||
local actions_layout = require 'telescope.actions.layout'
|
||||
|
||||
T.config = function()
|
||||
local telescope = require 'telescope'
|
||||
local actions = require 'telescope.actions'
|
||||
local actions_layout = require 'telescope.actions.layout'
|
||||
local mappings = {
|
||||
['<c-y>'] = actions_layout.cycle_layout_next,
|
||||
['<c-o>'] = actions_layout.toggle_mirror,
|
||||
['<c-q>'] = actions.smart_send_to_qflist + actions.open_qflist,
|
||||
['<c-l>'] = actions.smart_send_to_loclist + actions.open_loclist,
|
||||
['<c-c>'] = actions.close,
|
||||
|
||||
local mappings = {
|
||||
['<c-y>'] = actions_layout.cycle_layout_next,
|
||||
['<c-o>'] = actions_layout.toggle_mirror,
|
||||
['<c-q>'] = actions.smart_send_to_qflist + actions.open_qflist,
|
||||
['<c-l>'] = actions.smart_send_to_loclist + actions.open_loclist,
|
||||
['<c-c>'] = actions.close,
|
||||
['<s-down>'] = actions.preview_scrolling_down,
|
||||
['<s-up>'] = actions.preview_scrolling_up,
|
||||
|
||||
['<s-down>'] = actions.preview_scrolling_down,
|
||||
['<s-up>'] = actions.preview_scrolling_up,
|
||||
['<c-j>'] = actions.cycle_history_next,
|
||||
['<c-k>'] = actions.cycle_history_prev,
|
||||
}
|
||||
|
||||
['<c-j>'] = actions.cycle_history_next,
|
||||
['<c-k>'] = actions.cycle_history_prev,
|
||||
}
|
||||
local trouble = vim.F.npcall(require, 'trouble.providers.telescope')
|
||||
if trouble then
|
||||
mappings['<c-b>'] = trouble.open_with_trouble
|
||||
end
|
||||
|
||||
local trouble = vim.F.npcall(require, 'trouble.providers.telescope')
|
||||
if trouble then
|
||||
mappings['<c-b>'] = trouble.open_with_trouble
|
||||
end
|
||||
telescope.setup {
|
||||
defaults = {
|
||||
-- ╭────────╮
|
||||
-- │ Keymap │
|
||||
-- ╰────────╯
|
||||
mappings = { i = mappings, n = mappings },
|
||||
|
||||
telescope.setup {
|
||||
defaults = {
|
||||
-- ╭────────╮
|
||||
-- │ Keymap │
|
||||
-- ╰────────╯
|
||||
mappings = { i = mappings, n = mappings },
|
||||
-- ╭────────╮
|
||||
-- │ Prompt │
|
||||
-- ╰────────╯
|
||||
prompt_prefix = ' ❯ ',
|
||||
selection_caret = ' ', -- Other ideas: ➔
|
||||
|
||||
-- ╭────────╮
|
||||
-- │ Prompt │
|
||||
-- ╰────────╯
|
||||
prompt_prefix = ' ❯ ',
|
||||
selection_caret = ' ', -- Other ideas: ➔
|
||||
-- ╭─────────╮
|
||||
-- │ Results │
|
||||
-- ╰─────────╯
|
||||
multi_icon = ' ',
|
||||
scroll_strategy = 'limit', -- Don't wrap around in results.
|
||||
|
||||
-- ╭─────────╮
|
||||
-- │ Results │
|
||||
-- ╰─────────╯
|
||||
multi_icon = ' ',
|
||||
scroll_strategy = 'limit', -- Don't wrap around in results.
|
||||
-- ╭─────────╮
|
||||
-- │ Preview │
|
||||
-- ╰─────────╯
|
||||
dynamic_preview_title = true,
|
||||
|
||||
-- ╭─────────╮
|
||||
-- │ Preview │
|
||||
-- ╰─────────╯
|
||||
dynamic_preview_title = true,
|
||||
|
||||
-- ╭────────╮
|
||||
-- │ Layout │
|
||||
-- ╰────────╯
|
||||
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 },
|
||||
-- ╭────────╮
|
||||
-- │ Layout │
|
||||
-- ╰────────╯
|
||||
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' },
|
||||
},
|
||||
cycle_layout_list = { 'horizontal', 'vertical' },
|
||||
},
|
||||
|
||||
extensions = {
|
||||
file_browser = { theme = 'ivy' },
|
||||
},
|
||||
}
|
||||
extensions = {
|
||||
file_browser = { theme = 'ivy' },
|
||||
},
|
||||
}
|
||||
|
||||
local themes = require 'telescope.themes'
|
||||
local ts = require 'telescope.builtin'
|
||||
local my = {
|
||||
all_files = function(opts)
|
||||
ts.find_files(vim.tbl_extend('keep', opts or {}, {
|
||||
hidden = true,
|
||||
no_ignore = true,
|
||||
no_ignore_parent = true,
|
||||
}))
|
||||
end,
|
||||
colorschemes = function(opts)
|
||||
ts.colorscheme(themes.get_dropdown(vim.tbl_extend('keep', opts or {}, {
|
||||
enable_preview = true,
|
||||
})))
|
||||
end,
|
||||
diagnostics = function(opts)
|
||||
ts.diagnostics(vim.tbl_extend('keep', opts or {}, { bufnr = 0 }))
|
||||
end,
|
||||
dotfiles = function(opts)
|
||||
ts.find_files(vim.tbl_extend('keep', opts or {}, {
|
||||
cwd = '~/.dotfiles',
|
||||
hidden = true,
|
||||
}))
|
||||
end,
|
||||
selection = function(_)
|
||||
local selected = require('fschauen.util').get_selected_text()
|
||||
ts.grep_string {
|
||||
prompt_title = string.format(' Grep: %s ', selected),
|
||||
search = selected,
|
||||
}
|
||||
end,
|
||||
spell_suggest = function(opts)
|
||||
ts.spell_suggest(themes.get_cursor(opts))
|
||||
end,
|
||||
here = function(opts)
|
||||
ts.current_buffer_fuzzy_find(opts)
|
||||
end,
|
||||
}
|
||||
local themes = require 'telescope.themes'
|
||||
local ts = require 'telescope.builtin'
|
||||
local my = {
|
||||
all_files = function(opts)
|
||||
ts.find_files(vim.tbl_extend('keep', opts or {}, {
|
||||
hidden = true,
|
||||
no_ignore = true,
|
||||
no_ignore_parent = true,
|
||||
}))
|
||||
end,
|
||||
colorschemes = function(opts)
|
||||
ts.colorscheme(themes.get_dropdown(vim.tbl_extend('keep', opts or {}, {
|
||||
enable_preview = true,
|
||||
})))
|
||||
end,
|
||||
diagnostics = function(opts)
|
||||
ts.diagnostics(vim.tbl_extend('keep', opts or {}, { bufnr = 0 }))
|
||||
end,
|
||||
dotfiles = function(opts)
|
||||
ts.find_files(vim.tbl_extend('keep', opts or {}, {
|
||||
cwd = '~/.dotfiles',
|
||||
hidden = true,
|
||||
}))
|
||||
end,
|
||||
selection = function(_)
|
||||
local selected = require('fschauen.util').get_selected_text()
|
||||
ts.grep_string {
|
||||
prompt_title = string.format(' Grep: %s ', selected),
|
||||
search = selected,
|
||||
}
|
||||
end,
|
||||
spell_suggest = function(opts)
|
||||
ts.spell_suggest(themes.get_cursor(opts))
|
||||
end,
|
||||
here = function(opts)
|
||||
ts.current_buffer_fuzzy_find(opts)
|
||||
end,
|
||||
}
|
||||
|
||||
local map = function(keymap)
|
||||
for mode, list in pairs(keymap) do
|
||||
for _, row in ipairs(list) do
|
||||
local lhs, picker, title, desc = row[1], row[2], row[3], row[4]
|
||||
local rhs = function() picker { prompt_title = ' ' .. title .. ' ' } end
|
||||
vim.keymap.set(mode, T.trigger .. lhs, rhs, { desc = ' ' .. desc })
|
||||
local map = function(keymap)
|
||||
for mode, list in pairs(keymap) do
|
||||
for _, row in ipairs(list) do
|
||||
local lhs, picker, title, desc = row[1], row[2], row[3], row[4]
|
||||
local rhs = function() picker { prompt_title = ' ' .. title .. ' ' } end
|
||||
vim.keymap.set(mode, '<leader>f' .. lhs, rhs, { desc = ' ' .. desc })
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
map {
|
||||
-- ╭────╮ ╭──────╮ ╭────────────╮ ╭───────────────────╮
|
||||
-- │keys│ │picker│ │prompt title│ │mapping description│
|
||||
-- ╰────╯ ╰──────╯ ╰────────────╯ ╰───────────────────╯
|
||||
n = {
|
||||
{ 'a', ts.autocommands , ' Autocommands' , '[a]utocommands' },
|
||||
{ 'b', ts.buffers , ' Buffers' , '[b]uffers' },
|
||||
{ 'c', my.colorschemes , ' Colorschemes' , '[c]olorschemes' },
|
||||
{ 'dd', my.diagnostics , ' Document Diagnostics' , '[d]iagnostics [d]ocument' },
|
||||
{ 'dw', ts.diagnostics , ' Workspace Diagnostics', '[d]iagnostics [w]orkspace' },
|
||||
-- e
|
||||
{ 'f', ts.find_files , ' Files' , '[f]ind files' },
|
||||
{ 'F', my.all_files , ' ALL files' , 'all [F]iles' },
|
||||
{ 'gr', ts.live_grep , ' Live grep' , 'Live [gr]ep' },
|
||||
{ 'gf', ts.git_files , ' Git files' , '[g]it [f]iles' },
|
||||
{ 'gc', ts.git_commits , ' Commits' , '[g]it [c]ommits' },
|
||||
{ 'h', my.here , ' Current buffer' , '[b]uffer [h]ere' },
|
||||
{ 'H', ts.highlights , ' Highlights' , '[H]ighlights' },
|
||||
-- i
|
||||
{ 'j', ts.jumplist , ' Jumplist' , '[j]umplist' },
|
||||
{ 'k', ts.keymaps , ' Keymaps' , '[k]eymaps' },
|
||||
{ 'K', ts.help_tags , ' Help tags' , '[K] help/documentation' },
|
||||
{ 'l', ts.loclist , ' Location list' , '[l]ocation List' },
|
||||
{ 'm', ts.man_pages , ' Man pages' , '[m]an pages' },
|
||||
-- n
|
||||
{ 'o', ts.vim_options , ' Vim options' , 'vim [o]ptions' },
|
||||
-- p
|
||||
{ 'q', ts.quickfix , ' Quickfix' , '[q]uickfix' },
|
||||
{ 'r', ts.lsp_references , ' References' , '[r]eferences' },
|
||||
{ 'R', ts.registers , ' Registers' , '[R]registers' },
|
||||
{ 's', ts.lsp_document_symbols , ' Document Symbols ' , 'lsp document [s]ymbols' },
|
||||
{ 'S', ts.lsp_workspace_symbols , ' Workspace Symbols ' , 'lsp workspace [S]ymbols' },
|
||||
--'t' used in todo-comments
|
||||
{ 'T', ts.treesitter , ' Treesitter symbols' , '[T]reesitter Symbols' },
|
||||
-- u
|
||||
-- v
|
||||
{ 'w', my.selection , '' --[[dynamic]] , '[w]word under cursor' },
|
||||
-- x
|
||||
-- y
|
||||
{ 'z', my.spell_suggest , ' Spelling suggestions' , '[z] spell suggestions' },
|
||||
{ '.', my.dotfiles , ' Dotfiles' , '[.]dotfiles' },
|
||||
{ ':', ts.command_history , ' Command history' , '[:]command history' },
|
||||
{ '?', ts.commands , ' Commands' , 'commands [?]' },
|
||||
{ '/', ts.search_history , ' Search history' , '[/]search history' },
|
||||
{'<leader>', ts.resume , ' Resume' , 'Resume' },
|
||||
},
|
||||
v = {
|
||||
{ 's', my.selection , '' --[[dynamic]] , 'visual [s]election' },
|
||||
map {
|
||||
-- ╭────╮ ╭──────╮ ╭────────────╮ ╭───────────────────╮
|
||||
-- │keys│ │picker│ │prompt title│ │mapping description│
|
||||
-- ╰────╯ ╰──────╯ ╰────────────╯ ╰───────────────────╯
|
||||
n = {
|
||||
{ 'a', ts.autocommands , ' Autocommands' , '[a]utocommands' },
|
||||
{ 'b', ts.buffers , ' Buffers' , '[b]uffers' },
|
||||
{ 'c', my.colorschemes , ' Colorschemes' , '[c]olorschemes' },
|
||||
{ 'dd', my.diagnostics , ' Document Diagnostics' , '[d]iagnostics [d]ocument' },
|
||||
{ 'dw', ts.diagnostics , ' Workspace Diagnostics', '[d]iagnostics [w]orkspace' },
|
||||
-- e
|
||||
{ 'f', ts.find_files , ' Files' , '[f]ind files' },
|
||||
{ 'F', my.all_files , ' ALL files' , 'all [F]iles' },
|
||||
{ 'gr', ts.live_grep , ' Live grep' , 'Live [gr]ep' },
|
||||
{ 'gf', ts.git_files , ' Git files' , '[g]it [f]iles' },
|
||||
{ 'gc', ts.git_commits , ' Commits' , '[g]it [c]ommits' },
|
||||
{ 'h', my.here , ' Current buffer' , '[b]uffer [h]ere' },
|
||||
{ 'H', ts.highlights , ' Highlights' , '[H]ighlights' },
|
||||
-- i
|
||||
{ 'j', ts.jumplist , ' Jumplist' , '[j]umplist' },
|
||||
{ 'k', ts.keymaps , ' Keymaps' , '[k]eymaps' },
|
||||
{ 'K', ts.help_tags , ' Help tags' , '[K] help/documentation' },
|
||||
{ 'l', ts.loclist , ' Location list' , '[l]ocation List' },
|
||||
{ 'm', ts.man_pages , ' Man pages' , '[m]an pages' },
|
||||
-- n
|
||||
{ 'o', ts.vim_options , ' Vim options' , 'vim [o]ptions' },
|
||||
-- p
|
||||
{ 'q', ts.quickfix , ' Quickfix' , '[q]uickfix' },
|
||||
{ 'r', ts.lsp_references , ' References' , '[r]eferences' },
|
||||
{ 'R', ts.registers , ' Registers' , '[R]registers' },
|
||||
{ 's', ts.lsp_document_symbols , ' Document Symbols ' , 'lsp document [s]ymbols' },
|
||||
{ 'S', ts.lsp_workspace_symbols , ' Workspace Symbols ' , 'lsp workspace [S]ymbols' },
|
||||
--'t' used in todo-comments
|
||||
{ 'T', ts.treesitter , ' Treesitter symbols' , '[T]reesitter Symbols' },
|
||||
-- u
|
||||
-- v
|
||||
{ 'w', my.selection , '' --[[dynamic]] , '[w]word under cursor' },
|
||||
-- x
|
||||
-- y
|
||||
{ 'z', my.spell_suggest , ' Spelling suggestions' , '[z] spell suggestions' },
|
||||
{ '.', my.dotfiles , ' Dotfiles' , '[.]dotfiles' },
|
||||
{ ':', ts.command_history , ' Command history' , '[:]command history' },
|
||||
{ '?', ts.commands , ' Commands' , 'commands [?]' },
|
||||
{ '/', ts.search_history , ' Search history' , '[/]search history' },
|
||||
{'<leader>', ts.resume , ' Resume' , 'Resume' },
|
||||
},
|
||||
v = {
|
||||
{ 's', my.selection , '' --[[dynamic]] , 'visual [s]election' },
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
telescope.load_extension 'fzf'
|
||||
telescope.load_extension 'file_browser'
|
||||
vim.keymap.set('n', '<leader>fB', '<cmd>Telescope file_browser<cr>', { desc = ' [f]ile [B]rowser' })
|
||||
end
|
||||
|
||||
return T
|
||||
telescope.load_extension 'fzf'
|
||||
telescope.load_extension 'file_browser'
|
||||
vim.keymap.set('n', '<leader>fB', '<cmd>Telescope file_browser<cr>', { desc = ' [f]ile [B]rowser' })
|
||||
end,
|
||||
}
|
||||
|
||||
|
|
|
@ -1,13 +1,19 @@
|
|||
local telescope = vim.F.npcall(require, 'fschauen.plugins.telescope')
|
||||
local trigger = telescope and telescope.trigger or '<leader>f'
|
||||
|
||||
return {
|
||||
'folke/todo-comments.nvim',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim'
|
||||
},
|
||||
|
||||
config = true,
|
||||
event = { 'BufReadPost', 'BufNewFile' },
|
||||
|
||||
event = {
|
||||
'BufReadPost',
|
||||
'BufNewFile'
|
||||
},
|
||||
|
||||
keys = {
|
||||
{ trigger .. 't', '<cmd>TodoTelescope<cr>' },
|
||||
{ '<leader>ft', '<cmd>TodoTelescope<cr>' },
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,15 @@
|
|||
local config = function()
|
||||
require('nvim-treesitter.configs').setup {
|
||||
return {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter-refactor',
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
'nvim-treesitter/playground',
|
||||
},
|
||||
|
||||
main = 'nvim-treesitter.configs',
|
||||
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
'bash',
|
||||
'c',
|
||||
|
@ -81,21 +91,14 @@ local config = function()
|
|||
playground = {
|
||||
enable = true,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
vim.keymap.set('n', '<leader>tp', '<cmd>TSPlaygroundToggle<cr>')
|
||||
vim.keymap.set('n', '<leader>th', '<cmd>TSHighlightCapturesUnderCursor<cr>')
|
||||
vim.keymap.set('n', '<leader>tn', '<cmd>TSNodeUnderCursor<cr>')
|
||||
end
|
||||
event = { 'BufReadPost', 'BufNewFile' },
|
||||
|
||||
return {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
|
||||
config = config,
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter-refactor',
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
'nvim-treesitter/playground',
|
||||
keys = {
|
||||
{ '<leader>tp', '<cmd>TSPlaygroundToggle<cr>' },
|
||||
{ '<leader>th', '<cmd>TSHighlightCapturesUnderCursor<cr>' },
|
||||
{ '<leader>tn', '<cmd>TSNodeUnderCursor<cr>' },
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -3,17 +3,15 @@ return {
|
|||
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
|
||||
config = function()
|
||||
local trouble = require('trouble')
|
||||
opts = {
|
||||
padding = false, -- don't add an extra new line of top of the list
|
||||
auto_preview = false, -- don't preview automatically
|
||||
},
|
||||
|
||||
trouble.setup {
|
||||
padding = false, -- don't add an extra new line of top of the list
|
||||
auto_preview = false, -- don't preview automatically
|
||||
}
|
||||
|
||||
vim.keymap.set('n', '<leader>lt', '<cmd>TroubleToggle<cr>')
|
||||
vim.keymap.set('n', '<leader>lw', '<cmd>TroubleToggle workspace_diagnostics<cr>')
|
||||
vim.keymap.set('n', '<leader>ld', '<cmd>TroubleToggle document_diagnostics<cr>')
|
||||
end
|
||||
keys = {
|
||||
{ '<leader>lt', '<cmd>TroubleToggle<cr>' },
|
||||
{ '<leader>lw', '<cmd>TroubleToggle workspace_diagnostics<cr>' },
|
||||
{ '<leader>ld', '<cmd>TroubleToggle document_diagnostics<cr>' },
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -13,8 +13,10 @@ return {
|
|||
vim.g.undotree_TreeReturnShape = '╲'
|
||||
end,
|
||||
|
||||
config = function()
|
||||
vim.keymap.set('n', '<leader>u', '<cmd>UndotreeToggle<cr>')
|
||||
end
|
||||
config = false,
|
||||
|
||||
keys = {
|
||||
{ '<leader>u', '<cmd>UndotreeToggle<cr>' },
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -11,11 +11,13 @@ return {
|
|||
}
|
||||
end,
|
||||
|
||||
config = function()
|
||||
vim.keymap.set('n', '<leader>ww', '<cmd>ToggleWhitespace<cr>')
|
||||
vim.keymap.set('n', '<leader>wj', '<cmd>NextTrailingWhitespace<cr>')
|
||||
vim.keymap.set('n', '<leader>wk', '<cmd>PrevTrailingWhitespace<cr>')
|
||||
vim.keymap.set('n', '<leader>wd', '<cmd>StripWhitespace<cr>')
|
||||
end,
|
||||
config = false,
|
||||
|
||||
keys ={
|
||||
{ '<leader>ww', '<cmd>ToggleWhitespace<cr>' },
|
||||
{ '<leader>wj', '<cmd>NextTrailingWhitespace<cr>' },
|
||||
{ '<leader>wk', '<cmd>PrevTrailingWhitespace<cr>' },
|
||||
{ '<leader>wd', '<cmd>StripWhitespace<cr>' },
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -1,20 +1,24 @@
|
|||
return {
|
||||
'lukas-reineke/virt-column.nvim',
|
||||
|
||||
config = function()
|
||||
require('virt-column').setup {
|
||||
char = '│',
|
||||
}
|
||||
opts = {
|
||||
char = '│',
|
||||
},
|
||||
|
||||
local toggle_virtual_column = function()
|
||||
if vim.o.colorcolumn == '' then
|
||||
vim.o.colorcolumn = '+1' -- one after 'textwidth'
|
||||
else
|
||||
vim.o.colorcolumn = '' -- none
|
||||
end
|
||||
end
|
||||
event = { 'BufReadPost', 'BufNewFile' },
|
||||
|
||||
vim.keymap.set('n', '<leader>sc', toggle_virtual_column)
|
||||
end,
|
||||
keys ={
|
||||
{
|
||||
'<leader>sc',
|
||||
function()
|
||||
if vim.o.colorcolumn == '' then
|
||||
vim.o.colorcolumn = '+1' -- one after 'textwidth'
|
||||
else
|
||||
vim.o.colorcolumn = '' -- none
|
||||
end
|
||||
end,
|
||||
'Toggle virtual colunn'
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue