aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/alpha/colors.lua16
-rw-r--r--lua/alpha/completition.lua96
-rw-r--r--lua/alpha/dap.lua2
-rw-r--r--lua/alpha/disable_builtin.lua20
-rw-r--r--lua/alpha/first_load.lua27
-rw-r--r--lua/alpha/globals.lua (renamed from lua/alpha/global.lua)0
-rw-r--r--lua/alpha/harpoon.lua7
-rw-r--r--lua/alpha/init.lua2
-rw-r--r--lua/alpha/lsp.lua43
-rw-r--r--lua/alpha/plugins.lua (renamed from lua/plugins.lua)3
-rw-r--r--lua/alpha/status-line.lua31
-rw-r--r--lua/alpha/treesitter.lua60
12 files changed, 50 insertions, 257 deletions
diff --git a/lua/alpha/colors.lua b/lua/alpha/colors.lua
deleted file mode 100644
index d6d0d18..0000000
--- a/lua/alpha/colors.lua
+++ /dev/null
@@ -1,16 +0,0 @@
-local Color, colors, Group, groups, styles = require('colorbuddy').setup()
-
--- Use Color.new(<name>, <#rrggbb>) to create new colors
--- They can be accessed through colors.<name>
-Color.new('background', '#282c34')
-Color.new('red', '#cc6666')
-Color.new('green', '#99cc99')
-Color.new('yellow', '#f0c674')
-
--- Define highlights in terms of `colors` and `groups`
-Group.new('Comment' , colors.yellow , colors.background , styles.bold)
-Group.new('Special' , groups.Comment , groups.Comment , groups.Comment)
-Group.new('NonText' , groups.Comment , groups.Comment , groups.Comment)
-
--- Define highlights in relative terms of other colors
-Group.new('Error' , colors.red:light() , nil , styles.bold)
diff --git a/lua/alpha/completition.lua b/lua/alpha/completition.lua
deleted file mode 100644
index 7140ca5..0000000
--- a/lua/alpha/completition.lua
+++ /dev/null
@@ -1,96 +0,0 @@
-local lspkind = require "lspkind"
-
-local luasnip = require("luasnip")
-local cmp = require "cmp"
-local cmp_autopairs = require('nvim-autopairs.completion.cmp')
-cmp.event:on( 'confirm_done', cmp_autopairs.on_confirm_done({ map_char = { tex = '' } }))
-
-cmp.setup {
- mapping = {
- ["<C-d>"] = cmp.mapping.scroll_docs(-4),
- ["<C-f>"] = cmp.mapping.scroll_docs(4),
- ["<C-e>"] = cmp.mapping(function(fallback)
- if cmp.visible() then
- cmp.close()
- elseif luasnip.expand_or_jumpable() then
- luasnip.expand_or_jump()
- else
- fallback()
- end
- end, { "i", "s" }),
- ["<C-n>"] = cmp.mapping(function(fallback)
- if cmp.visible() then
- cmp.select_next_item()
- elseif luasnip.choice_active() then
- luasnip.change_choice(1)
- else
- fallback()
- end
- end, { "i", "s" }),
- ["<C-y>"] = cmp.mapping.confirm {
- behavior = cmp.ConfirmBehavior.Insert,
- select = true,
- },
- ["<c-space>"] = cmp.mapping.complete(),
- },
- sources = {
- { name = "nvim_lua" },
- { name = "nvim_lsp" },
- { name = "path" },
- { name = "luasnip" },
- {
- name = "buffer",
- keyword_length = 5,
- option = {
- get_bufnrs = function()
- local bufs = {}
- for _, win in ipairs(vim.api.nvim_list_wins()) do
- bufs[vim.api.nvim_win_get_buf(win)] = true
- end
- return vim.tbl_keys(bufs)
- end
- }
- },
- },
-
- snippet = {
- expand = function(args)
- require("luasnip").lsp_expand(args.body)
- end,
- },
-
- formatting = {
- format = lspkind.cmp_format {
- with_text = true,
- menu = {
- buffer = "[buf]",
- nvim_lsp = "[LSP]",
- nvim_lua = "[api]",
- path = "[path]",
- luasnip = "[snip]",
- }
- }
- },
-
- experimental = {
- native_menu = false,
-
- ghost_text = true,
- }
-}
--- Setup lspconfig.
- local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
- -- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled.
- require('lspconfig')['emmet_ls'].setup {
- capabilities = capabilities
- }
-
-local Group = require("colorbuddy.group").Group
-local g = require("colorbuddy.group").groups
-local s = require("colorbuddy.style").styles
-
-Group.new("CmpItemAbbr", g.Comment)
-Group.new("CmpItemAbbrDeprecated", g.Error)
-Group.new("CmpItemAbbrMatchFuzzy", g.CmpItemAbbr.fg:dark(), nil, s.italic)
-Group.new("CmpItemKind", g.Special)
-Group.new("CmpItemMenu", g.NonText)
diff --git a/lua/alpha/dap.lua b/lua/alpha/dap.lua
index fdd2150..bd1a403 100644
--- a/lua/alpha/dap.lua
+++ b/lua/alpha/dap.lua
@@ -13,7 +13,7 @@ dap_install.config("php", {
port = 9003,
pathMappings = function ()
local sail = vim.call('composer#query', 'require-dev.laravel/sail')
- if sail == nil then
+ if sail == "" then
return {['/app'] = vim.fn.getcwd()}
end
return {['/var/www/html'] = vim.fn.getcwd()}
diff --git a/lua/alpha/disable_builtin.lua b/lua/alpha/disable_builtin.lua
new file mode 100644
index 0000000..6177c82
--- /dev/null
+++ b/lua/alpha/disable_builtin.lua
@@ -0,0 +1,20 @@
+vim.g.loaded_gzip = 1
+vim.g.loaded_zip = 1
+vim.g.loaded_zipPlugin = 1
+vim.g.loaded_tar = 1
+vim.g.loaded_tarPlugin = 1
+
+vim.g.loaded_getscript = 1
+vim.g.loaded_getscriptPlugin = 1
+vim.g.loaded_vimball = 1
+vim.g.loaded_vimballPlugin = 1
+vim.g.loaded_2html_plugin = 1
+
+vim.g.loaded_matchit = 1
+vim.g.loaded_matchparen = 1
+vim.g.loaded_logiPat = 1
+vim.g.loaded_rrhelper = 1
+
+-- vim.g.loaded_netrw = 1
+-- vim.g.loaded_netrwPlugin = 1
+-- vim.g.loaded_netrwSettings = 1
diff --git a/lua/alpha/first_load.lua b/lua/alpha/first_load.lua
new file mode 100644
index 0000000..9ef6658
--- /dev/null
+++ b/lua/alpha/first_load.lua
@@ -0,0 +1,27 @@
+local download_packer = function()
+ if vim.fn.input "Download Packer? (y for yes)" ~= "y" then
+ return
+ end
+
+ local directory = string.format("%s/site/pack/packer/start/", vim.fn.stdpath "data")
+
+ vim.fn.mkdir(directory, "p")
+
+ local out = vim.fn.system(
+ string.format("git clone %s %s", "https://github.com/wbthomason/packer.nvim", directory .. "/packer.nvim")
+ )
+
+ print(out)
+ print "Downloading packer.nvim..."
+ print "( You'll need to restart now )"
+end
+
+return function()
+ if not pcall(require, "packer") then
+ download_packer()
+
+ return true
+ end
+
+ return false
+end
diff --git a/lua/alpha/global.lua b/lua/alpha/globals.lua
index 5fcee70..5fcee70 100644
--- a/lua/alpha/global.lua
+++ b/lua/alpha/globals.lua
diff --git a/lua/alpha/harpoon.lua b/lua/alpha/harpoon.lua
deleted file mode 100644
index c4fa9df..0000000
--- a/lua/alpha/harpoon.lua
+++ /dev/null
@@ -1,7 +0,0 @@
-vim.api.nvim_set_keymap("n", "<Leader>ss", [[ <Cmd>lua require("harpoon.ui").toggle_quick_menu()<CR>]], {noremap = true, silent = true, expr = false})
-
-vim.api.nvim_set_keymap("n", "<Leader>sa", [[ <Cmd>lua require("harpoon.mark").add_file()<CR>]], {noremap = true, silent = true, expr = false})
-vim.api.nvim_set_keymap("n", "<Leader>su", [[ <Cmd>lua require("harpoon.ui").nav_file(1)<CR>]], {noremap = true, silent = true, expr = false})
-vim.api.nvim_set_keymap("n", "<Leader>si", [[ <Cmd>lua require("harpoon.ui").nav_file(2)<CR>]], {noremap = true, silent = true, expr = false})
-vim.api.nvim_set_keymap("n", "<Leader>so", [[ <Cmd>lua require("harpoon.ui").nav_file(3)<CR>]], {noremap = true, silent = true, expr = false})
-vim.api.nvim_set_keymap("n", "<Leader>sp", [[ <Cmd>lua require("harpoon.ui").nav_file(4)<CR>]], {noremap = true, silent = true, expr = false})
diff --git a/lua/alpha/init.lua b/lua/alpha/init.lua
index cd38f36..0b14730 100644
--- a/lua/alpha/init.lua
+++ b/lua/alpha/init.lua
@@ -14,6 +14,4 @@ require("alpha.dap")
vim.api.nvim_set_keymap('n', '<leader>rs', ':lua require(\'alpha.refactor\').setter_getter()<cr>', {noremap = true})
vim.api.nvim_set_keymap('n', '<leader>rn', ':lua require(\'alpha.refactor\').new_property()<cr>', {noremap = true})
-vim.api.nvim_set_keymap('n', '<leader><leader>x', ':call alpha#save_and_exec()<cr>', {noremap = true})
-
vim.api.nvim_set_keymap('n', '<leader>m', ':MaximizerToggle<cr>', {noremap = true})
diff --git a/lua/alpha/lsp.lua b/lua/alpha/lsp.lua
deleted file mode 100644
index 40a56d6..0000000
--- a/lua/alpha/lsp.lua
+++ /dev/null
@@ -1,43 +0,0 @@
-local function on_attach()
- -- keymaps for lsp
- vim.api.nvim_set_keymap('n', 'K', ':lua vim.lsp.buf.hover()<cr>', {noremap = true})
- vim.api.nvim_set_keymap('n', '<leader>vd', ':lua vim.lsp.buf.definition()<cr>', {noremap = true})
-
-
- vim.api.nvim_set_keymap('n', '<leader>vo', ':LspRestart<cr>', {noremap = true})
-
- -- diagnostics to move between info and errors
- vim.api.nvim_set_keymap('n', '<leader>vn', ':lua vim.lsp.diagnostic.goto_next()<cr>', {noremap = true})
- vim.api.nvim_set_keymap('n', '<leader>vp', ':lua vim.lsp.diagnostic.goto_prev()<cr>', {noremap = true})
-
-
- vim.api.nvim_set_keymap('n', '<leader>vca', ':lua vim.lsp.buf.code_action()<cr>', {noremap = true})
- vim.api.nvim_set_keymap('n', '<leader>vf', ':lua vim.lsp.buf.formatting()<cr>', {noremap = true})
-
- vim.api.nvim_set_keymap('n', '<leader>vi', ':lua vim.lsp.buf.implementation()<cr>', {noremap = true})
- vim.api.nvim_set_keymap('n', '<leader>vrn', ':lua vim.lsp.buf.rename()<cr>', {noremap = true})
-
- require "lsp_signature".on_attach()
-
- vim.cmd [[au Filetype php setl omnifunc=v:lua.vim.lsp.omnifunc]]
- vim.cmd [[autocmd FileType go setlocal omnifunc=v:lua.vim.lsp.omnifunc]]
-
- vim.g.completion_matching_strategy_list = { 'exact', 'substring', 'fuzzy' }
-
-end
-
-local lsp_installer = require("nvim-lsp-installer")
-
-lsp_installer.on_server_ready(function(server)
- local opts = {}
-
- -- (optional) Customize the options passed to the server
- if server.name == "emmet_ls" then
- opts.filetypes = {"html", "css", "blade"}
- end
-
- opts.on_attach = on_attach
- -- This setup() function is exactly the same as lspconfig's setup function (:help lspconfig-quickstart)
- server:setup(opts)
- vim.cmd [[ do User LspAttachBuffers ]]
-end)
diff --git a/lua/plugins.lua b/lua/alpha/plugins.lua
index 31a3aad..d427aca 100644
--- a/lua/plugins.lua
+++ b/lua/alpha/plugins.lua
@@ -2,7 +2,8 @@ vim.cmd [[packadd packer.nvim]]
vim.cmd([[autocmd BufWritePost plugins.lua source <afile> | PackerCompile]])
return require('packer').startup(function(use)
- use {'wbthomason/packer.nvim', opt = true}
+ use 'wbthomason/packer.nvim'
+ use "lewis6991/impatient.nvim"
use {
'ThePrimeagen/refactoring.nvim',
diff --git a/lua/alpha/status-line.lua b/lua/alpha/status-line.lua
deleted file mode 100644
index e504b2d..0000000
--- a/lua/alpha/status-line.lua
+++ /dev/null
@@ -1,31 +0,0 @@
-require('lualine').setup{
- options = {
- theme = 'dracula',
- icons_enabled = true,
- },
- extensions = {'quickfix', 'fugitive'},
- sections = {
- lualine_a = { { 'mode', upper = true } },
- lualine_b = { { 'branch', icon = '' }, 'diff' },
- lualine_c = { { 'filename', file_status = true, path = 1 } },
- lualine_x = { { 'diagnostics', sources = { 'nvim_diagnostic' } },'encoding', 'fileformat', 'filetype' },
- lualine_y = { 'progress' },
- lualine_z = { 'location' },
- },
- inactive_sections = {
- lualine_a = { },
- lualine_b = { },
- lualine_c = { 'filename' },
- lualine_x = { 'location' },
- lualine_y = { },
- lualine_z = { },
- },
- -- tabline = {
- -- lualine_a = {'buffers'},
- -- lualine_b = {},
- -- lualine_c = {},
- -- lualine_x = {},
- -- lualine_y = {},
- -- lualine_z = {'tabs'}
- -- }
- }
diff --git a/lua/alpha/treesitter.lua b/lua/alpha/treesitter.lua
deleted file mode 100644
index 14b1295..0000000
--- a/lua/alpha/treesitter.lua
+++ /dev/null
@@ -1,60 +0,0 @@
-require "nvim-treesitter.configs".setup {
- ensure_installed = {"php", "go", "comment", "css", "html", "javascript", "lua", "typescript"},
- highlight = {
- enable = true,
- additional_vim_regex_highlighting = false,
- },
- indent = {
- enable = true,
- },
- incremental_selection = {
- enable = true,
- keymaps = {
- init_selection = "gnn",
- node_incremental = "grn",
- scope_incremental = "grc",
- node_decremental = "grm",
- },
- },
- refactor = {
- highlight_definitions = { enable = true },
- smart_rename = {
- enable = true,
- keymaps = {
- smart_rename = "grr",
- },
- },
- },
- textobjects = {
- select = {
- enable = true,
- lookahead = true,
- keymaps = {
- ["af"] = "@function.outer",
- ["if"] = "@function.inner",
- ["ac"] = "@conditional.outer",
- ["ic"] = "@conditional.inner",
- ["al"] = "@loop.outer",
- ["il"] = "@loop.inner",
- }
- }
- },
- playground = {
- enable = true,
- disable = {},
- updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
- persist_queries = false, -- Whether the query persists across vim sessions
- keybindings = {
- toggle_query_editor = 'o',
- toggle_hl_groups = 'i',
- toggle_injected_languages = 't',
- toggle_anonymous_nodes = 'a',
- toggle_language_display = 'I',
- focus_language = 'f',
- unfocus_language = 'F',
- update = 'R',
- goto_node = '<cr>',
- show_help = '?',
- },
- }
-}