486 lines
15 KiB
Lua
486 lines
15 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
|
|
|
|
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', 'glacambre/firenvim' },
|
|
cond = function()
|
|
return not vim.g.started_by_firenvim
|
|
end,
|
|
config = function()
|
|
require('nvim-tree').setup {
|
|
update_cwd = true
|
|
}
|
|
end
|
|
}
|
|
use 'bryanmylee/vim-colorscheme-icons'
|
|
use {
|
|
'akinsho/bufferline.nvim',
|
|
requires = 'glacambre/firenvim',
|
|
cond = function()
|
|
return not vim.g.started_by_firenvim
|
|
end,
|
|
config = function()
|
|
require('bufferline').setup {
|
|
options = {
|
|
separator_style = 'slant'
|
|
}
|
|
}
|
|
end
|
|
}
|
|
use {
|
|
'NTBBloodbath/galaxyline.nvim',
|
|
requires = 'glacambre/firenvim',
|
|
cond = function()
|
|
return not vim.g.started_by_firenvim
|
|
end,
|
|
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',
|
|
'glacambre/firenvim'
|
|
},
|
|
cond = function()
|
|
return not vim.g.started_by_firenvim
|
|
end,
|
|
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 = " ",
|
|
vimgrep_arguments = {
|
|
"rg",
|
|
"--color=never",
|
|
"--no-heading",
|
|
"--with-filename",
|
|
"--line-number",
|
|
"--column",
|
|
"--smart-case",
|
|
"--no-ignore",
|
|
},
|
|
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()
|
|
-- Mappings.
|
|
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
|
|
local opts = { noremap=true, silent=true }
|
|
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
|
|
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
|
|
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
|
|
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
|
|
|
|
-- Use an on_attach function to only map the following keys
|
|
-- after the language server attaches to the current buffer
|
|
local on_attach = function(client, bufnr)
|
|
-- Enable completion triggered by <c-x><c-o>
|
|
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
|
|
|
-- Mappings.
|
|
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
|
local bufopts = { noremap=true, silent=true, buffer=bufnr }
|
|
-- this suda thing does not work... maybe can hack suda
|
|
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
|
|
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
|
|
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
|
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
|
|
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
|
|
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts)
|
|
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
|
|
vim.keymap.set('n', '<space>wl', function()
|
|
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
|
end, bufopts)
|
|
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
|
|
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
|
|
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
|
|
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
|
vim.keymap.set('n', '<space>f', vim.lsp.buf.formatting, bufopts)
|
|
end
|
|
|
|
-- trying to haxx suda
|
|
--local declaration = vim.lsp.handlers['textDocument/declaration']
|
|
--vim.lsp.handlers['textDocument/declaration'] = vim.lsp.with(
|
|
-- function()
|
|
-- vim.g.suda_smart_edit = 0
|
|
-- declaration()
|
|
-- vim.g.suda_smart_edit = 1
|
|
-- end)
|
|
|
|
local servers = {'gdscript', 'clangd', 'zls' };
|
|
for _, lsp in ipairs(servers) do
|
|
require('lspconfig')[lsp].setup {
|
|
on_attach = on_attach,
|
|
}
|
|
end
|
|
end
|
|
}
|
|
use {
|
|
'ms-jpq/coq.artifacts',
|
|
branch = 'artifacts'
|
|
}
|
|
use {
|
|
'ms-jpq/coq_nvim',
|
|
branch = 'coq',
|
|
requires = 'ms-jpq/coq.artifacts',
|
|
config = function()
|
|
vim.g.coq_settings = {
|
|
auto_start = 'shut-up',
|
|
keymap = {
|
|
pre_select = true,
|
|
recommended = false
|
|
},
|
|
display = {
|
|
pum = {
|
|
fast_close = false
|
|
}
|
|
}
|
|
}
|
|
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',
|
|
-- enabled = false,
|
|
-- 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' }
|
|
use {
|
|
'glacambre/firenvim',
|
|
run = function() vim.fn['firenvim#install'](0) end,
|
|
config = function()
|
|
if vim.g.started_by_firenvim then
|
|
vim.o.laststatus = 0
|
|
vim.o.number = false
|
|
vim.o.guifont = 'JetBrains Mono:h9'
|
|
vim.o.wrap = true
|
|
vim.o.textwidth = 0
|
|
vim.o.linebreak = true
|
|
|
|
local timer = nil
|
|
local maybe_start_timer = function()
|
|
if timer and timer:get_due_in() > 0 then
|
|
return
|
|
end
|
|
|
|
timer = vim.defer_fn(function()
|
|
vim.api.nvim_command('write')
|
|
end, 10000)
|
|
end
|
|
|
|
vim.api.nvim_create_autocmd(
|
|
"BufEnter",
|
|
{
|
|
pattern = 'write.trees.st_*.txt',
|
|
command = 'set filetype=markdown | set tw=0'
|
|
}
|
|
)
|
|
|
|
vim.api.nvim_create_autocmd(
|
|
{ 'TextChanged', 'TextChangedI' },
|
|
{
|
|
pattern = '*',
|
|
nested = true,
|
|
callback = maybe_start_timer,
|
|
}
|
|
)
|
|
|
|
vim.g.firenvim_config = {
|
|
globalSettings = {
|
|
alt = 'all',
|
|
},
|
|
localSettings = {
|
|
['.*'] = {
|
|
takeover = 'never'
|
|
}
|
|
}
|
|
}
|
|
|
|
end
|
|
end
|
|
}
|
|
use { 'dstein64/nvim-scrollview' }
|
|
use { 'ziglang/zig.vim' }
|
|
use {
|
|
'mfussenegger/nvim-dap',
|
|
config = function()
|
|
local dap = require('dap')
|
|
dap.adapters.lldb = {
|
|
type = 'executable',
|
|
command = '/usr/bin/lldb-vscode',
|
|
name = 'lldb'
|
|
}
|
|
|
|
dap.configurations.cpp = {
|
|
{
|
|
name = 'Launch',
|
|
type = 'lldb',
|
|
request = 'launch',
|
|
program = function()
|
|
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
|
end,
|
|
cwd = '${workspaceFolder}',
|
|
stopOnEntry = false,
|
|
args = {},
|
|
runInTermanl = false,
|
|
},
|
|
}
|
|
|
|
dap.configurations.c = dap.configurations.cpp
|
|
dap.configurations.rust = dap.configurations.cpp
|
|
dap.configurations.zig = dap.configurations.cpp
|
|
|
|
vim.api.nvim_set_keymap('n', '<F5>', "<Cmd>lua require'dap'.continue()<CR>", {noremap=true})
|
|
vim.api.nvim_set_keymap('n', '<F9>', "<Cmd>lua require'dap'.step_over()<CR>", {noremap=true})
|
|
vim.api.nvim_set_keymap('n', '<F10>', "<Cmd>lua require'dap'.step_into()<CR>", {noremap=true})
|
|
vim.api.nvim_set_keymap('n', '<F12>', "<Cmd>lua require'dap'.step_out()<CR>", {noremap=true})
|
|
vim.api.nvim_set_keymap('n', '<Leader>b', "<Cmd>lua require'dap'.toggle_breakpoint()<CR>", {noremap=true})
|
|
vim.api.nvim_set_keymap('n', '<Leader>B', "<Cmd>lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint Cond: '))<CR>", {noremap=true})
|
|
vim.api.nvim_set_keymap('n', '<Leader>lp', "<Cmd>lua require'dap'.set_breakpoint(nil, nil, vim.fn.input('Logpoint msg: '))<CR>", {noremap=true})
|
|
vim.api.nvim_set_keymap('n', '<Leader>dr', "<Cmd>lua require'dap'.repl.open()<CR>", {noremap=true})
|
|
vim.api.nvim_set_keymap('n', '<Leader>dl', "<Cmd>lua require'dap'.repl.run_last()<CR>", {noremap=true})
|
|
end
|
|
}
|
|
use {
|
|
'rcarriga/nvim-dap-ui',
|
|
requires = { 'mfussenegger/nvim-dap' },
|
|
config = function()
|
|
local dap, dapui = require('dap'), require('dapui')
|
|
dapui.setup()
|
|
vim.api.nvim_create_user_command('Dapui', function() dapui.open(1) end, { nargs = 0 })
|
|
|
|
dap.listeners.after.event_initialized['dapui_config'] = function()
|
|
dapui.open()
|
|
end
|
|
dap.listeners.before.event_terminated["dapui_config"] = function()
|
|
dapui.close()
|
|
end
|
|
dap.listeners.before.event_exited["dapui_config"] = function()
|
|
dapui.close()
|
|
end
|
|
end
|
|
}
|
|
use {
|
|
'voldikss/vim-floaterm',
|
|
config = function()
|
|
vim.api.nvim_create_user_command('Gitui', function() vim.api.nvim_exec('FloatermNew gitui', false) end, { nargs = 0 })
|
|
vim.g.floaterm_keymap_new = '<Leader>tn'
|
|
vim.g.floaterm_keymap_toggle = '<Leader>tt'
|
|
vim.g.floaterm_keymap_show = '<Leader>ts'
|
|
vim.g.floaterm_keymap_hide = '<Leader>th'
|
|
vim.g.floaterm_keymap_kill = '<Leader>tk'
|
|
vim.g.floaterm_keymap_prev = '<Leader>t<left>'
|
|
vim.g.floaterm_keymap_next = '<Leader>t<right>'
|
|
vim.g.floaterm_title = 'term $1/$2'
|
|
vim.g.floaterm_width = 0.95
|
|
vim.g.floaterm_height = 0.95
|
|
vim.g.floaterm_borderchars = "─│─│╭╮╯╰"
|
|
vim.api.nvim_set_keymap('n', '<Leader>tg', "<Cmd>Gitui<CR>", {noremap=true})
|
|
end
|
|
}
|
|
end)
|
|
|
|
|