| @ -1,25 +0,0 @@ | |||
| { | |||
| "languageserver": { | |||
| "ccls": { | |||
| "command": "ccls", | |||
| "filetypes": [ | |||
| "c", | |||
| "cpp", | |||
| "objc", | |||
| "objcpp" | |||
| ], | |||
| "rootPatterns": [ | |||
| ".ccls", | |||
| "compile_commands.json", | |||
| ".vim/", | |||
| ".git/", | |||
| ".hg/" | |||
| ], | |||
| "initializationOptions": { | |||
| "cache": { | |||
| "directory": "/tmp/ccls" | |||
| } | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @ -1,11 +0,0 @@ | |||
| -- General options and remaps | |||
| require('general.options') | |||
| require('general.remaps') | |||
| require('general.autocmd') | |||
| -- Helper functions | |||
| require('helper.toggle-tab-width') | |||
| -- Plugins | |||
| require('packer-plugins') | |||
| @ -1,120 +0,0 @@ | |||
| local M = {} | |||
| function M.setup() | |||
| local has_words_before = function() | |||
| local line, col = unpack(vim.api.nvim_win_get_cursor(0)) | |||
| return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match "%s" == nil | |||
| end | |||
| local luasnip = require("luasnip") | |||
| local cmp = require("cmp") | |||
| cmp.setup { | |||
| completion = { completeopt = "menu,menuone,noinsert", keyword_length = 1 }, | |||
| experimental = { native_menu = false, ghost_text = false }, | |||
| snippet = { | |||
| expand = function(args) | |||
| require("luasnip").lsp_expand(args.body) | |||
| end, | |||
| }, | |||
| formatting = { | |||
| format = function(entry, vim_item) | |||
| vim_item.menu = ({ | |||
| nvim_lsp = "[LSP]", | |||
| buffer = "[Buffer]", | |||
| luasnip = "[Snip]", | |||
| nvim_lua = "[Lua]", | |||
| treesitter = "[Treesitter]", | |||
| path = "[Path]", | |||
| })[entry.source.name] | |||
| return vim_item | |||
| end, | |||
| }, | |||
| mapping = { | |||
| ["<C-k>"] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }), | |||
| ["<C-j>"] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }), | |||
| ["<C-b>"] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }), | |||
| ["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }), | |||
| ["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), | |||
| ["<C-e>"] = cmp.mapping { i = cmp.mapping.close(), c = cmp.mapping.close() }, | |||
| ["<CR>"] = cmp.mapping { | |||
| i = cmp.mapping.confirm { behavior = cmp.ConfirmBehavior.Replace, select = false }, | |||
| c = function(fallback) | |||
| if cmp.visible() then | |||
| cmp.confirm { behavior = cmp.ConfirmBehavior.Replace, select = false } | |||
| else | |||
| fallback() | |||
| end | |||
| end, | |||
| }, | |||
| ["<Tab>"] = cmp.mapping( | |||
| function(fallback) | |||
| if cmp.visible() then | |||
| cmp.select_next_item() | |||
| elseif luasnip.expand_or_jumpable() then | |||
| luasnip.expand_or_jump() | |||
| elseif has_words_before() then | |||
| cmp.complete() | |||
| else | |||
| fallback() | |||
| end | |||
| end, { | |||
| "i", | |||
| "s", | |||
| "c", | |||
| }), | |||
| ["<S-Tab>"] = cmp.mapping(function(fallback) | |||
| if cmp.visible() then | |||
| cmp.select_prev_item() | |||
| elseif luasnip.jumpable(-1) then | |||
| luasnip.jump(-1) | |||
| else | |||
| fallback() | |||
| end | |||
| end, { | |||
| "i", | |||
| "s", | |||
| "c", | |||
| }), | |||
| }, | |||
| sources = { | |||
| { name = "nvim_lsp" }, | |||
| { name = "treesitter" }, | |||
| { name = "buffer" }, | |||
| { name = "luasnip" }, | |||
| { name = "nvim_lua" }, | |||
| { name = "path" }, | |||
| -- { name = "spell" }, | |||
| -- { name = "emoji" }, | |||
| -- { name = "calc" }, | |||
| }, | |||
| window = { | |||
| documentation = { | |||
| border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" }, | |||
| winhighlight = "NormalFloat:NormalFloat,FloatBorder:TelescopeBorder", | |||
| }, | |||
| }, | |||
| } | |||
| -- Use buffer source for `/` | |||
| cmp.setup.cmdline("/", { | |||
| mapping = cmp.mapping.preset.cmdline(), | |||
| sources = { | |||
| { name = "buffer" }, | |||
| }, | |||
| }) | |||
| -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). | |||
| cmp.setup.cmdline(':', { | |||
| mapping = cmp.mapping.preset.cmdline(), | |||
| sources = cmp.config.sources({ | |||
| { name = 'path' } | |||
| }, { | |||
| { name = 'cmdline' } | |||
| }) | |||
| }) | |||
| end | |||
| return M | |||
| @ -1,52 +0,0 @@ | |||
| local M = {} | |||
| local servers = { | |||
| gopls = {}, | |||
| html = {}, | |||
| jsonls = {}, | |||
| pyright = {}, | |||
| tsserver = {}, | |||
| vimls = {}, | |||
| dartls = {}, | |||
| dockerls = {}, | |||
| intelephense = {}, | |||
| sqlls = {}, | |||
| volar = {}, | |||
| } | |||
| local function on_attach(client, bufnr) | |||
| -- Enable completion triggered by <C-X><C-O> | |||
| -- See `:help omnifunc` and `:help ins-completion` for more information. | |||
| vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc") | |||
| -- Use LSP as the handler for formatexpr. | |||
| -- See `:help formatexpr` for more information. | |||
| vim.api.nvim_buf_set_option(0, "formatexpr", "v:lua.vim.lsp.formatexpr()") | |||
| -- Configure key mappings | |||
| require("config.lsp.keymaps").setup(client, bufnr) | |||
| end | |||
| local lsp_signature = require "lsp_signature" | |||
| lsp_signature.setup { | |||
| bind = true, | |||
| handler_opts = { | |||
| border = "rounded", | |||
| }, | |||
| } | |||
| local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities()) | |||
| local opts = { | |||
| on_attach = on_attach, | |||
| capabilities = cababilities, | |||
| flags = { | |||
| debounce_text_changes = 150, | |||
| }, | |||
| } | |||
| function M.setup() | |||
| require("config.lsp.installer").setup(servers, opts) | |||
| end | |||
| return M | |||
| @ -1,26 +0,0 @@ | |||
| local lsp_installer_servers = require "nvim-lsp-installer.servers" | |||
| local utils = require "utils" | |||
| local M = {} | |||
| function M.setup(servers, options) | |||
| for server_name, _ in pairs(servers) do | |||
| local server_available, server = lsp_installer_servers.get_server(server_name) | |||
| if server_available then | |||
| server:on_ready(function() | |||
| local opts = vim.tbl_deep_extend("force", options, servers[server.name] or {}) | |||
| server:setup(opts) | |||
| end) | |||
| if not server:is_installed() then | |||
| utils.info("Installing " .. server.name) | |||
| server:install() | |||
| end | |||
| else | |||
| utils.error(server) | |||
| end | |||
| end | |||
| end | |||
| return M | |||
| @ -1,37 +0,0 @@ | |||
| local M = {} | |||
| local keymap = vim.api.nvim_set_keymap | |||
| local buf_keymap = vim.api.nvim_buf_set_keymap | |||
| local function keymappings(client, bufnr) | |||
| local opts = { noremap = true, silent = true } | |||
| -- Key mappings | |||
| vim.keymap.set("n", "K", vim.lsp.buf.hover, 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", "[e", function () vim.diagnostic.goto_prev({severity = vim.diagnostic.severity.ERROR}) end, opts) | |||
| vim.keymap.set("n", "]e", function () vim.diagnostic.goto_next({severity = vim.diagnostic.severity.ERROR}) end, opts) | |||
| vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts) | |||
| vim.keymap.set("n", "K", vim.lsp.buf.code_action, opts) | |||
| vim.keymap.set("n", "<leader>of", vim.diagnostic.open_float, opts) | |||
| -- if client.resolved_capabilities.document_formatting then | |||
| -- vim.keymap.set("n", "<leader>ff", vim.lsp.buf.formatting, opts) | |||
| -- end | |||
| vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) | |||
| vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts) | |||
| -- vim.keymap.set("n", "gr", function() vim.lsp.buf.references({ includeDeclaration = false }) end, opts) | |||
| vim.keymap.set("n", "gh", vim.lsp.buf.signature_help, opts) | |||
| vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts) | |||
| vim.keymap.set("n", "gT", vim.lsp.buf.type_definition, opts) | |||
| end | |||
| function M.setup(client, bufnr) | |||
| keymappings(client, bufnr) | |||
| end | |||
| return M | |||
| @ -1,14 +0,0 @@ | |||
| local M = {} | |||
| function M.setup() | |||
| local luasnip = require "luasnip" | |||
| luasnip.config.set_config { | |||
| history = false, | |||
| updateevents = "TextChanged,TextChangedI", | |||
| } | |||
| require("luasnip/loaders/from_vscode").load() | |||
| end | |||
| return M | |||
| @ -1,52 +0,0 @@ | |||
| local aucmd_dict = { | |||
| FileType = { | |||
| { | |||
| pattern = "dart,vue,js", | |||
| callback = function() | |||
| vim.opt_local.tabstop = 2 | |||
| vim.opt_local.softtabstop = 2 | |||
| vim.opt_local.shiftwidth = 2 | |||
| end, | |||
| }, | |||
| }, | |||
| BufWritePre = { | |||
| { | |||
| command = [[%s/\s\+$//e]], | |||
| }, | |||
| { | |||
| pattern = 'go', | |||
| callback = function () require('go.format').gofmt() end, | |||
| }, | |||
| }, | |||
| BufRead = { | |||
| { | |||
| command = [[if @% !~# '\.git[\/\\]COMMIT_EDITMSG$' && line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif]] | |||
| }, | |||
| { | |||
| pattern = { '*.docker' }, | |||
| callback = function() | |||
| vim.opt_local.syntax = 'dockerfile' | |||
| end | |||
| } | |||
| }, | |||
| BufNewFile = { | |||
| { | |||
| pattern = { '*.docker' }, | |||
| callback = function() | |||
| vim.opt_local.syntax = 'dockerfile' | |||
| end | |||
| } | |||
| }, | |||
| VimLeave = { | |||
| { | |||
| command = [[mksession! ~/.config/nvim/session/shutdown_session.vim]] | |||
| }, | |||
| }, | |||
| } | |||
| for event, opt_tbls in pairs(aucmd_dict) do | |||
| for _, opt_tbl in pairs(opt_tbls) do | |||
| vim.api.nvim_create_autocmd(event, opt_tbl) | |||
| end | |||
| end | |||
| @ -1,30 +0,0 @@ | |||
| vim.g.mapleader = ',' | |||
| vim.o.clipboard = 'unnamedplus' | |||
| vim.o.nohlsearch = true | |||
| vim.o.incsearch = true | |||
| vim.o.ignorecase = true | |||
| -- autocmd BufWritePre * :%s/\s\+$//e | |||
| vim.o.mouse = 'a' | |||
| vim.o.smartcase = true | |||
| vim.o.linebreak = true | |||
| vim.o.noswapfile = true | |||
| vim.o.nobackup = true | |||
| vim.o.undodir = vim.fn.expand('~/.config/nvim/undodir') | |||
| vim.o.undofile = true | |||
| vim.o.encoding = 'utf-8' | |||
| vim.o.number = true | |||
| vim.o.relativenumber = true | |||
| vim.o.tabstop = 4 | |||
| vim.o.softtabstop = 4 | |||
| vim.o.expandtab = true | |||
| vim.o.shiftwidth = 4 | |||
| vim.o.smarttab = true | |||
| vim.o.formatoptions = 'tqj' | |||
| @ -1,35 +0,0 @@ | |||
| local options = { noremap = true } | |||
| vim.api.nvim_set_keymap('n', 'c', '"_c', options) | |||
| -- Easily open splits | |||
| vim.api.nvim_set_keymap('n', '<leader>hs', '<cmd>split<cr>', options) | |||
| vim.api.nvim_set_keymap('n', '<leader>vs', '<cmd>vsplit<cr>', options) | |||
| -- Copy the entire file | |||
| vim.api.nvim_set_keymap('n', '<leader>y', 'ggyG<C-o>', options) | |||
| -- Easily navigate tabs | |||
| vim.api.nvim_set_keymap('n', '<leader>1', '1gt', options) | |||
| vim.api.nvim_set_keymap('n', '<leader>2', '2gt', options) | |||
| vim.api.nvim_set_keymap('n', '<leader>3', '3gt', options) | |||
| vim.api.nvim_set_keymap('n', '<leader>4', '4gt', options) | |||
| vim.api.nvim_set_keymap('n', '<leader>5', '5gt', options) | |||
| -- Manually store session | |||
| vim.api.nvim_set_keymap('n', '<F5>', '<cmd>mksession! ~/.config/nvim/session/manual_session.vim<cr>', options) | |||
| -- Restore manually stored session | |||
| vim.api.nvim_set_keymap('n', '<F6>', '<cmd>source ~/.config/nvim/session/manual_session.vim<cr>', options) | |||
| -- Restore auto saved session created on exit | |||
| vim.api.nvim_set_keymap('n', '<F7>', '<cmd>source ~/.config/nvim/session/shutdown_session.vim<CR>', options) | |||
| -- Replace all is aliased to S. | |||
| vim.api.nvim_set_keymap('n', '<C-s>', '<cmd>%s//g<Left><Left>', options) | |||
| -- Navigating with guides | |||
| vim.api.nvim_set_keymap('n', '<leader><leader>', '<Esc>/<++><Enter>"_c4l', options) | |||
| vim.api.nvim_set_keymap('i', '<leader><leader>', '<Esc>/<++><Enter>"_c4l', options) | |||
| vim.api.nvim_set_keymap('v', '<leader><leader>', '<Esc>/<++><Enter>"_c4l', options) | |||
| -- Spell-check | |||
| vim.api.nvim_set_keymap('n', '<leader>o', '<cmd>setlocal spell! spelllang=en_au<cr>', options) | |||
| @ -1,19 +0,0 @@ | |||
| local tabWidth = 4 | |||
| function ToggleTabWidth() | |||
| if tabWidth == 2 then | |||
| vim.o.tabstop = 4 | |||
| vim.o.softtabstop = 4 | |||
| vim.o.shiftwidth = 4 | |||
| tabWidth = 4 | |||
| print('Set tab width to 4') | |||
| return | |||
| end | |||
| vim.o.tabstop = 2 | |||
| vim.o.softtabstop = 2 | |||
| vim.o.shiftwidth = 2 | |||
| tabWidth = 2 | |||
| print('Set tab width to 2') | |||
| end | |||
| vim.keymap.set('n', '<leader>t', ToggleTabWidth, { noremap = true}) | |||
| @ -1,78 +0,0 @@ | |||
| return require('packer').startup(function() | |||
| -- Packer can manage itself | |||
| use 'wbthomason/packer.nvim' | |||
| -- colorscheme | |||
| use 'gruvbox-community/gruvbox' | |||
| use { 'neoclide/coc.nvim', run = 'yarn install', disable = true } | |||
| use { "williamboman/nvim-lsp-installer" } | |||
| use { | |||
| "neovim/nvim-lspconfig", | |||
| event = "BufReadPre", | |||
| wants = { "cmp-nvim-lsp", "nvim-lsp-installer", "lsp_signature.nvim" }, | |||
| config = function() | |||
| require("config.lsp").setup() | |||
| end, | |||
| requires = { | |||
| "williamboman/nvim-lsp-installer", | |||
| "ray-x/lsp_signature.nvim", | |||
| }, | |||
| } | |||
| use { | |||
| "ray-x/lsp_signature.nvim", | |||
| } | |||
| use { | |||
| "hrsh7th/nvim-cmp", | |||
| event = "InsertEnter", | |||
| requires = { | |||
| { "hrsh7th/cmp-nvim-lsp", after = "nvim-cmp" }, | |||
| { "f3fora/cmp-spell", after = "nvim-cmp" }, | |||
| { "hrsh7th/cmp-path", after = "nvim-cmp" }, | |||
| { "hrsh7th/cmp-buffer", after = "nvim-cmp" }, | |||
| { "hrsh7th/cmp-calc", after = "nvim-cmp" }, | |||
| { "quangnguyen30192/cmp-nvim-ultisnips", after = "nvim-cmp" }, | |||
| { | |||
| "L3MON4D3/LuaSnip", | |||
| -- after = 'nvim-cmp', | |||
| wants = "friendly-snippets", | |||
| requires = { | |||
| { "rafamadriz/friendly-snippets", after = 'nvim-cmp' }, | |||
| }, | |||
| config = function() | |||
| require("config.luasnip").setup() | |||
| end, | |||
| }, | |||
| }, | |||
| config = function() | |||
| require("config.cmp").setup() | |||
| end, | |||
| disable = false, | |||
| } | |||
| use 'nvim-lua/popup.nvim' | |||
| use 'nvim-lua/plenary.nvim' | |||
| use 'nvim-telescope/telescope.nvim' | |||
| use 'nvim-telescope/telescope-fzy-native.nvim' | |||
| use 'Rican7/php-doc-modded' | |||
| use 'f-person/git-blame.nvim' | |||
| use 'dart-lang/dart-vim-plugin' | |||
| use { 'nvim-treesitter/nvim-treesitter' } | |||
| use 'ray-x/go.nvim' | |||
| use 'ray-x/guihua.lua' | |||
| use 'aserowy/tmux.nvim' | |||
| -- Local nvim plugin development | |||
| -- use '~/Software/nvim-phpdoc/phpdoc.nvim' | |||
| end) | |||
| @ -1,37 +0,0 @@ | |||
| _G.dump = function(...) | |||
| print(vim.inspect(...)) | |||
| end | |||
| _G.prequire = function(...) | |||
| local status, lib = pcall(require, ...) | |||
| if status then | |||
| return lib | |||
| end | |||
| return nil | |||
| end | |||
| local M = {} | |||
| function M.t(str) | |||
| return vim.api.nvim_replace_termcodes(str, true, true, true) | |||
| end | |||
| function M.log(msg, hl, name) | |||
| name = name or "Neovim" | |||
| hl = hl or "Todo" | |||
| vim.api.nvim_echo({ { name .. ": ", hl }, { msg } }, true, {}) | |||
| end | |||
| function M.warn(msg, name) | |||
| vim.notify(msg, vim.log.levels.WARN, { title = name }) | |||
| end | |||
| function M.error(msg, name) | |||
| vim.notify(msg, vim.log.levels.ERROR, { title = name }) | |||
| end | |||
| function M.info(msg, name) | |||
| vim.notify(msg, vim.log.levels.INFO, { title = name }) | |||
| end | |||
| return M | |||
| @ -1,23 +0,0 @@ | |||
| -- vim.o.signcolumn = 'number' | |||
| -- | |||
| -- vim.cmd[[highlight CocErrorSign ctermfg=Black ctermbg=Magenta]] | |||
| -- | |||
| -- -- Bind tab to select next tab complete | |||
| -- vim.api.nvim_set_keymap("i", "<TAB>", "pumvisible() ? '<C-n>' : '<TAB>'", {noremap = true, silent = true, expr = true}) | |||
| -- | |||
| -- vim.api.nvim_set_keymap("n", "<leader>.", "<Plug>(coc-codeaction)", {}) | |||
| -- vim.api.nvim_set_keymap("n", "<leader>l", ":CocCommand eslint.executeAutofix<CR>", {}) | |||
| -- vim.api.nvim_set_keymap("n", "gd", "<Plug>(coc-definition)", {silent = true}) | |||
| -- vim.api.nvim_set_keymap("n", "gr", "<Plug>(coc-references)", {silent = true}) | |||
| -- vim.api.nvim_set_keymap("n", "K", ":call CocActionAsync('doHover')<CR>", {silent = true, noremap = true}) | |||
| -- vim.api.nvim_set_keymap("n", "<leader>rn", "<Plug>(coc-rename)", {}) | |||
| -- vim.api.nvim_set_keymap("n", "<leader>f", ":CocCommand prettier.formatFile<CR>", {noremap = true}) | |||
| -- | |||
| -- vim.api.nvim_set_keymap("n", "g[", ":call CocActionAsync('diagnosticPrevious')<CR>", {silent = true, noremap = true}) | |||
| -- vim.api.nvim_set_keymap("n", "g]", ":call CocActionAsync('diagnosticNext')<CR>", {silent = true, noremap = true}) | |||
| -- | |||
| -- vim.keymap.set("n", "<C-space>", vim.fn['coc#refresh'](), {silent = true, noremap = true}) | |||
| -- | |||
| -- -- Bind Ctrl + j,k to up and down for COC completion | |||
| -- vim.api.nvim_set_keymap('i', '<C-j>', "pumvisible() ? '<Down>' : '<C-j>'", { noremap = true, expr = true, silent = true }) | |||
| -- vim.api.nvim_set_keymap('i', '<C-k>', "pumvisible() ? '<Up>' : '<C-k>'", { noremap = true, expr = true, silent = true }) | |||
| @ -1 +0,0 @@ | |||
| require('go').setup() | |||
| @ -1 +0,0 @@ | |||
| vim.cmd[[colorscheme gruvbox]] | |||
| @ -1,263 +0,0 @@ | |||
| -- Automatically generated packer.nvim plugin loader code | |||
| if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then | |||
| vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"') | |||
| return | |||
| end | |||
| vim.api.nvim_command('packadd packer.nvim') | |||
| local no_errors, error_msg = pcall(function() | |||
| local time | |||
| local profile_info | |||
| local should_profile = false | |||
| if should_profile then | |||
| local hrtime = vim.loop.hrtime | |||
| profile_info = {} | |||
| time = function(chunk, start) | |||
| if start then | |||
| profile_info[chunk] = hrtime() | |||
| else | |||
| profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6 | |||
| end | |||
| end | |||
| else | |||
| time = function(chunk, start) end | |||
| end | |||
| local function save_profiles(threshold) | |||
| local sorted_times = {} | |||
| for chunk_name, time_taken in pairs(profile_info) do | |||
| sorted_times[#sorted_times + 1] = {chunk_name, time_taken} | |||
| end | |||
| table.sort(sorted_times, function(a, b) return a[2] > b[2] end) | |||
| local results = {} | |||
| for i, elem in ipairs(sorted_times) do | |||
| if not threshold or threshold and elem[2] > threshold then | |||
| results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms' | |||
| end | |||
| end | |||
| _G._packer = _G._packer or {} | |||
| _G._packer.profile_output = results | |||
| end | |||
| time([[Luarocks path setup]], true) | |||
| local package_path_str = "/home/tovi/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/tovi/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/tovi/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/tovi/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua" | |||
| local install_cpath_pattern = "/home/tovi/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so" | |||
| if not string.find(package.path, package_path_str, 1, true) then | |||
| package.path = package.path .. ';' .. package_path_str | |||
| end | |||
| if not string.find(package.cpath, install_cpath_pattern, 1, true) then | |||
| package.cpath = package.cpath .. ';' .. install_cpath_pattern | |||
| end | |||
| time([[Luarocks path setup]], false) | |||
| time([[try_loadstring definition]], true) | |||
| local function try_loadstring(s, component, name) | |||
| local success, result = pcall(loadstring(s), name, _G.packer_plugins[name]) | |||
| if not success then | |||
| vim.schedule(function() | |||
| vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {}) | |||
| end) | |||
| end | |||
| return result | |||
| end | |||
| time([[try_loadstring definition]], false) | |||
| time([[Defining packer_plugins]], true) | |||
| _G.packer_plugins = { | |||
| LuaSnip = { | |||
| config = { "\27LJ\2\n<\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\19config.luasnip\frequire\0" }, | |||
| loaded = true, | |||
| path = "/home/tovi/.local/share/nvim/site/pack/packer/start/LuaSnip", | |||
| url = "https://github.com/L3MON4D3/LuaSnip", | |||
| wants = { "friendly-snippets" } | |||
| }, | |||
| ["cmp-buffer"] = { | |||
| after_files = { "/home/tovi/.local/share/nvim/site/pack/packer/opt/cmp-buffer/after/plugin/cmp_buffer.lua" }, | |||
| load_after = { | |||
| ["nvim-cmp"] = true | |||
| }, | |||
| loaded = false, | |||
| needs_bufread = false, | |||
| path = "/home/tovi/.local/share/nvim/site/pack/packer/opt/cmp-buffer", | |||
| url = "https://github.com/hrsh7th/cmp-buffer" | |||
| }, | |||
| ["cmp-calc"] = { | |||
| after_files = { "/home/tovi/.local/share/nvim/site/pack/packer/opt/cmp-calc/after/plugin/cmp_calc.lua" }, | |||
| load_after = { | |||
| ["nvim-cmp"] = true | |||
| }, | |||
| loaded = false, | |||
| needs_bufread = false, | |||
| path = "/home/tovi/.local/share/nvim/site/pack/packer/opt/cmp-calc", | |||
| url = "https://github.com/hrsh7th/cmp-calc" | |||
| }, | |||
| ["cmp-nvim-lsp"] = { | |||
| after_files = { "/home/tovi/.local/share/nvim/site/pack/packer/opt/cmp-nvim-lsp/after/plugin/cmp_nvim_lsp.lua" }, | |||
| load_after = { | |||
| ["nvim-cmp"] = true | |||
| }, | |||
| loaded = false, | |||
| needs_bufread = false, | |||
| path = "/home/tovi/.local/share/nvim/site/pack/packer/opt/cmp-nvim-lsp", | |||
| url = "https://github.com/hrsh7th/cmp-nvim-lsp" | |||
| }, | |||
| ["cmp-nvim-ultisnips"] = { | |||
| after_files = { "/home/tovi/.local/share/nvim/site/pack/packer/opt/cmp-nvim-ultisnips/after/plugin/cmp_nvim_ultisnips.lua" }, | |||
| load_after = { | |||
| ["nvim-cmp"] = true | |||
| }, | |||
| loaded = false, | |||
| needs_bufread = false, | |||
| path = "/home/tovi/.local/share/nvim/site/pack/packer/opt/cmp-nvim-ultisnips", | |||
| url = "https://github.com/quangnguyen30192/cmp-nvim-ultisnips" | |||
| }, | |||
| ["cmp-path"] = { | |||
| after_files = { "/home/tovi/.local/share/nvim/site/pack/packer/opt/cmp-path/after/plugin/cmp_path.lua" }, | |||
| load_after = { | |||
| ["nvim-cmp"] = true | |||
| }, | |||
| loaded = false, | |||
| needs_bufread = false, | |||
| path = "/home/tovi/.local/share/nvim/site/pack/packer/opt/cmp-path", | |||
| url = "https://github.com/hrsh7th/cmp-path" | |||
| }, | |||
| ["cmp-spell"] = { | |||
| after_files = { "/home/tovi/.local/share/nvim/site/pack/packer/opt/cmp-spell/after/plugin/cmp-spell.lua" }, | |||
| load_after = { | |||
| ["nvim-cmp"] = true | |||
| }, | |||
| loaded = false, | |||
| needs_bufread = false, | |||
| path = "/home/tovi/.local/share/nvim/site/pack/packer/opt/cmp-spell", | |||
| url = "https://github.com/f3fora/cmp-spell" | |||
| }, | |||
| ["dart-vim-plugin"] = { | |||
| loaded = true, | |||
| path = "/home/tovi/.local/share/nvim/site/pack/packer/start/dart-vim-plugin", | |||
| url = "https://github.com/dart-lang/dart-vim-plugin" | |||
| }, | |||
| ["friendly-snippets"] = { | |||
| load_after = { | |||
| ["nvim-cmp"] = true | |||
| }, | |||
| loaded = false, | |||
| needs_bufread = false, | |||
| path = "/home/tovi/.local/share/nvim/site/pack/packer/opt/friendly-snippets", | |||
| url = "https://github.com/rafamadriz/friendly-snippets" | |||
| }, | |||
| ["git-blame.nvim"] = { | |||
| loaded = true, | |||
| path = "/home/tovi/.local/share/nvim/site/pack/packer/start/git-blame.nvim", | |||
| url = "https://github.com/f-person/git-blame.nvim" | |||
| }, | |||
| ["go.nvim"] = { | |||
| loaded = true, | |||
| path = "/home/tovi/.local/share/nvim/site/pack/packer/start/go.nvim", | |||
| url = "https://github.com/ray-x/go.nvim" | |||
| }, | |||
| gruvbox = { | |||
| loaded = true, | |||
| path = "/home/tovi/.local/share/nvim/site/pack/packer/start/gruvbox", | |||
| url = "https://github.com/gruvbox-community/gruvbox" | |||
| }, | |||
| ["guihua.lua"] = { | |||
| loaded = true, | |||
| path = "/home/tovi/.local/share/nvim/site/pack/packer/start/guihua.lua", | |||
| url = "https://github.com/ray-x/guihua.lua" | |||
| }, | |||
| ["lsp_signature.nvim"] = { | |||
| loaded = true, | |||
| path = "/home/tovi/.local/share/nvim/site/pack/packer/start/lsp_signature.nvim", | |||
| url = "https://github.com/ray-x/lsp_signature.nvim" | |||
| }, | |||
| ["nvim-cmp"] = { | |||
| after = { "cmp-nvim-ultisnips", "friendly-snippets", "cmp-spell", "cmp-buffer", "cmp-path", "cmp-calc", "cmp-nvim-lsp" }, | |||
| config = { "\27LJ\2\n8\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\15config.cmp\frequire\0" }, | |||
| loaded = false, | |||
| needs_bufread = false, | |||
| only_cond = false, | |||
| path = "/home/tovi/.local/share/nvim/site/pack/packer/opt/nvim-cmp", | |||
| url = "https://github.com/hrsh7th/nvim-cmp" | |||
| }, | |||
| ["nvim-lsp-installer"] = { | |||
| loaded = true, | |||
| path = "/home/tovi/.local/share/nvim/site/pack/packer/start/nvim-lsp-installer", | |||
| url = "https://github.com/williamboman/nvim-lsp-installer" | |||
| }, | |||
| ["nvim-lspconfig"] = { | |||
| config = { "\27LJ\2\n8\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\15config.lsp\frequire\0" }, | |||
| loaded = false, | |||
| needs_bufread = false, | |||
| only_cond = false, | |||
| path = "/home/tovi/.local/share/nvim/site/pack/packer/opt/nvim-lspconfig", | |||
| url = "https://github.com/neovim/nvim-lspconfig", | |||
| wants = { "cmp-nvim-lsp", "nvim-lsp-installer", "lsp_signature.nvim" } | |||
| }, | |||
| ["nvim-treesitter"] = { | |||
| loaded = true, | |||
| path = "/home/tovi/.local/share/nvim/site/pack/packer/start/nvim-treesitter", | |||
| url = "https://github.com/nvim-treesitter/nvim-treesitter" | |||
| }, | |||
| ["packer.nvim"] = { | |||
| loaded = true, | |||
| path = "/home/tovi/.local/share/nvim/site/pack/packer/start/packer.nvim", | |||
| url = "https://github.com/wbthomason/packer.nvim" | |||
| }, | |||
| ["php-doc-modded"] = { | |||
| loaded = true, | |||
| path = "/home/tovi/.local/share/nvim/site/pack/packer/start/php-doc-modded", | |||
| url = "https://github.com/Rican7/php-doc-modded" | |||
| }, | |||
| ["plenary.nvim"] = { | |||
| loaded = true, | |||
| path = "/home/tovi/.local/share/nvim/site/pack/packer/start/plenary.nvim", | |||
| url = "https://github.com/nvim-lua/plenary.nvim" | |||
| }, | |||
| ["popup.nvim"] = { | |||
| loaded = true, | |||
| path = "/home/tovi/.local/share/nvim/site/pack/packer/start/popup.nvim", | |||
| url = "https://github.com/nvim-lua/popup.nvim" | |||
| }, | |||
| ["telescope-fzy-native.nvim"] = { | |||
| loaded = true, | |||
| path = "/home/tovi/.local/share/nvim/site/pack/packer/start/telescope-fzy-native.nvim", | |||
| url = "https://github.com/nvim-telescope/telescope-fzy-native.nvim" | |||
| }, | |||
| ["telescope.nvim"] = { | |||
| loaded = true, | |||
| path = "/home/tovi/.local/share/nvim/site/pack/packer/start/telescope.nvim", | |||
| url = "https://github.com/nvim-telescope/telescope.nvim" | |||
| }, | |||
| ["tmux.nvim"] = { | |||
| loaded = true, | |||
| path = "/home/tovi/.local/share/nvim/site/pack/packer/start/tmux.nvim", | |||
| url = "https://github.com/aserowy/tmux.nvim" | |||
| } | |||
| } | |||
| time([[Defining packer_plugins]], false) | |||
| -- Config for: LuaSnip | |||
| time([[Config for LuaSnip]], true) | |||
| try_loadstring("\27LJ\2\n<\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\19config.luasnip\frequire\0", "config", "LuaSnip") | |||
| time([[Config for LuaSnip]], false) | |||
| vim.cmd [[augroup packer_load_aucmds]] | |||
| vim.cmd [[au!]] | |||
| -- Event lazy-loads | |||
| time([[Defining lazy-load event autocommands]], true) | |||
| vim.cmd [[au BufReadPre * ++once lua require("packer.load")({'nvim-lspconfig'}, { event = "BufReadPre *" }, _G.packer_plugins)]] | |||
| vim.cmd [[au InsertEnter * ++once lua require("packer.load")({'nvim-cmp'}, { event = "InsertEnter *" }, _G.packer_plugins)]] | |||
| time([[Defining lazy-load event autocommands]], false) | |||
| vim.cmd("augroup END") | |||
| if should_profile then save_profiles() end | |||
| end) | |||
| if not no_errors then | |||
| error_msg = error_msg:gsub('"', '\\"') | |||
| vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None') | |||
| end | |||
| @ -1,7 +0,0 @@ | |||
| vim.keymap.set('n', '<C-d>', function () | |||
| if vim.bo.filetype ~= 'php' then | |||
| return | |||
| end | |||
| vim.api.nvim_call_function("PhpDocSingle", {}) | |||
| end, options) | |||
| @ -1,61 +0,0 @@ | |||
| local pickers = require("telescope.pickers") | |||
| local finders = require("telescope.finders") | |||
| local previewers = require("telescope.previewers") | |||
| local action_state = require("telescope.actions.state") | |||
| local conf = require("telescope.config").values | |||
| local actions = require("telescope.actions") | |||
| require("telescope").setup({ | |||
| defaults = { | |||
| file_sorter = require("telescope.sorters").get_fzy_sorter, | |||
| prompt_prefix = " >", | |||
| color_devicons = true, | |||
| file_previewer = require("telescope.previewers").vim_buffer_cat.new, | |||
| grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new, | |||
| qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new, | |||
| mappings = { | |||
| i = { | |||
| ["<C-x>"] = false, | |||
| ["<C-q>"] = actions.send_to_qflist, | |||
| }, | |||
| }, | |||
| }, | |||
| }) | |||
| local M = {} | |||
| function git_branches () | |||
| require("telescope.builtin").git_branches({ | |||
| attach_mappings = function(_, map) | |||
| map("i", "<c-d>", actions.git_delete_branch) | |||
| map("n", "<c-d>", actions.git_delete_branch) | |||
| return true | |||
| end, | |||
| }) | |||
| end | |||
| local options = { noremap = true } | |||
| vim.keymap.set('n', '<C-g>', function() | |||
| local term = vim.fn.input("Grep For > ") | |||
| if term == '' then | |||
| return | |||
| end | |||
| require('telescope.builtin').grep_string({ search = term }) | |||
| end, options) | |||
| vim.keymap.set('n', '<C-p>', function() | |||
| local ran, errorMessage = pcall(require('telescope.builtin').git_files) | |||
| if not ran then | |||
| require('telescope.builtin').find_files() | |||
| end | |||
| end, options) | |||
| -- vim.keymap.set('n', '<C-q>', function() | |||
| -- end, options) | |||
| vim.keymap.set('n', '<leader>fb', require('telescope.builtin').buffers, options) | |||
| vim.keymap.set('n', 'gr', require('telescope.builtin').lsp_references, options) | |||
| @ -1,17 +0,0 @@ | |||
| require("tmux").setup({ | |||
| -- overwrite default configuration | |||
| -- here, e.g. to enable default bindings | |||
| copy_sync = { | |||
| -- enables copy sync and overwrites all register actions to | |||
| -- sync registers *, +, unnamed, and 0 till 9 from tmux in advance | |||
| enable = true, | |||
| }, | |||
| navigation = { | |||
| -- enables default keybindings (C-hjkl) for normal mode | |||
| enable_default_keybindings = true, | |||
| }, | |||
| resize = { | |||
| -- enables default keybindings (A-hjkl) for normal mode | |||
| enable_default_keybindings = true, | |||
| } | |||
| }) | |||
| @ -1,24 +0,0 @@ | |||
| require('nvim-treesitter.configs').setup { | |||
| -- A list of parser names, or "all" | |||
| ensure_installed = { 'go', 'dart' }, | |||
| -- Install parsers synchronously (only applied to `ensure_installed`) | |||
| sync_install = false, | |||
| -- Automatically install missing parsers when entering buffer | |||
| auto_install = true, | |||
| -- List of parsers to ignore installing (for "all") | |||
| ignore_install = { "javascript" }, | |||
| highlight = { | |||
| -- `false` will disable the whole extension | |||
| enable = true, | |||
| -- Setting this to true will run `:h syntax` and tree-sitter at the same time. | |||
| -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). | |||
| -- Using this option may slow down your editor, and you may see some duplicate highlights. | |||
| -- Instead of true it can also be a list of languages | |||
| additional_vim_regex_highlighting = false, | |||
| }, | |||
| } | |||