1
0
Fork 0
This commit is contained in:
Vivianne 2022-03-05 03:35:05 -08:00
parent 9859bdc9ce
commit 5e1d627e2e
6 changed files with 633 additions and 633 deletions

View File

@ -1,3 +1,3 @@
{ {
"diagnostic.showUnused": false, "diagnostic.showUnused": false,
} }

222
init.vim
View File

@ -1,111 +1,111 @@
let $CONFIG = stdpath('config') let $CONFIG = stdpath('config')
let $SCR_PLUGINS = $CONFIG . '/lua/plugins.lua' let $SCR_PLUGINS = $CONFIG . '/lua/plugins.lua'
let $SCR_INIT = $CONFIG . '/init.vim' let $SCR_INIT = $CONFIG . '/init.vim'
if has('win32') if has('win32')
source $VIMRUNTIME/mswin.vim source $VIMRUNTIME/mswin.vim
endif endif
set termguicolors set termguicolors
lua require('plugins') lua require('plugins')
filetype plugin indent on filetype plugin indent on
set tabstop=2 softtabstop=0 shiftwidth=2 expandtab smarttab autoindent set tabstop=2 softtabstop=0 shiftwidth=2 expandtab smarttab autoindent
set incsearch ignorecase smartcase hlsearch set incsearch ignorecase smartcase hlsearch
set wildmode=longest,list,full wildmenu set wildmode=longest,list,full wildmenu
set ruler laststatus=2 showcmd showmode set ruler laststatus=2 showcmd showmode
" set list listchars=trail: " set list listchars=trail:
set fillchars+=vert:\ set fillchars+=vert:\
set wrap breakindent set wrap breakindent
set encoding=utf-8 set encoding=utf-8
set textwidth=0 set textwidth=0
set hidden set hidden
set number set number
set title set title
set mouse=a set mouse=a
set cursorline set cursorline
set updatetime=300 set updatetime=300
set emoji set emoji
set noshowcmd set noshowcmd
set noshowmode set noshowmode
syntax on syntax on
colorscheme dracula colorscheme dracula
nnoremap <silent>]b :BufferLineCycleNext<CR> nnoremap <silent>]b :BufferLineCycleNext<CR>
nnoremap <silent>[b :BufferLineCyclePrev<CR> nnoremap <silent>[b :BufferLineCyclePrev<CR>
nnoremap <silent><leader>bp :BufferLinePick<CR> nnoremap <silent><leader>bp :BufferLinePick<CR>
nnoremap <silent><leader>bcc :BufferLinePickClose<CR> nnoremap <silent><leader>bcc :BufferLinePickClose<CR>
nnoremap <silent><leader>bcl :BufferLineCloseLeft<CR> nnoremap <silent><leader>bcl :BufferLineCloseLeft<CR>
nnoremap <silent><leader>bcr :BufferLineCloseRight<CR> nnoremap <silent><leader>bcr :BufferLineCloseRight<CR>
augroup packer_user_config augroup packer_user_config
autocmd! autocmd!
autocmd BufWritePost $SCR_PLUGINS source <afile> | PackerCompile autocmd BufWritePost $SCR_PLUGINS source <afile> | PackerCompile
augroup end augroup end
augroup init_refresh augroup init_refresh
autocmd! autocmd!
autocmd BufWritePost $SCR_INIT source <afile> autocmd BufWritePost $SCR_INIT source <afile>
augroup end augroup end
augroup telescope augroup telescope
autocmd! autocmd!
autocmd QuickFixCmdPost qf :Telescope quickfix<CR> autocmd QuickFixCmdPost qf :Telescope quickfix<CR>
augroup end augroup end
if exists('g:fvim_loaded') if exists('g:fvim_loaded')
nnoremap <silent> <C-ScrollWheelUp> :set guifont=+<CR> nnoremap <silent> <C-ScrollWheelUp> :set guifont=+<CR>
nnoremap <silent> <C-ScrollWheelDown> :set guifont=-<CR> nnoremap <silent> <C-ScrollWheelDown> :set guifont=-<CR>
FVimCursorSmoothMove v:true FVimCursorSmoothMove v:true
FVimCursorSmoothBlink v:true FVimCursorSmoothBlink v:true
FVimBackgroundComposition 'transparent' FVimBackgroundComposition 'transparent'
FVimBackgroundOpacity 0.90 FVimBackgroundOpacity 0.90
FVimBackgroundAltOpacity 0.85 FVimBackgroundAltOpacity 0.85
FVimCustomTitleBar v:false FVimCustomTitleBar v:false
FVimFontLigature v:true FVimFontLigature v:true
set guifont=JetBrains\ Mono:h12.5 set guifont=JetBrains\ Mono:h12.5
endif endif
nnoremap <leader><leader> :NvimTreeToggle<CR> nnoremap <leader><leader> :NvimTreeToggle<CR>
let g:scrollview_current_only = 1 let g:scrollview_current_only = 1
nnoremap <leader>vv <cmd>e $SCR_INIT<CR> nnoremap <leader>vv <cmd>e $SCR_INIT<CR>
nnoremap <leader>vp <cmd>e $SCR_PLUGINS<CR> nnoremap <leader>vp <cmd>e $SCR_PLUGINS<CR>
" Telescope binds " Telescope binds
nnoremap <leader>F <cmd>Telescope resume<cr> nnoremap <leader>F <cmd>Telescope resume<cr>
nnoremap <leader>fr <cmd>Telescope resume<cr> nnoremap <leader>fr <cmd>Telescope resume<cr>
nnoremap <leader>ff <cmd>Telescope find_files<cr> nnoremap <leader>ff <cmd>Telescope find_files<cr>
nnoremap <leader>fg <cmd>Telescope live_grep<cr> nnoremap <leader>fg <cmd>Telescope live_grep<cr>
nnoremap <leader>fb <cmd>Telescope buffers<cr> nnoremap <leader>fb <cmd>Telescope buffers<cr>
nnoremap <leader>fh <cmd>Telescope help_tags<cr> nnoremap <leader>fh <cmd>Telescope help_tags<cr>
nnoremap <leader>fq <cmd>Telescope quickfix<cr> nnoremap <leader>fq <cmd>Telescope quickfix<cr>
nnoremap <leader>fc <cmd>Telescope command_history<cr> nnoremap <leader>fc <cmd>Telescope command_history<cr>
nnoremap <leader>fs <cmd>Telescope search_history<cr> nnoremap <leader>fs <cmd>Telescope search_history<cr>
command CDC cd %:p:h command CDC cd %:p:h
" wiki.vim bindings " wiki.vim bindings
let g:wiki_filetypes = ['md'] let g:wiki_filetypes = ['md']
nnoremap <leader>fw <cmd>lua require'telescope.builtin'.find_files({ cwd = vim.g.wiki_root })<CR> nnoremap <leader>fw <cmd>lua require'telescope.builtin'.find_files({ cwd = vim.g.wiki_root })<CR>
nnoremap <leader>fW <cmd>lua require'telescope.builtin'.live_grep({ cwd = vim.g.wiki_root })<CR> nnoremap <leader>fW <cmd>lua require'telescope.builtin'.live_grep({ cwd = vim.g.wiki_root })<CR>
nnoremap <leader>ft <cmd>WikiTagSearch<CR> nnoremap <leader>ft <cmd>WikiTagSearch<CR>
let s:tag_parser = deepcopy(g:wiki#tags#default_parser) let s:tag_parser = deepcopy(g:wiki#tags#default_parser)
let s:tag_parser.re_match = '\v%(^|\s)#\zs[^# ]+' let s:tag_parser.re_match = '\v%(^|\s)#\zs[^# ]+'
let s:tag_parser.re_findstart = '\v%(^|\s)#\zs[^# ]+' let s:tag_parser.re_findstart = '\v%(^|\s)#\zs[^# ]+'
let g:wiki_tag_parsers = [s:tag_parser] let g:wiki_tag_parsers = [s:tag_parser]
let g:lt_location_list_toggle_map = '<leader>l' let g:lt_location_list_toggle_map = '<leader>l'
let g:lt_quickfix_list_toggle_map = '<leader>q' let g:lt_quickfix_list_toggle_map = '<leader>q'
" machine-specific settings " machine-specific settings
source $CONFIG/local.vim source $CONFIG/local.vim

View File

@ -1,3 +1,3 @@
-- Edit this as needed for your local config. -- Edit this as needed for your local config.
let g:wiki_root = $HOME . '/wiki' let g:wiki_root = $HOME . '/wiki'
-- let g:godot_executable = 'SOME_PATH' -- let g:godot_executable = 'SOME_PATH'

View File

@ -1,13 +1,13 @@
local M = {} local M = {}
function M.is_buffer_empty() function M.is_buffer_empty()
-- Check whether the current buffer is empty -- Check whether the current buffer is empty
return vim.fn.empty(vim.fn.expand '%:t') == 1 return vim.fn.empty(vim.fn.expand '%:t') == 1
end end
function M.has_width_gt(cols) function M.has_width_gt(cols)
-- Check if the windows width is greater than a given number of columns -- Check if the windows width is greater than a given number of columns
return vim.fn.winwidth(0) / 2 > cols return vim.fn.winwidth(0) / 2 > cols
end end
return M return M

View File

@ -1,321 +1,321 @@
local gl = require 'galaxyline' local gl = require 'galaxyline'
local utils = require 'conf.utils' local utils = require 'conf.utils'
local condition = require 'galaxyline.condition' local condition = require 'galaxyline.condition'
local vcs = require 'galaxyline.providers.vcs' local vcs = require 'galaxyline.providers.vcs'
local fileinfo = require 'galaxyline.providers.fileinfo' local fileinfo = require 'galaxyline.providers.fileinfo'
local gls = gl.section local gls = gl.section
gl.short_line_list = { gl.short_line_list = {
'packer', 'packer',
'NvimTree', 'NvimTree',
'Outline', 'Outline',
'Trouble', 'Trouble',
'dap-repl', 'dap-repl',
'dapui_scopes', 'dapui_scopes',
'dapui_breakpoints', 'dapui_breakpoints',
'dapui_stacks', 'dapui_stacks',
'dapui_watches', 'dapui_watches',
} }
local colors = { local colors = {
bg = '#282c34', bg = '#282c34',
fg = '#abb2bf', fg = '#abb2bf',
section_bg = '#38393f', section_bg = '#38393f',
blue = '#61afef', blue = '#61afef',
green = '#98c379', green = '#98c379',
purple = '#c678dd', purple = '#c678dd',
orange = '#e5c07b', orange = '#e5c07b',
red = '#e06c75', red = '#e06c75',
yellow = '#e5c07b', yellow = '#e5c07b',
darkgrey = '#2c323d', darkgrey = '#2c323d',
middlegrey = '#8791A5', middlegrey = '#8791A5',
} }
local mode_colors = { local mode_colors = {
['n'] = colors.green, ['n'] = colors.green,
['i'] = colors.blue, ['i'] = colors.blue,
['c'] = colors.green, ['c'] = colors.green,
['t'] = colors.blue, ['t'] = colors.blue,
['v'] = colors.purple, ['v'] = colors.purple,
['\x16'] = colors.purple, ['\x16'] = colors.purple,
['V'] = colors.purple, ['V'] = colors.purple,
['R'] = colors.red, ['R'] = colors.red,
['s'] = colors.red, ['s'] = colors.red,
['S'] = colors.red, ['S'] = colors.red,
['ic'] = colors.blue, ['ic'] = colors.blue,
} }
local mode_names = { local mode_names = {
['n'] = 'NORMAL', ['n'] = 'NORMAL',
['i'] = 'INSERT', ['i'] = 'INSERT',
['c'] = 'COMMAND', ['c'] = 'COMMAND',
['t'] = 'TERMINAL', ['t'] = 'TERMINAL',
['v'] = 'VISUAL', ['v'] = 'VISUAL',
['\x16'] = 'V-BLOCK', ['\x16'] = 'V-BLOCK',
['V'] = 'V-LINE', ['V'] = 'V-LINE',
['R'] = 'REPLACE', ['R'] = 'REPLACE',
['s'] = 'SELECT', ['s'] = 'SELECT',
['S'] = 'S-LINE', ['S'] = 'S-LINE',
['ic'] = 'COMPLETION', ['ic'] = 'COMPLETION',
} }
-- Local helper functions -- Local helper functions
local buffer_not_empty = function() local buffer_not_empty = function()
return not utils.is_buffer_empty() return not utils.is_buffer_empty()
end end
local checkwidth = function() local checkwidth = function()
return utils.has_width_gt(35) and buffer_not_empty() return utils.has_width_gt(35) and buffer_not_empty()
end end
local is_file = function() local is_file = function()
return vim.bo.buftype ~= 'nofile' return vim.bo.buftype ~= 'nofile'
end end
local function has_value(tab, val) local function has_value(tab, val)
for _, value in ipairs(tab) do for _, value in ipairs(tab) do
if value[1] == val then if value[1] == val then
return true return true
end end
end end
return false return false
end end
local get_mode = function() local get_mode = function()
return vim.api.nvim_get_mode()['mode'] return vim.api.nvim_get_mode()['mode']
end end
local mode_color = function(mode) local mode_color = function(mode)
local color = mode_colors[mode] local color = mode_colors[mode]
if color ~= nil then if color ~= nil then
return color return color
end end
print 'statusline: error looking up vi mode color' print 'statusline: error looking up vi mode color'
return colors.middlegrey return colors.middlegrey
end end
local vi_mode = function() local vi_mode = function()
local mode = get_mode() local mode = get_mode()
local color = mode_color(mode) local color = mode_color(mode)
vim.cmd('hi GalaxyViMode guibg=' .. color) vim.cmd('hi GalaxyViMode guibg=' .. color)
local alias = mode_names[mode] local alias = mode_names[mode]
if alias ~= nil then if alias ~= nil then
if not utils.has_width_gt(35) then if not utils.has_width_gt(35) then
alias = alias:sub(1, 1) alias = alias:sub(1, 1)
end end
else else
alias = mode alias = mode
end end
return ' ' .. alias .. ' ' return ' ' .. alias .. ' '
end end
local function file_readonly() local function file_readonly()
if vim.bo.filetype == 'help' then if vim.bo.filetype == 'help' then
return false return false
end end
if vim.bo.readonly then if vim.bo.readonly then
return true return true
end end
return false return false
end end
local function file_name() local function file_name()
local file = vim.fn.expand '%:t' local file = vim.fn.expand '%:t'
if not file then if not file then
return '' return ''
end end
if file_readonly() then if file_readonly() then
return file .. '' return file .. ''
end end
if vim.bo.modifiable and vim.bo.modified then if vim.bo.modifiable and vim.bo.modified then
return file .. '' return file .. ''
end end
return file .. ' ' return file .. ' '
end end
local function split(str, sep) local function split(str, sep)
local res = {} local res = {}
local n = 1 local n = 1
for w in str:gmatch('([^' .. sep .. ']*)') do for w in str:gmatch('([^' .. sep .. ']*)') do
res[n] = res[n] or w -- only set once (so the blank after a string is ignored) res[n] = res[n] or w -- only set once (so the blank after a string is ignored)
if w == '' then if w == '' then
n = n + 1 n = n + 1
end -- step forwards on a blank but not a string end -- step forwards on a blank but not a string
end end
return res return res
end end
local function file_path() local function file_path()
local fp = vim.fn.fnamemodify(vim.fn.expand '%', ':~:.:h') local fp = vim.fn.fnamemodify(vim.fn.expand '%', ':~:.:h')
local tbl = split(fp, '/') local tbl = split(fp, '/')
local len = #tbl local len = #tbl
if len > 2 and not len == 3 and not tbl[0] == '~' then if len > 2 and not len == 3 and not tbl[0] == '~' then
return '…/' .. table.concat(tbl, '/', len - 1) .. '/' -- shorten filepath to last 2 folders return '…/' .. table.concat(tbl, '/', len - 1) .. '/' -- shorten filepath to last 2 folders
-- alternative: only 1 containing folder using vim builtin function -- alternative: only 1 containing folder using vim builtin function
-- return '…/' .. vim.fn.fnamemodify(vim.fn.expand '%', ':p:h:t') .. '/' -- return '…/' .. vim.fn.fnamemodify(vim.fn.expand '%', ':p:h:t') .. '/'
else else
return fp .. '/' return fp .. '/'
end end
end end
local function get_basename(file) local function get_basename(file)
return file:match '^.+/(.+)$' return file:match '^.+/(.+)$'
end end
local git_root = function() local git_root = function()
local git_dir = vcs.get_git_dir() local git_dir = vcs.get_git_dir()
if not git_dir then if not git_dir then
return '' return ''
end end
local git_root = git_dir:gsub('/.git/?$', '') local git_root = git_dir:gsub('/.git/?$', '')
return get_basename(git_root) return get_basename(git_root)
end end
-- Left side -- Left side
gls.left[1] = { gls.left[1] = {
ViMode = { ViMode = {
provider = { vi_mode }, provider = { vi_mode },
highlight = { colors.bg, colors.bg, 'bold' }, highlight = { colors.bg, colors.bg, 'bold' },
}, },
} }
gls.left[2] = { gls.left[2] = {
FileIcon = { FileIcon = {
provider = { provider = {
function() function()
return ' ' return ' '
end, end,
'FileIcon', 'FileIcon',
}, },
condition = buffer_not_empty, condition = buffer_not_empty,
highlight = { highlight = {
fileinfo.get_file_icon, fileinfo.get_file_icon,
colors.section_bg, colors.section_bg,
}, },
}, },
} }
gls.left[3] = { gls.left[3] = {
FilePath = { FilePath = {
provider = file_path, provider = file_path,
condition = function() condition = function()
return is_file() and checkwidth() return is_file() and checkwidth()
end, end,
highlight = { colors.middlegrey, colors.section_bg }, highlight = { colors.middlegrey, colors.section_bg },
}, },
} }
gls.left[4] = { gls.left[4] = {
FileName = { FileName = {
provider = file_name, provider = file_name,
condition = buffer_not_empty, condition = buffer_not_empty,
highlight = { colors.fg, colors.section_bg }, highlight = { colors.fg, colors.section_bg },
separator = '', separator = '',
separator_highlight = { colors.section_bg, colors.bg }, separator_highlight = { colors.section_bg, colors.bg },
}, },
} }
-- Right side -- Right side
gls.right[1] = { gls.right[1] = {
DiffAdd = { DiffAdd = {
provider = 'DiffAdd', provider = 'DiffAdd',
condition = checkwidth, condition = checkwidth,
icon = '+', icon = '+',
highlight = { colors.green, colors.bg }, highlight = { colors.green, colors.bg },
separator = ' ', separator = ' ',
separator_highlight = { colors.section_bg, colors.bg }, separator_highlight = { colors.section_bg, colors.bg },
}, },
} }
gls.right[2] = { gls.right[2] = {
DiffModified = { DiffModified = {
provider = 'DiffModified', provider = 'DiffModified',
condition = checkwidth, condition = checkwidth,
icon = '~', icon = '~',
highlight = { colors.orange, colors.bg }, highlight = { colors.orange, colors.bg },
}, },
} }
gls.right[3] = { gls.right[3] = {
DiffRemove = { DiffRemove = {
provider = 'DiffRemove', provider = 'DiffRemove',
condition = checkwidth, condition = checkwidth,
icon = '-', icon = '-',
highlight = { colors.red, colors.bg }, highlight = { colors.red, colors.bg },
}, },
} }
gls.right[4] = { gls.right[4] = {
Space = { Space = {
provider = function() provider = function()
return ' ' return ' '
end, end,
highlight = { colors.section_bg, colors.bg }, highlight = { colors.section_bg, colors.bg },
}, },
} }
gls.right[6] = { gls.right[6] = {
GitBranch = { GitBranch = {
provider = { provider = {
function() function()
return '' return ''
end, end,
'GitBranch', 'GitBranch',
}, },
condition = condition.check_git_workspace, condition = condition.check_git_workspace,
highlight = { colors.middlegrey, colors.bg }, highlight = { colors.middlegrey, colors.bg },
}, },
} }
gls.right[7] = { gls.right[7] = {
GitRoot = { GitRoot = {
provider = git_root, provider = git_root,
condition = function() condition = function()
return utils.has_width_gt(50) and condition.check_git_workspace return utils.has_width_gt(50) and condition.check_git_workspace
end, end,
highlight = { colors.fg, colors.bg }, highlight = { colors.fg, colors.bg },
separator = ' ', separator = ' ',
separator_highlight = { colors.middlegrey, colors.bg }, separator_highlight = { colors.middlegrey, colors.bg },
}, },
} }
gls.right[8] = { gls.right[8] = {
PerCent = { PerCent = {
provider = 'LinePercent', provider = 'LinePercent',
separator = '', separator = '',
separator_highlight = { colors.blue, colors.bg }, separator_highlight = { colors.blue, colors.bg },
highlight = { colors.darkgrey, colors.blue }, highlight = { colors.darkgrey, colors.blue },
}, },
} }
-- Short status line -- Short status line
gls.short_line_left[1] = { gls.short_line_left[1] = {
FileIcon = { FileIcon = {
provider = { provider = {
function() function()
return ' ' return ' '
end, end,
'FileIcon', 'FileIcon',
}, },
condition = function() condition = function()
return buffer_not_empty return buffer_not_empty
and has_value(gl.short_line_list, vim.bo.filetype) and has_value(gl.short_line_list, vim.bo.filetype)
end, end,
highlight = { highlight = {
fileinfo.get_file_icon, fileinfo.get_file_icon,
colors.section_bg, colors.section_bg,
}, },
}, },
} }
gls.short_line_left[2] = { gls.short_line_left[2] = {
FileName = { FileName = {
provider = file_name, provider = file_name,
condition = buffer_not_empty, condition = buffer_not_empty,
highlight = { colors.fg, colors.section_bg }, highlight = { colors.fg, colors.section_bg },
separator = '', separator = '',
separator_highlight = { colors.section_bg, colors.bg }, separator_highlight = { colors.section_bg, colors.bg },
}, },
} }
gls.short_line_right[1] = { gls.short_line_right[1] = {
BufferIcon = { BufferIcon = {
provider = 'BufferIcon', provider = 'BufferIcon',
highlight = { colors.yellow, colors.section_bg }, highlight = { colors.yellow, colors.section_bg },
separator = '', separator = '',
separator_highlight = { colors.section_bg, colors.bg }, separator_highlight = { colors.section_bg, colors.bg },
}, },
} }
-- Force manual load so that nvim boots with a status line -- Force manual load so that nvim boots with a status line
gl.load_galaxyline() gl.load_galaxyline()

View File

@ -1,182 +1,182 @@
local fn = vim.fn local fn = vim.fn
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then 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}) 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: Add in downloading of sqlite dll for Windows, here.
end end
lsp_client_capabilities = vim.lsp.protocol.make_client_capabilities() lsp_client_capabilities = vim.lsp.protocol.make_client_capabilities()
return require('packer').startup(function(use) return require('packer').startup(function(use)
use 'wbthomason/packer.nvim' use 'wbthomason/packer.nvim'
use 'dracula/vim' use 'dracula/vim'
use 'kyazdani42/nvim-web-devicons' use 'kyazdani42/nvim-web-devicons'
use { use {
'kyazdani42/nvim-tree.lua', 'kyazdani42/nvim-tree.lua',
requires = 'kyazdani42/nvim-web-devicons', requires = 'kyazdani42/nvim-web-devicons',
config = function() config = function()
require('nvim-tree').setup {} require('nvim-tree').setup {}
end end
} }
use 'bryanmylee/vim-colorscheme-icons' use 'bryanmylee/vim-colorscheme-icons'
use { use {
'akinsho/bufferline.nvim', 'akinsho/bufferline.nvim',
config = function() config = function()
require('bufferline').setup { require('bufferline').setup {
options = { options = {
separator_style = 'slant' separator_style = 'slant'
} }
} }
end end
} }
use { use {
'NTBBloodbath/galaxyline.nvim', 'NTBBloodbath/galaxyline.nvim',
config = function() config = function()
require('galaxyline.themes.minimalist') require('galaxyline.themes.minimalist')
end, end,
requires = { 'kyazdani42/nvim-web-devicons', opt = true } requires = { 'kyazdani42/nvim-web-devicons', opt = true }
} }
use { use {
'tami5/sqlite.lua', 'tami5/sqlite.lua',
config = function() config = function()
if vim.fn.has('win32') then if vim.fn.has('win32') then
-- FIXME need to download the sqlite3.dll from sqlite.org and place in config folder -- 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' vim.g.sqlite_clib_path = vim.fn.stdpath('config') .. '/sqlite3.dll'
end end
end end
} }
use { use {
'nvim-telescope/telescope.nvim', 'nvim-telescope/telescope.nvim',
requires = { 'nvim-lua/plenary.nvim', 'nvim-telescope/telescope-smart-history.nvim' }, requires = { 'nvim-lua/plenary.nvim', 'nvim-telescope/telescope-smart-history.nvim' },
config = function() config = function()
local tele = require('telescope') local tele = require('telescope')
local actions = require('telescope.actions'); local actions = require('telescope.actions');
local actions_generate = require('telescope.actions.generate'); local actions_generate = require('telescope.actions.generate');
tele.setup{ tele.setup{
defaults = { defaults = {
prompt_prefix = "", prompt_prefix = "",
selection_caret = "", selection_caret = "",
mappings = { mappings = {
i = { i = {
["<C-Down>"] = actions.cycle_history_next, ["<C-Down>"] = actions.cycle_history_next,
["<C-Up>"] = actions.cycle_history_prev, ["<C-Up>"] = actions.cycle_history_prev,
["<C-?>"] = actions_generate.which_key { ["<C-?>"] = actions_generate.which_key {
name_width = 22, name_width = 22,
max_height = .05, max_height = .05,
mode_width = 0, mode_width = 0,
separator = '', separator = '',
column_indent = 1, column_indent = 1,
line_padding = 0 line_padding = 0
} }
}, },
n = { n = {
["?"] = actions_generate.which_key { ["?"] = actions_generate.which_key {
name_width = 22, name_width = 22,
max_height = .05, max_height = .05,
mode_width = 0, mode_width = 0,
separator = '', separator = '',
column_indent = 1, column_indent = 1,
line_padding = 0, line_padding = 0,
} }
} }
}, },
history = { history = {
path = vim.fn.stdpath('data') .. '/databases/telescope_history.sqlite3', path = vim.fn.stdpath('data') .. '/databases/telescope_history.sqlite3',
limit = 100, limit = 100,
}, },
layout_config = { layout_config = {
horizontal = { horizontal = {
width = 0.95, width = 0.95,
height = 0.95, height = 0.95,
}, },
vertical = { vertical = {
width = 0.95, width = 0.95,
height = 0.95, height = 0.95,
} }
} }
} }
} }
tele.load_extension('smart_history') tele.load_extension('smart_history')
end, end,
} }
use { use {
'nvim-telescope/telescope-smart-history.nvim', 'nvim-telescope/telescope-smart-history.nvim',
requires = { 'tami5/sqlite.lua' }, requires = { 'tami5/sqlite.lua' },
} }
use 'habamax/vim-godot' use 'habamax/vim-godot'
use 'skywind3000/asyncrun.vim' use 'skywind3000/asyncrun.vim'
use 'lervag/wiki.vim' use 'lervag/wiki.vim'
use 'valloric/listtoggle' use 'valloric/listtoggle'
use { use {
'neovim/nvim-lspconfig', 'neovim/nvim-lspconfig',
config = function() config = function()
require('lspconfig').gdscript.setup{ require('lspconfig').gdscript.setup{
capabilities = lsp_client_capabilities capabilities = lsp_client_capabilities
} }
end, end,
requires = { 'hrsh7th/cmp-nvim-lsp' } requires = { 'hrsh7th/cmp-nvim-lsp' }
} }
use { use {
'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-nvim-lsp',
config = function() config = function()
lsp_client_capabilities = require('cmp_nvim_lsp').update_capabilities(lsp_client_capabilities) lsp_client_capabilities = require('cmp_nvim_lsp').update_capabilities(lsp_client_capabilities)
end end
} }
use 'hrsh7th/cmp-nvim-lua' use 'hrsh7th/cmp-nvim-lua'
use 'hrsh7th/cmp-emoji' use 'hrsh7th/cmp-emoji'
use 'hrsh7th/cmp-path' use 'hrsh7th/cmp-path'
use 'hrsh7th/cmp-buffer' use 'hrsh7th/cmp-buffer'
use { use {
'hrsh7th/nvim-cmp', 'hrsh7th/nvim-cmp',
config = function() config = function()
local cmp = require 'cmp' local cmp = require 'cmp'
cmp.setup({ cmp.setup({
mapping = { mapping = {
['<C-d>'] = cmp.mapping.scroll_docs(-4), ['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4), ['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(), ['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.close(), ['<C-e>'] = cmp.mapping.close(),
['<CR>'] = cmp.mapping.confirm({ select = true }), ['<CR>'] = cmp.mapping.confirm({ select = true }),
['<TAB>'] = cmp.mapping.confirm({ select = true }) ['<TAB>'] = cmp.mapping.confirm({ select = true })
}, },
sources = { sources = {
{ name = 'nvim_lsp' }, { name = 'nvim_lsp' },
{ name = 'buffer' }, { name = 'buffer' },
{ name = 'emoji' }, { name = 'emoji' },
{ name = 'path' }, { name = 'path' },
{ name = 'nvim_lua' }, { name = 'nvim_lua' },
}, },
experimental = { experimental = {
ghost_text = true ghost_text = true
} }
}) })
end end
} }
use { use {
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
run = function() run = function()
vim.cmd(':TSUpdate') vim.cmd(':TSUpdate')
end, end,
config = function() config = function()
require 'nvim-treesitter.install'.compilers = { 'cl', 'clang' } require 'nvim-treesitter.install'.compilers = { 'cl', 'clang' }
end end
} }
use { use {
'onsails/lspkind-nvim', 'onsails/lspkind-nvim',
config = function() config = function()
require('lspkind').init{} require('lspkind').init{}
end end
} }
use 'lepture/vim-jinja' use 'lepture/vim-jinja'
use { use {
'neoclide/coc.nvim', 'neoclide/coc.nvim',
branch = 'release' branch = 'release'
} }
use 'editorconfig/editorconfig-vim' use 'editorconfig/editorconfig-vim'
end) end)