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