From 5e1d627e2e0403138a97e41c3e4d523a3fb0bac7 Mon Sep 17 00:00:00 2001 From: Vivianne Langdon Date: Sat, 5 Mar 2022 03:35:05 -0800 Subject: [PATCH] Dos2unix --- coc-settings.json | 6 +- init.vim | 222 ++++----- local.vim.template | 6 +- lua/conf/utils.lua | 26 +- lua/galaxyline/themes/minimalist.lua | 642 +++++++++++++-------------- lua/plugins.lua | 364 +++++++-------- 6 files changed, 633 insertions(+), 633 deletions(-) diff --git a/coc-settings.json b/coc-settings.json index e6500d3..85243d9 100644 --- a/coc-settings.json +++ b/coc-settings.json @@ -1,3 +1,3 @@ -{ - "diagnostic.showUnused": false, -} +{ + "diagnostic.showUnused": false, +} diff --git a/init.vim b/init.vim index 3c56ecb..ff289e0 100644 --- a/init.vim +++ b/init.vim @@ -1,111 +1,111 @@ -let $CONFIG = stdpath('config') -let $SCR_PLUGINS = $CONFIG . '/lua/plugins.lua' -let $SCR_INIT = $CONFIG . '/init.vim' - -if has('win32') - source $VIMRUNTIME/mswin.vim -endif - -set termguicolors - -lua require('plugins') - -filetype plugin indent on -set tabstop=2 softtabstop=0 shiftwidth=2 expandtab smarttab autoindent -set incsearch ignorecase smartcase hlsearch -set wildmode=longest,list,full wildmenu -set ruler laststatus=2 showcmd showmode -" set list listchars=trail: -set fillchars+=vert:\ -set wrap breakindent -set encoding=utf-8 -set textwidth=0 -set hidden -set number -set title - -set mouse=a -set cursorline -set updatetime=300 -set emoji -set noshowcmd -set noshowmode - -syntax on -colorscheme dracula - -nnoremap ]b :BufferLineCycleNext -nnoremap [b :BufferLineCyclePrev -nnoremap bp :BufferLinePick -nnoremap bcc :BufferLinePickClose -nnoremap bcl :BufferLineCloseLeft -nnoremap bcr :BufferLineCloseRight - -augroup packer_user_config - autocmd! - autocmd BufWritePost $SCR_PLUGINS source | PackerCompile -augroup end - -augroup init_refresh - autocmd! - autocmd BufWritePost $SCR_INIT source -augroup end - -augroup telescope - autocmd! - autocmd QuickFixCmdPost qf :Telescope quickfix -augroup end - -if exists('g:fvim_loaded') - nnoremap :set guifont=+ - nnoremap :set guifont=- - - FVimCursorSmoothMove v:true - FVimCursorSmoothBlink v:true - - FVimBackgroundComposition 'transparent' - FVimBackgroundOpacity 0.90 - FVimBackgroundAltOpacity 0.85 - FVimCustomTitleBar v:false - - FVimFontLigature v:true - - set guifont=JetBrains\ Mono:h12.5 -endif - -nnoremap :NvimTreeToggle - -let g:scrollview_current_only = 1 - -nnoremap vv e $SCR_INIT -nnoremap vp e $SCR_PLUGINS - -" Telescope binds -nnoremap F Telescope resume -nnoremap fr Telescope resume -nnoremap ff Telescope find_files -nnoremap fg Telescope live_grep -nnoremap fb Telescope buffers -nnoremap fh Telescope help_tags -nnoremap fq Telescope quickfix -nnoremap fc Telescope command_history -nnoremap fs Telescope search_history - -command CDC cd %:p:h - -" wiki.vim bindings -let g:wiki_filetypes = ['md'] -nnoremap fw lua require'telescope.builtin'.find_files({ cwd = vim.g.wiki_root }) -nnoremap fW lua require'telescope.builtin'.live_grep({ cwd = vim.g.wiki_root }) -nnoremap ft WikiTagSearch - -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] - -let g:lt_location_list_toggle_map = 'l' -let g:lt_quickfix_list_toggle_map = 'q' - -" machine-specific settings -source $CONFIG/local.vim +let $CONFIG = stdpath('config') +let $SCR_PLUGINS = $CONFIG . '/lua/plugins.lua' +let $SCR_INIT = $CONFIG . '/init.vim' + +if has('win32') + source $VIMRUNTIME/mswin.vim +endif + +set termguicolors + +lua require('plugins') + +filetype plugin indent on +set tabstop=2 softtabstop=0 shiftwidth=2 expandtab smarttab autoindent +set incsearch ignorecase smartcase hlsearch +set wildmode=longest,list,full wildmenu +set ruler laststatus=2 showcmd showmode +" set list listchars=trail: +set fillchars+=vert:\ +set wrap breakindent +set encoding=utf-8 +set textwidth=0 +set hidden +set number +set title + +set mouse=a +set cursorline +set updatetime=300 +set emoji +set noshowcmd +set noshowmode + +syntax on +colorscheme dracula + +nnoremap ]b :BufferLineCycleNext +nnoremap [b :BufferLineCyclePrev +nnoremap bp :BufferLinePick +nnoremap bcc :BufferLinePickClose +nnoremap bcl :BufferLineCloseLeft +nnoremap bcr :BufferLineCloseRight + +augroup packer_user_config + autocmd! + autocmd BufWritePost $SCR_PLUGINS source | PackerCompile +augroup end + +augroup init_refresh + autocmd! + autocmd BufWritePost $SCR_INIT source +augroup end + +augroup telescope + autocmd! + autocmd QuickFixCmdPost qf :Telescope quickfix +augroup end + +if exists('g:fvim_loaded') + nnoremap :set guifont=+ + nnoremap :set guifont=- + + FVimCursorSmoothMove v:true + FVimCursorSmoothBlink v:true + + FVimBackgroundComposition 'transparent' + FVimBackgroundOpacity 0.90 + FVimBackgroundAltOpacity 0.85 + FVimCustomTitleBar v:false + + FVimFontLigature v:true + + set guifont=JetBrains\ Mono:h12.5 +endif + +nnoremap :NvimTreeToggle + +let g:scrollview_current_only = 1 + +nnoremap vv e $SCR_INIT +nnoremap vp e $SCR_PLUGINS + +" Telescope binds +nnoremap F Telescope resume +nnoremap fr Telescope resume +nnoremap ff Telescope find_files +nnoremap fg Telescope live_grep +nnoremap fb Telescope buffers +nnoremap fh Telescope help_tags +nnoremap fq Telescope quickfix +nnoremap fc Telescope command_history +nnoremap fs Telescope search_history + +command CDC cd %:p:h + +" wiki.vim bindings +let g:wiki_filetypes = ['md'] +nnoremap fw lua require'telescope.builtin'.find_files({ cwd = vim.g.wiki_root }) +nnoremap fW lua require'telescope.builtin'.live_grep({ cwd = vim.g.wiki_root }) +nnoremap ft WikiTagSearch + +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] + +let g:lt_location_list_toggle_map = 'l' +let g:lt_quickfix_list_toggle_map = 'q' + +" machine-specific settings +source $CONFIG/local.vim diff --git a/local.vim.template b/local.vim.template index 69d25b7..9d839d0 100644 --- a/local.vim.template +++ b/local.vim.template @@ -1,3 +1,3 @@ --- Edit this as needed for your local config. -let g:wiki_root = $HOME . '/wiki' --- let g:godot_executable = 'SOME_PATH' +-- Edit this as needed for your local config. +let g:wiki_root = $HOME . '/wiki' +-- let g:godot_executable = 'SOME_PATH' diff --git a/lua/conf/utils.lua b/lua/conf/utils.lua index db5c18f..a9c641c 100644 --- a/lua/conf/utils.lua +++ b/lua/conf/utils.lua @@ -1,13 +1,13 @@ -local M = {} - -function M.is_buffer_empty() - -- Check whether the current buffer is empty - return vim.fn.empty(vim.fn.expand '%:t') == 1 -end - -function M.has_width_gt(cols) - -- Check if the windows width is greater than a given number of columns - return vim.fn.winwidth(0) / 2 > cols -end - -return M +local M = {} + +function M.is_buffer_empty() + -- Check whether the current buffer is empty + return vim.fn.empty(vim.fn.expand '%:t') == 1 +end + +function M.has_width_gt(cols) + -- Check if the windows width is greater than a given number of columns + return vim.fn.winwidth(0) / 2 > cols +end + +return M diff --git a/lua/galaxyline/themes/minimalist.lua b/lua/galaxyline/themes/minimalist.lua index 06966b9..ecffaaf 100644 --- a/lua/galaxyline/themes/minimalist.lua +++ b/lua/galaxyline/themes/minimalist.lua @@ -1,321 +1,321 @@ -local gl = require 'galaxyline' -local utils = require 'conf.utils' -local condition = require 'galaxyline.condition' -local vcs = require 'galaxyline.providers.vcs' -local fileinfo = require 'galaxyline.providers.fileinfo' - -local gls = gl.section -gl.short_line_list = { - 'packer', - 'NvimTree', - 'Outline', - 'Trouble', - 'dap-repl', - 'dapui_scopes', - 'dapui_breakpoints', - 'dapui_stacks', - 'dapui_watches', -} - -local colors = { - bg = '#282c34', - fg = '#abb2bf', - section_bg = '#38393f', - blue = '#61afef', - green = '#98c379', - purple = '#c678dd', - orange = '#e5c07b', - red = '#e06c75', - yellow = '#e5c07b', - darkgrey = '#2c323d', - middlegrey = '#8791A5', -} -local mode_colors = { - ['n'] = colors.green, - ['i'] = colors.blue, - ['c'] = colors.green, - ['t'] = colors.blue, - ['v'] = colors.purple, - ['\x16'] = colors.purple, - ['V'] = colors.purple, - ['R'] = colors.red, - ['s'] = colors.red, - ['S'] = colors.red, - ['ic'] = colors.blue, -} -local mode_names = { - ['n'] = 'NORMAL', - ['i'] = 'INSERT', - ['c'] = 'COMMAND', - ['t'] = 'TERMINAL', - ['v'] = 'VISUAL', - ['\x16'] = 'V-BLOCK', - ['V'] = 'V-LINE', - ['R'] = 'REPLACE', - ['s'] = 'SELECT', - ['S'] = 'S-LINE', - ['ic'] = 'COMPLETION', -} - --- Local helper functions -local buffer_not_empty = function() - return not utils.is_buffer_empty() -end - -local checkwidth = function() - return utils.has_width_gt(35) and buffer_not_empty() -end - -local is_file = function() - return vim.bo.buftype ~= 'nofile' -end - -local function has_value(tab, val) - for _, value in ipairs(tab) do - if value[1] == val then - return true - end - end - return false -end - -local get_mode = function() - return vim.api.nvim_get_mode()['mode'] -end - -local mode_color = function(mode) - local color = mode_colors[mode] - if color ~= nil then - return color - end - print 'statusline: error looking up vi mode color' - return colors.middlegrey -end - -local vi_mode = function() - local mode = get_mode() - local color = mode_color(mode) - vim.cmd('hi GalaxyViMode guibg=' .. color) - local alias = mode_names[mode] - if alias ~= nil then - if not utils.has_width_gt(35) then - alias = alias:sub(1, 1) - end - else - alias = mode - end - return ' ' .. alias .. ' ' -end - -local function file_readonly() - if vim.bo.filetype == 'help' then - return false - end - if vim.bo.readonly then - return true - end - return false -end - -local function file_name() - local file = vim.fn.expand '%:t' - if not file then - return '' - end - if file_readonly() then - return file .. '  ' - end - if vim.bo.modifiable and vim.bo.modified then - return file .. '  ' - end - return file .. ' ' -end - -local function split(str, sep) - local res = {} - local n = 1 - for w in str:gmatch('([^' .. sep .. ']*)') do - res[n] = res[n] or w -- only set once (so the blank after a string is ignored) - if w == '' then - n = n + 1 - end -- step forwards on a blank but not a string - end - return res -end - -local function file_path() - local fp = vim.fn.fnamemodify(vim.fn.expand '%', ':~:.:h') - local tbl = split(fp, '/') - local len = #tbl - - if len > 2 and not len == 3 and not tbl[0] == '~' then - return '…/' .. table.concat(tbl, '/', len - 1) .. '/' -- shorten filepath to last 2 folders - -- alternative: only 1 containing folder using vim builtin function - -- return '…/' .. vim.fn.fnamemodify(vim.fn.expand '%', ':p:h:t') .. '/' - else - return fp .. '/' - end -end - -local function get_basename(file) - return file:match '^.+/(.+)$' -end - -local git_root = function() - local git_dir = vcs.get_git_dir() - if not git_dir then - return '' - end - - local git_root = git_dir:gsub('/.git/?$', '') - return get_basename(git_root) -end - --- Left side -gls.left[1] = { - ViMode = { - provider = { vi_mode }, - highlight = { colors.bg, colors.bg, 'bold' }, - }, -} -gls.left[2] = { - FileIcon = { - provider = { - function() - return ' ' - end, - 'FileIcon', - }, - condition = buffer_not_empty, - highlight = { - fileinfo.get_file_icon, - colors.section_bg, - }, - }, -} -gls.left[3] = { - FilePath = { - provider = file_path, - condition = function() - return is_file() and checkwidth() - end, - highlight = { colors.middlegrey, colors.section_bg }, - }, -} -gls.left[4] = { - FileName = { - provider = file_name, - condition = buffer_not_empty, - highlight = { colors.fg, colors.section_bg }, - separator = '', - separator_highlight = { colors.section_bg, colors.bg }, - }, -} - --- Right side -gls.right[1] = { - DiffAdd = { - provider = 'DiffAdd', - condition = checkwidth, - icon = '+', - highlight = { colors.green, colors.bg }, - separator = ' ', - separator_highlight = { colors.section_bg, colors.bg }, - }, -} -gls.right[2] = { - DiffModified = { - provider = 'DiffModified', - condition = checkwidth, - icon = '~', - highlight = { colors.orange, colors.bg }, - }, -} -gls.right[3] = { - DiffRemove = { - provider = 'DiffRemove', - condition = checkwidth, - icon = '-', - highlight = { colors.red, colors.bg }, - }, -} -gls.right[4] = { - Space = { - provider = function() - return ' ' - end, - highlight = { colors.section_bg, colors.bg }, - }, -} -gls.right[6] = { - GitBranch = { - provider = { - function() - return '  ' - end, - 'GitBranch', - }, - condition = condition.check_git_workspace, - highlight = { colors.middlegrey, colors.bg }, - }, -} -gls.right[7] = { - GitRoot = { - provider = git_root, - condition = function() - return utils.has_width_gt(50) and condition.check_git_workspace - end, - highlight = { colors.fg, colors.bg }, - separator = ' ', - separator_highlight = { colors.middlegrey, colors.bg }, - }, -} -gls.right[8] = { - PerCent = { - provider = 'LinePercent', - separator = ' ', - separator_highlight = { colors.blue, colors.bg }, - highlight = { colors.darkgrey, colors.blue }, - }, -} - --- Short status line -gls.short_line_left[1] = { - FileIcon = { - provider = { - function() - return ' ' - end, - 'FileIcon', - }, - condition = function() - return buffer_not_empty - and has_value(gl.short_line_list, vim.bo.filetype) - end, - highlight = { - fileinfo.get_file_icon, - colors.section_bg, - }, - }, -} -gls.short_line_left[2] = { - FileName = { - provider = file_name, - condition = buffer_not_empty, - highlight = { colors.fg, colors.section_bg }, - separator = '', - separator_highlight = { colors.section_bg, colors.bg }, - }, -} - -gls.short_line_right[1] = { - BufferIcon = { - provider = 'BufferIcon', - highlight = { colors.yellow, colors.section_bg }, - separator = '', - separator_highlight = { colors.section_bg, colors.bg }, - }, -} - --- Force manual load so that nvim boots with a status line -gl.load_galaxyline() +local gl = require 'galaxyline' +local utils = require 'conf.utils' +local condition = require 'galaxyline.condition' +local vcs = require 'galaxyline.providers.vcs' +local fileinfo = require 'galaxyline.providers.fileinfo' + +local gls = gl.section +gl.short_line_list = { + 'packer', + 'NvimTree', + 'Outline', + 'Trouble', + 'dap-repl', + 'dapui_scopes', + 'dapui_breakpoints', + 'dapui_stacks', + 'dapui_watches', +} + +local colors = { + bg = '#282c34', + fg = '#abb2bf', + section_bg = '#38393f', + blue = '#61afef', + green = '#98c379', + purple = '#c678dd', + orange = '#e5c07b', + red = '#e06c75', + yellow = '#e5c07b', + darkgrey = '#2c323d', + middlegrey = '#8791A5', +} +local mode_colors = { + ['n'] = colors.green, + ['i'] = colors.blue, + ['c'] = colors.green, + ['t'] = colors.blue, + ['v'] = colors.purple, + ['\x16'] = colors.purple, + ['V'] = colors.purple, + ['R'] = colors.red, + ['s'] = colors.red, + ['S'] = colors.red, + ['ic'] = colors.blue, +} +local mode_names = { + ['n'] = 'NORMAL', + ['i'] = 'INSERT', + ['c'] = 'COMMAND', + ['t'] = 'TERMINAL', + ['v'] = 'VISUAL', + ['\x16'] = 'V-BLOCK', + ['V'] = 'V-LINE', + ['R'] = 'REPLACE', + ['s'] = 'SELECT', + ['S'] = 'S-LINE', + ['ic'] = 'COMPLETION', +} + +-- Local helper functions +local buffer_not_empty = function() + return not utils.is_buffer_empty() +end + +local checkwidth = function() + return utils.has_width_gt(35) and buffer_not_empty() +end + +local is_file = function() + return vim.bo.buftype ~= 'nofile' +end + +local function has_value(tab, val) + for _, value in ipairs(tab) do + if value[1] == val then + return true + end + end + return false +end + +local get_mode = function() + return vim.api.nvim_get_mode()['mode'] +end + +local mode_color = function(mode) + local color = mode_colors[mode] + if color ~= nil then + return color + end + print 'statusline: error looking up vi mode color' + return colors.middlegrey +end + +local vi_mode = function() + local mode = get_mode() + local color = mode_color(mode) + vim.cmd('hi GalaxyViMode guibg=' .. color) + local alias = mode_names[mode] + if alias ~= nil then + if not utils.has_width_gt(35) then + alias = alias:sub(1, 1) + end + else + alias = mode + end + return ' ' .. alias .. ' ' +end + +local function file_readonly() + if vim.bo.filetype == 'help' then + return false + end + if vim.bo.readonly then + return true + end + return false +end + +local function file_name() + local file = vim.fn.expand '%:t' + if not file then + return '' + end + if file_readonly() then + return file .. '  ' + end + if vim.bo.modifiable and vim.bo.modified then + return file .. '  ' + end + return file .. ' ' +end + +local function split(str, sep) + local res = {} + local n = 1 + for w in str:gmatch('([^' .. sep .. ']*)') do + res[n] = res[n] or w -- only set once (so the blank after a string is ignored) + if w == '' then + n = n + 1 + end -- step forwards on a blank but not a string + end + return res +end + +local function file_path() + local fp = vim.fn.fnamemodify(vim.fn.expand '%', ':~:.:h') + local tbl = split(fp, '/') + local len = #tbl + + if len > 2 and not len == 3 and not tbl[0] == '~' then + return '…/' .. table.concat(tbl, '/', len - 1) .. '/' -- shorten filepath to last 2 folders + -- alternative: only 1 containing folder using vim builtin function + -- return '…/' .. vim.fn.fnamemodify(vim.fn.expand '%', ':p:h:t') .. '/' + else + return fp .. '/' + end +end + +local function get_basename(file) + return file:match '^.+/(.+)$' +end + +local git_root = function() + local git_dir = vcs.get_git_dir() + if not git_dir then + return '' + end + + local git_root = git_dir:gsub('/.git/?$', '') + return get_basename(git_root) +end + +-- Left side +gls.left[1] = { + ViMode = { + provider = { vi_mode }, + highlight = { colors.bg, colors.bg, 'bold' }, + }, +} +gls.left[2] = { + FileIcon = { + provider = { + function() + return ' ' + end, + 'FileIcon', + }, + condition = buffer_not_empty, + highlight = { + fileinfo.get_file_icon, + colors.section_bg, + }, + }, +} +gls.left[3] = { + FilePath = { + provider = file_path, + condition = function() + return is_file() and checkwidth() + end, + highlight = { colors.middlegrey, colors.section_bg }, + }, +} +gls.left[4] = { + FileName = { + provider = file_name, + condition = buffer_not_empty, + highlight = { colors.fg, colors.section_bg }, + separator = '', + separator_highlight = { colors.section_bg, colors.bg }, + }, +} + +-- Right side +gls.right[1] = { + DiffAdd = { + provider = 'DiffAdd', + condition = checkwidth, + icon = '+', + highlight = { colors.green, colors.bg }, + separator = ' ', + separator_highlight = { colors.section_bg, colors.bg }, + }, +} +gls.right[2] = { + DiffModified = { + provider = 'DiffModified', + condition = checkwidth, + icon = '~', + highlight = { colors.orange, colors.bg }, + }, +} +gls.right[3] = { + DiffRemove = { + provider = 'DiffRemove', + condition = checkwidth, + icon = '-', + highlight = { colors.red, colors.bg }, + }, +} +gls.right[4] = { + Space = { + provider = function() + return ' ' + end, + highlight = { colors.section_bg, colors.bg }, + }, +} +gls.right[6] = { + GitBranch = { + provider = { + function() + return '  ' + end, + 'GitBranch', + }, + condition = condition.check_git_workspace, + highlight = { colors.middlegrey, colors.bg }, + }, +} +gls.right[7] = { + GitRoot = { + provider = git_root, + condition = function() + return utils.has_width_gt(50) and condition.check_git_workspace + end, + highlight = { colors.fg, colors.bg }, + separator = ' ', + separator_highlight = { colors.middlegrey, colors.bg }, + }, +} +gls.right[8] = { + PerCent = { + provider = 'LinePercent', + separator = ' ', + separator_highlight = { colors.blue, colors.bg }, + highlight = { colors.darkgrey, colors.blue }, + }, +} + +-- Short status line +gls.short_line_left[1] = { + FileIcon = { + provider = { + function() + return ' ' + end, + 'FileIcon', + }, + condition = function() + return buffer_not_empty + and has_value(gl.short_line_list, vim.bo.filetype) + end, + highlight = { + fileinfo.get_file_icon, + colors.section_bg, + }, + }, +} +gls.short_line_left[2] = { + FileName = { + provider = file_name, + condition = buffer_not_empty, + highlight = { colors.fg, colors.section_bg }, + separator = '', + separator_highlight = { colors.section_bg, colors.bg }, + }, +} + +gls.short_line_right[1] = { + BufferIcon = { + provider = 'BufferIcon', + highlight = { colors.yellow, colors.section_bg }, + separator = '', + separator_highlight = { colors.section_bg, colors.bg }, + }, +} + +-- Force manual load so that nvim boots with a status line +gl.load_galaxyline() diff --git a/lua/plugins.lua b/lua/plugins.lua index eb1aa97..ec1d59a 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -1,182 +1,182 @@ -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. -end - -lsp_client_capabilities = vim.lsp.protocol.make_client_capabilities() - -return require('packer').startup(function(use) - use 'wbthomason/packer.nvim' - use 'dracula/vim' - use 'kyazdani42/nvim-web-devicons' - use { - 'kyazdani42/nvim-tree.lua', - requires = 'kyazdani42/nvim-web-devicons', - config = function() - require('nvim-tree').setup {} - 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') 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'); - - tele.setup{ - defaults = { - prompt_prefix = " ", - selection_caret = " ", - mappings = { - i = { - [""] = actions.cycle_history_next, - [""] = actions.cycle_history_prev, - [""] = 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 = vim.fn.stdpath('data') .. '/databases/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' - 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 = { - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.close(), - [''] = cmp.mapping.confirm({ select = true }), - [''] = 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' } - end - } - use { - 'onsails/lspkind-nvim', - config = function() - require('lspkind').init{} - end - } - use 'lepture/vim-jinja' - use { - 'neoclide/coc.nvim', - branch = 'release' - } - use 'editorconfig/editorconfig-vim' -end) - - +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. +end + +lsp_client_capabilities = vim.lsp.protocol.make_client_capabilities() + +return require('packer').startup(function(use) + use 'wbthomason/packer.nvim' + use 'dracula/vim' + use 'kyazdani42/nvim-web-devicons' + use { + 'kyazdani42/nvim-tree.lua', + requires = 'kyazdani42/nvim-web-devicons', + config = function() + require('nvim-tree').setup {} + 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') 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'); + + tele.setup{ + defaults = { + prompt_prefix = " ", + selection_caret = " ", + mappings = { + i = { + [""] = actions.cycle_history_next, + [""] = actions.cycle_history_prev, + [""] = 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 = vim.fn.stdpath('data') .. '/databases/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' + 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 = { + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.close(), + [''] = cmp.mapping.confirm({ select = true }), + [''] = 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' } + end + } + use { + 'onsails/lspkind-nvim', + config = function() + require('lspkind').init{} + end + } + use 'lepture/vim-jinja' + use { + 'neoclide/coc.nvim', + branch = 'release' + } + use 'editorconfig/editorconfig-vim' +end) + +