From 7d70eda7a67156db0964b0c8dfd957e175463d98 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Thu, 16 Dec 2021 02:15:56 -0600 Subject: [PATCH] Current --- ftdetect/cf3.vim | 1 + ftplugin/cf3.vim | 221 +++++++++++ init.lua | 6 + lua/lsp.lua | 9 + lua/maps.lua | 138 +++++++ lua/plugins.lua | 420 ++++++++++++++++++++ lua/plugins/better-whitespace.lua | 27 ++ lua/plugins/bufferline.lua | 25 ++ lua/plugins/cmp.lua | 48 +++ lua/plugins/colorize.lua | 9 + lua/plugins/dap.lua | 61 +++ lua/plugins/dashboard.lua | 49 +++ lua/plugins/indent-blankline.lua | 33 ++ lua/plugins/lualine.lua | 53 +++ lua/plugins/nvim-scroll.lua | 2 + lua/plugins/nvim-tree.lua | 50 +++ lua/plugins/telescope.lua | 38 ++ lua/plugins/todo-comments.lua | 61 +++ lua/plugins/toggleterm.lua | 24 ++ lua/plugins/treesitter.lua | 27 ++ lua/plugins/true-zen.lua | 63 +++ lua/plugins/vista.lua | 3 + lua/settings.lua | 118 ++++++ lua/theme.lua | 99 +++++ lua/user_settings.lua | 58 +++ plugin/packer_compiled.lua | 562 ++++++++++++++++++++++++++ syntax/cf3.vim | 628 ++++++++++++++++++++++++++++++ 27 files changed, 2833 insertions(+) create mode 100644 ftdetect/cf3.vim create mode 100644 ftplugin/cf3.vim create mode 100755 init.lua create mode 100755 lua/lsp.lua create mode 100755 lua/maps.lua create mode 100755 lua/plugins.lua create mode 100755 lua/plugins/better-whitespace.lua create mode 100755 lua/plugins/bufferline.lua create mode 100755 lua/plugins/cmp.lua create mode 100755 lua/plugins/colorize.lua create mode 100755 lua/plugins/dap.lua create mode 100755 lua/plugins/dashboard.lua create mode 100755 lua/plugins/indent-blankline.lua create mode 100755 lua/plugins/lualine.lua create mode 100755 lua/plugins/nvim-scroll.lua create mode 100755 lua/plugins/nvim-tree.lua create mode 100755 lua/plugins/telescope.lua create mode 100755 lua/plugins/todo-comments.lua create mode 100755 lua/plugins/toggleterm.lua create mode 100755 lua/plugins/treesitter.lua create mode 100755 lua/plugins/true-zen.lua create mode 100755 lua/plugins/vista.lua create mode 100755 lua/settings.lua create mode 100755 lua/theme.lua create mode 100755 lua/user_settings.lua create mode 100644 plugin/packer_compiled.lua create mode 100644 syntax/cf3.vim diff --git a/ftdetect/cf3.vim b/ftdetect/cf3.vim new file mode 100644 index 0000000..d3a09d8 --- /dev/null +++ b/ftdetect/cf3.vim @@ -0,0 +1 @@ +au BufRead,BufNewFile *.cf set ft=cf3 diff --git a/ftplugin/cf3.vim b/ftplugin/cf3.vim new file mode 100644 index 0000000..bfa93ee --- /dev/null +++ b/ftplugin/cf3.vim @@ -0,0 +1,221 @@ +" Vim file plugin +" This is my first attempt at a ftplugin file. Feel free to send me +" corrections or improvements. I'll give you a credit. +" +" USAGE +" There is already a vim file that uses 'cf' as a file extension. You can use +" cf3 for your cf3 file extensions or identify via your vimrc file: +" au BufRead,BufNewFile *.cf set ft=cf3 + +" Check to see if DisableCF3Ftplugin is defined +" If you only want the syntax plugin add "let g:DisableCF3Ftplugin=1" in +" ~/.vimrc +if exists("g:DisableCF3Ftplugin") + finish +endif + + +" Only do this when not done yet for this buffer +if exists("b:loaded_CFE3Ftplugin") + finish +endif +let b:loaded_CFE3Ftplugin = 1 + +let s:install_dir = expand(':p:h:h') + +" =============== Keyword Abbreviations =============== +" enable keyword abbreviations with by adding +" "let g:EnableCFE3KeywordAbbreviations=1" to your vimrc +" Convenience function ToggleCFE3KeywordAbbreviations +" mapped to ,i by default to toggle abbreviations on or off +" +function! EnableCFE3KeywordAbbreviations() + iab = => + iab ba bundle agent + iab bc bundle common + iab bu bundle + iab cano canonify( "=Eatchar('\s') + iab cla classes: + iab comma commands: + iab comme comment => "=Eatchar('\s') + iab exp expression => =Eatchar('\s') + iab fil files: + iab han handle => "=Eatchar('\s') + iab ifv ifvarclass => =Eatchar('\s') + iab met methods: + iab pro processes: + iab rep reports: + iab sli slist => { + iab str string => "=Eatchar('\s') + iab sysw ${sys.workdir} + iab ub usebundle => + iab var vars: +endfunction + +function! DisableCFE3KeywordAbbreviations() + iunab = + iunab ba + iunab bc + iunab bu + iunab cano + iunab cla + iunab comma + iunab comme + iunab exp + iunab fil + iunab han + iunab ifv + iunab met + iunab pro + iunab rep + iunab sli + iunab str + iunab sysw + iunab ub + iunab var +endfunction + +" Default abbreviations off +" to disable let g:EnableCFE3KeywordAbbreviations=1 in ~/.vimrc +if exists('g:EnableCFE3KeywordAbbreviations') + call EnableCFE3KeywordAbbreviations() +endif + +function! ToggleCFE3KeywordAbbreviations() + if !exists('b:EnableCFE3KeywordAbbreviations') + let b:EnableCFE3KeywordAbbreviations=1 + call EnableCFE3KeywordAbbreviations() + else + unlet b:EnableCFE3KeywordAbbreviations + call DisableCFE3KeywordAbbreviations() + endif +endfunction + +function! EnableCFE3PermissionFix() +" On Save set the permissions of the edited file so others can't access + :autocmd BufWritePost *.cf silent !chmod g-w,o-rwx % +endfunction + +" Default permission fix off +" To enable permission fixing in your main .vimrc +" let g:EnableCFE3PermissionFix=1 +if exists('g:EnableCFE3PermissionFix') + call EnableCFE3PermissionFix() +endif + +" maps +" Toggle KeywordAbbreviations +nnoremap ,i :call ToggleCFE3KeywordAbbreviations() +" Wrap WORD in double quotes +nnoremap ,q dEi"pa" +" Insert blank promise +nnoremap ,p o""handle => "",comment => "" +" quote list items +vnoremap ,q :s/^\s*\(.*\)\s*$/"\1",/g + +" Function to align groups of => assignment lines. +" Credit to 'Scripting the Vim editor, Part 2: User-defined functions' +" by Damian Conway +" http://www.ibm.com/developerworks/linux/library/l-vim-script-2/index.html +if !exists("*CF3AlignAssignments") +function CF3AlignAssignments (AOP) + "Patterns needed to locate assignment operators... + if a:AOP == 'vars' + let ASSIGN_OP = '\(string\|int\|real\|data\|slist\|ilist\|rlist\|expression\|and\|or\|not\|volume\)*\s\+=>' + else + let ASSIGN_OP = '=>' + endif + let ASSIGN_LINE = '^\(.\{-}\)\s*\(' . ASSIGN_OP . '\)' + + "Locate block of code to be considered (same indentation, no blanks) + let indent_pat = '^' . matchstr(getline('.'), '^\s*') . '\S' + let firstline = search('^\%('. indent_pat . '\)\@!','bnW') + 1 + let lastline = search('^\%('. indent_pat . '\)\@!', 'nW') - 1 + if lastline < 0 + let lastline = line('$') + endif + + "Find the column at which the operators should be aligned... + let max_align_col = 0 + let max_op_width = 0 + for linetext in getline(firstline, lastline) + "Does this line have an assignment in it? + let left_width = match(linetext, '\s*' . ASSIGN_OP) + + "If so, track the maximal assignment column and operator width... + if left_width >= 0 + let max_align_col = max([max_align_col, left_width]) + + let op_width = strlen(matchstr(linetext, ASSIGN_OP)) + let max_op_width = max([max_op_width, op_width+1]) + endif + endfor + + "Code needed to reformat lines so as to align operators... + let FORMATTER = '\=printf("%-*s%*s", max_align_col, submatch(1), + \ max_op_width, submatch(2))' + + " Reformat lines with operators aligned in the appropriate column... + for linenum in range(firstline, lastline) + let oldline = getline(linenum) + let newline = substitute(oldline, ASSIGN_LINE, FORMATTER, "") + call setline(linenum, newline) + endfor +endfunction +endif + +nnoremap ,= :call CF3AlignAssignments("null") +nnoremap = :call CF3AlignAssignments("vars") + +" For pasting code snippets +function! Pastefile( FILE ) + let arg_file = s:install_dir."/snippets/".a:FILE + let @" = join( readfile( arg_file ), "\n" ) + put + return "" +endfunction + +nnoremap ,k :call Pastefile("template.cf")kdd +nnoremap ,s :call Pastefile("stdlib.cf")kdd + +" TODO +" Indents + +" CREDITS +" Neil Watson +" Other Cfengine information: http://watson-wilson.ca/cfengine/ +" +" CHANGES +" Wednesday January 09 2013 +" Operator alignment now works for just '=>' with ',=' or 'string, stlist ,etc +" and => ' with '=' +" +" Wednesday October 05 2011 +" - Added comment and handle abbs. Assumes you have the Eatchar and Getchar +" functions. +" - Can now wrap words and lists in quotes. +" - Insert blank promises (,p) +" - Insert blank testing skeleton (,k) +" +" CHANGES +" Monday November 21 2011 +" - IAB's for string, slist and usebundle. + +" CHANGES +" Fri Apr 27 2012 +" Added function to align assigment operators + +" vim_cf3 files (https://github.com/neilhwatson/vim_cf3) +" Copyright (C) 2011 Neil H. Watson +" +" This program is free software: you can redistribute it and/or modify it under +" the terms of the GNU General Public License as published by the Free Software +" Foundation, either version 3 of the License, or (at your option) any later +" version. +" +" This program is distributed in the hope that it will be useful, but WITHOUT ANY +" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +" PARTICULAR PURPOSE. See the GNU General Public License for more details. +" +" You should have received a copy of the GNU General Public License along with +" this program. If not, see . diff --git a/init.lua b/init.lua new file mode 100755 index 0000000..0f93455 --- /dev/null +++ b/init.lua @@ -0,0 +1,6 @@ +-- sourcing config files. +require("settings") +require("plugins") +require("maps") +require("theme") +require("user_settings") diff --git a/lua/lsp.lua b/lua/lsp.lua new file mode 100755 index 0000000..3ff7036 --- /dev/null +++ b/lua/lsp.lua @@ -0,0 +1,9 @@ +local lsp_installer = require("nvim-lsp-installer") +lsp_installer.on_server_ready(function(server) + local opts = {} + server:setup { + -- capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities()) + capabilities = require("coq").lsp_ensure_capabilities(vim.lsp.protocol.make_client_capabilities()) + } + vim.cmd [[ do User LspAttachBuffers ]] +end) diff --git a/lua/maps.lua b/lua/maps.lua new file mode 100755 index 0000000..deedb37 --- /dev/null +++ b/lua/maps.lua @@ -0,0 +1,138 @@ +-- Function for make mapping easier. +local function map(mode, lhs, rhs, opts) + local options = {noremap = true} + if opts then options = vim.tbl_extend("force", options, opts) end + vim.api.nvim_set_keymap(mode, lhs, rhs, options) +end + + +-- Map leader key to space. +vim.g.mapleader = " " + + +-- Set cl for clearing highlights after searching word in file. +map("n", "cl", ":noh") + + +-- Split navigations. +map("n", "", "") +map("n", "", "") +map("n", "", "") +map("n", "", "") + + +-- Buffer resizing. +map("n", "", ":call ResizeLeft(3)") +map("n", "", ":call ResizeRight(3)") +map("n", "", ":call ResizeUp(1)") +map("n", "", ":call ResizeDown(1)") + + +-- Buffer switching. +map("n", "", ":BufferLineCyclePrev") +map("n", "", ":BufferLineCycleNext") + +-- Buffer closing. +map("n", "bc", ":BufferLinePickClose") + +-- Buffer moving. +map("n", "bl", ":BufferLineMoveNext") +map("n", "bh", "::BufferLineMovePrev") + + +-- NvimTree toggle +map("n", "nt", ":NvimTreeToggle") + + +-- Telescop. +map("n", "tw", ":Telescope live_grep") +map("n", "gs", ":Telescope git_status") +map("n", "gc", ":Telescope git_commits") +map("n", "tf", ":Telescope find_files find_command=rg,--follow,--hidden,--files") +map("n", "td", ":Telescope find_directories") +map("n", "tp", ":Telescope media_files") +map("n", "tb", ":Telescope buffers") +map("n", "th", ":Telescope help_tags") +map("n", "to", ":Telescope oldfiles") +map("n", "tc", ":Telescope colorscheme") + + +-- Dashboard +map("n", "db", ":Dashboard") +map("n", "fn", ":DashboardNewFile") +map("n", "bm", ":DashboardJumpMarks") +map("n", "l", ":SessionLoad") +map("n", "s", ":SessionSave") + + +-- Lsp +local lsp_opts = { noremap=true, silent=true } +map("n", "lD", ":lua vim.lsp.buf.declaration()", lsp_opts) +map("n", "ld", ":lua vim.lsp.buf.definition()", lsp_opts) +map("n", "k", ":lua vim.lsp.buf.hover()", lsp_opts) +map("n", "li", ":lua vim.lsp.buf.implementation()", lsp_opts) +map("n", "", ":lua vim.lsp.buf.signature_help()", lsp_opts) +map("n", "la", ":lua vim.lsp.buf.add_workspace_folder()", lsp_opts) +map("n", "lx", ":lua vim.lsp.buf.remove_workspace_folder()", lsp_opts) +map("n", "ll", ":lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))", lsp_opts) +map("n", "lT", ":lua vim.lsp.buf.type_definition()", lsp_opts) +map("n", "ln", ":lua vim.lsp.buf.rename()", lsp_opts) +map("n", "lc", ":lua vim.lsp.buf.code_action()", lsp_opts) +map("n", "lr", ":lua vim.lsp.buf.references()", lsp_opts) +map("n", "le", ":lua vim.lsp.diagnostic.show_line_diagnostics()", lsp_opts) +map("n", "[d", ":lua vim.lsp.diagnostic.goto_prev()", lsp_opts) +map("n", "]d", ":lua vim.lsp.diagnostic.goto_next()", lsp_opts) +map("n", "lq", ":lua vim.lsp.diagnostic.set_loclist()", lsp_opts) + + +-- Dap +map("n", "", ":lua require(\"dap\").continue()") +map("n", "te", ":lua require(\"dap\").terminate()") +map("n", "br", ":lua require(\"dap\").toggle_breakpoint()") +map("n", "Br", ":lua require(\"dap\").set_breakpoint(vim.fn.input('Breakpoint condition: '))") +map("n", "lp", ":lua require(\"dap\").set_breakpoint(nil, nil, vim.fn.input('Log point message: '))") +map("n", "", ":lua require(\"dap\").step_over()") +map("n", "", ":lua require(\"dap\").step_into()") +map("n", "", ":lua require(\"dap\").step_out()") +map("n", "sb", ":lua require(\"dap\").step_back()") +map("n", "rc", ":lua require(\"dap\").run_to_cursor()") +map("n", "ro", ":lua require(\"dap\").repl.open()") +map("n", "dt", ":lua require(\"dapui\").toggle()") +map("n", "dl", ":lua require(\"dap\").run_last()") + + +-- ToggleTerm +map("n", "", ":ToggleTerm dir=%:p:h") +map("t", "", ":ToggleTerm dir=%:p:h") +map("n", "v:count1 ", ":v:count1" .. "\"ToggleTerm\"") +map("v", "v:count1 ", ":v:count1" .. "\"ToggleTerm\"") +function _G.set_terminal_keymaps() + map("t", "", "") + map("t", "", "h") + map("t", "", "j") + map("t", "", "k") + map("t", "", "l") + + map("t", "", ":call ResizeLeft(3)") + map("t", "", ":call ResizeDown(1)") + map("t", "", ":call ResizeUp(1)") + map("t", "", ":call ResizeRight(3)") +end +vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()") + + +-- Remove unnecessary white spaces. +map("n", "cw", ":StripWhitespace") + + +-- TrueZen focus mode. +map("n", "fs", ":TZFocus") + + +-- comment +map("n", "/", ":CommentToggle") +map("v", "/", ":'<,'>CommentToggle") + + +-- Code formatter. +map("n", "fr", ":Neoformat", lsp_opts) diff --git a/lua/plugins.lua b/lua/plugins.lua new file mode 100755 index 0000000..35fc95b --- /dev/null +++ b/lua/plugins.lua @@ -0,0 +1,420 @@ +local use = require("packer").use +local user_settings_file = require("../user_settings") + +return require("packer").startup({function() + use { "wbthomason/packer.nvim" } + + -- Color schemes. + use { "folke/tokyonight.nvim" } + use { "bluz71/vim-nightfly-guicolors" } + use { "bluz71/vim-moonfly-colors" } + use { "shaunsingh/nord.nvim" } + use { "navarasu/onedark.nvim" } + use { "wuelnerdotexe/vim-enfocado" } + + -- TrueZen.nvim is a Neovim plugin that aims to provide a cleaner and less cluttered interface + -- when toggled in either of it has three different modes (Ataraxis, Minimalist and Focus). + use { + "Pocco81/TrueZen.nvim", + cmd = { + "TZFocus", + "TZAtaraxis", + "TZMinimalist", + }, + setup = function() + require("plugins/true-zen") + end + } + + -- This plugin adds indentation guides to all lines (including empty lines). + use { + "lukas-reineke/indent-blankline.nvim", + event = "BufEnter", + config = function() + require("plugins/indent-blankline") + end + } + + -- This plugin show trailing whitespace. + use { + "ntpeters/vim-better-whitespace", + event = "BufRead", + config = function() + require("plugins/better-whitespace") + end + } + + -- Icons. + use { + "kyazdani42/nvim-web-devicons", + event = "BufEnter" + } + + -- File explorer tree. + use { + "kyazdani42/nvim-tree.lua", + cmd = { + "NvimTreeOpen", + "NvimTreeFocus", + "NvimTreeToggle", + }, + config = function() + require("plugins/nvim-tree") + end + } + + -- Bufferline. + use { + "akinsho/nvim-bufferline.lua", + after = "nvim-web-devicons", + config = function() + require("plugins/bufferline") + end + } + + -- Statusline. + use { + "nvim-lualine/lualine.nvim", + after = "nvim-bufferline.lua", + config = function () + require("plugins/lualine") + end + } + + -- TreeSitter. + use { + "nvim-treesitter/nvim-treesitter", + run = ":TSUpdate", + event = "BufEnter", + cmd = { + "TSInstall", + "TSInstallSync", + "TSBufEnable", + "TSBufToggle", + "TSEnableAll", + "TSInstallFromGrammer", + "TSToggleAll", + "TSUpdate", + "TSUpdateSync" + }, + config = function() + require("plugins/treesitter") + end + } + + -- Colorizer (for highlighting color codes). + use { + "norcalli/nvim-colorizer.lua", + event = "BufEnter", + config = function() + require("plugins/colorize") + vim.cmd("ColorizerAttachToBuffer") + end + } + + -- Startup screen. + use { + "glepnir/dashboard-nvim", + cmd = { + "Dashboard", + "DashboardChangeColorscheme", + "DashboardFindFile", + "DashboardFindHistory", + "DashboardFindWord", + "DashboardNewFile", + "DashboardJumpMarks", + "SessionLoad", + "SessionSave" + }, + setup = function() + require("plugins/dashboard") + end + } + + use { + "nvim-lua/plenary.nvim", + } + + use { + "nvim-telescope/telescope-fzf-native.nvim", run = "make", + cmd = "Telescope" + } + local os = vim.loop.os_uname().sysname + if os == "Linux" then + use { + "nvim-lua/popup.nvim", + cmd = "Telescope" + } + use { + "nvim-telescope/telescope-media-files.nvim", + cmd = "Telescope" + } + use { + "artart222/telescope_find_directories", + cmd = "Telescope" + } + else + use { + "artart222/telescope_find_directories", + } + end + use { + "nvim-telescope/telescope.nvim", + cmd = "Telescope", + config = function() + require("plugins/telescope") + end + } + + -- LSP, LSP installer and tab completion. + use { + "neovim/nvim-lspconfig", + event = "BufEnter" + } + use { + "williamboman/nvim-lsp-installer", + after = "nvim-lspconfig", + config = function() + require("../lsp") + end + } + + use { + "simrat39/rust-tools.nvim", + after = "nvim-lsp-installer", + config = function() + require("rust-tools").setup({}) + end + } + use { + "rafamadriz/friendly-snippets", + event = "InsertEnter" + } + + -- LSP signature. + use { + "ray-x/lsp_signature.nvim", + after = "friendly-snippets", + config = function () + require("lsp_signature").setup() + end + } + + -- VsCode like pictograms for lsp. + use { + "onsails/lspkind-nvim", + after = "friendly-snippets" + } + + use { + "mfussenegger/nvim-dap", + } + use { + "Pocco81/DAPInstall.nvim", + cmd = { + "lua require'dap'.continue()", + "lua require'dap'.run()", + "lua require'dap'.run_last()", + "lua require'dap'.launch()", + "lua require'dap'.terminate()", + "lua require'dap'.disconnect()", + "lua require'dap'.close()", + "lua require'dap'.attach()", + "lua require'dap'.set_breakpoint()", + "lua require'dap'.toggle_breakpoint()", + "lua require'dap'.list_breakpoints()", + "lua require'dap'.set_exception_breakpoints()", + "lua require'dap'.step_over()", + "lua require'dap'.step_into()", + "lua require'dap'.step_out()", + "lua require'dap'.step_back()", + "lua require'dap'.pause()", + "lua require'dap'.reverse_continue()", + "lua require'dap'.up()", + "lua require'dap'.down()", + "lua require'dap'.run_to_cursor()", + "lua require'dap'.repl.open()", + "lua require'dap'.repl.toggle()", + "lua require'dap'.repl.close()", + "lua require'dap'.set_log_level()", + "lua require'dap'.session()", + "DIInstall", + "DIUninstall", + "DIList", + }, + } + use { + "rcarriga/nvim-dap-ui", + after = "DAPInstall.nvim", + config = function () + require("plugins/dap") + end + } + + -- Code formatter. + use { + "sbdchd/neoformat", + cmd = "Neoformat" + } + + -- View and search LSP symbols, tags in Neovim. + use { + "liuchengxu/vista.vim", + cmd = "Vista", + config = function () + require("plugins/vista") + end + } + + -- Terminal. + use { + "akinsho/nvim-toggleterm.lua", + cmd = "ToggleTerm", + config = function() + require("plugins/toggleterm") + end + } + + -- Git support for nvim. + use { + "tpope/vim-fugitive", + cmd = "Git" + } + + -- Git signs. + use { + "lewis6991/gitsigns.nvim", + event = "BufRead", + config = function() + require("gitsigns").setup() + end + } + + -- Auto closes. + use { + "windwp/nvim-autopairs", + after = "coq_nvim", + config = function() + require("nvim-autopairs").setup() + end + } + -- This is for html and it can autorename too! + use { + "windwp/nvim-ts-autotag", + ft = { + "html", + "javascript", + "javascriptreact", + "typescriptreact", + "svelte", + "vue", + "php" + } + } + + -- Scrollbar. + use { + "dstein64/nvim-scrollview", + event = "BufRead", + config = function() + require("plugins/nvim-scroll") + end + } + + -- Smooth scroll. + use { + "karb94/neoscroll.nvim", + event = "BufRead", + config = function() + require("neoscroll").setup() + end + } + -- todo-comments is a lua plugin for Neovim to highlight and search for + -- todo comments like TODO, HACK, BUG in code base. + use { + "folke/todo-comments.nvim", + event = "BufEnter", + config = function() + require("plugins/todo-comments") + end + } + + -- WhichKey is a lua plugin that displays a popup with possible + -- key bindings of the command you started typing. + use { + "folke/which-key.nvim", + config = function() + require("which-key").setup() + end + } + + -- A plugin for neovim that automatically creates missing directories + -- on saving a file. + use { + "jghauser/mkdir.nvim", + cmd = "new", + config = function() + require("mkdir") + end + } + + -- Neovim plugin to comment text in and out. + -- Supports commenting out the current line, a visual selection and a motion. + use { + "terrortylor/nvim-comment", + cmd = "CommentToggle", + config = function() + require("nvim_comment").setup() + end + } + + -- match-up is a plugin that lets you highlight, navigate, and operate on sets of matching text. + use { "andymass/vim-matchup" } + + -- With this plugin you can resize Neovim buffers easily. + use { + "artart222/vim-resize", + event = "BufEnter" + } + + use { + "rafamadriz/neon" + } + use { + "marko-cerovac/material.nvim", + config = function() + require("material").setup({ + contrast = true, + pop_menu = "colorful", + italics = { + comments = false, + keywords = true, + functions = false, + strings = false, + variables = false + }, + + text_contrast = { + lighter = false, + darker = true + } + }) + end + } + + for key, plugin in pairs(additional_plugins) do + if type(plugin) == "string" then + use { plugin } + else + use { unpack(plugin) } + end + end + +end, + config = { + display = { + open_fn = function() + return require("packer.util").float({ border = "single" }) + end + } + }}) diff --git a/lua/plugins/better-whitespace.lua b/lua/plugins/better-whitespace.lua new file mode 100755 index 0000000..889af78 --- /dev/null +++ b/lua/plugins/better-whitespace.lua @@ -0,0 +1,27 @@ +_G.whitespace_disabled_file_types = { + "lsp-installer", + "lspinfo", + "TelescopePrompt", + "dashboard" +} +function _G.whitespace_visibility(file_types) + local better_whitespace_status = 1 + local current_file_type = vim.api.nvim_eval("&ft") + for k,v in ipairs(file_types) do + if current_file_type == "" or current_file_type == v then + better_whitespace_status = 0 + end + end + + -- vim.cmd("DisableWhitespace") + if better_whitespace_status == 0 then + vim.cmd("execute \"DisableWhitespace\"") + else + vim.cmd("execute \"EnableWhitespace\"") + end +end + +vim.cmd("autocmd BufEnter * lua whitespace_visibility(whitespace_disabled_file_types)") +--[[ BUG: I don't know why but it seems we must again specifcly run function for FileType dashboard. +we must have it in both whitespace_disabled_file_types and here.]] +vim.cmd("autocmd FileType dashboard execute \"DisableWhitespace\" | autocmd BufLeave lua whitespace_visibility(whitespace_disabled_file_types)") diff --git a/lua/plugins/bufferline.lua b/lua/plugins/bufferline.lua new file mode 100755 index 0000000..d8d477b --- /dev/null +++ b/lua/plugins/bufferline.lua @@ -0,0 +1,25 @@ +local present, bufferline = pcall(require, "bufferline") +if not present then + return +end + +bufferline.setup { + options = { + numbers = function(opts) + return string.format("%s", opts.id) + end, + diagnostics = "nvim_lsp", + offsets = { + { + filetype = "NvimTree", + text = "File Explorer", + highlight = "Directory", + text_align = "left" + }, + { + filetype = "vista", + text = "LspTags", + } + } + } +} diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua new file mode 100755 index 0000000..1631b9f --- /dev/null +++ b/lua/plugins/cmp.lua @@ -0,0 +1,48 @@ +local present, cmp = pcall(require, "cmp") +if not present then + return +end +local lspkind = require("lspkind") + +cmp.setup { + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + formatting = { + format = lspkind.cmp_format({ with_text = false, maxwidth = 50 }) + }, + mapping = { + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.close(), + [""] = cmp.mapping.confirm({ select = true }), + [""] = function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif require("luasnip").expand_or_jumpable() then + vim.fn.feedkeys(vim.api.nvim_replace_termcodes("luasnip-expand-or-jump", true, true, true), "") + else + fallback() + end + end, + [""] = function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif require("luasnip").jumpable(-1) then + vim.fn.feedkeys(vim.api.nvim_replace_termcodes("luasnip-jump-prev", true, true, true), "") + else + fallback() + end + end, + }, + sources = { + { name = "luasnip" }, + { name = "buffer" }, + { name = "path" }, + { name = "nvim_lsp" }, + { name = "nvim_lua" } + }, +} diff --git a/lua/plugins/colorize.lua b/lua/plugins/colorize.lua new file mode 100755 index 0000000..7c0ac07 --- /dev/null +++ b/lua/plugins/colorize.lua @@ -0,0 +1,9 @@ +local present, color = pcall(require, "colorizer") +if not present then + return +end + +color.setup { + "*", + css = { rgb_fn = true; } +} diff --git a/lua/plugins/dap.lua b/lua/plugins/dap.lua new file mode 100755 index 0000000..254e5d0 --- /dev/null +++ b/lua/plugins/dap.lua @@ -0,0 +1,61 @@ +-- dap-install configurations +local dap_install = require("dap-install") +dap_install.setup { + installation_path = vim.fn.stdpath("data") .. "/dapinstall/", +} +local dap_install = require("dap-install") +local dbg_list = require("dap-install.api.debuggers").get_installed_debuggers() + +for _, debugger in ipairs(dbg_list) do + dap_install.config(debugger) +end + + +-- dap-ui configurations +require("dapui").setup({ + icons = { expanded = "▾", collapsed = "▸" }, + mappings = { + -- Use a table to apply multiple mappings + expand = { "", "<2-LeftMouse>" }, + open = "o", + remove = "d", + edit = "e", + repl = "r", + }, + sidebar = { + -- You can change the order of elements in the sidebar + elements = { + -- Provide as ID strings or tables with "id" and "size" keys + { + id = "scopes", + size = 0.25, -- Can be float or integer > 1 + }, + { id = "breakpoints", size = 0.25 }, + { id = "stacks", size = 0.25 }, + { id = "watches", size = 00.25 }, + }, + size = 40, + position = "left", -- Can be "left", "right", "top", "bottom" + }, + tray = { + elements = { "repl" }, + size = 10, + position = "bottom", -- Can be "left", "right", "top", "bottom" + }, + floating = { + max_height = nil, -- These can be integers or a float between 0 and 1. + max_width = nil, -- Floats will be treated as percentage of your screen. + border = "single", -- Border style. Can be "single", "double" or "rounded" + mappings = { + close = { "q", "" }, + }, + }, + windows = { indent = 1 }, +}) + + +vim.fn.sign_define('DapBreakpoint', {text='●', texthl='', linehl='', numhl=''}) + + +local dap = require('dap') +dap.defaults.fallback.terminal_win_cmd = 'ToggleTerm' diff --git a/lua/plugins/dashboard.lua b/lua/plugins/dashboard.lua new file mode 100755 index 0000000..ecc6240 --- /dev/null +++ b/lua/plugins/dashboard.lua @@ -0,0 +1,49 @@ +local g = vim.g +local fn = vim.fn + +if vim.fn.has("win32") == 1 then + plugins_count = fn.len(fn.globpath("~/AppData/Local/nvim-data/site/pack/packer/start", "*", 0, 1)) +else + plugins_count = fn.len(fn.globpath("~/.local/share/nvim/site/pack/packer/start", "*", 0, 1)) +end + +g.dashboard_disable_statusline = 1 +g.dashboard_default_executive = "telescope" + +g.dashboard_custom_header = { + " ", + " ", + " ", + " ⣴⣶⣤⡤⠦⣤⣀⣤⠆ ⣈⣭⣿⣶⣿⣦⣼⣆ ", + " ⠉⠻⢿⣿⠿⣿⣿⣶⣦⠤⠄⡠⢾⣿⣿⡿⠋⠉⠉⠻⣿⣿⡛⣦ ", + " ⠈⢿⣿⣟⠦ ⣾⣿⣿⣷ ⠻⠿⢿⣿⣧⣄ ", + " ⣸⣿⣿⢧ ⢻⠻⣿⣿⣷⣄⣀⠄⠢⣀⡀⠈⠙⠿⠄ ", + " ⢠⣿⣿⣿⠈ ⣻⣿⣿⣿⣿⣿⣿⣿⣛⣳⣤⣀⣀ ", + " ⢠⣧⣶⣥⡤⢄ ⣸⣿⣿⠘ ⢀⣴⣿⣿⡿⠛⣿⣿⣧⠈⢿⠿⠟⠛⠻⠿⠄ ", + " ⣰⣿⣿⠛⠻⣿⣿⡦⢹⣿⣷ ⢊⣿⣿⡏ ⢸⣿⣿⡇ ⢀⣠⣄⣾⠄ ", + " ⣠⣿⠿⠛ ⢀⣿⣿⣷⠘⢿⣿⣦⡀ ⢸⢿⣿⣿⣄ ⣸⣿⣿⡇⣪⣿⡿⠿⣿⣷⡄ ", + " ⠙⠃ ⣼⣿⡟ ⠈⠻⣿⣿⣦⣌⡇⠻⣿⣿⣷⣿⣿⣿ ⣿⣿⡇ ⠛⠻⢷⣄ ", + " ⢻⣿⣿⣄ ⠈⠻⣿⣿⣿⣷⣿⣿⣿⣿⣿⡟ ⠫⢿⣿⡆ ", + " ⠻⣿⣿⣿⣿⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⡟⢀⣀⣤⣾⡿⠃ ", + " ", +} + +g.dashboard_custom_section = { + a = { description = { " Find File SPC t f" }, command = "Telescope find_files" }, + b = { description = { " Find directory SPC t d" }, command = "Telescope find_directories" }, + c = { description = { " Recents SPC t o" }, command = "Telescope oldfiles" }, + d = { description = { " Find Word SPC t w" }, command = "Telescope live_grep" }, + e = { description = { "洛 New File SPC f n" }, command = "DashboardNewFile" }, + f = { description = { " Bookmarks SPC b m" }, command = "Telescope marks" }, + g = { description = { " Load Last Session SPC s l" }, command = "SessionLoad" } +} + +g.dashboard_custom_footer = { + " ", + "Loaded " .. plugins_count .. " plugins!  ", + "Neovim" +} + +-- Disable statusline and cursorline in dashboard. +vim.cmd("autocmd BufEnter * if &ft is \"dashboard\" | set laststatus=0 | else | set laststatus=2 | endif") +vim.cmd("autocmd BufEnter * if &ft is \"dashboard\" | set nocursorline | endif") diff --git a/lua/plugins/indent-blankline.lua b/lua/plugins/indent-blankline.lua new file mode 100755 index 0000000..03aad25 --- /dev/null +++ b/lua/plugins/indent-blankline.lua @@ -0,0 +1,33 @@ +-- indent-blankline character. + +require("../user_settings") +local indent_blankline_style = 1 +if user_indent_blankline_style then + indent_blankline_style = user_indent_blankline_style +end + +indent_blankline_styles = { + "▏", + "¦", + "┆", + "│", + "⎸", + "|", +} + +vim.g.indent_blankline_char = indent_blankline_styles[indent_blankline_style] + +-- Disable indent-blankline on these pages. +vim.g.indent_blankline_filetype_exclude = { + "help", + "terminal", + "dashboard", + "packer", + "lsp-installer", + "lspinfo", + "vista_kind" +} +vim.g.indent_blankline_buftype_exclude = { "terminal" } + +vim.g.indent_blankline_show_trailing_blankline_indent = false +vim.g.indent_blankline_show_first_indent_level = true diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua new file mode 100755 index 0000000..bc384de --- /dev/null +++ b/lua/plugins/lualine.lua @@ -0,0 +1,53 @@ +local present, lualine = pcall(require, "lualine") +if not present then + return +end + +require("../user_settings") +local lualine_style = 1 +if user_lualine_style then + lualine_style = user_lualine_style +end + +local lualine_styles = { + { + { left = " ", right = " " }, + { left = "│", right = "│" }, + }, + { + { left = ' ', right = ''}, + { left = ' ', right = ' '}, + }, + { + { left = '', right = ''}, + { left = ' ', right = ' '}, + }, + { + { left = "", right = "" }, + { left = '', right = '' } + }, + { + { left = "", right = ""}, + { left = ' ', right = ' '} + } +} + +lualine.setup { + options = { + theme = "spaceduck", + disabled_filetypes = { + "toggleterm", + "NvimTree", + "vista_kind", + "dapui_scopes", + "dapui_breakpoints", + "dapui_stacks", + "dapui_watches", + "dap-repl" + }, + + section_separators = lualine_styles[lualine_style][1], + component_separators = lualine_styles[lualine_style][2] + }, + extensions = { "fugitive" }, +} diff --git a/lua/plugins/nvim-scroll.lua b/lua/plugins/nvim-scroll.lua new file mode 100755 index 0000000..4eb3538 --- /dev/null +++ b/lua/plugins/nvim-scroll.lua @@ -0,0 +1,2 @@ +vim.cmd("let g:scrollview_excluded_filetypes = [\"NvimTree\"]") +vim.cmd("highlight ScrollView ctermbg=160 guibg=LightCyan") -- Set scrollbar color to LightCyan diff --git a/lua/plugins/nvim-tree.lua b/lua/plugins/nvim-tree.lua new file mode 100755 index 0000000..22bf906 --- /dev/null +++ b/lua/plugins/nvim-tree.lua @@ -0,0 +1,50 @@ +local present, nvimtree = pcall(require, "nvim-tree") +if not present then + return +end +local tree_cb = require"nvim-tree.config".nvim_tree_callback + +-- Set alias for vim.g. +local g = vim.g + +g.nvim_tree_ignore = { ".git", "node_modules", ".cache", "__pycache__"} -- Ignore these types in listing. +g.nvim_tree_auto_ignore_ft = { "dashboard" } -- Don't open tree on specific fiypes. +g.nvim_tree_quit_on_open = 0 -- closes tree when file's opened. +g.nvim_tree_indent_markers = 1 -- This option shows indent markers when folders are open. +g.nvim_tree_hide_dotfiles = 1 -- This option hides files and folders starting with a dot `.`. +g.nvim_tree_git_hl = 1 -- Will enable file highlight for git attributes (can be used without the icons). +g.nvim_tree_highlight_opened_files = 0 -- Will enable folder and file icon highlight for opened files/directories. +g.nvim_tree_add_trailing = 0 -- Append a trailing slash to folder names. ]] +vim.g.nvim_tree_window_picker_exclude = { + filetype = {'packer', 'vista_kind'}, + buftype = {'terminal'} +} + +nvimtree.setup { + auto_close = false, + open_on_tab = false, + update_cwd = true, + update_to_buf_dir = { + enable = true, + auto_open = true, + }, + diagnostics = { + enable = true, + icons = { + hint = "", + info = "", + warning = "", + error = "", + } + }, + view = { + width = "20%", + side = "left", + mappings = { + list = { + {key = "", cb = ":call ResizeLeft(3)"}, + {key = "", cb = tree_cb("toggle_dotfiles")}, + } + } + } +} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua new file mode 100755 index 0000000..b598ba4 --- /dev/null +++ b/lua/plugins/telescope.lua @@ -0,0 +1,38 @@ +local present, telescope = pcall(require, "telescope") +if not present then + return +end + +local os = vim.loop.os_uname().sysname +if os == "Linux" then + telescope.setup { + extensions = { + media_files = { + filetypes = { "png", "webp", "jpg", "jpeg" }, + find_cmd = "rg" + }, + fzf = { + fuzzy = true, + override_generic_sorter = true, + override_file_sorter = true, + case_mode = "smart_case", + }, + }, + } + telescope.load_extension("media_files") + telescope.load_extension("find_directories") + telescope.load_extension("fzf") +else + telescope.setup { + extensions = { + fzf = { + fuzzy = true, + override_generic_sorter = true, + override_file_sorter = true, + case_mode = "smart_case", + } + }, + } + telescope.load_extension("fzf") + telescope.load_extension("find_directories") +end diff --git a/lua/plugins/todo-comments.lua b/lua/plugins/todo-comments.lua new file mode 100755 index 0000000..b3f6bd2 --- /dev/null +++ b/lua/plugins/todo-comments.lua @@ -0,0 +1,61 @@ +local present, todo_comments = pcall(require, "todo-comments") +if not present then + return +end + +todo_comments.setup { + signs = true, -- show icons in the signs column + sign_priority = 8, -- sign priority + -- keywords recognized as todo comments + keywords = { + FIX = { + icon = " ", -- icon used for the sign, and in search results + color = "error", -- can be a hex color, or a named color (see below) + alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords + -- signs = false, -- configure signs for some keywords individually + }, + TODO = { icon = " ", color = "info" }, + HACK = { icon = " ", color = "warning" }, + WARN = { icon = " ", color = "warning", alt = { "WARNING", "XXX" } }, + PERF = { icon = " ", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } }, + NOTE = { icon = " ", color = "hint", alt = { "INFO" } }, + }, + merge_keywords = true, -- when true, custom keywords will be merged with the defaults + -- highlighting of the line containing the todo comment + -- * before: highlights before the keyword (typically comment characters) + -- * keyword: highlights of the keyword + -- * after: highlights after the keyword (todo text) + highlight = { + before = "", -- "fg" or "bg" or empty + keyword = "wide", -- "fg", "bg", "wide" or empty. (wide is the same as bg, but will also highlight surrounding characters) + after = "fg", -- "fg" or "bg" or empty + --pattern = [[.*<(KEYWORDS)\s*:]], -- pattern or table of patterns, used for highlightng (vim regex) + pattern = [[(KEYWORDS)]], -- pattern or table of patterns, used for highlightng (vim regex) + comments_only = true, -- uses treesitter to match keywords in comments only + max_line_len = 400, -- ignore lines longer than this + exclude = {}, -- list of file types to exclude highlighting + }, + -- list of named colors where we try to extract the guifg from the + -- list of hilight groups or use the hex color if hl not found as a fallback + colors = { + error = { "LspDiagnosticsDefaultError", "ErrorMsg", "#DC2626" }, + warning = { "LspDiagnosticsDefaultWarning", "WarningMsg", "#FBBF24" }, + info = { "LspDiagnosticsDefaultInformation", "#2563EB" }, + hint = { "LspDiagnosticsDefaultHint", "#10B981" }, + default = { "Identifier", "#7C3AED" }, + }, + search = { + command = "rg", + args = { + "--color=never", + "--no-heading", + "--with-filename", + "--line-number", + "--column", + }, + -- regex that will be used to match keywords. + -- don"t replace the (KEYWORDS) placeholder + -- pattern = [[\b(KEYWORDS):]], -- ripgrep regex + pattern = [[\b(KEYWORDS)\b]], -- match without the extra colon. You"ll likely get false positives + }, +} diff --git a/lua/plugins/toggleterm.lua b/lua/plugins/toggleterm.lua new file mode 100755 index 0000000..5b4e97f --- /dev/null +++ b/lua/plugins/toggleterm.lua @@ -0,0 +1,24 @@ +local present, toggle_term = pcall(require, "toggleterm") +if not present then + return +end + +toggle_term.setup { + hide_numbers = true, -- hide the number column in toggleterm buffers + shade_terminals = false, + start_in_insert = true, + insert_mappings = true, -- whether or not the open mapping applies in insert mode + persist_size = true, + direction = "horizontal", + close_on_exit = true, -- close the terminal window when the process exits + float_opts = { + border = "curved", + width = 120, + height = 40, + winblend = 3, + highlights = { + border = "Normal", + background = "Normal", + } + } +} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua new file mode 100755 index 0000000..0a04468 --- /dev/null +++ b/lua/plugins/treesitter.lua @@ -0,0 +1,27 @@ +local present, nvim_treesitter = pcall(require, "nvim-treesitter.configs") +if not present then + return +end + +nvim_treesitter.setup { + highlight = { + enable = true, + additional_vim_regex_highlighting = true, + }, + matchup = { + enable = true, + }, + indent = { + enable = true + }, + autotag = { + enable = true + } +} + +vim.cmd +[[ +set foldmethod=expr +set foldexpr=nvim_treesitter#foldexpr() +set foldlevel=99 +]] diff --git a/lua/plugins/true-zen.lua b/lua/plugins/true-zen.lua new file mode 100755 index 0000000..040bb7c --- /dev/null +++ b/lua/plugins/true-zen.lua @@ -0,0 +1,63 @@ +local present, true_zen = pcall(require, "true-zen") +if not present then + return +end + +true_zen.setup { + ui = { + bottom = { + laststatus = 0, + ruler = false, + showmode = false, + showcmd = false, + cmdheight = 1, + }, + top = { + showtabline = 0, + }, + left = { + number = false, + relativenumber = false, + signcolumn = "no", + }, + }, + modes = { + ataraxis = { + left_padding = 32, + right_padding = 32, + top_padding = 1, + bottom_padding = 1, + ideal_writing_area_width = { 0 }, + auto_padding = true, + keep_default_fold_fillchars = true, + custom_bg = { "none", "" }, + bg_configuration = true, + quit = "untoggle", + ignore_floating_windows = true, + affected_higroups = { NonText = {}, FoldColumn = {}, ColorColumn = {}, VertSplit = {}, StatusLine = {}, StatusLineNC = {}, SignColumn = {} } + }, + focus = { + margin_of_error = 5, + focus_method = "experimental" + }, + }, + integrations = { + vim_gitgutter = false, + galaxyline = false, + tmux = false, + gitsigns = false, + nvim_bufferline = false, + limelight = false, + twilight = false, + vim_airline = false, + vim_powerline = false, + vim_signify = false, + express_line = false, + lualine = false, + }, + misc = { + on_off_commands = false, + ui_elements_commands = false, + cursor_by_mode = false, + } +} diff --git a/lua/plugins/vista.lua b/lua/plugins/vista.lua new file mode 100755 index 0000000..157cfcf --- /dev/null +++ b/lua/plugins/vista.lua @@ -0,0 +1,3 @@ +vim.g.vista_disable_statusline = 1 +vim.g.vista_icon_indent = { "╰─▸ ", "├─▸ " } +vim.g.vista_default_executive = 'nvim_lsp' diff --git a/lua/settings.lua b/lua/settings.lua new file mode 100755 index 0000000..3a961cb --- /dev/null +++ b/lua/settings.lua @@ -0,0 +1,118 @@ +-- Defining alias for vim.opt. +local opt = vim.opt + +-- Number settings. +opt.number = true +opt.numberwidth = 2 +opt.relativenumber = false + +-- Set scroll offset. +opt.scrolloff = 3 + +-- Remove showing mode. +opt.showmode = false + +-- True collor support. +opt.termguicolors = true + +-- Enable clipboard. +opt.clipboard = "unnamedplus" + +-- Enable mouse in all modes. +opt.mouse = "a" + +-- Enable cursor line. +opt.cursorline = true + +-- Setting colorcolumn. This is set because of +-- this (https://github.com/lukas-reineke/indent-blankline.nvim/issues/59) +-- indent-blankline bug. +opt.colorcolumn = "9999" + +-- With set hidden you’re telling Neovim that you can +-- have unsaved worked that’s not displayed on your screen. +opt.hidden = true + +-- Set indentation stuf. +opt.tabstop = 4 +opt.shiftwidth = 4 +opt.smartindent = true +opt.smartcase = true +opt.expandtab = true +opt.smarttab = true + +-- Set searching stuf. +opt.hlsearch = true +opt.incsearch = true +opt.ignorecase = true + +-- Set terminal bidirectual. +-- For writing in right to left languages like arabic, persian and hebrew. +opt.termbidi = true + +-- Without this option some times backspace did not work correctly. +opt.backspace = "indent,eol,start" + +-- For opening splits on right or bottom. +opt.splitbelow = true +opt.splitright = true + +-- Enabling ruler and statusline. +opt.ruler = true + +-- Setting time that Neovim wait after each keystroke. +opt.ttimeoutlen = 20 +opt.timeoutlen = 1000 + +-- Setting up autocomplete menu. +opt.completeopt = "menuone,noselect" + +-- Add cursorline and diasable it in terminal +vim.cmd("autocmd WinEnter,BufEnter * if &ft is \"toggleterm\" | set nocursorline | else | set cursorline | endif") + +-- Set line number for help files. +vim.cmd +[[ +augroup help_config + autocmd! + autocmd FileType help :set number +augroup END +]] + +-- Auto open nvim-tree when writing (nvim .) in command line +-- and auto open Dashboard when nothing given as argument. +vim.cmd +[[ +if index(argv(), ".") >= 0 + autocmd VimEnter * NvimTreeToggle + bd1 +elseif len(argv()) == 0 + autocmd VimEnter * Dashboard +endif +]] + +vim.cmd +[[ +if has("win32") + command CodeArtUpdate !powershell.exe -executionpolicy bypass -file "$HOME\AppData\Local\nvim\CodeArtUpdate.ps1" +else + command CodeArtUpdate !bash ~/.config/nvim/CodeArtUpdate.sh +endif +]] + +vim.cmd("autocmd BufWritePost plugins.lua source ") + + +-- NOTE: Your shell must be powershell in bellow code block because of :CodeArtUpdate command +vim.cmd +[[ +if has("win32") + set shell=powershell " Your shell must be powershell + let &shellcmdflag = "-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;" + let &shellredir = "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode" + let &shellpipe = "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode" + set shellquote= shellxquote= +endif +]] + +vim.cmd("command CodeArtTransparent lua make_codeart_transparent()") diff --git a/lua/theme.lua b/lua/theme.lua new file mode 100755 index 0000000..f35ee73 --- /dev/null +++ b/lua/theme.lua @@ -0,0 +1,99 @@ +-- Hide ~ from end of lines. +vim.opt.fillchars = { eob = " " } + +-- Add icons for lsp diagnostics sings +vim.cmd +[[ +sign define LspDiagnosticsSignError text= texthl=LspDiagnosticsSignError linehl= numhl= +sign define LspDiagnosticsSignWarning text= texthl=LspDiagnosticsSignWarning linehl= numhl= +sign define LspDiagnosticsSignInformation text= texthl=LspDiagnosticsSignInformation linehl= numhl= +sign define LspDiagnosticsSignHint text= texthl=LspDiagnosticsSignHint linehl= numhl= +]] + +vim.g.tokyonight_style = "night" -- styles: storm, night and day. +vim.g.onedark_style = "deep" -- styles: dark, darker, cool, deep, warm and warmer. +vim.g.enfocado_style = "nature" -- styles: nature and neon. +vim.g.neon_style = "dark" +vim.g.material_style = "deep ocean" +vim.cmd("colorscheme spaceduck") + +function _G.make_codeart_transparent() + vim.cmd("highlight Normal guibg=NONE guifg=NONE") + vim.cmd("highlight NormalNc guibg=NONE guifg=NONE") + vim.cmd("highlight LineNr guibg=NONE guifg=NONE") + vim.cmd("highlight CursorLineNr guibg=NONE guifg=NONE") + vim.cmd("highlight SignColumn guibg=NONE guifg=NONE") + vim.cmd("highlight EndOfBuffer guibg=NONE guifg=NONE") + + + vim.cmd("highlight NvimTreeNormal guibg=NONE guifg=NONE") + vim.cmd("highlight NvimTreeNormalNc guibg=NONE guifg=NONE") + vim.cmd("highlight NvimTreeEndOfBuffer guibg=NONE guifg=NONE") + vim.cmd("highlight NvimTreeFolderIcon guibg=NONE guifg=NONE") + vim.cmd("highlight NvimTreeOpenedFolderName guibg=NONE guifg=NONE") + + + vim.cmd("highlight BufferLineFill guibg=NONE guifg=NONE") + vim.cmd("highlight BufferLineDiagnostics guibg=NONE guifg=NONE") + vim.cmd("highlight BufferLineTab guibg=NONE guifg=NONE") + vim.cmd("highlight BufferLineTabSelected guibg=NONE guifg=NONE") + vim.cmd("highlight BufferLineTabClose guibg=NONE guifg=NONE") + vim.cmd("highlight BufferLineDuplicate guibg=NONE guifg=NONE") + vim.cmd("highlight BufferLineDuplicateSelected guibg=NONE guifg=NONE") + vim.cmd("highlight BufferLineDuplicateVisible guibg=NONE guifg=NONE") + + vim.cmd("highlight BufferLineBackground guibg=NONE guifg=NONE") + vim.cmd("highlight BufferLineCloseButton guibg=NONE guifg=NONE") + vim.cmd("highlight BufferLineCloseButtonSelected guibg=NONE guifg=NONE") + vim.cmd("highlight BufferLineCloseButtonVisible guibg=NONE guifg=NONE") + vim.cmd("highlight BufferLineBufferVisible guibg=NONE guifg=NONE") + vim.cmd("highlight BufferLinePick guibg=NONE") + vim.cmd("highlight BufferLinePickSelected guibg=NONE") + vim.cmd("highlight BufferLineSeperator guibg=NONE guifg=NONE") + vim.cmd("highlight BufferLineGroupSeperator guibg=NONE guifg=NONE") + vim.cmd("highlight bufferlineseperatorvisible guibg=none guifg=none") + vim.cmd("highlight BufferLineSeparatorSelected guibg=none") + vim.cmd("highlight BufferLineSeparator guibg=NONE guifg=NONE") + vim.cmd("highlight BufferLineIndicatorSelected guibg=NONE") + vim.cmd("highlight BufferLineBufferSelected guibg=NONE guifg=NONE") + vim.cmd("highlight BufferLineDiagnostic guibg=NONE guifg=NONE") + vim.cmd("highlight BufferLineDevIconLuaSelected guibg=NONE") + vim.cmd("highlight BufferLineDevIconDefaultInactive guibg=NONE") + + vim.cmd("highlight BufferLineError guibg=NONE guifg=NONE") + vim.cmd("highlight BufferLineErrorVisible guibg=NONE guifg=NONE") + vim.cmd("highlight BufferLineErrorDiagnosticVisible guibg=NONE guifg=NONE") + vim.cmd("highlight BufferLineErrorSelected guibg=NONE") + vim.cmd("highlight BufferLineErrorDiagnostic guibg=NONE guifg=NONE") + vim.cmd("highlight BufferLineErrorDiagnosticSelected guibg=NONE") + vim.cmd("highlight BufferLineErrorDiagnosticSelected guibg=NONE") + + vim.cmd("highlight BufferLineWarning guibg=NONE guifg=NONE") + vim.cmd("highlight BufferLineWarningVisible guibg=NONE guifg=NONE") + vim.cmd("highlight BufferLineWarningDiagnosticVisible guibg=NONE guifg=NONE") + vim.cmd("highlight BufferLineWarningSelected guibg=NONE") + vim.cmd("highlight BufferLineWarningDiagnostic guibg=NONE guifg=NONE") + vim.cmd("highlight BufferLineWarningDiagnosticSelected guibg=NONE") + vim.cmd("highlight BufferLineWarningDiagnosticSelected guibg=NONE") + + vim.cmd("highlight BufferLineInfo guibg=NONE guifg=NONE") + vim.cmd("highlight BufferLineInfoVisible guibg=NONE guifg=NONE") + vim.cmd("highlight BufferLineInfoDiagnosticVisible guibg=NONE guifg=NONE") + vim.cmd("highlight BufferLineInfoSelected guibg=NONE") + vim.cmd("highlight BufferLineInfoDiagnostic guibg=NONE guifg=NONE") + vim.cmd("highlight BufferLineInfoDiagnosticSelected guibg=NONE") + vim.cmd("highlight BufferLineInfoDiagnosticSelected guibg=NONE") + + vim.cmd("highlight BufferLineModified guibg=NONE") + vim.cmd("highlight BufferLineModifiedSelected guibg=NONE") + vim.cmd("highlight BufferLineModifiedVisible guibg=NONE guifg=NONE") + + vim.cmd("highlight DiagnosticVirtualTextError guibg=NONE") + vim.cmd("highlight DiagnosticVirtualTextWarn guibg=NONE") + vim.cmd("highlight DiagnosticVirtualTextHint guibg=NONE") + vim.cmd("highlight DiagnosticVirtualTextInfo guibg=NONE") + + vim.cmd("highlight NormalFloat guibg=NONE") + vim.cmd("highlight FloatBorder guibg=#NONE") + vim.cmd("highlight WhichKeyFloat guibg=NONE") +end diff --git a/lua/user_settings.lua b/lua/user_settings.lua new file mode 100755 index 0000000..4529fbb --- /dev/null +++ b/lua/user_settings.lua @@ -0,0 +1,58 @@ +-- Function for make mapping easier. +local function map(mode, lhs, rhs, opts) + local options = {noremap = true} + if opts then options = vim.tbl_extend("force", options, opts) end + vim.api.nvim_set_keymap(mode, lhs, rhs, options) +end + +additional_plugins = { + { "pineapplegiant/spaceduck", branch = "main" }, + { "ms-jpq/coq_nvim" }, + { "ms-jpq/coq.artifacts" }, + { "ms-jpq/coq.thirdparty" }, + -- You can put your additional plugins here. + -- Syntax is like normal packer.nvim Syntax. Examples: + + -- { "famiu/feline.nvim", branch = "develop" }, + + -- "mhartington/formatter.nvim", + + -- { crispgm/nvim-go", ft = "go" }, +} + + +-- Other settings here +-- For examples for disabling line number: +-- vim.opt.number = false +-- vim.opt.relativenumber = false + + +-- Or for changing terminal toggle mapping: +-- first argument is mode of mapping. second argument is keymap. +-- third argument is command. and last argument is optional argument like {expr = true}. +-- map("n", "", ":ToggleTerm") +-- map("t", "", ":ToggleTerm") + +user_lualine_style = 3 -- You can choose between 1, 2, 3, 4 and 5 +user_indent_blankline_style = 4 -- You can choose between 1, 2, 3, 4,5 and 6 + +-- Set theme to be transparent +vim.g.tokyonight_transparent = true + +-- Enable persistent undo +vim.opt.undofile = true + +-- Run COQ on open +vim.g.coq_settings = { + auto_start = "shut-up" +} + +-- Nvim LSP Settings +-- vim.diagnostic.config({ +-- virtual_text = true, +-- signs = true, +-- underline = true, +-- update_in_insert = true, +-- severity_sort = false, +-- }) + diff --git a/plugin/packer_compiled.lua b/plugin/packer_compiled.lua new file mode 100644 index 0000000..4c59ecd --- /dev/null +++ b/plugin/packer_compiled.lua @@ -0,0 +1,562 @@ +-- 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 = "/Users/pricehiller/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/Users/pricehiller/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/Users/pricehiller/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/Users/pricehiller/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua" +local install_cpath_pattern = "/Users/pricehiller/.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 = { + ["DAPInstall.nvim"] = { + after = { "nvim-dap-ui" }, + commands = { "lua require'dap'.continue()", "lua require'dap'.run()", "lua require'dap'.run_last()", "lua require'dap'.launch()", "lua require'dap'.terminate()", "lua require'dap'.disconnect()", "lua require'dap'.close()", "lua require'dap'.attach()", "lua require'dap'.set_breakpoint()", "lua require'dap'.toggle_breakpoint()", "lua require'dap'.list_breakpoints()", "lua require'dap'.set_exception_breakpoints()", "lua require'dap'.step_over()", "lua require'dap'.step_into()", "lua require'dap'.step_out()", "lua require'dap'.step_back()", "lua require'dap'.pause()", "lua require'dap'.reverse_continue()", "lua require'dap'.up()", "lua require'dap'.down()", "lua require'dap'.run_to_cursor()", "lua require'dap'.repl.open()", "lua require'dap'.repl.toggle()", "lua require'dap'.repl.close()", "lua require'dap'.set_log_level()", "lua require'dap'.session()", "DIInstall", "DIUninstall", "DIList" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/DAPInstall.nvim", + url = "https://github.com/Pocco81/DAPInstall.nvim" + }, + ["TrueZen.nvim"] = { + commands = { "TZFocus", "TZAtaraxis", "TZMinimalist" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/TrueZen.nvim", + url = "https://github.com/Pocco81/TrueZen.nvim" + }, + ["coq.artifacts"] = { + loaded = true, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/start/coq.artifacts", + url = "https://github.com/ms-jpq/coq.artifacts" + }, + ["coq.thirdparty"] = { + loaded = true, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/start/coq.thirdparty", + url = "https://github.com/ms-jpq/coq.thirdparty" + }, + coq_nvim = { + loaded = true, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/start/coq_nvim", + url = "https://github.com/ms-jpq/coq_nvim" + }, + ["dashboard-nvim"] = { + commands = { "Dashboard", "DashboardChangeColorscheme", "DashboardFindFile", "DashboardFindHistory", "DashboardFindWord", "DashboardNewFile", "DashboardJumpMarks", "SessionLoad", "SessionSave" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/dashboard-nvim", + url = "https://github.com/glepnir/dashboard-nvim" + }, + ["friendly-snippets"] = { + after = { "lsp_signature.nvim", "lspkind-nvim" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/friendly-snippets", + url = "https://github.com/rafamadriz/friendly-snippets" + }, + ["gitsigns.nvim"] = { + config = { "\27LJ\2\n6\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\rgitsigns\frequire\0" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/gitsigns.nvim", + url = "https://github.com/lewis6991/gitsigns.nvim" + }, + ["indent-blankline.nvim"] = { + config = { "\27LJ\2\n8\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\29plugins/indent-blankline\frequire\0" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/indent-blankline.nvim", + url = "https://github.com/lukas-reineke/indent-blankline.nvim" + }, + ["lsp_signature.nvim"] = { + 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\18lsp_signature\frequire\0" }, + load_after = { + ["friendly-snippets"] = true + }, + loaded = false, + needs_bufread = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/lsp_signature.nvim", + url = "https://github.com/ray-x/lsp_signature.nvim" + }, + ["lspkind-nvim"] = { + load_after = { + ["friendly-snippets"] = true + }, + loaded = false, + needs_bufread = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/lspkind-nvim", + url = "https://github.com/onsails/lspkind-nvim" + }, + ["lualine.nvim"] = { + config = { "\27LJ\2\n/\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\20plugins/lualine\frequire\0" }, + load_after = { + ["nvim-bufferline.lua"] = true + }, + loaded = false, + needs_bufread = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/lualine.nvim", + url = "https://github.com/nvim-lualine/lualine.nvim" + }, + ["material.nvim"] = { + loaded = true, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/start/material.nvim", + url = "https://github.com/marko-cerovac/material.nvim" + }, + ["mkdir.nvim"] = { + commands = { "new" }, + config = { "\27LJ\2\n%\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\nmkdir\frequire\0" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/mkdir.nvim", + url = "https://github.com/jghauser/mkdir.nvim" + }, + neoformat = { + commands = { "Neoformat" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/neoformat", + url = "https://github.com/sbdchd/neoformat" + }, + neon = { + loaded = true, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/start/neon", + url = "https://github.com/rafamadriz/neon" + }, + ["neoscroll.nvim"] = { + config = { "\27LJ\2\n7\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\14neoscroll\frequire\0" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/neoscroll.nvim", + url = "https://github.com/karb94/neoscroll.nvim" + }, + ["nord.nvim"] = { + loaded = true, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/start/nord.nvim", + url = "https://github.com/shaunsingh/nord.nvim" + }, + ["nvim-autopairs"] = { + 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\19nvim-autopairs\frequire\0" }, + load_after = {}, + loaded = true, + needs_bufread = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/nvim-autopairs", + url = "https://github.com/windwp/nvim-autopairs" + }, + ["nvim-bufferline.lua"] = { + after = { "lualine.nvim" }, + config = { "\27LJ\2\n2\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\23plugins/bufferline\frequire\0" }, + load_after = { + ["nvim-web-devicons"] = true + }, + loaded = false, + needs_bufread = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/nvim-bufferline.lua", + url = "https://github.com/akinsho/nvim-bufferline.lua" + }, + ["nvim-colorizer.lua"] = { + config = { "\27LJ\2\n`\0\0\3\0\5\0\b6\0\0\0'\2\1\0B\0\2\0016\0\2\0009\0\3\0'\2\4\0B\0\2\1K\0\1\0\28ColorizerAttachToBuffer\bcmd\bvim\21plugins/colorize\frequire\0" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/nvim-colorizer.lua", + url = "https://github.com/norcalli/nvim-colorizer.lua" + }, + ["nvim-comment"] = { + commands = { "CommentToggle" }, + 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\17nvim_comment\frequire\0" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/nvim-comment", + url = "https://github.com/terrortylor/nvim-comment" + }, + ["nvim-dap"] = { + loaded = true, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/start/nvim-dap", + url = "https://github.com/mfussenegger/nvim-dap" + }, + ["nvim-dap-ui"] = { + config = { "\27LJ\2\n+\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\16plugins/dap\frequire\0" }, + load_after = { + ["DAPInstall.nvim"] = true + }, + loaded = false, + needs_bufread = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/nvim-dap-ui", + url = "https://github.com/rcarriga/nvim-dap-ui" + }, + ["nvim-lsp-installer"] = { + after = { "rust-tools.nvim" }, + config = { "\27LJ\2\n&\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\v../lsp\frequire\0" }, + load_after = { + ["nvim-lspconfig"] = true + }, + loaded = false, + needs_bufread = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/nvim-lsp-installer", + url = "https://github.com/williamboman/nvim-lsp-installer" + }, + ["nvim-lspconfig"] = { + after = { "nvim-lsp-installer" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/nvim-lspconfig", + url = "https://github.com/neovim/nvim-lspconfig" + }, + ["nvim-scrollview"] = { + config = { "\27LJ\2\n3\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\24plugins/nvim-scroll\frequire\0" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/nvim-scrollview", + url = "https://github.com/dstein64/nvim-scrollview" + }, + ["nvim-toggleterm.lua"] = { + commands = { "ToggleTerm" }, + config = { "\27LJ\2\n2\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\23plugins/toggleterm\frequire\0" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/nvim-toggleterm.lua", + url = "https://github.com/akinsho/nvim-toggleterm.lua" + }, + ["nvim-tree.lua"] = { + commands = { "NvimTreeOpen", "NvimTreeFocus", "NvimTreeToggle" }, + config = { "\27LJ\2\n1\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\22plugins/nvim-tree\frequire\0" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/nvim-tree.lua", + url = "https://github.com/kyazdani42/nvim-tree.lua" + }, + ["nvim-treesitter"] = { + commands = { "TSInstall", "TSInstallSync", "TSBufEnable", "TSBufToggle", "TSEnableAll", "TSInstallFromGrammer", "TSToggleAll", "TSUpdate", "TSUpdateSync" }, + config = { "\27LJ\2\n2\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\23plugins/treesitter\frequire\0" }, + loaded = false, + needs_bufread = true, + only_cond = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/nvim-treesitter", + url = "https://github.com/nvim-treesitter/nvim-treesitter" + }, + ["nvim-ts-autotag"] = { + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/nvim-ts-autotag", + url = "https://github.com/windwp/nvim-ts-autotag" + }, + ["nvim-web-devicons"] = { + after = { "nvim-bufferline.lua" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/nvim-web-devicons", + url = "https://github.com/kyazdani42/nvim-web-devicons" + }, + ["onedark.nvim"] = { + loaded = true, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/start/onedark.nvim", + url = "https://github.com/navarasu/onedark.nvim" + }, + ["packer.nvim"] = { + loaded = true, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/start/packer.nvim", + url = "https://github.com/wbthomason/packer.nvim" + }, + ["plenary.nvim"] = { + loaded = true, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/start/plenary.nvim", + url = "https://github.com/nvim-lua/plenary.nvim" + }, + ["rust-tools.nvim"] = { + config = { "\27LJ\2\n<\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\15rust-tools\frequire\0" }, + load_after = { + ["nvim-lsp-installer"] = true + }, + loaded = false, + needs_bufread = true, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/rust-tools.nvim", + url = "https://github.com/simrat39/rust-tools.nvim" + }, + spaceduck = { + loaded = true, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/start/spaceduck", + url = "https://github.com/pineapplegiant/spaceduck" + }, + ["telescope-fzf-native.nvim"] = { + commands = { "Telescope" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/telescope-fzf-native.nvim", + url = "https://github.com/nvim-telescope/telescope-fzf-native.nvim" + }, + ["telescope.nvim"] = { + commands = { "Telescope" }, + config = { "\27LJ\2\n1\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\22plugins/telescope\frequire\0" }, + loaded = false, + needs_bufread = true, + only_cond = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/telescope.nvim", + url = "https://github.com/nvim-telescope/telescope.nvim" + }, + telescope_find_directories = { + loaded = true, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/start/telescope_find_directories", + url = "https://github.com/artart222/telescope_find_directories" + }, + ["todo-comments.nvim"] = { + config = { "\27LJ\2\n5\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\26plugins/todo-comments\frequire\0" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/todo-comments.nvim", + url = "https://github.com/folke/todo-comments.nvim" + }, + ["tokyonight.nvim"] = { + loaded = true, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/start/tokyonight.nvim", + url = "https://github.com/folke/tokyonight.nvim" + }, + ["vim-better-whitespace"] = { + config = { "\27LJ\2\n9\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\30plugins/better-whitespace\frequire\0" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/vim-better-whitespace", + url = "https://github.com/ntpeters/vim-better-whitespace" + }, + ["vim-enfocado"] = { + loaded = true, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/start/vim-enfocado", + url = "https://github.com/wuelnerdotexe/vim-enfocado" + }, + ["vim-fugitive"] = { + commands = { "Git" }, + loaded = false, + needs_bufread = true, + only_cond = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/vim-fugitive", + url = "https://github.com/tpope/vim-fugitive" + }, + ["vim-matchup"] = { + loaded = true, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/start/vim-matchup", + url = "https://github.com/andymass/vim-matchup" + }, + ["vim-moonfly-colors"] = { + loaded = true, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/start/vim-moonfly-colors", + url = "https://github.com/bluz71/vim-moonfly-colors" + }, + ["vim-nightfly-guicolors"] = { + loaded = true, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/start/vim-nightfly-guicolors", + url = "https://github.com/bluz71/vim-nightfly-guicolors" + }, + ["vim-resize"] = { + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/vim-resize", + url = "https://github.com/artart222/vim-resize" + }, + ["vista.vim"] = { + commands = { "Vista" }, + config = { "\27LJ\2\n-\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\18plugins/vista\frequire\0" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/vista.vim", + url = "https://github.com/liuchengxu/vista.vim" + }, + ["which-key.nvim"] = { + config = { "\27LJ\2\n7\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\14which-key\frequire\0" }, + loaded = true, + path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/start/which-key.nvim", + url = "https://github.com/folke/which-key.nvim" + } +} + +time([[Defining packer_plugins]], false) +-- Setup for: TrueZen.nvim +time([[Setup for TrueZen.nvim]], true) +try_loadstring("\27LJ\2\n0\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\21plugins/true-zen\frequire\0", "setup", "TrueZen.nvim") +time([[Setup for TrueZen.nvim]], false) +-- Setup for: dashboard-nvim +time([[Setup for dashboard-nvim]], true) +try_loadstring("\27LJ\2\n1\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\22plugins/dashboard\frequire\0", "setup", "dashboard-nvim") +time([[Setup for dashboard-nvim]], false) +-- Config for: which-key.nvim +time([[Config for which-key.nvim]], true) +try_loadstring("\27LJ\2\n7\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\14which-key\frequire\0", "config", "which-key.nvim") +time([[Config for which-key.nvim]], false) +-- Load plugins in order defined by `after` +time([[Sequenced loading]], true) +vim.cmd [[ packadd coq_nvim ]] +vim.cmd [[ packadd nvim-autopairs ]] + +-- Config for: nvim-autopairs +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\19nvim-autopairs\frequire\0", "config", "nvim-autopairs") + +time([[Sequenced loading]], false) + +-- Command lazy-loads +time([[Defining lazy-load commands]], true) +pcall(vim.cmd, [[au CmdUndefined lua require'dap'.run_last() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]]) +pcall(vim.cmd, [[au CmdUndefined lua require'dap'.launch() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]]) +pcall(vim.cmd, [[au CmdUndefined lua require'dap'.terminate() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]]) +pcall(vim.cmd, [[au CmdUndefined lua require'dap'.disconnect() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]]) +pcall(vim.cmd, [[au CmdUndefined lua require'dap'.close() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]]) +pcall(vim.cmd, [[au CmdUndefined lua require'dap'.attach() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]]) +pcall(vim.cmd, [[au CmdUndefined lua require'dap'.set_breakpoint() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]]) +pcall(vim.cmd, [[au CmdUndefined lua require'dap'.toggle_breakpoint() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]]) +pcall(vim.cmd, [[au CmdUndefined lua require'dap'.list_breakpoints() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]]) +pcall(vim.cmd, [[au CmdUndefined lua require'dap'.set_exception_breakpoints() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]]) +pcall(vim.cmd, [[au CmdUndefined lua require'dap'.step_over() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]]) +pcall(vim.cmd, [[au CmdUndefined lua require'dap'.step_into() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]]) +pcall(vim.cmd, [[au CmdUndefined lua require'dap'.step_out() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]]) +pcall(vim.cmd, [[au CmdUndefined lua require'dap'.step_back() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]]) +pcall(vim.cmd, [[au CmdUndefined lua require'dap'.pause() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]]) +pcall(vim.cmd, [[au CmdUndefined lua require'dap'.reverse_continue() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]]) +pcall(vim.cmd, [[au CmdUndefined lua require'dap'.up() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]]) +pcall(vim.cmd, [[au CmdUndefined lua require'dap'.down() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Dashboard lua require("packer.load")({'dashboard-nvim'}, { cmd = "Dashboard", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DashboardChangeColorscheme lua require("packer.load")({'dashboard-nvim'}, { cmd = "DashboardChangeColorscheme", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DashboardFindFile lua require("packer.load")({'dashboard-nvim'}, { cmd = "DashboardFindFile", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DashboardFindHistory lua require("packer.load")({'dashboard-nvim'}, { cmd = "DashboardFindHistory", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DashboardFindWord lua require("packer.load")({'dashboard-nvim'}, { cmd = "DashboardFindWord", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DashboardNewFile lua require("packer.load")({'dashboard-nvim'}, { cmd = "DashboardNewFile", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DashboardJumpMarks lua require("packer.load")({'dashboard-nvim'}, { cmd = "DashboardJumpMarks", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file SessionLoad lua require("packer.load")({'dashboard-nvim'}, { cmd = "SessionLoad", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file SessionSave lua require("packer.load")({'dashboard-nvim'}, { cmd = "SessionSave", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file new lua require("packer.load")({'mkdir.nvim'}, { cmd = "new", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Telescope lua require("packer.load")({'telescope-fzf-native.nvim', 'telescope.nvim'}, { cmd = "Telescope", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSInstall lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSInstall", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSInstallSync lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSInstallSync", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSBufEnable lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSBufEnable", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSBufToggle lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSBufToggle", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSEnableAll lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSEnableAll", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSInstallFromGrammer lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSInstallFromGrammer", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSToggleAll lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSToggleAll", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSUpdate lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSUpdate", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSUpdateSync lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSUpdateSync", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file NvimTreeToggle lua require("packer.load")({'nvim-tree.lua'}, { cmd = "NvimTreeToggle", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file NvimTreeFocus lua require("packer.load")({'nvim-tree.lua'}, { cmd = "NvimTreeFocus", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file NvimTreeOpen lua require("packer.load")({'nvim-tree.lua'}, { cmd = "NvimTreeOpen", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Vista lua require("packer.load")({'vista.vim'}, { cmd = "Vista", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file ToggleTerm lua require("packer.load")({'nvim-toggleterm.lua'}, { cmd = "ToggleTerm", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Git lua require("packer.load")({'vim-fugitive'}, { cmd = "Git", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Neoformat lua require("packer.load")({'neoformat'}, { cmd = "Neoformat", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file CommentToggle lua require("packer.load")({'nvim-comment'}, { cmd = "CommentToggle", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DIList lua require("packer.load")({'DAPInstall.nvim'}, { cmd = "DIList", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DIUninstall lua require("packer.load")({'DAPInstall.nvim'}, { cmd = "DIUninstall", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DIInstall lua require("packer.load")({'DAPInstall.nvim'}, { cmd = "DIInstall", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[au CmdUndefined lua require'dap'.session() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]]) +pcall(vim.cmd, [[au CmdUndefined lua require'dap'.set_log_level() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]]) +pcall(vim.cmd, [[au CmdUndefined lua require'dap'.repl.close() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]]) +pcall(vim.cmd, [[au CmdUndefined lua require'dap'.repl.toggle() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]]) +pcall(vim.cmd, [[au CmdUndefined lua require'dap'.repl.open() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]]) +pcall(vim.cmd, [[au CmdUndefined lua require'dap'.run_to_cursor() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TZFocus lua require("packer.load")({'TrueZen.nvim'}, { cmd = "TZFocus", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TZMinimalist lua require("packer.load")({'TrueZen.nvim'}, { cmd = "TZMinimalist", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TZAtaraxis lua require("packer.load")({'TrueZen.nvim'}, { cmd = "TZAtaraxis", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[au CmdUndefined lua require'dap'.continue() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]]) +pcall(vim.cmd, [[au CmdUndefined lua require'dap'.run() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]]) +time([[Defining lazy-load commands]], false) + +vim.cmd [[augroup packer_load_aucmds]] +vim.cmd [[au!]] + -- Filetype lazy-loads +time([[Defining lazy-load filetype autocommands]], true) +vim.cmd [[au FileType javascriptreact ++once lua require("packer.load")({'nvim-ts-autotag'}, { ft = "javascriptreact" }, _G.packer_plugins)]] +vim.cmd [[au FileType typescriptreact ++once lua require("packer.load")({'nvim-ts-autotag'}, { ft = "typescriptreact" }, _G.packer_plugins)]] +vim.cmd [[au FileType svelte ++once lua require("packer.load")({'nvim-ts-autotag'}, { ft = "svelte" }, _G.packer_plugins)]] +vim.cmd [[au FileType vue ++once lua require("packer.load")({'nvim-ts-autotag'}, { ft = "vue" }, _G.packer_plugins)]] +vim.cmd [[au FileType php ++once lua require("packer.load")({'nvim-ts-autotag'}, { ft = "php" }, _G.packer_plugins)]] +vim.cmd [[au FileType html ++once lua require("packer.load")({'nvim-ts-autotag'}, { ft = "html" }, _G.packer_plugins)]] +vim.cmd [[au FileType javascript ++once lua require("packer.load")({'nvim-ts-autotag'}, { ft = "javascript" }, _G.packer_plugins)]] +time([[Defining lazy-load filetype autocommands]], false) + -- Event lazy-loads +time([[Defining lazy-load event autocommands]], true) +vim.cmd [[au BufRead * ++once lua require("packer.load")({'gitsigns.nvim', 'vim-better-whitespace', 'neoscroll.nvim', 'nvim-scrollview'}, { event = "BufRead *" }, _G.packer_plugins)]] +vim.cmd [[au BufEnter * ++once lua require("packer.load")({'nvim-treesitter', 'nvim-web-devicons', 'indent-blankline.nvim', 'todo-comments.nvim', 'nvim-colorizer.lua', 'nvim-lspconfig', 'vim-resize'}, { event = "BufEnter *" }, _G.packer_plugins)]] +vim.cmd [[au InsertEnter * ++once lua require("packer.load")({'friendly-snippets'}, { 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 + vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None') +end diff --git a/syntax/cf3.vim b/syntax/cf3.vim new file mode 100644 index 0000000..3075ade --- /dev/null +++ b/syntax/cf3.vim @@ -0,0 +1,628 @@ +" vim:foldmethod=marker + +" Vim syntax file +" Language: Cfengine version 3 +" Maintainer: Neil Watson +" Last Change: Jun 02 2018 +" Location: +" +" TODO: +" - would be great to know current promise type +" +" This is my first attempt at a syntax file. Feel free to send me corrections +" or improvements. I'll give you a credit. +" +" USAGE +" There is already a vim file that uses 'cf' as a file extension. You can use +" cf3 for your cf3 file extensions or identify via your vimrc file: +" au BufRead,BufNewFile *.cf set ft=cf3 +" +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded + +au BufRead,BufNewFile *.cf set ft=cf3 + +if version < 600 " {{{ + syntax clear +elseif exists ("b:current_syntax") + finish +endif + +syn case ignore + +syn match cf3BundleParams /(\w\+\(,\s*\w\+\)*)/hs=s+1,he=e-1 contained +syn match cf3BundleName /\s\+\w\+\s*/ contained nextgroup=cf3BundleParams + +syn keyword cf3BundleTypes agent common server knowledge monitor edit_line contained nextgroup=cf3BundleName skipwhite +syn keyword cf3BundleTypes edit_xml contained nextgroup=cf3BundleName skipwhite +syn match cf3Bundle /^\s*bundle\s\+/ nextgroup=Cf3BundleTypes skipwhite + +syn keyword cf3BodyTypes action classes contain acl changes contained nextgroup=cf3BundleName skipwhite +syn keyword cf3BodyTypes copy_from delete depth_search contained nextgroup=cf3BundleName skipwhite +syn keyword cf3BodyTypes edit_defaults file_select password contained nextgroup=cf3BundleName skipwhite +syn keyword cf3BodyTypes link_from perms rename tcp_ip contained nextgroup=cf3BundleName skipwhite +syn keyword cf3BodyTypes package_method process_count package_module contained nextgroup=cf3BundleName skipwhite +syn keyword cf3BodyTypes process_select service_method contained nextgroup=cf3BundleName skipwhite +syn keyword cf3BodyTypes mount volume printfile match_value contained nextgroup=cf3BundleName skipwhite +syn keyword cf3BodyTypes association select_region delete_select contained nextgroup=cf3BundleName skipwhite +syn keyword cf3BodyTypes insert_select location edit_field replace_with contained nextgroup=cf3BundleName skipwhite +syn keyword cf3BodyTypes common database_server environment_resources contained nextgroup=cf3BundleName skipwhite +syn match cf3Body /^\s*body\s\+/ nextgroup=Cf3BodyTypes skipwhite + +syn match cf3BodyControl /^\s*body\s\+\(common\|agent\|server\)\s\+control/ +syn match cf3BodyControl /^\s*body\s\+\(monitor\|runagent\)\s\+control/ +syn match cf3BodyControl /^\s*body\s\+\(executor\|knowledge\|hub\)\s\+control/ +syn match cf3BodyControl /^\s*body\s\+\(reporter\|file\)\s\+control/ + +syn match cf3Action /\<\(vars\|classes\|reports\|meta\|users\):/ +syn match cf3Action /\<\(commands\|databases\|files\|interfaces\|methods\|packages\|storage\):/ +syn match cf3Action /\<\(access\|measurements\|roles\|topics\|occurrences\|defaults\):/ +syn match cf3Action /\<\(control\|guest_environments\|outputs\|processes\|services\|things\):/ +syn match cf3Action /\<\(delete_lines\|field_edits\|insert_lines\|replace_patterns\):/ + +syn match cf3Class /[^ "\t:#]\+::/ +syn region cf3ClassBlock start=/\[%CFEngine/ end=/%\]/ contains=Cf3Class + +syn keyword TODO todo TODO FIXME TBD NOTE contained +syn match cf3Comment /#.*/ contains=TODO + +syn match cf3Identifier /=>/ + +" Escape sequences in regexes +syn match cf3Esc /\\\\[sSdD+][\+\*]*/ contained +" Array indexes contained in []. Does not seems to be working. +syn region cf3Array start=/\(\\\)\@]/ contains=cf3BuiltIns,cf3Stdlib +syn match cf3Function /\<\w\+[,;()]/ contains=cf3BuiltIns,cf3Stdlib,cf3Evolve_freelib + +syn keyword cf3ControlAttr bundlesequence cache_system_functions goal_categories contained +syn keyword cf3ControlAttr ignore_missing_bundles ignore_missing_inputs inputs contained +syn keyword cf3ControlAttr version lastseenexpireafter output_prefix domain contained +syn keyword cf3ControlAttr require_comments host_licenses_paid site_classes contained +syn keyword cf3ControlAttr syslog_host syslog_port fips_mode protocol_version contained +syn keyword cf3ControlAttr package_module contained +syn keyword cf3MethodAttr usebundle useresult inherit contained +syn keyword cf3CommonAttr action classes if unless ifvarclass handle depends_on comment policy with meta contained +syn keyword cf3ClassesAttr and dist expression not or persistence scope select_class xor contained +syn keyword cf3CommandsAttr args contain module contained +syn keyword cf3ProcessesAttr process_count process_select contained +syn keyword cf3ProcessesAttr process_stop restart_class signals contained +syn keyword cf3PackagesAttr package_architectures package_method package_policy contained +syn keyword cf3PackagesAttr package_select package_version package_module contained +syn keyword cf3GuestEnvAttr environment_host environment_interface contained +syn keyword cf3GuestEnvAttr environment_resources environment_state contained +syn keyword cf3GuestEnvAttr environment_type contained +syn keyword cf3TopicsAttr association synonyms generalizations contained +syn keyword cf3ServicesAttr service_policy service_dependencies service_method contained +syn keyword cf3DatabasesAttr database_server database_type contained +syn keyword cf3DatabasesAttr database_operation database_columns contained +syn keyword cf3DatabasesAttr database_rows registry_exclude contained +syn keyword cf3DefaultsAttr if_match_regex contained +syn keyword cf3StorageAttr mount volume contained +syn keyword cf3FilesAttr acl changes copy_from create delete depth_search contained +syn keyword cf3FilesAttr edit_defaults edit_line edit_template edit_xml file_select contained +syn keyword cf3FilesAttr link_from move_obstructions pathtype perms contained +syn keyword cf3FilesAttr rename repository template_method template_data touch transformer contained +syn keyword cf3AccessAttr admit_ips admit_hostnames admit_keys admit deny deny_ips deny_hostnames deny_keys maproot contained +syn keyword cf3AccessAttr ifencrypted resource_type contained +syn keyword cf3MeasurementsAttr stream_type data_type history_type contained +syn keyword cf3MeasurementsAttr units match_value contained +syn keyword cf3ReportsAttr friend_pattern intermittency lastseen contained +syn keyword cf3ReportsAttr printfile report_to_file showstate contained +syn keyword cf3ReportsAttr bundle_return_value_index contained + +" Bodies +syn keyword cf3EditLineAttr replace_with edit_field whitespace_policy location contained +syn keyword cf3EditLineAttr insert_select insert_type expand_scalars not_matching contained +syn keyword cf3EditLineAttr delete_select select_region contained +syn keyword cf3EditFieldAttr allow_blank_fields extend_fields field_operation contained +syn keyword cf3EditFieldAttr field_separator field_value select_field contained +syn keyword cf3EditFieldAttr start_fields_from_zero value_separator contained +syn keyword cf3ReplaceWithAttr occurrences replace_value contained +syn keyword cf3SelectRegionAttr include_start_delimiter include_end_delimiter contained +syn keyword cf3SelectRegionAttr select_start select_end contained +syn keyword cf3ProcCountAttr in_range_define match_range out_of_range_define contained +syn keyword cf3ProcSelectAttr command pid ppid pgid priority process_owner contained +syn keyword cf3ProcSelectAttr process_result rsize status stime_range ttime_range contained +syn keyword cf3ProcSelectAttr tty threads vsize contained +syn keyword cf3EditDefAttr edit_backup empty_file_before_editing max_file_size recognize_join contained +syn keyword cf3LocationAttr before_after first_last select_line_matching contained +syn keyword cf3BodyFileSelectAttr leaf_name path_name search_mode search_size search_owners contained +syn keyword cf3BodyFileSelectAttr search_groups search_bsdflags ctime mtime atime contained +syn keyword cf3BodyFileSelectAttr exec_regex exec_program file_types issymlinkto file_result contained +syn keyword cf3BodyClassesAttr promise_repaired repair_failed repair_denied contained +syn keyword cf3BodyClassesAttr repair_timeout promise_kept cancel_kept cancel_repaired contained +syn keyword cf3BodyClassesAttr cancel_notkept kept_returncodes repaired_returncodes contained +syn keyword cf3BodyClassesAttr failed_returncodes persist_time scope timer_policy contained +syn keyword cf3BodyLinkFromAttr copy_patterns link_children link_type source contained +syn keyword cf3BodyLinkFromAttr when_linking_children when_no_source contained +syn keyword cf3BodyPermsAttr bsdflags groups mode owners rxdirs contained +syn keyword cf3BodyACLAttr aces acl_directory_inherit acl_method acl_type specify_inherit_aces contained +syn keyword cf3BodyDepthSearchAttr depth exclude_dirs include_basedir include_dirs contained +syn keyword cf3BodyDepthSearchAttr rmdeadlinks traverse_links xdev contained +syn keyword cf3BodyDeleteAttr dirlinks rmdirs contained +syn keyword cf3BodyRenameAttr disable disable_mode disable_suffix newname rotate contained +syn keyword cf3BodyChangesAttr hash report_changes update_hashes report_diffs contained +syn keyword cf3BodyPackageModuleAttr default_options query_installed_ifelapsed contained +syn keyword cf3BodyPackageModuleAttr query_updates_ifelapsed contained +syn keyword cf3BodyPackageMethodAttr package_add_command package_arch_regex contained +syn keyword cf3BodyPackageMethodAttr package_changes package_delete_command contained +syn keyword cf3BodyPackageMethodAttr package_delete_convention package_file_repositories contained +syn keyword cf3BodyPackageMethodAttr package_installed_regex package_list_arch_regex contained +syn keyword cf3BodyPackageMethodAttr package_list_command package_list_name_regex contained +syn keyword cf3BodyPackageMethodAttr package_list_update_command package_list_update_ifelapsed contained +syn keyword cf3BodyPackageMethodAttr package_list_version_regex package_name_convention contained +syn keyword cf3BodyPackageMethodAttr package_name_regex package_noverify_regex contained +syn keyword cf3BodyPackageMethodAttr package_noverify_returncode package_patch_arch_regex contained +syn keyword cf3BodyPackageMethodAttr package_patch_command package_patch_installed_regex contained +syn keyword cf3BodyPackageMethodAttr package_patch_list_command package_patch_name_regex contained +syn keyword cf3BodyPackageMethodAttr package_patch_version_regex package_update_command contained +syn keyword cf3BodyPackageMethodAttr package_verify_command package_version_regex contained +syn keyword cf3BodyPackageMethodAttr package_version_less_command package_version_equal_command contained +syn keyword cf3BodyPackageMethodAttr package_multiline_start contained +syn keyword cf3BodyActionAttr action_policy ifelapsed expireafter log_string contained +syn keyword cf3BodyActionAttr log_level log_kept log_priority log_repaired contained +syn keyword cf3BodyActionAttr log_failed value_kept value_repaired value_notkept contained +syn keyword cf3BodyActionAttr audit background report_level contained +syn keyword cf3BodyActionAttr measurement_class contained +syn keyword cf3BodyContainAttr useshell umask exec_owner exec_group exec_timeout contained +syn keyword cf3BodyContainAttr chdir chroot preview no_output contained +syn keyword cf3BodyCopyFromAttr source servers collapse_destination_dir contained +syn keyword cf3BodyCopyFromAttr compare copy_backup encrypt check_root contained +syn keyword cf3BodyCopyFromAttr copylink_patterns copy_size findertype contained +syn keyword cf3BodyCopyFromAttr linkcopy_patterns link_type force_update contained +syn keyword cf3BodyCopyFromAttr force_ipv4 portnumber preserve protocol_version purge contained +syn keyword cf3BodyCopyFromAttr stealth timeout trustkey type_check verify contained +syn keyword cf3BodyVolumeAttr check_foreign freespace sensible_size contained +syn keyword cf3BodyVolumeAttr sensible_count scan_arrivals contained +syn keyword cf3BodyMountAttr edit_fstab mount_type mount_source contained +syn keyword cf3BodyMountAttr mount_server mount_options unmount contained +syn keyword cf3BodyServiceMethodAttr service_type service_args contained +syn keyword cf3BodyServiceMethodAttr service_autostart_policy service_dependence_chain contained +syn keyword cf3BodyDatabaseServerAttr db_server_owner db_server_password contained +syn keyword cf3BodyDatabaseServerAttr db_server_host db_server_type contained +syn keyword cf3BodyDatabaseServerAttr db_server_connection_db contained +syn keyword cf3BodyEnvResourcesAttr env_cpus env_memory env_disk contained +syn keyword cf3BodyEnvResourcesAttr env_baseline env_spec_file env_spec contained +syn keyword cf3BodyMatchValueAttr select_line_matching select_line_number contained +syn keyword cf3BodyMatchValueAttr extraction_regex track_growing_file contained +syn keyword cf3BodyServiceMethodAttr service_type service_args service_bundle contained +syn keyword cf3BodyServiceMethodAttr service_autostart_policy service_dependence_chain contained +syn keyword cf3BodyEnvInterfaceAttr env_addresses env_name env_network contained +syn keyword cf3BodyServerControlAttr allowallconnects allowconnects allowlegacyconnects contained +syn keyword cf3BodyServerControlAttr allowusers auditing bindtointerface contained +syn keyword cf3BodyServerControlAttr cfruncommand denybadclocks denyconnects contained +syn keyword cf3BodyServerControlAttr dynamicaddresses hostnamekeys keycacheTTL contained +syn keyword cf3BodyServerControlAttr logallconnections logencryptedtransfers contained +syn keyword cf3BodyServerControlAttr maxconnections port serverfacility contained +syn keyword cf3BodyServerControlAttr skipverify trustkeysfrom contained +syn keyword cf3BodyAgentControlAttr abortclasses abortbundleclasses addclasses contained +syn keyword cf3BodyAgentControlAttr agentaccess agentfacility alwaysvalidate contained +syn keyword cf3BodyAgentControlAttr auditing binarypaddingchar bindtointerface contained +syn keyword cf3BodyAgentControlAttr hashupdates childlibpath checksum_alert_time contained +syn keyword cf3BodyAgentControlAttr defaultcopytype dryrun editbinaryfilesize contained +syn keyword cf3BodyAgentControlAttr editfilesize environment exclamation expireafter contained +syn keyword cf3BodyAgentControlAttr files_single_copy files_auto_define hostnamekeys contained +syn keyword cf3BodyAgentControlAttr ifelapsed inform intermittency max_children contained +syn keyword cf3BodyAgentControlAttr maxconnections mountfilesystems nonalphanumfiles contained +syn keyword cf3BodyAgentControlAttr repchar refresh_processes default_repository contained +syn keyword cf3BodyAgentControlAttr secureinput sensiblecount sensiblesize contained +syn keyword cf3BodyAgentControlAttr skipidentify suspiciousnames syslog verbose contained +syn keyword cf3BodyAgentControlAttr track_value timezone default_timeout contained +syn keyword cf3BodyExecutorControlAttr splaytime mailfrom mailsubject mailto smtpserver contained +syn keyword cf3BodyExecutorControlAttr mailmaxlines schedule executorfacility contained +syn keyword cf3BodyExecutorControlAttr exec_command contained +syn keyword cf3BodyEditDefsAttr edit_backup empty_file_before_editing contained +syn keyword cf3BodyEditDefsAttr max_file_size recognize_join inherit contained +syn keyword cf3BodyDeleteSelectAttr delete_if_startwith_from_list contained +syn keyword cf3BodyDeleteSelectAttr delete_if_not_startwith_from_list contained +syn keyword cf3BodyDeleteSelectAttr delete_if_match_from_list contained +syn keyword cf3BodyDeleteSelectAttr delete_if_not_match_from_list contained +syn keyword cf3BodyDeleteSelectAttr delete_if_contains_from_list contained +syn keyword cf3BodyDeleteSelectAttr delete_if_not_contains_from_list contained +syn keyword cf3BodyInsertSelectAttr insert_if_startwith_from_list contained +syn keyword cf3BodyInsertSelectAttr insert_if_not_startwith_from_list contained +syn keyword cf3BodyInsertSelectAttr insert_if_match_from_list contained +syn keyword cf3BodyInsertSelectAttr insert_if_not_match_from_list contained +syn keyword cf3BodyInsertSelectAttr insert_if_contains_from_list contained +syn keyword cf3BodyInsertSelectAttr insert_if_not_contains_from_list contained +syn keyword cf3BodyMonitorControlAttr forgetrate monitorfacility histograms contained +syn keyword cf3BodyMonitorControlAttr tcpdump tcpdumpcommand contained +syn keyword cf3BodyPrintfileAttr file_to_print number_of_lines contained + +syn cluster cf3AttrCluster contains=cf3CommonAttr,cf3ClassesAttr,cf3Identifier, +syn cluster cf3AttrCluster add=cf3ProcessesAttr,cf3FilesAttr,cf3ReportsAttr +syn cluster cf3AttrCluster add=cf3PackagesAttr,cf3GuestEnvAttr,cf3TopicsAttr +syn cluster cf3AttrCluster add=cf3StorageAttr,cf3AccessAttr,cf3MeasurementsAttr +syn cluster cf3AttrCluster add=cf3EditLineAttr,cf3EditFieldAttr,cf3ReplaceWithAttr +syn cluster cf3AttrCluster add=cf3SelectRegionAttr,cf3ProcCountAttr,cf3ProcSelectAttr +syn cluster cf3AttrCluster add=cf3EditDefAttr,cf3LocationAttr,cf3CommandsAttr,cf3BodyFileSelectAttr +syn cluster cf3AttrCluster add=cf3ControlAttr,cf3MethodAttr,cf3BodyClassesAttr +syn cluster cf3AttrCluster add=cf3ServicesAttr,cf3DatabasesAttr,cf3DefaultsAttr + +syn cluster cf3AttrCluster add=cf3BodyLinkFromAttr,cf3BodyPermsAttr,cf3BodyACLAttr +syn cluster cf3AttrCluster add=cf3BodyDepthSearchAttr,cf3BodyDeleteAttr,cf3BodyRenameAttr +syn cluster cf3AttrCluster add=cf3BodyChangesAttr,cf3BodyPackageMethodAttr,cf3BodyActionAttr +syn cluster cf3AttrCluster add=cf3BodyPackageModuleAttr +syn cluster cf3AttrCluster add=cf3BodyContainAttr,cf3BodyCopyFromAttr,cf3BodyVolumeAttr +syn cluster cf3AttrCluster add=cf3BodyMountAttr,cf3BodyServiceMethodAttr,cf3BodyDatabaseServerAttr +syn cluster cf3AttrCluster add=cf3BodyEnvResourcesAttr,cf3BodyMatchValueAttr,cf3BodyServiceMethodAttr +syn cluster cf3AttrCluster add=cf3BodyEnvInterfaceAttr,cf3BodyServerControlAttr,cf3BodyEditDefsAttr +syn cluster cf3AttrCluster add=cf3BodyAgentControlAttr,cf3BodyExecutorControlAttr +syn cluster cf3AttrCluster add=cf3BodyDeleteSelectAttr,cf3BodyInsertSelectAttr +syn cluster cf3AttrCluster add=cf3BodyMonitorControlAttr,cf3BodyPrintfileAttr +syn match cf3Attributes /\w\+\s*=>/ contains=@cf3AttrCluster + +" }}} + +if version >= 508 || !exists("did_cfg_syn_inits") " {{{ + if version < 508 + let did_cfg_syn_inits = 1 + command -nargs=+ HiLink hi link + else + command -nargs=+ HiLink hi def link + endif + + hi cf3Context ctermfg=DarkGreen + hi cf3Arrows ctermfg=DarkCyan + hi cf3Type ctermfg=Magenta + hi Identifier ctermfg=Blue + hi Function ctermfg=DarkGreen + hi Library ctermfg=DarkGrey + hi cf3ClassBlock ctermfg=Yellow + + HiLink cf3Bundle Statement + HiLink cf3BundleTypes Statement + HiLink cf3BundleName Function + HiLink cf3BundleParams Identifier + + HiLink cf3Body Statement + HiLink cf3BodyTypes Statement + HiLink cf3Comment Comment + + HiLink cf3BodyControl Statement + HiLink cf3BodyControlTypes Statement + HiLink cf3BodyControlName Statement + + HiLink cf3Action Underlined + HiLink cf3Class cf3Context + + HiLink cf3String String + HiLink cf3BuiltIns Function + HiLink cf3Evolve_freelib Function + HiLink cf3Stdlib Library + + HiLink cf3Identifier cf3Arrows + HiLink cf3Esc Special + HiLink cf3Array Special + HiLink cf3Var Identifier + + HiLink cf3Type cf3Type + HiLink cf3CommonAttr Statement + HiLink cf3ClassesAttr Statement + HiLink cf3CommandsAttr Statement + HiLink cf3ProcessesAttr Statement + HiLink cf3FilesAttr Statement + HiLink cf3MethodAttr cf3Type + HiLink cf3PackagesAttr Statement + HiLink cf3ControlAttr Statement + HiLink cf3GuestEnvAttr Statement + HiLink cf3TopicsAttr Statement + HiLink cf3ServicesAttr Statement + HiLink cf3DatabasesAttr Statement + HiLink cf3DefaultsAttr Statement + HiLink cf3StorageAttr Statement + HiLink cf3AccessAttr Statement + HiLink cf3MeasurementsAttr Statement + HiLink cf3ReportsAttr Statement + + HiLink cf3EditLineAttr Statement + HiLink cf3EditFieldAttr Statement + HiLink cf3ReplaceWithAttr Statement + HiLink cf3SelectRegionAttr Statement + HiLink cf3ProcCountAttr Statement + HiLink cf3ProcSelectAttr Statement + HiLink cf3EditDefAttr Statement + HiLink cf3LocationAttr Statement + HiLink cf3BodyFileSelectAttr Statement + HiLink cf3BodyClassesAttr Statement + HiLink cf3BodyLinkFromAttr Statement + HiLink cf3BodyPermsAttr Statement + HiLink cf3BodyACLAttr Statement + HiLink cf3BodyDepthSearchAttr Statement + HiLink cf3BodyDeleteAttr Statement + HiLink cf3BodyRenameAttr Statement + HiLink cf3BodyChangesAttr Statement + HiLink cf3BodyPackageMethodAttr Statement + HiLink cf3BodyPackageModuleAttr Statement + HiLink cf3BodyActionAttr Statement + HiLink cf3BodyContainAttr Statement + HiLink cf3BodyCopyFromAttr Statement + HiLink cf3BodyVolumeAttr Statement + HiLink cf3BodyMountAttr Statement + HiLink cf3BodyServiceMethodAttr Statement + HiLink cf3BodyDatabaseServerAttr Statement + HiLink cf3BodyEnvResourcesAttr Statement + HiLink cf3BodyMatchValueAttr Statement + HiLink cf3BodyServiceMethodAttr Statement + HiLink cf3BodyEnvInterfaceAttr Statement + HiLink cf3BodyServerControlAttr Statement + HiLink cf3BodyAgentControlAttr Statement + HiLink cf3BodyExecutorControlAttr Statement + HiLink cf3BodyEditDefsAttr Statement + HiLink cf3BodyInsertSelectAttr Statement + HiLink cf3BodyDeleteSelectAttr Statement + HiLink cf3BodyMonitorControlAttr Statement + HiLink cf3BodyPrintfileAttr Statement + + delcommand HiLink +endif +let b:current_syntax = "cf3" + +" }}} + +" Folding {{{ + +function! CF3Folds() + let line = getline(v:lnum) + + " Don't include blank lines in previous fold {{{ + if line =~? '\v^\s*$' + return '-1' + endif + " }}} + + " Don't include comments in the previous fold {{{ + if line =~? '\v^\s*#.*$' + return '-1' + endif + " }}} + + " Fold bodies/bundles {{{ + let body_types = [ + \"^bundle", + \"^body" + \ ] + for type in body_types + if line =~ type + return ">1" + endif + endfor + " }}} + + " Fold promises {{{ + let promise_types = [ + \"meta:", + \"vars:", + \"defaults:", + \"classes:", + \"users:", + \"files:", + \"packages:", + \"guest_environments:", + \"methods:", + \"processes:", + \"services:", + \"commands:", + \"storage:", + \"databases:", + \"access:", + \"roles:", + \"measurements:", + \"reports:", + \ ] + for promise_type in promise_types + if line =~ promise_type + return ">2" + endif + endfor + " }}} + + " TODO: + " - fold lists + " - include trailing }'s in fdl 1 + + " If nothing matches, keep the previous foldlevel + return '=' + +endfunction + +setlocal foldmethod=expr +setlocal foldexpr=CF3Folds() + +" }}} + +" CREDITS +" Neil Watson +" Aleksey Tsalolikhin +" John Coleman of Yale U +" Matt Lesko +" Ivan Pesin +" Zach Himsel +" +" vim_cf3 files (https://github.com/neilhwatson/vim_cf3) +" Copyright (C) 2011 Neil H. Watson +" +" This program is free software: you can redistribute it and/or modify it under +" the terms of the GNU General Public License as published by the Free Software +" Foundation, either version 3 of the License, or (at your option) any later +" version. +" +" This program is distributed in the hope that it will be useful, but WITHOUT ANY +" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +" PARTICULAR PURPOSE. See the GNU General Public License for more details. +" +" You should have received a copy of the GNU General Public License along with +" this program. If not, see .