1
0
Fork 0
nvim-configs/lua/plugins.lua

293 lines
7.8 KiB
Lua

local fn = vim.fn
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
packer_bootstrap = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
-- TODO: Add in downloading of sqlite dll for Windows, here.
-- TODO: It seems sqlite needs installing or configuring on gentoo as well.
end
lsp_client_capabilities = vim.lsp.protocol.make_client_capabilities()
return require('packer').startup(function(use)
use 'wbthomason/packer.nvim'
use {
'dracula/vim',
config = function()
vim.cmd('colorscheme dracula')
end
}
use 'kyazdani42/nvim-web-devicons'
use {
'kyazdani42/nvim-tree.lua',
requires = 'kyazdani42/nvim-web-devicons',
config = function()
require('nvim-tree').setup {
update_cwd = true
}
end
}
use 'bryanmylee/vim-colorscheme-icons'
use {
'akinsho/bufferline.nvim',
config = function()
require('bufferline').setup {
options = {
separator_style = 'slant'
}
}
end
}
use {
'NTBBloodbath/galaxyline.nvim',
config = function()
require('galaxyline.themes.minimalist')
end,
requires = { 'kyazdani42/nvim-web-devicons', opt = true }
}
use {
'tami5/sqlite.lua',
config = function()
if vim.fn.has('win32') == 1 then
-- FIXME need to download the sqlite3.dll from sqlite.org and place in config folder
vim.g.sqlite_clib_path = vim.fn.stdpath('config') .. '/sqlite3.dll'
end
end
}
use {
'nvim-telescope/telescope.nvim',
requires = { 'nvim-lua/plenary.nvim', 'nvim-telescope/telescope-smart-history.nvim' },
config = function()
local tele = require('telescope')
local actions = require('telescope.actions');
local actions_generate = require('telescope.actions.generate');
local db_dir = vim.fn.stdpath('data') .. '/databases'
os.execute('mkdir ' .. db_dir)
tele.setup{
defaults = {
prompt_prefix = "",
selection_caret = "",
mappings = {
i = {
["<C-Down>"] = actions.cycle_history_next,
["<C-Up>"] = actions.cycle_history_prev,
["<C-?>"] = actions_generate.which_key {
name_width = 22,
max_height = .05,
mode_width = 0,
separator = '',
column_indent = 1,
line_padding = 0
}
},
n = {
["?"] = actions_generate.which_key {
name_width = 22,
max_height = .05,
mode_width = 0,
separator = '',
column_indent = 1,
line_padding = 0,
}
}
},
history = {
path = db_dir .. '/telescope_history.sqlite3',
limit = 100,
},
layout_config = {
horizontal = {
width = 0.95,
height = 0.95,
},
vertical = {
width = 0.95,
height = 0.95,
}
}
}
}
tele.load_extension('smart_history')
end,
}
use {
'nvim-telescope/telescope-smart-history.nvim',
requires = { 'tami5/sqlite.lua' },
}
use 'habamax/vim-godot'
use 'skywind3000/asyncrun.vim'
use {
'lervag/wiki.vim',
config = function()
vim.g.wiki_filetypes = {'md'}
vim.api.nvim_set_keymap('n', '<leader>fw', "<cmd>lua require'telescope.builtin'.find_files({ cwd = vim.g.wiki_root})<CR>", {noremap=true})
vim.api.nvim_set_keymap('n', '<leader>fW', "<cmd>lua require'telescope.builtin'.live_grep({ cwd = vim.g.wiki_root})<CR>", {noremap=true})
vim.api.nvim_set_keymap('n', '<leader>ft', '<cmd>WikiTagSearch<CR>', {noremap=true})
vim.api.nvim_exec(
[[
let s:tag_parser = deepcopy(g:wiki#tags#default_parser)
let s:tag_parser.re_match = '\v%(^|\s)#\zs[^# ]+'
let s:tag_parser.re_findstart = '\v%(^|\s)#\zs[^# ]+'
let g:wiki_tag_parsers = [s:tag_parser]
]],
true)
end,
requires = { 'nvim-telescope/telescope.nvim' }
}
use 'valloric/listtoggle'
use {
'neovim/nvim-lspconfig',
config = function()
require('lspconfig').gdscript.setup{
capabilities = lsp_client_capabilities
}
end,
requires = { 'hrsh7th/cmp-nvim-lsp' }
}
use {
'hrsh7th/cmp-nvim-lsp',
config = function()
lsp_client_capabilities = require('cmp_nvim_lsp').update_capabilities(lsp_client_capabilities)
end
}
use 'hrsh7th/cmp-nvim-lua'
use 'hrsh7th/cmp-emoji'
use 'hrsh7th/cmp-path'
use 'hrsh7th/cmp-buffer'
use {
'hrsh7th/nvim-cmp',
config = function()
local cmp = require 'cmp'
cmp.setup({
mapping = {
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.close(),
['<CR>'] = cmp.mapping.confirm({ select = true }),
['<TAB>'] = cmp.mapping.confirm({ select = true })
},
sources = {
{ name = 'nvim_lsp' },
{ name = 'buffer' },
{ name = 'emoji' },
{ name = 'path' },
{ name = 'nvim_lua' },
},
experimental = {
ghost_text = true
}
})
end
}
use {
'nvim-treesitter/nvim-treesitter',
run = function()
vim.cmd(':TSUpdate')
end,
config = function()
require 'nvim-treesitter.install'.compilers = { 'cl', 'clang' }
require 'nvim-treesitter.configs'.setup {
ensure_installed = "all",
highlight = {
--enable = true
},
indent = {
enable = true
},
}
end
}
use {
'onsails/lspkind-nvim',
config = function()
require('lspkind').init{}
end
}
use 'lepture/vim-jinja'
use {
'neoclide/coc.nvim',
branch = 'release',
config = function()
vim.g.coc_global_extensions = {
'coc-cmake',
'coc-css',
'coc-docker',
'coc-git',
'coc-html',
'coc-json',
'coc-rls',
'coc-sql',
'coc-toml',
'coc-tsserver',
'coc-yaml',
'coc-zig'
}
vim.api.nvim_exec(
[[
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
inoremap <silent><expr> <Tab>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<Tab>" :
\ coc#refresh()
nnoremap <silent> K :call <SID>show_documentation()<CR>
function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
elseif (coc#rpc#ready())
call CocActionAsync('doHover')
else
execute '!' . &keywordprg . " " . expand('<cword>')
endif
endfunction
]], true)
end
}
use 'editorconfig/editorconfig-vim'
use {
'gentoo/gentoo-syntax',
-- Latest version is buggy as hell
tag = 'gentoo-syntax-20220220',
run = 'make PREFIX=~/.local/share/nvim install'
}
use {
'lambdalisue/suda.vim',
setup = function()
vim.g.suda_smart_edit = 1
end,
cond = function()
return vim.fn.has('win32') == 0
end
}
use 'khaveesh/vim-fish-syntax'
use {
'moll/vim-bbye',
config = function()
vim.api.nvim_set_keymap('n', '<leader>q', "<cmd>:Bdelete<CR>", {noremap=true})
end
}
use 'ron-rs/ron.vim'
use {
-- To be configured!
'numToStr/FTerm.nvim'
}
use { 'sirver/ultisnips' }
use { 'honza/vim-snippets' }
use { 'andrewstuart/vim-kubernetes' }
use { 'arrufat/vala.vim' }
use { 'pirmd/gemini.vim' }
end)