chore: move plugin config files into after
Move the nvim configuration files into `.config/nvim/after/plugin` so that they are autoloaded. This also means that the local `init` functions can be removed as they are no longer needed, and this also simplifies the Packer configuration.
This commit is contained in:
parent
ac3c15f4a5
commit
0786ed3b3d
22 changed files with 200 additions and 360 deletions
nvim/.config/nvim
after/plugin
colours.luacompletion.luafloaterm.luagitsigns.luaindent-blankline.lualspconfig.luaseiya.luatelescope.luatreesitter.luavim-test.lua
lua/opdavies
packer.lua
plugins
plugin
3
nvim/.config/nvim/after/plugin/colours.lua
Normal file
3
nvim/.config/nvim/after/plugin/colours.lua
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
require("colorbuddy").colorscheme("gruvbuddy")
|
||||||
|
|
||||||
|
require'colorizer'.setup()
|
50
nvim/.config/nvim/after/plugin/completion.lua
Normal file
50
nvim/.config/nvim/after/plugin/completion.lua
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
local cmp = require "cmp"
|
||||||
|
|
||||||
|
cmp.setup {
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
require('luasnip').lsp_expand(args.body)
|
||||||
|
end
|
||||||
|
},
|
||||||
|
|
||||||
|
mapping = {
|
||||||
|
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
||||||
|
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||||
|
["<C-e>"] = cmp.mapping.close(),
|
||||||
|
["<c-y>"] = cmp.mapping.confirm {
|
||||||
|
behavior = cmp.ConfirmBehavior.Insert,
|
||||||
|
select = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
sources = {
|
||||||
|
{ name = "buffer", priority = 2, keyword_length = 5, max_item_count = 5 },
|
||||||
|
{ name = "calc" },
|
||||||
|
{ name = "path" },
|
||||||
|
{ name = "spell" },
|
||||||
|
{ name = "treesitter" },
|
||||||
|
|
||||||
|
-- Neovim
|
||||||
|
{ name = "nvim_lsp", priority = 10 },
|
||||||
|
{ name = "nvim_lua" },
|
||||||
|
|
||||||
|
-- Plugins
|
||||||
|
{ name = "luasnip" },
|
||||||
|
{ name = "cmp_tabnine" },
|
||||||
|
},
|
||||||
|
|
||||||
|
formatting = {
|
||||||
|
format = require("lspkind").cmp_format({with_text = true, menu = ({
|
||||||
|
buffer = "[buf]",
|
||||||
|
cmp_tabnine = "[tn]",
|
||||||
|
luasnip = "[snip]",
|
||||||
|
nvim_lsp = "[lsp]",
|
||||||
|
nvim_lua = "[lua]",
|
||||||
|
path = "[path]",
|
||||||
|
})}),
|
||||||
|
},
|
||||||
|
|
||||||
|
experimental = {
|
||||||
|
ghost_text = true
|
||||||
|
},
|
||||||
|
}
|
8
nvim/.config/nvim/after/plugin/floaterm.lua
Normal file
8
nvim/.config/nvim/after/plugin/floaterm.lua
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
local map = vim.api.nvim_set_keymap
|
||||||
|
|
||||||
|
local options = { noremap = true }
|
||||||
|
|
||||||
|
map('n', '<leader>ld', '<cmd>FloatermNew --autoclose=2 --height=0.9 --width=0.9 lazydocker<cr>', options)
|
||||||
|
map('n', '<leader>lg', '<cmd>FloatermNew --autoclose=2 --height=0.9 --width=0.9 lazygit<cr>', options)
|
||||||
|
map('n', '<leader>nn', '<cmd>FloatermNew --autoclose=2 --height=0.5 --width=0.5 nnn -Hde<cr>', options)
|
||||||
|
map('n', '<leader>tt', '<cmd>FloatermNew --autoclose=2 --height=0.9 --width=0.9 zsh<cr>', options)
|
23
nvim/.config/nvim/after/plugin/gitsigns.lua
Normal file
23
nvim/.config/nvim/after/plugin/gitsigns.lua
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
require "colorbuddy"
|
||||||
|
|
||||||
|
local c = require("colorbuddy.color").colors
|
||||||
|
local Group = require("colorbuddy.group").Group
|
||||||
|
|
||||||
|
Group.new("GitSignsAdd", c.green)
|
||||||
|
Group.new("GitSignsChange", c.yellow)
|
||||||
|
Group.new("GitSignsDelete", c.red)
|
||||||
|
|
||||||
|
require 'gitsigns'.setup {
|
||||||
|
linehl = false,
|
||||||
|
numhl = true,
|
||||||
|
|
||||||
|
signs = {
|
||||||
|
add = { hl = "GitSignsAdd", text = "│", numhl = "GitSignsAddNr" },
|
||||||
|
change = { hl = "GitSignsChange", text = "│", numhl = "GitSignsChangeNr" },
|
||||||
|
delete = { hl = "GitSignsDelete", text = "_", numhl = "GitSignsDeleteNr" },
|
||||||
|
topdelete = { hl = "GitSignsDelete", text = "‾", numhl = "GitSignsDeleteNr" },
|
||||||
|
changedelete = { hl = "GitSignsDelete", text = "~", numhl = "GitSignsChangeNr" },
|
||||||
|
},
|
||||||
|
|
||||||
|
word_diff = false,
|
||||||
|
}
|
13
nvim/.config/nvim/after/plugin/indent-blankline.lua
Normal file
13
nvim/.config/nvim/after/plugin/indent-blankline.lua
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
vim.opt.list = true
|
||||||
|
vim.opt.listchars = {
|
||||||
|
eol = "↴",
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.cmd [[highlight IndentBlanklineIndent1 guifg=#555555 gui=nocombine]]
|
||||||
|
|
||||||
|
require "indent_blankline".setup {
|
||||||
|
char_highlight_list = {
|
||||||
|
"IndentBlanklineIndent1",
|
||||||
|
},
|
||||||
|
show_end_of_line = true,
|
||||||
|
}
|
53
nvim/.config/nvim/after/plugin/lspconfig.lua
Normal file
53
nvim/.config/nvim/after/plugin/lspconfig.lua
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
--local has_lsp, lspconfig = pcall(require, "lspconfig")
|
||||||
|
|
||||||
|
local function config(_config)
|
||||||
|
return vim.tbl_deep_extend("force", {
|
||||||
|
capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||||
|
}, _config or {})
|
||||||
|
end
|
||||||
|
|
||||||
|
require'lspconfig'.ansiblels.setup(config())
|
||||||
|
|
||||||
|
require'lspconfig'.bashls.setup(config())
|
||||||
|
|
||||||
|
require'lspconfig'.cssls.setup(config())
|
||||||
|
|
||||||
|
require'lspconfig'.html.setup(config())
|
||||||
|
|
||||||
|
require'lspconfig'.intelephense.setup(config({
|
||||||
|
filetypes = { "php", "test", "theme" }
|
||||||
|
}))
|
||||||
|
|
||||||
|
require'lspconfig'.tsserver.setup(config())
|
||||||
|
|
||||||
|
require'lspconfig'.vuels.setup(config())
|
||||||
|
|
||||||
|
require'lspconfig'.yamlls.setup(config())
|
||||||
|
|
||||||
|
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
|
||||||
|
vim.lsp.diagnostic.on_publish_diagnostics, {
|
||||||
|
underline = true,
|
||||||
|
virtual_text = true,
|
||||||
|
signs = true,
|
||||||
|
update_in_insert = true,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
local map = vim.api.nvim_set_keymap
|
||||||
|
|
||||||
|
local options = {
|
||||||
|
noremap = true,
|
||||||
|
silent = true,
|
||||||
|
}
|
||||||
|
|
||||||
|
map('n', '<leader>vb', ':lua require"telescope.builtin".buffers()<CR>', options)
|
||||||
|
map('n', '<leader>vca', ':lua vim.lsp.buf.code_action()<CR>', options)
|
||||||
|
map('n', '<leader>vd', ':lua vim.lsp.buf.definition()<CR>', options)
|
||||||
|
map('n', '<leader>vh', ':lua vim.lsp.buf.hover()<CR>', options)
|
||||||
|
map('n', '<leader>vi', ':lua vim.lsp.buf.implementation()<CR>', options)
|
||||||
|
map('n', '<leader>vn', ':lua vim.lsp.diagnostic.goto_next()<CR>', options)
|
||||||
|
map('n', '<leader>vrn', ':lua vim.lsp.buf.rename()<CR>', options)
|
||||||
|
map('n', '<leader>vrr', ':lua vim.lsp.buf.references()<CR>', options)
|
||||||
|
map('n', '<leader>vs', ':lua require"telescope.builtin".live_grep()<CR>', options)
|
||||||
|
map('n', '<leader>vsd', ':lua vim.lsp.diagnostic.show_line_diagnostics(); vim.lsp.util.show_line_diagnostics()<CR>', options)
|
||||||
|
map('n', '<leader>vsh', ':lua vim.lsp.buf.signature_help()<CR>', options)
|
3
nvim/.config/nvim/after/plugin/seiya.lua
Normal file
3
nvim/.config/nvim/after/plugin/seiya.lua
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
vim.g.seiya_auto_enable = 1
|
||||||
|
|
||||||
|
vim.g.seiya_target_groups = { 'guibg' }
|
18
nvim/.config/nvim/after/plugin/telescope.lua
Normal file
18
nvim/.config/nvim/after/plugin/telescope.lua
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
local map = vim.api.nvim_set_keymap
|
||||||
|
|
||||||
|
local options = {
|
||||||
|
noremap = true,
|
||||||
|
silent = true,
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Builtin
|
||||||
|
map('n', '<leader>fb', '<CMD>lua require("telescope.builtin").buffers()<CR>', options)
|
||||||
|
map('n', '<leader>fc', '<CMD>lua require("telescope.builtin").lsp_code_actions()<CR>', options)
|
||||||
|
map('n', '<leader>fd', '<CMD>lua require("telescope.builtin").lsp_workspace_diagnostics()<CR>', options)
|
||||||
|
map('n', '<leader>fe', '<CMD>lua require("telescope.builtin").file_browser{ cwd = vim.fn.expand("%:p:h") }<CR>', options)
|
||||||
|
map('n', '<leader>ff', '<CMD>lua require("telescope.builtin").find_files{ hidden = true }<CR>', options)
|
||||||
|
map('n', '<leader>fg', '<CMD>lua require("telescope.builtin").git_files{}<CR>', options)
|
||||||
|
map('n', '<leader>fh', '<CMD>lua require("telescope.builtin").help_tags()<CR>', options)
|
||||||
|
map('n', '<leader>fl', '<CMD>lua require("telescope.builtin").live_grep()<CR>', options)
|
||||||
|
map('n', '<leader>fr', '<CMD>lua require("telescope.builtin").registers()<CR>', options)
|
||||||
|
map('n', '<leader>fr', '<CMD>lua require("telescope.builtin").registers()<CR>', options)
|
9
nvim/.config/nvim/after/plugin/treesitter.lua
Normal file
9
nvim/.config/nvim/after/plugin/treesitter.lua
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
require "nvim-treesitter.configs".setup {
|
||||||
|
context_commenting = {
|
||||||
|
enable = true
|
||||||
|
},
|
||||||
|
ensure_installed = "maintained",
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
}
|
||||||
|
}
|
13
nvim/.config/nvim/after/plugin/vim-test.lua
Normal file
13
nvim/.config/nvim/after/plugin/vim-test.lua
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
local map = vim.api.nvim_set_keymap
|
||||||
|
|
||||||
|
local options = {
|
||||||
|
silent = true
|
||||||
|
}
|
||||||
|
|
||||||
|
map('n', 't<C-f>', ':TestFile<CR>', options)
|
||||||
|
map('n', 't<C-g>', ':TestVisit<CR>', options)
|
||||||
|
map('n', 't<C-l>', ':TestLast<CR>', options)
|
||||||
|
map('n', 't<C-n>', ':TestNearest<CR>', options)
|
||||||
|
map('n', 't<C-s>', ':TestSuite<CR>', options)
|
||||||
|
|
||||||
|
vim.g['test#strategy'] = "neovim"
|
|
@ -8,43 +8,18 @@ local function packer_startup()
|
||||||
use 'christoomey/vim-tmux-navigator'
|
use 'christoomey/vim-tmux-navigator'
|
||||||
use 'editorconfig/editorconfig-vim'
|
use 'editorconfig/editorconfig-vim'
|
||||||
use 'icatalina/vim-case-change'
|
use 'icatalina/vim-case-change'
|
||||||
use {
|
use 'lewis6991/gitsigns.nvim'
|
||||||
'lewis6991/gitsigns.nvim',
|
use 'lukas-reineke/indent-blankline.nvim'
|
||||||
config = function()
|
|
||||||
require 'opdavies.plugins.gitsigns'.init()
|
|
||||||
end
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'lukas-reineke/indent-blankline.nvim',
|
|
||||||
config = function()
|
|
||||||
require 'opdavies.plugins.indent-blankline'.init()
|
|
||||||
end
|
|
||||||
}
|
|
||||||
use 'machakann/vim-highlightedyank'
|
use 'machakann/vim-highlightedyank'
|
||||||
use {
|
use 'miyakogi/seiya.vim'
|
||||||
'miyakogi/seiya.vim',
|
|
||||||
config = function()
|
|
||||||
require 'opdavies.plugins.seiya'.init()
|
|
||||||
end
|
|
||||||
}
|
|
||||||
use 'norcalli/nvim-colorizer.lua'
|
use 'norcalli/nvim-colorizer.lua'
|
||||||
use 'nvim-lua/plenary.nvim'
|
use 'nvim-lua/plenary.nvim'
|
||||||
use 'nvim-lua/popup.nvim'
|
use 'nvim-lua/popup.nvim'
|
||||||
use 'preservim/nerdcommenter'
|
use 'preservim/nerdcommenter'
|
||||||
use 'sheerun/vim-polyglot'
|
use 'sheerun/vim-polyglot'
|
||||||
use 'tpope/vim-surround'
|
use 'tpope/vim-surround'
|
||||||
use {
|
use 'vim-test/vim-test'
|
||||||
'vim-test/vim-test',
|
use 'voldikss/vim-floaterm'
|
||||||
config = function ()
|
|
||||||
require 'opdavies.plugins.vim-test'.init()
|
|
||||||
end
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'voldikss/vim-floaterm',
|
|
||||||
config = function()
|
|
||||||
require 'opdavies.plugins.floaterm'.init()
|
|
||||||
end
|
|
||||||
}
|
|
||||||
use { 'mg979/vim-visual-multi', branch = 'master' }
|
use { 'mg979/vim-visual-multi', branch = 'master' }
|
||||||
|
|
||||||
-- Themes
|
-- Themes
|
||||||
|
@ -53,9 +28,6 @@ local function packer_startup()
|
||||||
requires = {
|
requires = {
|
||||||
'tjdevries/colorbuddy.vim'
|
'tjdevries/colorbuddy.vim'
|
||||||
},
|
},
|
||||||
config = function()
|
|
||||||
require 'opdavies.plugins.colours'.init()
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Navigation
|
-- Navigation
|
||||||
|
@ -66,9 +38,6 @@ local function packer_startup()
|
||||||
use {
|
use {
|
||||||
'nvim-treesitter/nvim-treesitter',
|
'nvim-treesitter/nvim-treesitter',
|
||||||
run = ':TSUpdate',
|
run = ':TSUpdate',
|
||||||
config = function()
|
|
||||||
require 'opdavies.plugins.treesitter'.init()
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Completion
|
-- Completion
|
||||||
|
@ -85,27 +54,14 @@ local function packer_startup()
|
||||||
'tzachar/cmp-tabnine',
|
'tzachar/cmp-tabnine',
|
||||||
run = './install.sh'
|
run = './install.sh'
|
||||||
}
|
}
|
||||||
},
|
|
||||||
config = {
|
|
||||||
require 'opdavies.plugins.completion'.init()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
-- LSP
|
-- LSP
|
||||||
use {
|
use 'neovim/nvim-lspconfig'
|
||||||
'neovim/nvim-lspconfig',
|
|
||||||
config = function()
|
|
||||||
require 'opdavies.plugins.lspconfig'.init()
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Telescope
|
-- Telescope
|
||||||
use {
|
use 'nvim-telescope/telescope.nvim'
|
||||||
'nvim-telescope/telescope.nvim',
|
|
||||||
config = function ()
|
|
||||||
require 'opdavies.plugins.telescope'.init()
|
|
||||||
end
|
|
||||||
}
|
|
||||||
use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }
|
use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }
|
||||||
|
|
||||||
use 'vimwiki/vimwiki'
|
use 'vimwiki/vimwiki'
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
local function init()
|
|
||||||
require("colorbuddy").colorscheme("gruvbuddy")
|
|
||||||
|
|
||||||
require'colorizer'.setup()
|
|
||||||
end
|
|
||||||
|
|
||||||
return {
|
|
||||||
init = init
|
|
||||||
}
|
|
|
@ -1,56 +0,0 @@
|
||||||
local cmp = require "cmp"
|
|
||||||
|
|
||||||
local function init()
|
|
||||||
cmp.setup {
|
|
||||||
snippet = {
|
|
||||||
expand = function(args)
|
|
||||||
require('luasnip').lsp_expand(args.body)
|
|
||||||
end
|
|
||||||
},
|
|
||||||
|
|
||||||
mapping = {
|
|
||||||
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
|
||||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
|
||||||
["<C-e>"] = cmp.mapping.close(),
|
|
||||||
["<c-y>"] = cmp.mapping.confirm {
|
|
||||||
behavior = cmp.ConfirmBehavior.Insert,
|
|
||||||
select = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
sources = {
|
|
||||||
{ name = "buffer", priority = 2, keyword_length = 5, max_item_count = 5 },
|
|
||||||
{ name = "calc" },
|
|
||||||
{ name = "path" },
|
|
||||||
{ name = "spell" },
|
|
||||||
{ name = "treesitter" },
|
|
||||||
|
|
||||||
-- Neovim
|
|
||||||
{ name = "nvim_lsp", priority = 10 },
|
|
||||||
{ name = "nvim_lua" },
|
|
||||||
|
|
||||||
-- Plugins
|
|
||||||
{ name = "luasnip" },
|
|
||||||
{ name = "cmp_tabnine" },
|
|
||||||
},
|
|
||||||
|
|
||||||
formatting = {
|
|
||||||
format = require("lspkind").cmp_format({with_text = true, menu = ({
|
|
||||||
buffer = "[buf]",
|
|
||||||
cmp_tabnine = "[tn]",
|
|
||||||
luasnip = "[snip]",
|
|
||||||
nvim_lsp = "[lsp]",
|
|
||||||
nvim_lua = "[lua]",
|
|
||||||
path = "[path]",
|
|
||||||
})}),
|
|
||||||
},
|
|
||||||
|
|
||||||
experimental = {
|
|
||||||
ghost_text = true
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
return {
|
|
||||||
init = init
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
local function init()
|
|
||||||
local map = vim.api.nvim_set_keymap
|
|
||||||
|
|
||||||
local options = { noremap = true }
|
|
||||||
|
|
||||||
map('n', '<leader>ld', '<cmd>FloatermNew --autoclose=2 --height=0.9 --width=0.9 lazydocker<cr>', options)
|
|
||||||
map('n', '<leader>lg', '<cmd>FloatermNew --autoclose=2 --height=0.9 --width=0.9 lazygit<cr>', options)
|
|
||||||
map('n', '<leader>nn', '<cmd>FloatermNew --autoclose=2 --height=0.5 --width=0.5 nnn -Hde<cr>', options)
|
|
||||||
map('n', '<leader>tt', '<cmd>FloatermNew --autoclose=2 --height=0.9 --width=0.9 zsh<cr>', options)
|
|
||||||
end
|
|
||||||
|
|
||||||
return {
|
|
||||||
init = init
|
|
||||||
}
|
|
|
@ -1,29 +0,0 @@
|
||||||
require "colorbuddy"
|
|
||||||
|
|
||||||
local function init()
|
|
||||||
local c = require("colorbuddy.color").colors
|
|
||||||
local Group = require("colorbuddy.group").Group
|
|
||||||
|
|
||||||
Group.new("GitSignsAdd", c.green)
|
|
||||||
Group.new("GitSignsChange", c.yellow)
|
|
||||||
Group.new("GitSignsDelete", c.red)
|
|
||||||
|
|
||||||
require 'gitsigns'.setup {
|
|
||||||
linehl = false,
|
|
||||||
numhl = true,
|
|
||||||
|
|
||||||
signs = {
|
|
||||||
add = { hl = "GitSignsAdd", text = "│", numhl = "GitSignsAddNr" },
|
|
||||||
change = { hl = "GitSignsChange", text = "│", numhl = "GitSignsChangeNr" },
|
|
||||||
delete = { hl = "GitSignsDelete", text = "_", numhl = "GitSignsDeleteNr" },
|
|
||||||
topdelete = { hl = "GitSignsDelete", text = "‾", numhl = "GitSignsDeleteNr" },
|
|
||||||
changedelete = { hl = "GitSignsDelete", text = "~", numhl = "GitSignsChangeNr" },
|
|
||||||
},
|
|
||||||
|
|
||||||
word_diff = false,
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
return {
|
|
||||||
init = init
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
local function init()
|
|
||||||
vim.opt.list = true
|
|
||||||
vim.opt.listchars = {
|
|
||||||
eol = "↴",
|
|
||||||
}
|
|
||||||
|
|
||||||
vim.cmd [[highlight IndentBlanklineIndent1 guifg=#555555 gui=nocombine]]
|
|
||||||
|
|
||||||
require "indent_blankline".setup {
|
|
||||||
char_highlight_list = {
|
|
||||||
"IndentBlanklineIndent1",
|
|
||||||
},
|
|
||||||
show_end_of_line = true,
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
return {
|
|
||||||
init = init
|
|
||||||
}
|
|
|
@ -1,66 +0,0 @@
|
||||||
local function lsp_setup()
|
|
||||||
--local has_lsp, lspconfig = pcall(require, "lspconfig")
|
|
||||||
|
|
||||||
local function config(_config)
|
|
||||||
return vim.tbl_deep_extend("force", {
|
|
||||||
capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
|
||||||
}, _config or {})
|
|
||||||
end
|
|
||||||
|
|
||||||
require'lspconfig'.ansiblels.setup(config())
|
|
||||||
|
|
||||||
require'lspconfig'.bashls.setup(config())
|
|
||||||
|
|
||||||
require'lspconfig'.cssls.setup(config())
|
|
||||||
|
|
||||||
require'lspconfig'.html.setup(config())
|
|
||||||
|
|
||||||
require'lspconfig'.intelephense.setup(config({
|
|
||||||
filetypes = { "php", "test", "theme" }
|
|
||||||
}))
|
|
||||||
|
|
||||||
require'lspconfig'.tsserver.setup(config())
|
|
||||||
|
|
||||||
require'lspconfig'.vuels.setup(config())
|
|
||||||
|
|
||||||
require'lspconfig'.yamlls.setup(config())
|
|
||||||
|
|
||||||
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
|
|
||||||
vim.lsp.diagnostic.on_publish_diagnostics, {
|
|
||||||
underline = true,
|
|
||||||
virtual_text = true,
|
|
||||||
signs = true,
|
|
||||||
update_in_insert = true,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
local function key_mappings()
|
|
||||||
local map = vim.api.nvim_set_keymap
|
|
||||||
|
|
||||||
local options = {
|
|
||||||
noremap = true,
|
|
||||||
silent = true,
|
|
||||||
}
|
|
||||||
|
|
||||||
map('n', '<leader>vb', ':lua require"telescope.builtin".buffers()<CR>', options)
|
|
||||||
map('n', '<leader>vca', ':lua vim.lsp.buf.code_action()<CR>', options)
|
|
||||||
map('n', '<leader>vd', ':lua vim.lsp.buf.definition()<CR>', options)
|
|
||||||
map('n', '<leader>vh', ':lua vim.lsp.buf.hover()<CR>', options)
|
|
||||||
map('n', '<leader>vi', ':lua vim.lsp.buf.implementation()<CR>', options)
|
|
||||||
map('n', '<leader>vn', ':lua vim.lsp.diagnostic.goto_next()<CR>', options)
|
|
||||||
map('n', '<leader>vrn', ':lua vim.lsp.buf.rename()<CR>', options)
|
|
||||||
map('n', '<leader>vrr', ':lua vim.lsp.buf.references()<CR>', options)
|
|
||||||
map('n', '<leader>vs', ':lua require"telescope.builtin".live_grep()<CR>', options)
|
|
||||||
map('n', '<leader>vsd', ':lua vim.lsp.diagnostic.show_line_diagnostics(); vim.lsp.util.show_line_diagnostics()<CR>', options)
|
|
||||||
map('n', '<leader>vsh', ':lua vim.lsp.buf.signature_help()<CR>', options)
|
|
||||||
end
|
|
||||||
|
|
||||||
local function init()
|
|
||||||
lsp_setup()
|
|
||||||
key_mappings()
|
|
||||||
end
|
|
||||||
|
|
||||||
return {
|
|
||||||
init = init
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
local function init()
|
|
||||||
vim.g.seiya_auto_enable = 1
|
|
||||||
|
|
||||||
vim.g.seiya_target_groups = { 'guibg' }
|
|
||||||
end
|
|
||||||
|
|
||||||
return {
|
|
||||||
init = init
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
local function init()
|
|
||||||
local map = vim.api.nvim_set_keymap
|
|
||||||
|
|
||||||
local options = {
|
|
||||||
noremap = true,
|
|
||||||
silent = true,
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Builtin
|
|
||||||
map('n', '<leader>fb', '<CMD>lua require("telescope.builtin").buffers()<CR>', options)
|
|
||||||
map('n', '<leader>fc', '<CMD>lua require("telescope.builtin").lsp_code_actions()<CR>', options)
|
|
||||||
map('n', '<leader>fd', '<CMD>lua require("telescope.builtin").lsp_workspace_diagnostics()<CR>', options)
|
|
||||||
map('n', '<leader>fe', '<CMD>lua require("telescope.builtin").file_browser{ cwd = vim.fn.expand("%:p:h") }<CR>', options)
|
|
||||||
map('n', '<leader>ff', '<CMD>lua require("telescope.builtin").find_files{ hidden = true }<CR>', options)
|
|
||||||
map('n', '<leader>fg', '<CMD>lua require("telescope.builtin").git_files{}<CR>', options)
|
|
||||||
map('n', '<leader>fh', '<CMD>lua require("telescope.builtin").help_tags()<CR>', options)
|
|
||||||
map('n', '<leader>fl', '<CMD>lua require("telescope.builtin").live_grep()<CR>', options)
|
|
||||||
map('n', '<leader>fr', '<CMD>lua require("telescope.builtin").registers()<CR>', options)
|
|
||||||
map('n', '<leader>fr', '<CMD>lua require("telescope.builtin").registers()<CR>', options)
|
|
||||||
end
|
|
||||||
|
|
||||||
return {
|
|
||||||
init = init
|
|
||||||
}
|
|
|
@ -1,15 +0,0 @@
|
||||||
local function init()
|
|
||||||
require "nvim-treesitter.configs".setup {
|
|
||||||
context_commenting = {
|
|
||||||
enable = true
|
|
||||||
},
|
|
||||||
ensure_installed = "maintained",
|
|
||||||
highlight = {
|
|
||||||
enable = true,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
return {
|
|
||||||
init = init
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
local function init()
|
|
||||||
local map = vim.api.nvim_set_keymap
|
|
||||||
|
|
||||||
local options = {
|
|
||||||
silent = true
|
|
||||||
}
|
|
||||||
|
|
||||||
map('n', 't<C-f>', ':TestFile<CR>', options)
|
|
||||||
map('n', 't<C-g>', ':TestVisit<CR>', options)
|
|
||||||
map('n', 't<C-l>', ':TestLast<CR>', options)
|
|
||||||
map('n', 't<C-n>', ':TestNearest<CR>', options)
|
|
||||||
map('n', 't<C-s>', ':TestSuite<CR>', options)
|
|
||||||
|
|
||||||
vim.g['test#strategy'] = "neovim"
|
|
||||||
end
|
|
||||||
|
|
||||||
return {
|
|
||||||
init = init
|
|
||||||
}
|
|
|
@ -110,13 +110,11 @@ _G.packer_plugins = {
|
||||||
url = "https://github.com/editorconfig/editorconfig-vim"
|
url = "https://github.com/editorconfig/editorconfig-vim"
|
||||||
},
|
},
|
||||||
["gitsigns.nvim"] = {
|
["gitsigns.nvim"] = {
|
||||||
config = { "\27LJ\2\2F\0\0\2\0\3\0\0066\0\0\0'\1\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\tinit\30opdavies.plugins.gitsigns\frequire\0" },
|
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/gitsigns.nvim",
|
path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/gitsigns.nvim",
|
||||||
url = "https://github.com/lewis6991/gitsigns.nvim"
|
url = "https://github.com/lewis6991/gitsigns.nvim"
|
||||||
},
|
},
|
||||||
["gruvbuddy.nvim"] = {
|
["gruvbuddy.nvim"] = {
|
||||||
config = { "\27LJ\2\2E\0\0\2\0\3\0\0066\0\0\0'\1\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\tinit\29opdavies.plugins.colours\frequire\0" },
|
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/gruvbuddy.nvim",
|
path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/gruvbuddy.nvim",
|
||||||
url = "https://github.com/tjdevries/gruvbuddy.nvim"
|
url = "https://github.com/tjdevries/gruvbuddy.nvim"
|
||||||
|
@ -127,7 +125,6 @@ _G.packer_plugins = {
|
||||||
url = "https://github.com/ThePrimeagen/harpoon"
|
url = "https://github.com/ThePrimeagen/harpoon"
|
||||||
},
|
},
|
||||||
["indent-blankline.nvim"] = {
|
["indent-blankline.nvim"] = {
|
||||||
config = { "\27LJ\2\2N\0\0\2\0\3\0\0066\0\0\0'\1\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\tinit&opdavies.plugins.indent-blankline\frequire\0" },
|
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/indent-blankline.nvim",
|
path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/indent-blankline.nvim",
|
||||||
url = "https://github.com/lukas-reineke/indent-blankline.nvim"
|
url = "https://github.com/lukas-reineke/indent-blankline.nvim"
|
||||||
|
@ -143,7 +140,6 @@ _G.packer_plugins = {
|
||||||
url = "https://github.com/preservim/nerdcommenter"
|
url = "https://github.com/preservim/nerdcommenter"
|
||||||
},
|
},
|
||||||
["nvim-cmp"] = {
|
["nvim-cmp"] = {
|
||||||
config = {},
|
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/nvim-cmp",
|
path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/nvim-cmp",
|
||||||
url = "https://github.com/hrsh7th/nvim-cmp"
|
url = "https://github.com/hrsh7th/nvim-cmp"
|
||||||
|
@ -154,13 +150,11 @@ _G.packer_plugins = {
|
||||||
url = "https://github.com/norcalli/nvim-colorizer.lua"
|
url = "https://github.com/norcalli/nvim-colorizer.lua"
|
||||||
},
|
},
|
||||||
["nvim-lspconfig"] = {
|
["nvim-lspconfig"] = {
|
||||||
config = { "\27LJ\2\2G\0\0\2\0\3\0\0066\0\0\0'\1\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\tinit\31opdavies.plugins.lspconfig\frequire\0" },
|
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
|
path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
|
||||||
url = "https://github.com/neovim/nvim-lspconfig"
|
url = "https://github.com/neovim/nvim-lspconfig"
|
||||||
},
|
},
|
||||||
["nvim-treesitter"] = {
|
["nvim-treesitter"] = {
|
||||||
config = { "\27LJ\2\2H\0\0\2\0\3\0\0066\0\0\0'\1\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\tinit opdavies.plugins.treesitter\frequire\0" },
|
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
|
path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
|
||||||
url = "https://github.com/nvim-treesitter/nvim-treesitter"
|
url = "https://github.com/nvim-treesitter/nvim-treesitter"
|
||||||
|
@ -191,7 +185,6 @@ _G.packer_plugins = {
|
||||||
url = "https://github.com/cakebaker/scss-syntax.vim"
|
url = "https://github.com/cakebaker/scss-syntax.vim"
|
||||||
},
|
},
|
||||||
["seiya.vim"] = {
|
["seiya.vim"] = {
|
||||||
config = { "\27LJ\2\2C\0\0\2\0\3\0\0066\0\0\0'\1\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\tinit\27opdavies.plugins.seiya\frequire\0" },
|
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/seiya.vim",
|
path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/seiya.vim",
|
||||||
url = "https://github.com/miyakogi/seiya.vim"
|
url = "https://github.com/miyakogi/seiya.vim"
|
||||||
|
@ -202,7 +195,6 @@ _G.packer_plugins = {
|
||||||
url = "https://github.com/nvim-telescope/telescope-fzf-native.nvim"
|
url = "https://github.com/nvim-telescope/telescope-fzf-native.nvim"
|
||||||
},
|
},
|
||||||
["telescope.nvim"] = {
|
["telescope.nvim"] = {
|
||||||
config = { "\27LJ\2\2G\0\0\2\0\3\0\0066\0\0\0'\1\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\tinit\31opdavies.plugins.telescope\frequire\0" },
|
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/telescope.nvim",
|
path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/telescope.nvim",
|
||||||
url = "https://github.com/nvim-telescope/telescope.nvim"
|
url = "https://github.com/nvim-telescope/telescope.nvim"
|
||||||
|
@ -213,7 +205,6 @@ _G.packer_plugins = {
|
||||||
url = "https://github.com/icatalina/vim-case-change"
|
url = "https://github.com/icatalina/vim-case-change"
|
||||||
},
|
},
|
||||||
["vim-floaterm"] = {
|
["vim-floaterm"] = {
|
||||||
config = { "\27LJ\2\2F\0\0\2\0\3\0\0066\0\0\0'\1\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\tinit\30opdavies.plugins.floaterm\frequire\0" },
|
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/vim-floaterm",
|
path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/vim-floaterm",
|
||||||
url = "https://github.com/voldikss/vim-floaterm"
|
url = "https://github.com/voldikss/vim-floaterm"
|
||||||
|
@ -239,7 +230,6 @@ _G.packer_plugins = {
|
||||||
url = "https://github.com/tpope/vim-surround"
|
url = "https://github.com/tpope/vim-surround"
|
||||||
},
|
},
|
||||||
["vim-test"] = {
|
["vim-test"] = {
|
||||||
config = { "\27LJ\2\2F\0\0\2\0\3\0\0066\0\0\0'\1\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\tinit\30opdavies.plugins.vim-test\frequire\0" },
|
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/vim-test",
|
path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/vim-test",
|
||||||
url = "https://github.com/vim-test/vim-test"
|
url = "https://github.com/vim-test/vim-test"
|
||||||
|
@ -262,45 +252,6 @@ _G.packer_plugins = {
|
||||||
}
|
}
|
||||||
|
|
||||||
time([[Defining packer_plugins]], false)
|
time([[Defining packer_plugins]], false)
|
||||||
-- Config for: telescope.nvim
|
|
||||||
time([[Config for telescope.nvim]], true)
|
|
||||||
try_loadstring("\27LJ\2\2G\0\0\2\0\3\0\0066\0\0\0'\1\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\tinit\31opdavies.plugins.telescope\frequire\0", "config", "telescope.nvim")
|
|
||||||
time([[Config for telescope.nvim]], false)
|
|
||||||
-- Config for: vim-floaterm
|
|
||||||
time([[Config for vim-floaterm]], true)
|
|
||||||
try_loadstring("\27LJ\2\2F\0\0\2\0\3\0\0066\0\0\0'\1\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\tinit\30opdavies.plugins.floaterm\frequire\0", "config", "vim-floaterm")
|
|
||||||
time([[Config for vim-floaterm]], false)
|
|
||||||
-- Config for: indent-blankline.nvim
|
|
||||||
time([[Config for indent-blankline.nvim]], true)
|
|
||||||
try_loadstring("\27LJ\2\2N\0\0\2\0\3\0\0066\0\0\0'\1\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\tinit&opdavies.plugins.indent-blankline\frequire\0", "config", "indent-blankline.nvim")
|
|
||||||
time([[Config for indent-blankline.nvim]], false)
|
|
||||||
-- Config for: nvim-treesitter
|
|
||||||
time([[Config for nvim-treesitter]], true)
|
|
||||||
try_loadstring("\27LJ\2\2H\0\0\2\0\3\0\0066\0\0\0'\1\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\tinit opdavies.plugins.treesitter\frequire\0", "config", "nvim-treesitter")
|
|
||||||
time([[Config for nvim-treesitter]], false)
|
|
||||||
-- Config for: gruvbuddy.nvim
|
|
||||||
time([[Config for gruvbuddy.nvim]], true)
|
|
||||||
try_loadstring("\27LJ\2\2E\0\0\2\0\3\0\0066\0\0\0'\1\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\tinit\29opdavies.plugins.colours\frequire\0", "config", "gruvbuddy.nvim")
|
|
||||||
time([[Config for gruvbuddy.nvim]], false)
|
|
||||||
-- Config for: nvim-cmp
|
|
||||||
time([[Config for nvim-cmp]], true)
|
|
||||||
time([[Config for nvim-cmp]], false)
|
|
||||||
-- Config for: gitsigns.nvim
|
|
||||||
time([[Config for gitsigns.nvim]], true)
|
|
||||||
try_loadstring("\27LJ\2\2F\0\0\2\0\3\0\0066\0\0\0'\1\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\tinit\30opdavies.plugins.gitsigns\frequire\0", "config", "gitsigns.nvim")
|
|
||||||
time([[Config for gitsigns.nvim]], false)
|
|
||||||
-- Config for: seiya.vim
|
|
||||||
time([[Config for seiya.vim]], true)
|
|
||||||
try_loadstring("\27LJ\2\2C\0\0\2\0\3\0\0066\0\0\0'\1\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\tinit\27opdavies.plugins.seiya\frequire\0", "config", "seiya.vim")
|
|
||||||
time([[Config for seiya.vim]], false)
|
|
||||||
-- Config for: vim-test
|
|
||||||
time([[Config for vim-test]], true)
|
|
||||||
try_loadstring("\27LJ\2\2F\0\0\2\0\3\0\0066\0\0\0'\1\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\tinit\30opdavies.plugins.vim-test\frequire\0", "config", "vim-test")
|
|
||||||
time([[Config for vim-test]], false)
|
|
||||||
-- Config for: nvim-lspconfig
|
|
||||||
time([[Config for nvim-lspconfig]], true)
|
|
||||||
try_loadstring("\27LJ\2\2G\0\0\2\0\3\0\0066\0\0\0'\1\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\tinit\31opdavies.plugins.lspconfig\frequire\0", "config", "nvim-lspconfig")
|
|
||||||
time([[Config for nvim-lspconfig]], false)
|
|
||||||
if should_profile then save_profiles() end
|
if should_profile then save_profiles() end
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue