From 53d1e8b9010ac956763a93b24f8c576d6b5b9644 Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 4 Jul 2021 03:06:56 -0400 Subject: [PATCH 01/54] no more ft for rust tools for now --- lua/plugins.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins.lua b/lua/plugins.lua index bdda5847..4f4d8a85 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -419,7 +419,7 @@ return require("packer").startup(function(use) -- Rust tools -- TODO: use lazy loading maybe? - use {"simrat39/rust-tools.nvim", ft = "rust"} + use {"simrat39/rust-tools.nvim", disable = not O.lang.rust.rust_tools.active} -- Elixir use {"elixir-editors/vim-elixir", ft = {"elixir", "eelixir", "euphoria3"}} From 1ed739253485621d165341bcb69f857aa9d13a01 Mon Sep 17 00:00:00 2001 From: rob Date: Sun, 4 Jul 2021 15:07:11 +0100 Subject: [PATCH 02/54] Prevent startup errors on first run (#645) --- lua/lsp/emmet-ls.lua | 4 ++++ lua/lv-autopairs/init.lua | 4 ++++ lua/lv-compe/init.lua | 4 ++++ lua/lv-galaxyline/init.lua | 4 ++++ lua/lv-nvimtree/init.lua | 4 ++++ lua/lv-treesitter/init.lua | 4 ++++ lua/lv-which-key/init.lua | 4 ++++ 7 files changed, 28 insertions(+) diff --git a/lua/lsp/emmet-ls.lua b/lua/lsp/emmet-ls.lua index 46d6c90d..badacce3 100644 --- a/lua/lsp/emmet-ls.lua +++ b/lua/lsp/emmet-ls.lua @@ -1,3 +1,7 @@ +if not package.loaded['lspconfig'] then + return +end + local nvim_lsp = require'lspconfig' local configs = require'lspconfig/configs' local capabilities = vim.lsp.protocol.make_client_capabilities() diff --git a/lua/lv-autopairs/init.lua b/lua/lv-autopairs/init.lua index fb1300a2..54e14564 100644 --- a/lua/lv-autopairs/init.lua +++ b/lua/lv-autopairs/init.lua @@ -1,3 +1,7 @@ +if not package.loaded['nvim-autopairs'] then + return +end + local npairs = require('nvim-autopairs') local Rule = require('nvim-autopairs.rule') diff --git a/lua/lv-compe/init.lua b/lua/lv-compe/init.lua index d0f7efb1..903d2403 100644 --- a/lua/lv-compe/init.lua +++ b/lua/lv-compe/init.lua @@ -1,3 +1,7 @@ +if not package.loaded['compe'] then + return +end + local M = {} M.config = function() diff --git a/lua/lv-galaxyline/init.lua b/lua/lv-galaxyline/init.lua index 51b9072c..ee607aa6 100644 --- a/lua/lv-galaxyline/init.lua +++ b/lua/lv-galaxyline/init.lua @@ -1,3 +1,7 @@ +if not package.loaded['galaxyline'] then + return +end + local gl = require('galaxyline') -- get my theme in galaxyline repo -- local colors = require('galaxyline.theme').default diff --git a/lua/lv-nvimtree/init.lua b/lua/lv-nvimtree/init.lua index eea9e689..abb25374 100644 --- a/lua/lv-nvimtree/init.lua +++ b/lua/lv-nvimtree/init.lua @@ -1,3 +1,7 @@ +if not package.loaded['nvim-tree.view'] then + return +end + local M = {} M.config = function() diff --git a/lua/lv-treesitter/init.lua b/lua/lv-treesitter/init.lua index 99ab185d..f5917281 100644 --- a/lua/lv-treesitter/init.lua +++ b/lua/lv-treesitter/init.lua @@ -1,3 +1,7 @@ +if not package.loaded['nvim-treesitter'] then + return +end + require'nvim-treesitter.configs'.setup { ensure_installed = O.treesitter.ensure_installed, -- one of "all", "maintained" (parsers with maintainers), or a list of languages ignore_install = O.treesitter.ignore_install, diff --git a/lua/lv-which-key/init.lua b/lua/lv-which-key/init.lua index 88dd2ef0..2b4ac95d 100644 --- a/lua/lv-which-key/init.lua +++ b/lua/lv-which-key/init.lua @@ -1,3 +1,7 @@ +if not package.loaded['which-key'] then + return +end + require("which-key").setup { plugins = { marks = true, -- shows a list of your marks on ' and ` From 0d14b91e1e44bac124e796a82776085126699536 Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 4 Jul 2021 10:22:16 -0400 Subject: [PATCH 03/54] seems to disable everything we may have to use a more complicated method --- lua/lsp/emmet-ls.lua | 6 +++--- lua/lv-autopairs/init.lua | 6 +++--- lua/lv-compe/init.lua | 6 +++--- lua/lv-nvimtree/init.lua | 6 +++--- lua/lv-treesitter/init.lua | 6 +++--- lua/lv-which-key/init.lua | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lua/lsp/emmet-ls.lua b/lua/lsp/emmet-ls.lua index badacce3..277adc7f 100644 --- a/lua/lsp/emmet-ls.lua +++ b/lua/lsp/emmet-ls.lua @@ -1,6 +1,6 @@ -if not package.loaded['lspconfig'] then - return -end +-- if not package.loaded['lspconfig'] then +-- return +-- end local nvim_lsp = require'lspconfig' local configs = require'lspconfig/configs' diff --git a/lua/lv-autopairs/init.lua b/lua/lv-autopairs/init.lua index 54e14564..a76f4537 100644 --- a/lua/lv-autopairs/init.lua +++ b/lua/lv-autopairs/init.lua @@ -1,6 +1,6 @@ -if not package.loaded['nvim-autopairs'] then - return -end +-- if not package.loaded['nvim-autopairs'] then +-- return +-- end local npairs = require('nvim-autopairs') local Rule = require('nvim-autopairs.rule') diff --git a/lua/lv-compe/init.lua b/lua/lv-compe/init.lua index 903d2403..8a32f7c1 100644 --- a/lua/lv-compe/init.lua +++ b/lua/lv-compe/init.lua @@ -1,6 +1,6 @@ -if not package.loaded['compe'] then - return -end +--if not package.loaded['compe'] then +-- return +-- end local M = {} diff --git a/lua/lv-nvimtree/init.lua b/lua/lv-nvimtree/init.lua index abb25374..7b560038 100644 --- a/lua/lv-nvimtree/init.lua +++ b/lua/lv-nvimtree/init.lua @@ -1,6 +1,6 @@ -if not package.loaded['nvim-tree.view'] then - return -end +--if not package.loaded['nvim-tree.view'] then +-- return +--end local M = {} diff --git a/lua/lv-treesitter/init.lua b/lua/lv-treesitter/init.lua index f5917281..ee88120b 100644 --- a/lua/lv-treesitter/init.lua +++ b/lua/lv-treesitter/init.lua @@ -1,6 +1,6 @@ -if not package.loaded['nvim-treesitter'] then - return -end +-- if not package.loaded['nvim-treesitter'] then +-- return +-- end require'nvim-treesitter.configs'.setup { ensure_installed = O.treesitter.ensure_installed, -- one of "all", "maintained" (parsers with maintainers), or a list of languages diff --git a/lua/lv-which-key/init.lua b/lua/lv-which-key/init.lua index 2b4ac95d..c46ce12a 100644 --- a/lua/lv-which-key/init.lua +++ b/lua/lv-which-key/init.lua @@ -1,6 +1,6 @@ -if not package.loaded['which-key'] then - return -end +-- if not package.loaded['which-key'] then +-- return +-- end require("which-key").setup { plugins = { From bf41c5630aa471b600b0d9082b085d9915a25ea6 Mon Sep 17 00:00:00 2001 From: maxxnino <34153891+maxxnino@users.noreply.github.com> Date: Sun, 4 Jul 2021 23:26:52 +0900 Subject: [PATCH 04/54] Fix close buffer command according to new bufferline plugin (#650) * auto detect file for zig, and language server for zig * fix close buffer command according to new bufferline plugin Co-authored-by: maxxnino --- lua/lv-which-key/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lv-which-key/init.lua b/lua/lv-which-key/init.lua index c46ce12a..69572dce 100644 --- a/lua/lv-which-key/init.lua +++ b/lua/lv-which-key/init.lua @@ -92,7 +92,7 @@ vim.api.nvim_set_keymap("v", "/", ":CommentToggle", {noremap = true, silent = true}) -- close buffer -vim.api.nvim_set_keymap("n", "c", ":BufferClose", +vim.api.nvim_set_keymap("n", "c", ":bdelete", {noremap = true, silent = true}) -- TODO create entire treesitter section From c8c29aa03cf784fdb8e3c0da94c87f8c073b7ddd Mon Sep 17 00:00:00 2001 From: rebuilt Date: Sun, 4 Jul 2021 16:27:25 +0200 Subject: [PATCH 05/54] lazy load lspinstall (#654) --- lua/plugins.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/plugins.lua b/lua/plugins.lua index 4f4d8a85..c3e25606 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -34,7 +34,9 @@ return require("packer").startup(function(use) -- TODO refactor all of this (for now it works, but yes I know it could be wrapped in a simpler function) use {"neovim/nvim-lspconfig"} use {"glepnir/lspsaga.nvim"} - use {"kabouzeid/nvim-lspinstall"} + use {"kabouzeid/nvim-lspinstall", + cmd = "LspInstall", + } -- Telescope use {"nvim-lua/popup.nvim"} use {"nvim-lua/plenary.nvim"} From a291b0597a7c9f76cfdb0dc4be9833ed6c8778e8 Mon Sep 17 00:00:00 2001 From: Brandon Conway Date: Sun, 4 Jul 2021 07:34:53 -0700 Subject: [PATCH 06/54] Solargraph uses stdio instead of --stdio (#642) You can see this in the [default config](https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/solargraph.lua). --- ftplugin/ruby.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ftplugin/ruby.lua b/ftplugin/ruby.lua index f46a71f8..4f2c20f8 100644 --- a/ftplugin/ruby.lua +++ b/ftplugin/ruby.lua @@ -1,6 +1,6 @@ -- If you are using rvm, make sure to change below configuration require'lspconfig'.solargraph.setup { - cmd = {DATA_PATH .. "/lspinstall/ruby/solargraph/solargraph", "--stdio"}, + cmd = {DATA_PATH .. "/lspinstall/ruby/solargraph/solargraph", "stdio"}, on_attach = require'lsp'.common_on_attach, handlers = { ["textDocument/publishDiagnostics"] = vim.lsp.with( From 1988b96afc6a03cedb5fa796792422b61ce4cca9 Mon Sep 17 00:00:00 2001 From: James Walmsley Date: Sun, 4 Jul 2021 15:41:57 +0100 Subject: [PATCH 07/54] [KEYBINDINGS] Add Alt-jk etc for move line up/down. (#659) --- lua/keymappings.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lua/keymappings.lua b/lua/keymappings.lua index 0e8284d3..b611b16e 100644 --- a/lua/keymappings.lua +++ b/lua/keymappings.lua @@ -42,6 +42,14 @@ vim.api.nvim_set_keymap('n', '', ':bprevious', {noremap = true, silen vim.api.nvim_set_keymap('x', 'K', ':move \'<-2gv-gv', {noremap = true, silent = true}) vim.api.nvim_set_keymap('x', 'J', ':move \'>+1gv-gv', {noremap = true, silent = true}) +-- Move current line / block with Alt-j/k ala vscode. +vim.api.nvim_set_keymap('n', '', ':m .+1==', {noremap = true, silent = true}) +vim.api.nvim_set_keymap('n', '', ':m .-2==', {noremap = true, silent = true}) +vim.api.nvim_set_keymap('i', '', ':m .+1==gi', {noremap = true, silent = true}) +vim.api.nvim_set_keymap('i', '', ':m .-2==gi', {noremap = true, silent = true}) +vim.api.nvim_set_keymap('x', '', ':m \'>+1gv-gv', {noremap = true, silent = true}) +vim.api.nvim_set_keymap('x', '', ':m \'<-2gv-gv', {noremap = true, silent = true}) + -- Better nav for omnicomplete vim.cmd('inoremap (\"\\\")') vim.cmd('inoremap (\"\\\")') From 881d57c6ed332d837e990c59249c4e7fe69cfeed Mon Sep 17 00:00:00 2001 From: Luc Sinet Date: Sun, 4 Jul 2021 16:43:45 +0200 Subject: [PATCH 08/54] Configure the template chooser to include community links. (#644) --- .github/ISSUE_TEMPLATE/config.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..12d6ceab --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,9 @@ +blank_issues_enabled: true + +contact_links: + - name: Matrix community + url: https://matrix.to/#/+atmachine:matrix + about: Please ask and answer questions on Matrix. + - name: Discord community + url: https://discord.gg/Xb9B4Ny + about: Please ask and answer questions on Discord. From 816c6cfa7dab79d8f30760970a6fd43545e16f0b Mon Sep 17 00:00:00 2001 From: Abouzar Parvan Date: Sun, 4 Jul 2021 19:15:38 +0430 Subject: [PATCH 09/54] Adding tabnine for compe (#640) --- lua/default-config.lua | 3 ++- lua/lv-compe/init.lua | 8 +++++++- lua/plugins.lua | 8 ++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/lua/default-config.lua b/lua/default-config.lua index 28a95bef..9797ce90 100644 --- a/lua/default-config.lua +++ b/lua/default-config.lua @@ -68,7 +68,8 @@ O = { diffview = {active = false}, bracey = {active = false}, telescope_project = {active = false}, - dap_install = {active = false} + dap_install = {active = false}, + tabnine = {active = false} }, diff --git a/lua/lv-compe/init.lua b/lua/lv-compe/init.lua index 8a32f7c1..aa21f658 100644 --- a/lua/lv-compe/init.lua +++ b/lua/lv-compe/init.lua @@ -5,7 +5,7 @@ local M = {} M.config = function() -require'compe'.setup { +opt = { enabled = O.auto_complete, autocomplete = true, debug = false, @@ -38,6 +38,12 @@ require'compe'.setup { } } +if O.plugin.tabnine.active then + opt.source.tabnine = {kind = " ", priority=200, max_reslts=6} +end + +require'compe'.setup(opt) + local t = function(str) return vim.api.nvim_replace_termcodes(str, true, true, true) end diff --git a/lua/plugins.lua b/lua/plugins.lua index c3e25606..bb6854c5 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -425,4 +425,12 @@ return require("packer").startup(function(use) -- Elixir use {"elixir-editors/vim-elixir", ft = {"elixir", "eelixir", "euphoria3"}} + + -- Tabnine + use { + "tzachar/compe-tabnine", + run="./install.sh", + requires = "hrsh7th/nvim-compe", + disable = not O.plugin.tabnine.active + } end) From 8d2ef2dfbb915cf58d5aa30461aa4652bc16a1ce Mon Sep 17 00:00:00 2001 From: Luc Sinet Date: Sun, 4 Jul 2021 16:49:35 +0200 Subject: [PATCH 10/54] Define a form for LSP issues (#626) * Define a form for LSP issues * Add reference to ftplugin/ for LSP issues --- .../ISSUE_TEMPLATE/general-issue-form.yaml | 9 ++- .github/ISSUE_TEMPLATE/lsp-issue-form.yaml | 80 +++++++++++++++++++ 2 files changed, 86 insertions(+), 3 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/lsp-issue-form.yaml diff --git a/.github/ISSUE_TEMPLATE/general-issue-form.yaml b/.github/ISSUE_TEMPLATE/general-issue-form.yaml index 4571fa12..50a8e210 100644 --- a/.github/ISSUE_TEMPLATE/general-issue-form.yaml +++ b/.github/ISSUE_TEMPLATE/general-issue-form.yaml @@ -52,9 +52,12 @@ body: - type: checkboxes id: checks attributes: - label: I have read + label: I have options: - - label: The readme + - label: Read the readme required: true - - label: The wiki + - label: Read the wiki required: true + - label: Searched for similar issues + required: true + diff --git a/.github/ISSUE_TEMPLATE/lsp-issue-form.yaml b/.github/ISSUE_TEMPLATE/lsp-issue-form.yaml new file mode 100644 index 00000000..6597ec2a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/lsp-issue-form.yaml @@ -0,0 +1,80 @@ +name: LSP Issue +description: File a LSP related bug report +title: "[Bug]: " +labels: [bug, lsp] +# assignees: +# - ChristianChiarulli +body: + - type: markdown + attributes: + value: | + Thank you for helping us improve ! + - type: textarea + id: problem-description + attributes: + label: Problem description + description: Also tell us, what did you expect to happen? + placeholder: | + Steps to reproduce the behavior: + 1. Go to '...' + 2. Click on '....' + 3. Scroll down to '....' + 4. See error + validations: + required: true + - type: checkboxes + id: generic-checks + attributes: + label: Check the following + options: + - label: I am in a git managed directory + required: true + - label: I restarted Neovim after running :LspInstall + required: true + - label: I have a valid language configuration (~/.config/nvim/ftplugin/) + required: true + - label: I checked the options (~/.config/nvim/lv-config.lua) + required: true + - label: The programs specified by the config are installed + - type: input + id: lunar-vim-version + attributes: + label: LunarVim version + validations: + required: true + - type: input + id: nvim-version + attributes: + label: Neovim version (>= 0.5) + placeholder: nvim --version + validations: + required: true + - type: textarea + id: logs + attributes: + label: Relevant log output + placeholder: | + :echo &ft + :LspInfo + + :LspStart + :messages + :checkhealth + grep ERROR ~/.cache/nvim/lsp.log + render: shell + - type: textarea + id: screenshots + attributes: + label: Screenshots + description: If applicable, add screenshots to help explain your problem + - type: checkboxes + id: documentation-checks + attributes: + label: I have + options: + - label: Read the readme + required: true + - label: Read the wiki + required: true + - label: Searched for similar issues + required: true From 6a09208590c3fc2d1f5a8f58b916d3d528f92a9e Mon Sep 17 00:00:00 2001 From: PZ31k0nauT <86895284+PZ31k0nauT@users.noreply.github.com> Date: Sun, 4 Jul 2021 17:42:42 +0200 Subject: [PATCH 11/54] Snippets in config dir (#661) * Update init.lua * Update init.lua * Update init.lua * Update default-config.lua --- lua/default-config.lua | 1 + lua/lv-compe/init.lua | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lua/default-config.lua b/lua/default-config.lua index 9797ce90..0023256f 100644 --- a/lua/default-config.lua +++ b/lua/default-config.lua @@ -22,6 +22,7 @@ O = { hl_search = false, transparent_window = false; leader_key = "space"; + vnsip_dir = vim.fn.stdpath('config') .. "/snippets", -- @usage pass a table with your desired languages treesitter = { diff --git a/lua/lv-compe/init.lua b/lua/lv-compe/init.lua index aa21f658..4a8e3230 100644 --- a/lua/lv-compe/init.lua +++ b/lua/lv-compe/init.lua @@ -4,6 +4,8 @@ local M = {} +vim.g.vsnip_snippet_dir = O.vnsip_dir + M.config = function() opt = { enabled = O.auto_complete, From a8b4a96dddab415d20df4822e136c66e96dd629c Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 4 Jul 2021 12:17:45 -0400 Subject: [PATCH 12/54] more lazyload --- lua/plugins.lua | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lua/plugins.lua b/lua/plugins.lua index bb6854c5..f79c082d 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -33,10 +33,8 @@ return require("packer").startup(function(use) -- TODO refactor all of this (for now it works, but yes I know it could be wrapped in a simpler function) use {"neovim/nvim-lspconfig"} - use {"glepnir/lspsaga.nvim"} - use {"kabouzeid/nvim-lspinstall", - cmd = "LspInstall", - } + use {"glepnir/lspsaga.nvim", cmd = "Lspsaga"} + use {"kabouzeid/nvim-lspinstall", cmd = "LspInstall"} -- Telescope use {"nvim-lua/popup.nvim"} use {"nvim-lua/plenary.nvim"} @@ -58,6 +56,7 @@ return require("packer").startup(function(use) -- Autocomplete use { "hrsh7th/nvim-compe", + event = "InsertEnter", config = function() require("lv-compe").config() end @@ -91,6 +90,7 @@ return require("packer").startup(function(use) -- Autopairs use { + -- event = "InsertEnter", "windwp/nvim-autopairs", config = function() require 'lv-autopairs' @@ -224,9 +224,8 @@ return require("packer").startup(function(use) vim.g.indentLine_enabled = 1 vim.g.indent_blankline_char = "▏" - vim.g.indent_blankline_filetype_exclude = { - "help", "terminal", "dashboard" - } + vim.g.indent_blankline_filetype_exclude = + {"help", "terminal", "dashboard"} vim.g.indent_blankline_buftype_exclude = {"terminal"} vim.g.indent_blankline_show_trailing_blankline_indent = false @@ -421,7 +420,10 @@ return require("packer").startup(function(use) -- Rust tools -- TODO: use lazy loading maybe? - use {"simrat39/rust-tools.nvim", disable = not O.lang.rust.rust_tools.active} + use { + "simrat39/rust-tools.nvim", + disable = not O.lang.rust.rust_tools.active + } -- Elixir use {"elixir-editors/vim-elixir", ft = {"elixir", "eelixir", "euphoria3"}} @@ -429,7 +431,7 @@ return require("packer").startup(function(use) -- Tabnine use { "tzachar/compe-tabnine", - run="./install.sh", + run = "./install.sh", requires = "hrsh7th/nvim-compe", disable = not O.plugin.tabnine.active } From c0a48c186b8f989395d8f374865751ec1116efc8 Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Sun, 4 Jul 2021 12:19:29 -0400 Subject: [PATCH 13/54] update docs --- utils/installer/lv-config.example.lua | 29 +++++---------------------- 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/utils/installer/lv-config.example.lua b/utils/installer/lv-config.example.lua index f71ad561..169cfcc8 100644 --- a/utils/installer/lv-config.example.lua +++ b/utils/installer/lv-config.example.lua @@ -20,7 +20,7 @@ O.smart_case = true O.lushmode = false O.transparent_window = false --- After changing plugin config it is recommended to run :PackerCompile +-- After changing plugin config exit and reopen LunarVim, Run :PackerInstall :PackerCompile O.plugin.hop.active = false O.plugin.dial.active = false O.plugin.dashboard.active = true @@ -89,29 +89,10 @@ O.lang.clang.autoformat = false -- Set to true to enable auto-format in C/C++ fi --- create custom autocommand field (This would be easy with lua) +-- TODO Autocommands +-- https://neovim.io/doc/user/autocmd.html --- Turn off relative_numbers --- O.relative_number = false +-- TODO Additional Plugins --- Turn off cursorline --- O.cursorline = false - --- Neovim turns the default cursor to 'Block' --- when switched back into terminal. --- This below line fixes that. Uncomment if needed. - --- vim.cmd('autocmd VimLeave,VimSuspend * set guicursor=a:ver90') -- Beam --- vim.cmd('autocmd VimLeave,VimSuspend * set guicursor=a:hor20') -- Underline - --- NOTE: Above code doesn't take a value from the terminal's cursor and --- replace it. It hardcodes the cursor shape. --- And I think `ver` means vertical and `hor` means horizontal. --- The numbers didn't make a difference in alacritty. Please change --- the number to something that suits your needs if it looks weird. - --- TODO --- custom autocommands --- user defined plugin config --- custom settings +-- TODO User Config for plugins From be87f71c20e9e4074f0ea57ddfb7d4c699c3e8b6 Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Sun, 4 Jul 2021 12:32:11 -0400 Subject: [PATCH 14/54] more lazyload --- lua/lv-autopairs/init.lua | 44 ++++++++++++++++++--------------------- lua/plugins.lua | 3 ++- 2 files changed, 22 insertions(+), 25 deletions(-) diff --git a/lua/lv-autopairs/init.lua b/lua/lv-autopairs/init.lua index a76f4537..057525a3 100644 --- a/lua/lv-autopairs/init.lua +++ b/lua/lv-autopairs/init.lua @@ -1,51 +1,47 @@ -- if not package.loaded['nvim-autopairs'] then -- return -- end - local npairs = require('nvim-autopairs') local Rule = require('nvim-autopairs.rule') -- skip it, if you use another global object -_G.MUtils= {} +_G.MUtils = {} vim.g.completion_confirm_key = "" -MUtils.completion_confirm=function() - if vim.fn.pumvisible() ~= 0 then - if vim.fn.complete_info()["selected"] ~= -1 then - return vim.fn["compe#confirm"](npairs.esc("")) +MUtils.completion_confirm = function() + if vim.fn.pumvisible() ~= 0 then + if vim.fn.complete_info()["selected"] ~= -1 then + return vim.fn["compe#confirm"](npairs.esc("")) + else + return npairs.esc("") + end else - return npairs.esc("") + return npairs.autopairs_cr() end - else - return npairs.autopairs_cr() - end end - -require("nvim-autopairs.completion.compe").setup({ - map_cr = true, -- map on insert mode - map_complete = true -- it will auto insert `(` after select function or method item -}) +if package.loaded['compe'] then + require("nvim-autopairs.completion.compe").setup({ + map_cr = true, -- map on insert mode + map_complete = true -- it will auto insert `(` after select function or method item + }) +end npairs.setup({ check_ts = true, ts_config = { - lua = {'string'},-- it will not add pair on that treesitter node + lua = {'string'}, -- it will not add pair on that treesitter node javascript = {'template_string'}, - java = false,-- don't check treesitter on java + java = false -- don't check treesitter on java } }) -require('nvim-treesitter.configs').setup { - autopairs = {enable = true} -} +require('nvim-treesitter.configs').setup {autopairs = {enable = true}} local ts_conds = require('nvim-autopairs.ts-conds') -- press % => %% is only inside comment or string npairs.add_rules({ - Rule("%", "%", "lua") - :with_pair(ts_conds.is_ts_node({'string','comment'})), - Rule("$", "$", "lua") - :with_pair(ts_conds.is_not_ts_node({'function'})) + Rule("%", "%", "lua"):with_pair(ts_conds.is_ts_node({'string', 'comment'})), + Rule("$", "$", "lua"):with_pair(ts_conds.is_not_ts_node({'function'})) }) diff --git a/lua/plugins.lua b/lua/plugins.lua index f79c082d..8dc28266 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -90,8 +90,9 @@ return require("packer").startup(function(use) -- Autopairs use { - -- event = "InsertEnter", "windwp/nvim-autopairs", + event = "InsertEnter", + after = {"telescope.nvim", "nvim-compe"}, config = function() require 'lv-autopairs' end From 79fa16ff06a74183f07c038a6bb79e40432f1bab Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Sun, 4 Jul 2021 12:40:40 -0400 Subject: [PATCH 15/54] remove package loaded for now --- lua/lv-galaxyline/init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/lv-galaxyline/init.lua b/lua/lv-galaxyline/init.lua index ee607aa6..685d38e7 100644 --- a/lua/lv-galaxyline/init.lua +++ b/lua/lv-galaxyline/init.lua @@ -1,6 +1,6 @@ -if not package.loaded['galaxyline'] then - return -end +-- if not package.loaded['galaxyline'] then +-- return +-- end local gl = require('galaxyline') -- get my theme in galaxyline repo From ec814f60c55a8d9d4695bdde1240289b2743f01a Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Sun, 4 Jul 2021 12:43:54 -0400 Subject: [PATCH 16/54] move colorscheme setting to settings --- init.lua | 2 -- lua/settings.lua | 7 ++++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/init.lua b/init.lua index 7f79b3bc..40317a23 100644 --- a/init.lua +++ b/init.lua @@ -2,8 +2,6 @@ require('default-config') vim.cmd('luafile ' .. CONFIG_PATH .. '/lv-config.lua') require('settings') require('plugins') -vim.g.colors_name = O.colorscheme -vim.g.syntax = true require('lv-utils') require('keymappings') require('lv-galaxyline') diff --git a/lua/settings.lua b/lua/settings.lua index 6c7f7ddf..20708d83 100644 --- a/lua/settings.lua +++ b/lua/settings.lua @@ -1,13 +1,11 @@ --- HELPERS --- - local cmd = vim.cmd local opt = vim.opt --- VIM ONLY COMMANDS --- - cmd('filetype plugin on') -- filetype detection cmd('let &titleold="'..TERMINAL..'"') cmd('set inccommand=split') -- show what you are substituting in real time @@ -17,8 +15,11 @@ if O.transparent_window then cmd('au ColorScheme * hi Normal ctermbg=none guibg=none') end ---- SETTINGS --- +--- COLORSCHEME --- +vim.g.colors_name = O.colorscheme + +--- SETTINGS --- opt.backup = false -- creates a backup file opt.clipboard = "unnamedplus" -- allows neovim to access the system clipboard From 927d5b165e668eb806fe0fa3150c09fc57427120 Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Sun, 4 Jul 2021 12:44:38 -0400 Subject: [PATCH 17/54] remove whitespace --- lua/settings.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/settings.lua b/lua/settings.lua index 20708d83..7930f9cd 100644 --- a/lua/settings.lua +++ b/lua/settings.lua @@ -7,7 +7,7 @@ local opt = vim.opt --- VIM ONLY COMMANDS --- cmd('filetype plugin on') -- filetype detection -cmd('let &titleold="'..TERMINAL..'"') +cmd('let &titleold="'..TERMINAL..'"') cmd('set inccommand=split') -- show what you are substituting in real time cmd('set iskeyword+=-') -- treat dash as a separate word cmd('set whichwrap+=<,>,[,],h,l') -- move to next line with theses keys From 7cd58b1228749f72a81ba84c265cafafe47fa5a6 Mon Sep 17 00:00:00 2001 From: PZ31k0nauT <86895284+PZ31k0nauT@users.noreply.github.com> Date: Sun, 4 Jul 2021 18:50:38 +0200 Subject: [PATCH 18/54] Basics for php lsp (#664) * Update php.lua * Update default-config.lua * Update lv-config.example.lua --- ftplugin/php.lua | 25 +++++++++++++++++++++++-- lua/default-config.lua | 16 +++++++++++++++- utils/installer/lv-config.example.lua | 9 ++++++++- 3 files changed, 46 insertions(+), 4 deletions(-) diff --git a/ftplugin/php.lua b/ftplugin/php.lua index abc90092..b571a213 100644 --- a/ftplugin/php.lua +++ b/ftplugin/php.lua @@ -1,4 +1,25 @@ require'lspconfig'.intelephense.setup { cmd = { DATA_PATH .. "/lspinstall/php/node_modules/.bin/intelephense", "--stdio" }, - on_attach = require'lsp'.common_on_attach -} \ No newline at end of file + on_attach = require'lsp'.common_on_attach, + handlers = { + ["textDocument/publishDiagnostics"] = vim.lsp.with( + vim.lsp.diagnostic.on_publish_diagnostics, { + virtual_text = O.lang.php.diagnostics.virtual_text, + signs = O.lang.php.diagnostics.signs, + underline = O.lang.php.diagnostics.underline, + update_in_insert = true + + }) + }, + filetypes = O.lang.php.filetypes, + settings = { + intelephense = { + format = { + braces = O.lang.php.format.braces + }, + environment = { + phpVersion = O.lang.php.environment.php_version + }, + } + }; +} diff --git a/lua/default-config.lua b/lua/default-config.lua index 0023256f..0d33fe47 100644 --- a/lua/default-config.lua +++ b/lua/default-config.lua @@ -182,7 +182,21 @@ O = { } }, svelte = {}, - php = {}, + php = { + format = { + braces = "psr12" + }, + environment = { + php_version = "7.4" + }, + autoformat = false, + diagnostics = { + virtual_text = {spacing = 0, prefix = ""}, + signs = true, + underline = true + }, + filetypes = {'php', 'phtml'} + }, latex = {}, kotlin = {}, html = {}, diff --git a/utils/installer/lv-config.example.lua b/utils/installer/lv-config.example.lua index 169cfcc8..6910a2cb 100644 --- a/utils/installer/lv-config.example.lua +++ b/utils/installer/lv-config.example.lua @@ -87,7 +87,14 @@ O.lang.rust.autoformat = true -- clang O.lang.clang.autoformat = false -- Set to true to enable auto-format in C/C++ files. - +-- php +O.lang.php.format.braces = "k&r" -- options: psr12, allman, k&r +O.lang.php.environment.php_version = "7.4" +-- TODO: autoformat seems not to work at the moment +O.lang.php.autoformat = false +O.lang.php.diagnostics.signs = true +O.lang.php.diagnostics.underline = true +O.lang.php.filetypes = { "php", "phtml" } -- TODO Autocommands -- https://neovim.io/doc/user/autocmd.html From 49c93a622930e750d23ee66cb3f26205dbfb779c Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Sun, 4 Jul 2021 12:58:24 -0400 Subject: [PATCH 19/54] load keymaps before config --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 40317a23..3e6a3b21 100644 --- a/init.lua +++ b/init.lua @@ -1,9 +1,9 @@ require('default-config') +require('keymappings') vim.cmd('luafile ' .. CONFIG_PATH .. '/lv-config.lua') require('settings') require('plugins') require('lv-utils') -require('keymappings') require('lv-galaxyline') require('lv-treesitter') require('lv-which-key') From fdac614a3b959768716fbf748ed2db0ecd231975 Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Sun, 4 Jul 2021 13:30:32 -0400 Subject: [PATCH 20/54] much more handsome bufferline --- lua/lv-bufferline/init.lua | 116 ++++++++++++++++++++++--------------- 1 file changed, 70 insertions(+), 46 deletions(-) diff --git a/lua/lv-bufferline/init.lua b/lua/lv-bufferline/init.lua index c6c37371..74dbd12f 100644 --- a/lua/lv-bufferline/init.lua +++ b/lua/lv-bufferline/init.lua @@ -1,52 +1,76 @@ local M = {} M.config = function() -require('bufferline').setup { - options = { - -- numbers = "none" | "ordinal" | "buffer_id" | "both", - -- number_style = "superscript" | "" | { "none", "subscript" }, -- buffer_id at index 1, ordinal at index 2 - -- mappings = true | false, - -- close_command = "bdelete! %d", -- can be a string | function, see "Mouse actions" - -- right_mouse_command = "bdelete! %d", -- can be a string | function, see "Mouse actions" - -- left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions" - middle_mouse_command = nil, -- can be a string | function, see "Mouse actions" - indicator_icon = '▎', - buffer_close_icon = '', - modified_icon = '●', - close_icon = '', - left_trunc_marker = '', - right_trunc_marker = '', - --- name_formatter can be used to change the buffer's label in the bufferline. - --- Please note some names can/will break the - --- bufferline so use this at your discretion knowing that it has - --- some limitations that will *NOT* be fixed. - -- name_formatter = function(buf) -- buf contains a "name", "path" and "bufnr" - -- -- remove extension from markdown files for example - -- if buf.name:match('%.md') then - -- return vim.fn.fnamemodify(buf.name, ':t:r') - -- end - -- end, - max_name_length = 18, - max_prefix_length = 15, -- prefix used when a buffer is de-duplicated - tab_size = 18, - -- diagnostics = "nvim_lsp", - offsets = {{filetype = "NvimTree", text = "File Explorer", text_align = "left", padding = 1}}, - -- show_buffer_icons = true | false, -- disable filetype icons for buffers - show_buffer_close_icons = true - -- show_close_icon = true | false, - -- show_tab_indicators = true | false, - -- persist_buffer_sort = true, -- whether or not custom sorted buffers should persist - -- can also be a table containing 2 custom separators - -- [focused and unfocused]. eg: { '|', '|' } - -- separator_style = "slant" | "thick" | "thin" | { 'any', 'any' }, - -- enforce_regular_tabs = false | true, - -- always_show_bufferline = true | false, - -- sort_by = 'extension' | 'relative_directory' | 'directory' | function(buffer_a, buffer_b) - -- add custom logic - -- return buffer_a.modified > buffer_b.modified - -- end - } -} + + -- Buffer line setup + require'bufferline'.setup { + options = { + indicator_icon = '▎', + buffer_close_icon = '', + modified_icon = '●', + close_icon = '', + close_command = "Bdelete %d", + right_mouse_command = "Bdelete! %d", + left_trunc_marker = '', + right_trunc_marker = '', + offsets = { + { + filetype = "NvimTree", + text = "EXPLORER", + text_align = "center", + padding = 1 + } + }, + show_tab_indicators = true, + show_close_icon = false + }, + highlights = { + fill = { + guifg = {attribute = "fg", highlight = "Normal"}, + guibg = {attribute = "bg", highlight = "StatusLineNC"} + }, + -- background = { + -- guifg = {attribute = "fg", highlight = "Normal"}, + -- guibg = {attribute = "bg", highlight = "StatusLine"} + -- }, + -- buffer_visible = { + -- gui = "", + -- guifg = {attribute = "fg", highlight = "Normal"}, + -- guibg = {attribute = "bg", highlight = "Normal"} + -- }, + -- buffer_selected = { + -- gui = "", + -- guifg = {attribute = "fg", highlight = "Normal"}, + -- guibg = {attribute = "bg", highlight = "Normal"} + -- }, + -- separator = { + -- guifg = {attribute = "bg", highlight = "Normal"}, + -- guibg = {attribute = "bg", highlight = "StatusLine"} + -- }, + -- separator_selected = { + -- guifg = {attribute = "fg", highlight = "Special"}, + -- guibg = {attribute = "bg", highlight = "Normal"} + -- }, + -- separator_visible = { + -- guifg = {attribute = "fg", highlight = "Normal"}, + -- guibg = {attribute = "bg", highlight = "StatusLineNC"} + -- }, + -- close_button = { + -- guifg = {attribute = "fg", highlight = "Normal"}, + -- guibg = {attribute = "bg", highlight = "StatusLine"} + -- }, + -- close_button_selected = { + -- guifg = {attribute = "fg", highlight = "normal"}, + -- guibg = {attribute = "bg", highlight = "normal"} + -- }, + -- close_button_visible = { + -- guifg = {attribute = "fg", highlight = "normal"}, + -- guibg = {attribute = "bg", highlight = "normal"} + -- } + + } + } + end return M From 1125c2c990046c9a9260ac91a338087833cedeea Mon Sep 17 00:00:00 2001 From: Kai Date: Sun, 4 Jul 2021 20:21:46 +0200 Subject: [PATCH 21/54] typo Bdelete instead of bdelete (#666) --- lua/lv-bufferline/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lv-bufferline/init.lua b/lua/lv-bufferline/init.lua index 74dbd12f..38fa42ae 100644 --- a/lua/lv-bufferline/init.lua +++ b/lua/lv-bufferline/init.lua @@ -9,8 +9,8 @@ M.config = function() buffer_close_icon = '', modified_icon = '●', close_icon = '', - close_command = "Bdelete %d", - right_mouse_command = "Bdelete! %d", + close_command = "bdelete %d", + right_mouse_command = "bdelete! %d", left_trunc_marker = '', right_trunc_marker = '', offsets = { From b73ccf803db453ae6fb117133828dcbb3c2c5e97 Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Sun, 4 Jul 2021 15:01:09 -0400 Subject: [PATCH 22/54] galaxyline will follow theme colors, still need themes that support these hl groups tho --- colors/spacegray.vim | 510 ++++++++++++++++++------------------ lua/lv-galaxyline/init.lua | 96 ++++--- lua/lv-themes/spacegray.lua | 34 ++- 3 files changed, 337 insertions(+), 303 deletions(-) diff --git a/colors/spacegray.vim b/colors/spacegray.vim index 0bd60f5f..be065c28 100644 --- a/colors/spacegray.vim +++ b/colors/spacegray.vim @@ -1,263 +1,259 @@ -"Theme built with Lush.nvim, exported at Fri Jul 2 13:45:55 2021 -highlight SpecialKey guifg=#5486C0 guibg=NONE guisp=NONE gui=bold blend=NONE -highlight Title guifg=#5486C0 guibg=NONE guisp=NONE gui=bold blend=NONE -highlight! link Substitute Search -highlight MoreMsg guifg=#64A6C4 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight Type guifg=#BF85C1 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight! link StorageClass Type -highlight! link Typedef Type -highlight! link Statement Keyword -highlight! link Repeat Keyword -highlight! link Label Keyword -highlight! link Exception Keyword -highlight! link Macro PreProc -highlight! link PreCondit PreProc -highlight Special guifg=#C67158 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight! link SpecialChar Character -highlight Tag guifg=#7299EE guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight Debug guifg=#AF4B57 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight Delimiter guifg=#9092A2 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight SpecialComment guifg=#858585 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight Underlined guifg=NONE guibg=NONE guisp=NONE gui=underline blend=NONE -highlight Italic guifg=NONE guibg=NONE guisp=NONE gui=italic blend=NONE -highlight Ignore guifg=#C7C8D1 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight Normal guifg=#C7C8D1 guibg=#212121 guisp=NONE gui=NONE blend=NONE -highlight EndOfBuffer guifg=#212121 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight CursorLine guifg=NONE guibg=#292929 guisp=NONE gui=NONE blend=NONE -highlight VertSplit guifg=#393E46 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight! link CursorColumn CursorLine -highlight TelescopeSelection guifg=#64A6C4 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight TelescopeMatching guifg=#AF4B57 guibg=NONE guisp=NONE gui=bold blend=NONE -highlight TelescopeBorder guifg=#858585 guibg=#292929 guisp=NONE gui=NONE blend=NONE -highlight NvimTreeNormal guifg=#B1B3BE guibg=#292929 guisp=NONE gui=NONE blend=NONE -highlight NvimTreeGitDelete guifg=#93151B guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight NvimTreeVertSplit guifg=#292929 guibg=#292929 guisp=NONE gui=NONE blend=NONE -highlight TabLine guifg=#C7C8D1 guibg=#292929 guisp=NONE gui=NONE blend=NONE -highlight TabLineFill guifg=#C7C8D1 guibg=#292929 guisp=NONE gui=NONE blend=NONE -highlight! link LspDiagnosticsError LspDiagnosticsSignError -highlight! link LspDiagnosticsWarning LspDiagnosticsSignWarning -highlight! link LspDiagnosticsInformation LspDiagnosticsSignInformation -highlight! link LspDiagnosticsHint LspDiagnosticsSignHint -highlight BufferVisible guifg=NONE guibg=#212121 guisp=NONE gui=NONE blend=NONE -highlight BufferVisibleIndex guifg=NONE guibg=#212121 guisp=NONE gui=NONE blend=NONE -highlight BufferVisibleMod guifg=#FFCC66 guibg=#212121 guisp=NONE gui=NONE blend=NONE -highlight BufferVisibleSign guifg=#FFCC66 guibg=#212121 guisp=NONE gui=NONE blend=NONE -highlight BufferVisibleTarget guifg=#AF4B57 guibg=#212121 guisp=NONE gui=bold blend=NONE -highlight BufferInactiveIndex guifg=#858585 guibg=#292929 guisp=NONE gui=NONE blend=NONE -highlight BufferInactiveMod guifg=#FFCC66 guibg=#292929 guisp=NONE gui=NONE blend=NONE -highlight BufferInactiveSign guifg=#858585 guibg=#292929 guisp=NONE gui=NONE blend=NONE -highlight BufferInactiveTarget guifg=#AF4B57 guibg=#292929 guisp=NONE gui=NONE blend=NONE -highlight! link htmlH1 Title -highlight mkdLink guifg=#64A6C4 guibg=NONE guisp=NONE gui=underline blend=NONE -highlight mkdLineBreak guifg=NONE guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight mkdHeading guifg=#C7C8D1 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight! link TSKeyword Keyword -highlight mkdUnderline guifg=#858585 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight! link TSKeywordFunction Keyword -highlight markdownCode guifg=#C67158 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight! link markdownLinkTextDelimiter Delimiter -highlight! link TSLabel Label -highlight! link TSMethod Function -highlight TSNamespace guifg=#5486C0 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight markdownItalic guifg=NONE guibg=NONE guisp=NONE gui=italic blend=NONE -highlight! link TSNumber Number -highlight! link TSOperator Operator -highlight StatusLineDeco guifg=#EEBA59 guibg=#393E46 guisp=NONE gui=NONE blend=NONE -highlight! link TSParameter TSField -highlight StatusLineLColAlt guifg=#C7C8D1 guibg=#292929 guisp=NONE gui=NONE blend=NONE -highlight! link TSParameterReference TSParameter -highlight StatusLineFTAlt guifg=#C7C8D1 guibg=#393E46 guisp=NONE gui=NONE blend=NONE -highlight TSProperty guifg=#64A6C4 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight StatusLineGitAlt guifg=#212121 guibg=#858585 guisp=NONE gui=NONE blend=NONE -highlight! link TSPunctDelimiter Delimiter -highlight StatusLineFileName guifg=#C7C8D1 guibg=#292929 guisp=NONE gui=bold blend=NONE -highlight! link TSPunctBracket Delimiter -highlight! link TabLineError LspDiagnosticsSignError -highlight! link TSPunctSpecial Delimiter -highlight! link TSRepeat Repeat -highlight! link TSString String -highlight WhichKey guifg=#BF85C1 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight! link TSStringRegex TSString -highlight WhichKeyDesc guifg=#64A6C4 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight! link TSStringEscape Character -highlight! link TSSymbol Identifier -highlight! link TSTag Tag -highlight! link DiffviewStatusAdded SignAdd -highlight! link TSTagDelimiter Delimiter -highlight TSText guifg=#C7C8D1 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight! link DiffviewStatusDeleted SignDelete -highlight! link DiffviewFilePanelInsertion SignAdd -highlight! link DiffviewFilePanelDeletion SignDelete -highlight TSEmphasis guifg=NONE guibg=NONE guisp=NONE gui=italic blend=NONE -highlight Directory guifg=#5486C0 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight TSUnderline guifg=NONE guibg=NONE guisp=NONE gui=underline blend=NONE -highlight TSStrike guifg=NONE guibg=NONE guisp=NONE gui=strikethrough blend=NONE -highlight! link TSTitle Title -highlight! link TSLiteral String -highlight TSURI guifg=#64A6C4 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight! link TSWarning Todo -highlight! link TSType Type -highlight! link TSTypeBuiltin Type -highlight TSVariable guifg=#C7C8D1 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight TSVariableBuiltin guifg=#64A6C4 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight! link Define PreProc -highlight Character guifg=#B1D67A guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight Float guifg=#AF4B57 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight Identifier guifg=#C7C8D1 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight! link Conditional Keyword -highlight Keyword guifg=#5486C0 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight! link Structure Type -highlight! link Include Keyword -highlight WhichKeySeperator guifg=#87B479 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight luaTSConstructor guifg=#9092A2 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight DiffAdd guifg=NONE guibg=#5A7D0C guisp=NONE gui=NONE blend=NONE -highlight TSAnnotation guifg=#64A6C4 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight TSAttribute guifg=#64A6C4 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight! link TSBoolean Boolean -highlight! link TSCharacter Character -highlight! link TSComment Comment -highlight! link TSConditional Conditional -highlight! link TSConstant Constant -highlight! link TSConstBuiltin Constant -highlight GitSignsChange guifg=#0C7D9D guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight! link TSConstructor Type -highlight GitSignsDelete guifg=#93151B guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight! link TSException Exception -highlight TSField guifg=#C7C8D1 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight Search guifg=#C7C8D1 guibg=#67899E guisp=NONE gui=NONE blend=NONE -highlight! link TSFunction Function -highlight! link TSFuncBuiltin Function -highlight LspDiagnosticsDefaultHint guifg=#4DC1FF guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight LspDiagnosticsDefaultError guifg=#F44848 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight LspDiagnosticsDefaultWarning guifg=#FF8800 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight LspDiagnosticsDefaultInformation guifg=#FFCC66 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight! link LspDiagnosticsVirtualTextHint LspDiagnosticsDefaultHint -highlight! link LspDiagnosticsVirtualTextError LspDiagnosticsDefaultError -highlight! link LspDiagnosticsVirtualTextWarning LspDiagnosticsDefaultWarning -highlight! link LspDiagnosticsVirtualTextInformation LspDiagnosticsDefaultInformation -highlight LspDiagnosticsUnderlineHint guifg=NONE guibg=NONE guisp=#87B479 gui=underline blend=NONE -highlight LspDiagnosticsUnderlineError guifg=NONE guibg=NONE guisp=#AF4B57 gui=underline blend=NONE -highlight LspDiagnosticsUnderlineWarning guifg=NONE guibg=NONE guisp=#EEBA59 gui=underline blend=NONE -highlight LspDiagnosticsUnderlineInformation guifg=NONE guibg=NONE guisp=#5486C0 gui=underline blend=NONE -highlight LspDiagnosticsFloatingHint guifg=#4DC1FF guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight LspDiagnosticsFloatingError guifg=#F44848 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight LspDiagnosticsFloatingWarning guifg=#FF8800 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight LspDiagnosticsFloatingInformation guifg=#FFCC66 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight GitSignsAdd guifg=#5A7D0C guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight PreProc guifg=#64A6C4 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight Constant guifg=#C67158 guibg=NONE guisp=NONE gui=NONE blend=NONE +"Theme built with Lush.nvim, exported at Sun 04 Jul 2021 02:47:35 PM EDT +highlight StatusLineLspDiagnosticsHint guifg=#4DC1FF guibg=#292929 guisp=NONE gui=NONE blend=NONE highlight BufferInactive guifg=#858585 guibg=#292929 guisp=NONE gui=NONE blend=NONE -highlight Operator guifg=#67899E guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight BufferCurrent guifg=NONE guibg=#212121 guisp=NONE gui=NONE blend=NONE -highlight String guifg=#87B479 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight Number guifg=#AF4B57 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight Boolean guifg=#AF4B57 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight DiffChange guifg=NONE guibg=#0C7D9D guisp=NONE gui=NONE blend=NONE -highlight Error guifg=#F44848 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight DiffDelete guifg=NONE guibg=#93151B guisp=NONE gui=NONE blend=NONE -highlight! link NonText EndOfBuffer -highlight LspDiagnosticsSignError guifg=#F44848 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight LspDiagnosticsSignWarning guifg=#FF8800 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight LspDiagnosticsSignHint guifg=#4DC1FF guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight LspDiagnosticsSignInformation guifg=#FFCC66 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight WarningMsg guifg=#AF4B57 guibg=NONE guisp=NONE gui=NONE blend=NONE -" highlight LspReferenceText guifg=NONE guibg=#292929 guisp=NONE gui=underline blend=NONE -" highlight LspReferenceRead guifg=NONE guibg=#292929 guisp=NONE gui=underline blend=NONE -" highlight LspReferenceWrite guifg=NONE guibg=#292929 guisp=NONE gui=underline blend=NONE -highlight NvimTreeGitStaged guifg=#5A7D0C guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight NvimTreeGitDirty guifg=#5A7D0C guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight NvimTreeGitNew guifg=#5A7D0C guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight NvimTreeGitMerge guifg=#0C7D9D guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight NvimTreeGitRenamed guifg=#0C7D9D guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight NvimTreeRootFolder guifg=#3B6AA0 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight NvimTreeIndentMarker guifg=#858585 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight NvimTreeFolderName guifg=#5486C0 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight NvimTreeOpenedFolderName guifg=#4E99BC guibg=NONE guisp=NONE gui=italic blend=NONE -highlight NvimTreeSpecialFile guifg=#64A6C4 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight NvimTreeExecFile guifg=#87B479 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight NvimTreeImageFile guifg=#BF85C1 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight Comment guifg=#858585 guibg=NONE guisp=NONE gui=italic blend=NONE -highlight CodiVirtualText guifg=#4DC1FF guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight ErrorMsg guifg=#F44848 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight IndentBlanklineContextChar guifg=#6B6B6B guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight DashboardFooter guifg=#64A6C4 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight DashboardCenter guifg=#BF85C1 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight DashboardHeader guifg=#5486C0 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight DiffviewVertSplit guifg=#858585 guibg=#212121 guisp=NONE gui=NONE blend=NONE +highlight markdownCode guifg=#C67158 guibg=NONE guisp=NONE gui=NONE blend=NONE highlight! link DiffviewStatusRenamed SignChange -highlight! link DiffviewStatusModified SignChange -highlight! link DiffviewNormal NvimTreeNormal -highlight CompeDocumentation guifg=NONE guibg=#393E46 guisp=NONE gui=NONE blend=NONE -highlight WhichKeyFloat guifg=NONE guibg=#292929 guisp=NONE gui=NONE blend=NONE -highlight WhichKeyGroup guifg=#5486C0 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight! link TabLineInformation LspDiagnosticsSignInformation -highlight! link TabLineHint LspDiagnosticsSignHint -highlight NvimTreeFolderIcon guifg=#5486C0 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight! link TabLineWarning LspDiagnosticsSignWarning -highlight LspTroubleIndent guifg=#919191 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight! link IncSearch Search -highlight StatusLineLSP guifg=#A3A3A3 guibg=#292929 guisp=NONE gui=NONE blend=NONE -highlight StatusLineGit guifg=#212121 guibg=#858585 guisp=NONE gui=NONE blend=NONE -highlight! link ColorColumn CursorLine -highlight StatusLineLCol guifg=#C7C8D1 guibg=#393E46 guisp=NONE gui=NONE blend=NONE -highlight StatusLineMode guifg=#212121 guibg=#858585 guisp=NONE gui=bold blend=NONE -highlight StatusLineNC guifg=#858585 guibg=#292929 guisp=NONE gui=NONE blend=NONE -highlight StatusLine guifg=#C7C8D1 guibg=#292929 guisp=NONE gui=NONE blend=NONE -highlight FlutterWidgetGuides guifg=#919191 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight! link TSInclude Include -highlight! link TSFuncMacro Macro -highlight! link markdownLinkDelimiter Delimiter -highlight Function guifg=#EEBA59 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight! link mkdInlineURL mkdLink -highlight! link TSFloat Float -highlight TabLineSel guifg=#292929 guibg=#5486C0 guisp=NONE gui=NONE blend=NONE -highlight TSError guifg=NONE guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight SignChange guifg=#0C7D9D guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight! link TSConstMacro Macro -highlight! link markdownIdDelimiter Delimiter -highlight! link markdownUrl mkdLink -highlight! link Question MoreMsg -highlight BufferCurrentTarget guifg=#AF4B57 guibg=#212121 guisp=NONE gui=bold blend=NONE -highlight StatusLineFT guifg=#C7C8D1 guibg=#393E46 guisp=NONE gui=NONE blend=NONE -highlight BufferCurrentMod guifg=#FFCC66 guibg=#212121 guisp=NONE gui=NONE blend=NONE -highlight BufferCurrentIndex guifg=#64A6C4 guibg=#212121 guisp=NONE gui=NONE blend=NONE -highlight! link NvimTreeOpenedFile NvimTreeOpenedFolderName -highlight SignDelete guifg=#93151B guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight SignAdd guifg=#5A7D0C guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight BufferCurrentSign guifg=#64A6C4 guibg=#212121 guisp=NONE gui=NONE blend=NONE -highlight Bold guifg=NONE guibg=NONE guisp=NONE gui=bold blend=NONE -highlight Todo guifg=#AF4B57 guibg=NONE guisp=NONE gui=bold blend=NONE -highlight! link SignColumn Normal -highlight! link ModeMsg Normal -highlight! link MsgArea Normal -highlight! link MsgSeparator Normal -highlight SpellBad guifg=#C7C8D1 guibg=NONE guisp=#AF4B57 gui=underline blend=NONE -highlight SpellCap guifg=#C7C8D1 guibg=NONE guisp=#EEBA59 gui=underline blend=NONE -highlight SpellLocal guifg=#C7C8D1 guibg=NONE guisp=#87B479 gui=underline blend=NONE -highlight SpellRare guifg=#C7C8D1 guibg=NONE guisp=#5486C0 gui=underline blend=NONE -highlight! link NormalNC Normal -highlight Pmenu guifg=#C7C8D1 guibg=#393E46 guisp=NONE gui=NONE blend=NONE -highlight PmenuSel guifg=#262626 guibg=#67899E guisp=NONE gui=NONE blend=NONE -highlight! link WildMenu PmenuSel -highlight CursorLineNr guifg=#C7C8C0 guibg=NONE guisp=NONE gui=bold blend=NONE -highlight markdownLinkText guifg=#64A6C4 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight Folded guifg=#858585 guibg=#292929 guisp=NONE gui=NONE blend=NONE +highlight! link StorageClass Type +highlight! link SpecialChar Character highlight FoldColumn guifg=#858585 guibg=#212121 guisp=NONE gui=NONE blend=NONE -highlight LineNr guifg=#858585 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight FloatBorder guifg=#858585 guibg=#292929 guisp=NONE gui=NONE blend=NONE -highlight Whitespace guifg=#575757 guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight NormalFloat guifg=NONE guibg=#292D32 guisp=NONE gui=NONE blend=NONE -highlight Visual guifg=NONE guibg=#2C2F35 guisp=NONE gui=NONE blend=NONE -highlight! link VisualNOS Visual -highlight DiffText guifg=NONE guibg=NONE guisp=NONE gui=NONE blend=NONE -highlight! link QuickFixLine CursorLine -highlight PmenuSbar guifg=NONE guibg=#535A65 guisp=NONE gui=NONE blend=NONE -highlight PmenuThumb guifg=NONE guibg=#C7C8D1 guisp=NONE gui=NONE blend=NONE -highlight MatchParen guifg=NONE guibg=#292929 guisp=NONE gui=NONE blend=NONE -highlight Cursor guifg=NONE guibg=NONE guisp=NONE gui=reverse blend=NONE -highlight! link lCursor Cursor -highlight! link CursorIM Cursor +highlight TabLine guifg=#C7C8D1 guibg=#292929 guisp=NONE gui=NONE blend=NONE +highlight TelescopeSelection guifg=#64A6C4 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight NvimTreeGitDelete guifg=#93151B guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight! link TSMethod Function +highlight Identifier guifg=#C7C8D1 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight NvimTreeRootFolder guifg=#3B6AA0 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight GitSignsChange guifg=#0C7D9D guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight! link TSLabel Label +highlight! link TSComment Comment +highlight! link LspDiagnosticsWarning LspDiagnosticsSignWarning +highlight SignAdd guifg=#5A7D0C guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight! link IncSearch Search +highlight WhichKey guifg=#BF85C1 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight! link TSLiteral String +highlight BufferCurrent guifg=NONE guibg=#212121 guisp=NONE gui=NONE blend=NONE +highlight Todo guifg=#AF4B57 guibg=NONE guisp=NONE gui=bold blend=NONE +highlight! link TSParameterReference TSParameter +highlight NvimTreeOpenedFolderName guifg=#4E99BC guibg=NONE guisp=NONE gui=italic blend=NONE +highlight! link MsgSeparator Normal highlight! link TermCursor Cursor +highlight LspDiagnosticsFloatingHint guifg=#4DC1FF guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight! link TSConstBuiltin Constant +highlight TSStrike guifg=NONE guibg=NONE guisp=NONE gui=strikethrough blend=NONE +highlight Number guifg=#AF4B57 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight! link WildMenu PmenuSel +highlight DiffText guifg=NONE guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight SignDelete guifg=#93151B guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight Normal guifg=#C7C8D1 guibg=#212121 guisp=NONE gui=NONE blend=NONE +highlight LspDiagnosticsSignInformation guifg=#FFCC66 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight Type guifg=#BF85C1 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight Float guifg=#AF4B57 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight CompeDocumentation guifg=NONE guibg=#393E46 guisp=NONE gui=NONE blend=NONE +highlight Ignore guifg=#C7C8D1 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight GitSignsDelete guifg=#93151B guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight! link TSConstant Constant +highlight StatusLineSeparator guifg=NONE guibg=#292929 guisp=NONE gui=NONE blend=NONE +highlight! link TSConstructor Type +highlight! link Substitute Search +highlight StatusLineGitDelete guifg=#AF4B57 guibg=#292929 guisp=NONE gui=NONE blend=NONE +highlight LspDiagnosticsSignError guifg=#F44848 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight StatusLineLspDiagnosticsError guifg=#F44848 guibg=#292929 guisp=NONE gui=NONE blend=NONE +highlight WhichKeyFloat guifg=NONE guibg=#292929 guisp=NONE gui=NONE blend=NONE +highlight markdownItalic guifg=NONE guibg=NONE guisp=NONE gui=italic blend=NONE +highlight Pmenu guifg=#C7C8D1 guibg=#393E46 guisp=NONE gui=NONE blend=NONE +highlight! link TabLineWarning LspDiagnosticsSignWarning +highlight PmenuSel guifg=#262626 guibg=#67899E guisp=NONE gui=NONE blend=NONE +highlight! link Typedef Type +highlight! link Define PreProc +highlight TSError guifg=NONE guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight Directory guifg=#5486C0 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight DashboardFooter guifg=#64A6C4 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight WhichKeyGroup guifg=#5486C0 guibg=NONE guisp=NONE gui=NONE blend=NONE highlight! link TermCursorNC Cursor +highlight MatchParen guifg=NONE guibg=#292929 guisp=NONE gui=NONE blend=NONE +highlight! link TSOperator Operator +highlight TSVariableBuiltin guifg=#64A6C4 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight NvimTreeGitDirty guifg=#5A7D0C guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight BufferVisibleIndex guifg=NONE guibg=#212121 guisp=NONE gui=NONE blend=NONE +highlight LspDiagnosticsFloatingError guifg=#F44848 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight WarningMsg guifg=#AF4B57 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight DashboardCenter guifg=#BF85C1 guibg=NONE guisp=NONE gui=NONE blend=NONE highlight Conceal guifg=#5486C0 guibg=NONE guisp=NONE gui=NONE blend=NONE - +highlight NvimTreeVertSplit guifg=#292929 guibg=#292929 guisp=NONE gui=NONE blend=NONE +highlight LspDiagnosticsSignWarning guifg=#FF8800 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight LspDiagnosticsUnderlineHint guifg=NONE guibg=NONE guisp=#87B479 gui=underline blend=NONE +highlight Visual guifg=NONE guibg=#2C2F35 guisp=NONE gui=NONE blend=NONE +highlight Tag guifg=#7299EE guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight TelescopeMatching guifg=#AF4B57 guibg=NONE guisp=NONE gui=bold blend=NONE +highlight LspDiagnosticsDefaultInformation guifg=#FFCC66 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight WhichKeySeperator guifg=#87B479 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight! link htmlH1 Title +highlight! link TSParameter TSField +highlight! link LspDiagnosticsVirtualTextWarning LspDiagnosticsDefaultWarning +highlight! link TSTagDelimiter Delimiter +highlight BufferInactiveTarget guifg=#AF4B57 guibg=#292929 guisp=NONE gui=NONE blend=NONE +highlight! link LspDiagnosticsVirtualTextInformation LspDiagnosticsDefaultInformation +highlight StatusLineLspDiagnosticsWarning guifg=#FF8800 guibg=#292929 guisp=NONE gui=NONE blend=NONE +highlight! link CursorIM Cursor +highlight! link TSFloat Float +highlight! link markdownIdDelimiter Delimiter +highlight BufferCurrentMod guifg=#FFCC66 guibg=#212121 guisp=NONE gui=NONE blend=NONE +highlight Whitespace guifg=#575757 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight! link Repeat Keyword +highlight NvimTreeIndentMarker guifg=#858585 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight Character guifg=#B1D67A guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight NvimTreeGitRenamed guifg=#0C7D9D guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight BufferInactiveMod guifg=#FFCC66 guibg=#292929 guisp=NONE gui=NONE blend=NONE +highlight! link DiffviewFilePanelDeletion SignDelete +highlight StatusLineTreeSitter guifg=#87B479 guibg=#292929 guisp=NONE gui=NONE blend=NONE +highlight SpecialKey guifg=#5486C0 guibg=NONE guisp=NONE gui=bold blend=NONE +highlight DiffAdd guifg=NONE guibg=#5A7D0C guisp=NONE gui=NONE blend=NONE +highlight CursorLine guifg=NONE guibg=#292929 guisp=NONE gui=NONE blend=NONE +highlight! link TSPunctSpecial Delimiter +highlight! link QuickFixLine CursorLine +highlight! link Label Keyword +highlight TSEmphasis guifg=NONE guibg=NONE guisp=NONE gui=italic blend=NONE +highlight Error guifg=#F44848 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight! link TSWarning Todo +highlight! link TSNumber Number +highlight BufferVisible guifg=NONE guibg=#212121 guisp=NONE gui=NONE blend=NONE +highlight SpellRare guifg=#C7C8D1 guibg=NONE guisp=#5486C0 gui=underline blend=NONE +highlight LspDiagnosticsDefaultError guifg=#F44848 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight! link Question MoreMsg +highlight Operator guifg=#67899E guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight Cursor guifg=NONE guibg=NONE guisp=NONE gui=reverse blend=NONE +highlight BufferCurrentIndex guifg=#64A6C4 guibg=#212121 guisp=NONE gui=NONE blend=NONE +highlight! link CursorColumn CursorLine +highlight! link TSType Type +highlight StatusLine guifg=#C7C8D1 guibg=#292929 guisp=NONE gui=NONE blend=NONE +highlight LspDiagnosticsUnderlineInformation guifg=NONE guibg=NONE guisp=#5486C0 gui=underline blend=NONE +highlight! link NormalNC Normal +highlight! link TSRepeat Repeat +highlight NvimTreeNormal guifg=#B1B3BE guibg=#292929 guisp=NONE gui=NONE blend=NONE +highlight ErrorMsg guifg=#F44848 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight NvimTreeGitMerge guifg=#0C7D9D guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight mkdLineBreak guifg=NONE guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight NvimTreeGitNew guifg=#5A7D0C guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight! link LspDiagnosticsHint LspDiagnosticsSignHint +highlight! link DiffviewNormal NvimTreeNormal +highlight! link PreCondit PreProc +highlight! link Macro PreProc +highlight NormalFloat guifg=NONE guibg=#292D32 guisp=NONE gui=NONE blend=NONE +highlight! link TSStringRegex TSString +highlight FlutterWidgetGuides guifg=#919191 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight Debug guifg=#AF4B57 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight TSAttribute guifg=#64A6C4 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight BufferInactiveIndex guifg=#858585 guibg=#292929 guisp=NONE gui=NONE blend=NONE +highlight! link TSKeyword Keyword +highlight mkdHeading guifg=#C7C8D1 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight! link LspDiagnosticsVirtualTextError LspDiagnosticsDefaultError +highlight Function guifg=#EEBA59 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight StatusLineNC guifg=#C7C8C0 guibg=#292929 guisp=NONE gui=NONE blend=NONE +highlight! link DiffviewStatusAdded SignAdd +highlight! link TSString String +highlight TSText guifg=#C7C8D1 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight! link DiffviewFilePanelInsertion SignAdd +highlight! link TSTag Tag +highlight! link LspDiagnosticsInformation LspDiagnosticsSignInformation +highlight! link TSKeywordFunction Keyword +highlight LspDiagnosticsDefaultHint guifg=#4DC1FF guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight! link DiffviewStatusModified SignChange +highlight DiffviewVertSplit guifg=#858585 guibg=#212121 guisp=NONE gui=NONE blend=NONE +highlight NvimTreeGitStaged guifg=#5A7D0C guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight! link NonText EndOfBuffer +highlight NvimTreeSpecialFile guifg=#64A6C4 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight SpecialComment guifg=#858585 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight! link Exception Keyword +highlight PreProc guifg=#64A6C4 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight! link markdownUrl mkdLink +highlight LspDiagnosticsFloatingWarning guifg=#FF8800 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight TSNamespace guifg=#5486C0 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight VertSplit guifg=#393E46 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight BufferVisibleTarget guifg=#AF4B57 guibg=#212121 guisp=NONE gui=bold blend=NONE +highlight FloatBorder guifg=#858585 guibg=#292929 guisp=NONE gui=NONE blend=NONE +highlight! link TabLineHint LspDiagnosticsSignHint +highlight BufferVisibleSign guifg=#FFCC66 guibg=#212121 guisp=NONE gui=NONE blend=NONE +highlight BufferVisibleMod guifg=#FFCC66 guibg=#212121 guisp=NONE gui=NONE blend=NONE +highlight TSUnderline guifg=NONE guibg=NONE guisp=NONE gui=underline blend=NONE +highlight LspTroubleIndent guifg=#919191 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight EndOfBuffer guifg=#212121 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight! link TabLineError LspDiagnosticsSignError +highlight! link LspDiagnosticsVirtualTextHint LspDiagnosticsDefaultHint +highlight! link Structure Type +highlight CodiVirtualText guifg=#4DC1FF guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight! link DiffviewStatusDeleted SignDelete +highlight! link TSFuncBuiltin Function +highlight! link lCursor Cursor +highlight DiffDelete guifg=NONE guibg=#93151B guisp=NONE gui=NONE blend=NONE +highlight markdownLinkText guifg=#64A6C4 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight! link TSTypeBuiltin Type +highlight! link TSFuncMacro Macro +highlight BufferCurrentTarget guifg=#AF4B57 guibg=#212121 guisp=NONE gui=bold blend=NONE +highlight! link TSPunctDelimiter Delimiter +highlight! link TSException Exception +highlight TSProperty guifg=#64A6C4 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight NvimTreeImageFile guifg=#BF85C1 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight TSVariable guifg=#C7C8D1 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight LspDiagnosticsUnderlineWarning guifg=NONE guibg=NONE guisp=#EEBA59 gui=underline blend=NONE +highlight DashboardHeader guifg=#5486C0 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight TabLineFill guifg=#C7C8D1 guibg=#292929 guisp=NONE gui=NONE blend=NONE +highlight LspDiagnosticsSignHint guifg=#4DC1FF guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight Bold guifg=NONE guibg=NONE guisp=NONE gui=bold blend=NONE +highlight String guifg=#87B479 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight! link TabLineInformation LspDiagnosticsSignInformation +highlight mkdLink guifg=#64A6C4 guibg=NONE guisp=NONE gui=underline blend=NONE +highlight! link TSFunction Function +highlight NvimTreeFolderIcon guifg=#5486C0 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight Title guifg=#5486C0 guibg=NONE guisp=NONE gui=bold blend=NONE +highlight! link SignColumn Normal +highlight! link TSPunctBracket Delimiter +highlight! link TSCharacter Character +highlight luaTSConstructor guifg=#9092A2 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight Keyword guifg=#5486C0 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight! link Statement Keyword +highlight MoreMsg guifg=#64A6C4 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight TSURI guifg=#64A6C4 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight SpellCap guifg=#C7C8D1 guibg=NONE guisp=#EEBA59 gui=underline blend=NONE +highlight GitSignsAdd guifg=#5A7D0C guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight LspDiagnosticsFloatingInformation guifg=#FFCC66 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight Special guifg=#C67158 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight Comment guifg=#858585 guibg=NONE guisp=NONE gui=italic blend=NONE +highlight Folded guifg=#858585 guibg=#292929 guisp=NONE gui=NONE blend=NONE +highlight! link TSStringEscape Character +highlight! link markdownLinkDelimiter Delimiter +highlight LspDiagnosticsDefaultWarning guifg=#FF8800 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight! link Conditional Keyword +highlight Search guifg=#C7C8D1 guibg=#67899E guisp=NONE gui=NONE blend=NONE +highlight Italic guifg=NONE guibg=NONE guisp=NONE gui=italic blend=NONE +highlight CursorLineNr guifg=#C7C8C0 guibg=NONE guisp=NONE gui=bold blend=NONE +highlight! link VisualNOS Visual +highlight DiffChange guifg=NONE guibg=#0C7D9D guisp=NONE gui=NONE blend=NONE +highlight! link ColorColumn CursorLine +highlight! link TSBoolean Boolean +highlight! link markdownLinkTextDelimiter Delimiter +highlight SpellBad guifg=#C7C8D1 guibg=NONE guisp=#AF4B57 gui=underline blend=NONE +highlight StatusLineGitChange guifg=#5486C0 guibg=#292929 guisp=NONE gui=NONE blend=NONE +highlight! link TSInclude Include +highlight! link Include Keyword +highlight SpellLocal guifg=#C7C8D1 guibg=NONE guisp=#87B479 gui=underline blend=NONE +highlight! link NvimTreeOpenedFile NvimTreeOpenedFolderName +highlight! link TSSymbol Identifier +highlight! link TSConstMacro Macro +highlight! link TSTitle Title +highlight PmenuThumb guifg=NONE guibg=#C7C8D1 guisp=NONE gui=NONE blend=NONE +highlight SignChange guifg=#0C7D9D guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight Delimiter guifg=#9092A2 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight TelescopeBorder guifg=#858585 guibg=#292929 guisp=NONE gui=NONE blend=NONE +highlight NvimTreeFolderName guifg=#5486C0 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight Underlined guifg=NONE guibg=NONE guisp=NONE gui=underline blend=NONE +highlight! link ModeMsg Normal +highlight LspDiagnosticsUnderlineError guifg=NONE guibg=NONE guisp=#AF4B57 gui=underline blend=NONE +highlight NvimTreeExecFile guifg=#87B479 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight IndentBlanklineContextChar guifg=#6B6B6B guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight! link MsgArea Normal +highlight TabLineSel guifg=#292929 guibg=#5486C0 guisp=NONE gui=NONE blend=NONE +highlight! link TSConditional Conditional +highlight BufferCurrentSign guifg=#64A6C4 guibg=#212121 guisp=NONE gui=NONE blend=NONE +highlight TSField guifg=#C7C8D1 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight LineNr guifg=#858585 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight WhichKeyDesc guifg=#64A6C4 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight Constant guifg=#C67158 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight TSAnnotation guifg=#64A6C4 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight BufferInactiveSign guifg=#858585 guibg=#292929 guisp=NONE gui=NONE blend=NONE +highlight! link mkdInlineURL mkdLink +highlight mkdUnderline guifg=#858585 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight! link LspDiagnosticsError LspDiagnosticsSignError +highlight Boolean guifg=#AF4B57 guibg=NONE guisp=NONE gui=NONE blend=NONE +highlight PmenuSbar guifg=NONE guibg=#535A65 guisp=NONE gui=NONE blend=NONE +highlight StatusLineGit guifg=#C67158 guibg=#292929 guisp=NONE gui=NONE blend=NONE +highlight StatusLineGitAdd guifg=#87B479 guibg=#292929 guisp=NONE gui=NONE blend=NONE +highlight StatusLineLspDiagnosticsInformation guifg=#FFCC66 guibg=#292929 guisp=NONE gui=NONE blend=NONE diff --git a/lua/lv-galaxyline/init.lua b/lua/lv-galaxyline/init.lua index 685d38e7..fece7a04 100644 --- a/lua/lv-galaxyline/init.lua +++ b/lua/lv-galaxyline/init.lua @@ -102,9 +102,10 @@ table.insert(gls.left, { t = colors.blue } vim.api.nvim_command('hi GalaxyViMode guifg=' .. mode_color[vim.fn.mode()]) - return '▊ ' + return '▊' end, - highlight = {colors.red, colors.bg} + -- highlight = 'TabLineSel' + -- highlight = {colors.red, colors.bg} } }) -- print(vim.fn.getbufvar(0, 'ts')) @@ -113,12 +114,12 @@ vim.fn.getbufvar(0, 'ts') table.insert(gls.left, { GitIcon = { provider = function() - return ' ' + return ' ' end, condition = condition.check_git_workspace, separator = ' ', - separator_highlight = {'NONE', colors.bg}, - highlight = {colors.orange, colors.bg} + separator_highlight = 'StatusLineSeparator', + highlight = 'StatusLineGit' } }) @@ -127,8 +128,8 @@ table.insert(gls.left, { provider = 'GitBranch', condition = condition.check_git_workspace, separator = ' ', - separator_highlight = {'NONE', colors.bg}, - highlight = {colors.grey, colors.bg} + separator_highlight = 'StatusLineSeparator', + highlight = 'StatusLineNC' } }) @@ -137,7 +138,7 @@ table.insert(gls.left, { provider = 'DiffAdd', condition = condition.hide_in_width, icon = '  ', - highlight = {colors.green, colors.bg} + highlight = 'StatusLineGitAdd' } }) @@ -146,7 +147,7 @@ table.insert(gls.left, { provider = 'DiffModified', condition = condition.hide_in_width, icon = ' 柳', - highlight = {colors.blue, colors.bg} + highlight = 'StatusLineGitChange' } }) @@ -155,30 +156,52 @@ table.insert(gls.left, { provider = 'DiffRemove', condition = condition.hide_in_width, icon = '  ', - highlight = {colors.red, colors.bg} + highlight = 'StatusLineGitDelete' } }) table.insert(gls.right, { - DiagnosticError = {provider = 'DiagnosticError', icon = '  ', highlight = {colors.error_red, colors.bg}} + DiagnosticError = {provider = 'DiagnosticError', icon = '  ', + highlight = 'StatusLineLspDiagnosticsError' + } }) -table.insert(gls.right, {DiagnosticWarn = {provider = 'DiagnosticWarn', icon = '  ', highlight = {colors.orange, colors.bg}}}) +table.insert(gls.right, {DiagnosticWarn = {provider = 'DiagnosticWarn', icon = '  ', + + + highlight = 'StatusLineLspDiagnosticsWarning' + + +}}) + + +table.insert(gls.right, {DiagnosticInfo = {provider = 'DiagnosticInfo', icon = '  ', + + highlight = 'StatusLineLspDiagnosticsInformation' + + +}}) + + table.insert(gls.right, { - DiagnosticHint = {provider = 'DiagnosticHint', icon = '  ', highlight = {colors.vivid_blue, colors.bg}} -}) + DiagnosticHint = {provider = 'DiagnosticHint', icon = '  ', -table.insert(gls.right, {DiagnosticInfo = {provider = 'DiagnosticInfo', icon = '  ', highlight = {colors.info_yellow, colors.bg}}}) + + highlight = 'StatusLineLspDiagnosticsHint' + + + } +}) table.insert(gls.right, { TreesitterIcon = { provider = function() - if next(vim.treesitter.highlighter.active) ~= nil then return ' ' end + if next(vim.treesitter.highlighter.active) ~= nil then return ' ' end return '' end, separator = ' ', - separator_highlight = {'NONE', colors.bg}, - highlight = {colors.green, colors.bg} + separator_highlight = 'StatusLineSeparator', + highlight = 'StatusLineTreeSitter' } }) @@ -220,7 +243,7 @@ table.insert(gls.right, { return true end, icon = ' ', - highlight = {colors.grey, colors.bg} + highlight = 'StatusLineNC' } }) @@ -228,8 +251,8 @@ table.insert(gls.right, { LineInfo = { provider = 'LineColumn', separator = ' ', - separator_highlight = {'NONE', colors.bg}, - highlight = {colors.grey, colors.bg} + separator_highlight = 'StatusLineSeparator', + highlight = 'StatusLineNC' } }) @@ -237,8 +260,8 @@ table.insert(gls.right, { PerCent = { provider = 'LinePercent', separator = ' ', - separator_highlight = {'NONE', colors.bg}, - highlight = {colors.grey, colors.bg} + separator_highlight = 'StatusLineSeparator', + highlight = 'StatusLineNC' } }) @@ -249,8 +272,8 @@ table.insert(gls.right, { end, condition = condition.hide_in_width, separator = ' ', - separator_highlight = {'NONE', colors.bg}, - highlight = {colors.grey, colors.bg} + separator_highlight = 'StatusLineSeparator', + highlight = 'StatusLineNC' } }) @@ -259,8 +282,8 @@ table.insert(gls.right, { provider = 'FileTypeName', condition = condition.hide_in_width, separator = ' ', - separator_highlight = {'NONE', colors.bg}, - highlight = {colors.grey, colors.bg} + separator_highlight = 'StatusLineSeparator', + highlight = 'StatusLineNC' } }) @@ -269,8 +292,8 @@ table.insert(gls.right, { provider = 'FileEncode', condition = condition.hide_in_width, separator = ' ', - separator_highlight = {'NONE', colors.bg}, - highlight = {colors.grey, colors.bg} + separator_highlight = 'StatusLineSeparator', + highlight = 'StatusLineNC' } }) @@ -280,8 +303,8 @@ table.insert(gls.right, { return ' ' end, separator = ' ', - separator_highlight = {'NONE', colors.bg}, - highlight = {colors.orange, colors.bg} + separator_highlight = 'StatusLineSeparator', + highlight = 'StatusLineNC' } }) @@ -289,13 +312,18 @@ table.insert(gls.short_line_left, { BufferType = { provider = 'FileTypeName', separator = ' ', - separator_highlight = {'NONE', colors.bg}, - highlight = {colors.grey, colors.bg} + separator_highlight = 'StatusLineSeparator', + highlight = 'StatusLineNC' } }) table.insert(gls.short_line_left, { - SFileName = {provider = 'SFileName', condition = condition.buffer_not_empty, highlight = {colors.grey, colors.bg}} + SFileName = {provider = 'SFileName', condition = condition.buffer_not_empty, + + highlight = 'StatusLineNC' + + + } }) --table.insert(gls.short_line_right[1] = {BufferIcon = {provider = 'BufferIcon', highlight = {colors.grey, colors.bg}}}) diff --git a/lua/lv-themes/spacegray.lua b/lua/lv-themes/spacegray.lua index d21c0037..ef4ecc17 100644 --- a/lua/lv-themes/spacegray.lua +++ b/lua/lv-themes/spacegray.lua @@ -307,18 +307,28 @@ local theme = lush(function() markdownItalic {fg = "NONE", gui = "italic"}, -- flutter-tools.nvim FlutterWidgetGuides {fg = c.gray.li(10)}, -- statusline - StatusLine {bg = c.bg1, fg = c.white}, - StatusLineNC {bg = c.bg1, fg = c.gray}, - StatusLineMode {bg = c.gray, fg = c.bg, gui = "bold"}, - StatusLineDeco {bg = c.bg2, fg = c.yellow}, - StatusLineLCol {bg = c.bg2, fg = c.white}, - StatusLineLColAlt {bg = c.bg1, fg = c.white}, - StatusLineFT {bg = c.bg2, fg = c.white}, - StatusLineFTAlt {bg = c.bg2, fg = c.white}, - StatusLineGit {bg = c.gray, fg = c.bg}, - StatusLineGitAlt {bg = c.gray, fg = c.bg}, - StatusLineLSP {bg = c.bg1, fg = c.gray.li(25)}, - StatusLineFileName {bg = c.bg1, fg = c.white, gui = "bold"}, + StatusLine {bg = c.bg1, fg = c.white}, -- status line of current window + StatusLineNC {bg = c.bg1, fg = c.light_gray}, -- status lines of not-current windows Note: if this is equal to "StatusLine" Vim will use "^^^" in the status line of the current window. + StatusLineSeparator {bg = c.bg1, fg = "NONE"}, + StatusLineGit {bg = c.bg1, fg = c.orange}, + StatusLineGitAdd {bg = c.bg1, fg = c.green}, + StatusLineGitChange {bg = c.bg1, fg = c.blue}, + StatusLineGitDelete {bg = c.bg1, fg = c.red}, + StatusLineLspDiagnosticsError {bg = c.bg1, fg = c.error_red, gui = "NONE"}, + StatusLineLspDiagnosticsWarning {bg = c.bg1, fg = c.warning_orange, gui = "NONE"}, + StatusLineLspDiagnosticsInformation {bg = c.bg1, fg = c.info_yellow, gui = "NONE"}, + StatusLineLspDiagnosticsHint {bg = c.bg1, fg = c.hint_blue, gui = "NONE"}, + StatusLineTreeSitter {bg = c.bg1, fg = c.green}, + + -- StatusLineMode {bg = c.gray, fg = c.bg, gui = "bold"}, + -- StatusLineDeco {bg = c.bg2, fg = c.yellow}, + -- StatusLineLCol {bg = c.bg2, fg = c.white}, + -- StatusLineLColAlt {bg = c.bg1, fg = c.white}, + -- StatusLineFT {bg = c.bg2, fg = c.white}, + -- StatusLineFTAlt {bg = c.bg2, fg = c.white}, + -- StatusLineGitAlt {bg = c.gray, fg = c.bg}, + -- StatusLineLSP {bg = c.bg1, fg = c.gray.li(25)}, + -- StatusLineFileName {bg = c.bg1, fg = c.white, gui = "bold"}, -- lsp-trouble.nvim From 37057d7c4b7fa9f1ac5ebe779eed05da11ab56e3 Mon Sep 17 00:00:00 2001 From: James Walmsley Date: Sun, 4 Jul 2021 20:08:41 +0100 Subject: [PATCH 23/54] [KEYMAP] Support quickfix navigation with [q / ]q (#660) --- lua/keymappings.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/keymappings.lua b/lua/keymappings.lua index b611b16e..7224a432 100644 --- a/lua/keymappings.lua +++ b/lua/keymappings.lua @@ -50,6 +50,10 @@ vim.api.nvim_set_keymap('i', '', ':m .-2==gi', {noremap = true, si vim.api.nvim_set_keymap('x', '', ':m \'>+1gv-gv', {noremap = true, silent = true}) vim.api.nvim_set_keymap('x', '', ':m \'<-2gv-gv', {noremap = true, silent = true}) +-- QuickFix +vim.api.nvim_set_keymap('n', ']q', ':cnext', {noremap = true, silent = true}) +vim.api.nvim_set_keymap('n', '[q', ':cprev', {noremap = true, silent = true}) + -- Better nav for omnicomplete vim.cmd('inoremap (\"\\\")') vim.cmd('inoremap (\"\\\")') From 6934262a5db8b6d94fad2e877a1794768026081b Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Sun, 4 Jul 2021 15:14:31 -0400 Subject: [PATCH 24/54] cleaner tree --- lua/lv-bufferline/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lv-bufferline/init.lua b/lua/lv-bufferline/init.lua index 38fa42ae..0dbaaceb 100644 --- a/lua/lv-bufferline/init.lua +++ b/lua/lv-bufferline/init.lua @@ -16,7 +16,7 @@ M.config = function() offsets = { { filetype = "NvimTree", - text = "EXPLORER", + text = "", text_align = "center", padding = 1 } From d2324d14e166a17b2573006485fd3e4e8c971100 Mon Sep 17 00:00:00 2001 From: maxime50 <51096534+maxime50@users.noreply.github.com> Date: Sun, 4 Jul 2021 18:22:10 -0400 Subject: [PATCH 25/54] Better JS/TS Development Experience (#667) Co-authored-by: Maxime --- lua/lsp/init.lua | 42 ++++++++++++++++++++++++++++++++++++++++- lua/lsp/ts-fmt-lint.lua | 30 +---------------------------- lua/plugins.lua | 19 +++++++++++++++++++ 3 files changed, 61 insertions(+), 30 deletions(-) diff --git a/lua/lsp/init.lua b/lua/lsp/init.lua index 8bc8984f..7c78d054 100644 --- a/lua/lsp/init.lua +++ b/lua/lsp/init.lua @@ -106,8 +106,48 @@ if O.document_highlight then end function lsp_config.tsserver_on_attach(client, bufnr) - lsp_config.common_on_attach(client, bufnr) + -- lsp_config.common_on_attach(client, bufnr) client.resolved_capabilities.document_formatting = false + + local ts_utils = require("nvim-lsp-ts-utils") + + -- defaults + ts_utils.setup { + debug = false, + disable_commands = false, + enable_import_on_completion = false, + import_all_timeout = 5000, -- ms + + -- eslint + eslint_enable_code_actions = true, + eslint_enable_disable_comments = true, + eslint_bin = O.lang.tsserver.linter, + eslint_config_fallback = nil, + eslint_enable_diagnostics = true, + + -- formatting + enable_formatting = O.lang.tsserver.autoformat, + formatter = O.lang.tsserver.formatter, + formatter_config_fallback = nil, + + -- parentheses completion + complete_parens = false, + signature_help_in_parens = false, + + -- update imports on file move + update_imports_on_move = false, + require_confirmation_on_move = false, + watch_dir = nil, + } + + -- required to fix code action ranges + ts_utils.setup_client(client) + + -- TODO: keymap these? + -- vim.api.nvim_buf_set_keymap(bufnr, "n", "gs", ":TSLspOrganize", {silent = true}) + -- vim.api.nvim_buf_set_keymap(bufnr, "n", "qq", ":TSLspFixCurrent", {silent = true}) + -- vim.api.nvim_buf_set_keymap(bufnr, "n", "gr", ":TSLspRenameFile", {silent = true}) + -- vim.api.nvim_buf_set_keymap(bufnr, "n", "gi", ":TSLspImportAll", {silent = true}) end diff --git a/lua/lsp/ts-fmt-lint.lua b/lua/lsp/ts-fmt-lint.lua index 3ca97d71..5cca9c60 100644 --- a/lua/lsp/ts-fmt-lint.lua +++ b/lua/lsp/ts-fmt-lint.lua @@ -17,46 +17,18 @@ M.setup = function() } end - -- TODO global eslint? - - local eslint = { - lintCommand = "./node_modules/.bin/eslint -f unix --stdin --stdin-filename ${INPUT}", - lintIgnoreExitCode = true, - lintStdin = true, - lintFormats = {"%f:%l:%c: %m"}, - -- formatCommand = "./node_modules/.bin/eslint -f unix --fix --stdin-filename ${INPUT}", -- TODO check if eslint is the formatter then add this - formatStdin = true - } - - if O.lang.tsserver.formatter == 'prettier' then - table.insert(tsserver_args, prettier) - end - - if O.lang.tsserver.linter == 'eslint' then - table.insert(tsserver_args, eslint) - end - require"lspconfig".efm.setup { -- init_options = {initializationOptions}, cmd = {DATA_PATH .. "/lspinstall/efm/efm-langserver"}, init_options = {documentFormatting = true, codeAction = false}, - filetypes = { - "javascriptreact", "javascript", "typescript", "typescriptreact", - "html", "css", "yaml", "vue" - }, + filetypes = {"html", "css", "yaml", "vue"}, settings = { rootMarkers = {".git/", "package.json"}, languages = { - javascript = tsserver_args, - javascriptreact = tsserver_args, - typescript = tsserver_args, - typescriptreact = tsserver_args, html = {prettier}, css = {prettier}, json = {prettier}, yaml = {prettier} - -- javascriptreact = {prettier, eslint}, - -- javascript = {prettier, eslint}, -- markdown = {markdownPandocFormat, markdownlint}, } } diff --git a/lua/plugins.lua b/lua/plugins.lua index 8dc28266..51e9c52f 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -429,6 +429,25 @@ return require("packer").startup(function(use) -- Elixir use {"elixir-editors/vim-elixir", ft = {"elixir", "eelixir", "euphoria3"}} + -- Javascript / Typescript + use { + "jose-elias-alvarez/nvim-lsp-ts-utils", + ft = { + "javascript", "javascriptreact", "javascript.jsx", "typescript", + "typescriptreact", "typescript.tsx" + } + } + use { + "jose-elias-alvarez/null-ls.nvim", + ft = { + "javascript", "javascriptreact", "javascript.jsx", "typescript", + "typescriptreact", "typescript.tsx" + }, + config = function() + require('null-ls').setup() + end + } + -- Tabnine use { "tzachar/compe-tabnine", From b461c878e6f70a6795d0e9b438335ccfecbb4bd9 Mon Sep 17 00:00:00 2001 From: Jacek Kiedrowski <33070637+atropos112@users.noreply.github.com> Date: Mon, 5 Jul 2021 00:00:32 +0100 Subject: [PATCH 26/54] Changed ft of latex (lervag/vimtex) to correct 'tex' value. Need to run PackerInstall, Compile etc to make it work after this change. (#670) --- lua/plugins.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/plugins.lua b/lua/plugins.lua index 51e9c52f..e202100f 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -416,8 +416,8 @@ return require("packer").startup(function(use) -- LANGUAGE SPECIFIC GOES HERE - -- Latex TODO what filetypes should this be active for? - use {"lervag/vimtex", ft = "latex"} + use {"lervag/vimtex", ft = "tex" } + -- Rust tools -- TODO: use lazy loading maybe? From 9f511bcb594b7e2461c97cb8182603928c773c2f Mon Sep 17 00:00:00 2001 From: Rafael Date: Sun, 4 Jul 2021 22:14:01 -0300 Subject: [PATCH 27/54] start formatting rules --- ftdetect/zig.lua | 4 +- ftplugin/c.lua | 42 +- ftplugin/cmake.lua | 8 +- ftplugin/css.lua | 15 +- ftplugin/dart.lua | 20 +- ftplugin/docker.lua | 8 +- ftplugin/elixir.lua | 4 +- ftplugin/elm.lua | 16 +- ftplugin/euphoria3.lua | 4 +- ftplugin/go.lua | 36 +- ftplugin/graphql.lua | 2 +- ftplugin/html.lua | 14 +- ftplugin/java.lua | 34 +- ftplugin/javascript.lua | 113 +-- ftplugin/javascriptreact.lua | 113 +-- ftplugin/json.lua | 45 +- ftplugin/kotlin.lua | 32 +- ftplugin/lua.lua | 103 +-- ftplugin/php.lua | 44 +- ftplugin/python.lua | 130 ++- ftplugin/ruby.lua | 36 +- ftplugin/rust.lua | 150 ++-- ftplugin/sh.lua | 44 +- ftplugin/tex.lua | 6 +- ftplugin/tf.lua | 8 +- ftplugin/typescript.lua | 113 +-- ftplugin/typescriptreact.lua | 113 +-- ftplugin/vim.lua | 6 +- ftplugin/vue.lua | 8 +- ftplugin/yaml.lua | 8 +- ftplugin/zig.lua | 22 +- ftplugin/zsh.lua | 52 +- init.lua | 24 +- lua/default-config.lua | 542 ++++++------ lua/keymappings.lua | 64 +- lua/lv-autopairs/init.lua | 56 +- lua/lv-bufferline/init.lua | 135 ++- lua/lv-colorizer/init.lua | 23 +- lua/lv-compe/init.lua | 125 ++- lua/lv-dashboard/init.lua | 107 +-- lua/lv-dial/init.lua | 14 +- lua/lv-galaxyline/init.lua | 430 ++++----- lua/lv-gitblame/init.lua | 2 +- lua/lv-gitsigns/init.lua | 94 +- lua/lv-hop/init.lua | 6 +- lua/lv-lsp-rooter/init.lua | 8 +- lua/lv-lspinstall/init.lua | 6 +- lua/lv-matchup/init.lua | 3 +- lua/lv-nvimtree/init.lua | 123 ++- lua/lv-quickscope/init.lua | 4 +- lua/lv-rnvimr/init.lua | 2 +- lua/lv-snap/init.lua | 16 +- lua/lv-spectre/init.lua | 73 +- lua/lv-symbols-outline/init.lua | 26 +- lua/lv-telescope/init.lua | 148 ++-- lua/lv-themes/spacegray.lua | 635 +++++++------ lua/lv-treesitter/init.lua | 67 +- lua/lv-utils/init.lua | 36 +- lua/lv-vimtex/init.lua | 12 +- lua/lv-which-key/init.lua | 516 ++++++----- lua/lv-zen/init.lua | 42 +- lua/plugins.lua | 835 +++++++++--------- lua/settings.lua | 90 +- utils/installer/lv-config.example.lua | 19 +- .../lua/lush_theme/lush_template.lua | 5 +- 65 files changed, 2829 insertions(+), 2812 deletions(-) diff --git a/ftdetect/zig.lua b/ftdetect/zig.lua index 81e901ca..7edf1f68 100644 --- a/ftdetect/zig.lua +++ b/ftdetect/zig.lua @@ -1,4 +1,4 @@ -vim.cmd([[ +vim.cmd [[ au BufRead,BufNewFile *.zig set filetype=zig au BufRead,BufNewFile *.zir set filetype=zir -]]) +]] diff --git a/ftplugin/c.lua b/ftplugin/c.lua index a2324986..ef371c03 100644 --- a/ftplugin/c.lua +++ b/ftplugin/c.lua @@ -1,31 +1,31 @@ -local clangd_flags = {"--background-index"}; +local clangd_flags = { "--background-index" } if O.lang.clang.cross_file_rename then - table.insert(clangd_flags, "--cross-file-rename") + table.insert(clangd_flags, "--cross-file-rename") end table.insert(clangd_flags, "--header-insertion=" .. O.lang.clang.header_insertion) -require'lspconfig'.clangd.setup { - cmd = {DATA_PATH .. "/lspinstall/cpp/clangd/bin/clangd", unpack(clangd_flags)}, - on_attach = require'lsp'.common_on_attach, - handlers = { - ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { - virtual_text = O.lang.clang.diagnostics.virtual_text, - signs = O.lang.clang.diagnostics.signs, - underline = O.lang.clang.diagnostics.underline, - update_in_insert = true - - }) - } +require("lspconfig").clangd.setup { + cmd = { DATA_PATH .. "/lspinstall/cpp/clangd/bin/clangd", unpack(clangd_flags) }, + on_attach = require("lsp").common_on_attach, + handlers = { + ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { + virtual_text = O.lang.clang.diagnostics.virtual_text, + signs = O.lang.clang.diagnostics.signs, + underline = O.lang.clang.diagnostics.underline, + update_in_insert = true, + }), + }, } if O.lang.clang.autoformat then - require('lv-utils').define_augroups({ - _clang_autoformat = { - {'BufWritePre *.c lua vim.lsp.buf.formatting_sync(nil,1000)'}, - {'BufWritePre *.h lua vim.lsp.buf.formatting_sync(nil,1000)'}, - {'BufWritePre *.cpp lua vim.lsp.buf.formatting_sync(nil,1000)'}, - {'BufWritePre *.hpp lua vim.lsp.buf.formatting_sync(nil,1000)'}, - }}) + require("lv-utils").define_augroups { + _clang_autoformat = { + { "BufWritePre *.c lua vim.lsp.buf.formatting_sync(nil,1000)" }, + { "BufWritePre *.h lua vim.lsp.buf.formatting_sync(nil,1000)" }, + { "BufWritePre *.cpp lua vim.lsp.buf.formatting_sync(nil,1000)" }, + { "BufWritePre *.hpp lua vim.lsp.buf.formatting_sync(nil,1000)" }, + }, + } end diff --git a/ftplugin/cmake.lua b/ftplugin/cmake.lua index a9647118..1b61ffb2 100644 --- a/ftplugin/cmake.lua +++ b/ftplugin/cmake.lua @@ -1,5 +1,5 @@ -require'lspconfig'.cmake.setup { - cmd = {DATA_PATH .. '/lspinstall/cmake/venv/bin/cmake-language-server'}, - on_attach = require'lsp'.common_on_attach, - filetypes = {"cmake"}, +require("lspconfig").cmake.setup { + cmd = { DATA_PATH .. "/lspinstall/cmake/venv/bin/cmake-language-server" }, + on_attach = require("lsp").common_on_attach, + filetypes = { "cmake" }, } diff --git a/ftplugin/css.lua b/ftplugin/css.lua index 4affb45e..d51dee70 100644 --- a/ftplugin/css.lua +++ b/ftplugin/css.lua @@ -1,9 +1,10 @@ -- npm install -g vscode-css-languageserver-bin -require'lspconfig'.cssls.setup { - cmd = { - "node", DATA_PATH .. "/lspinstall/css/vscode-css/css-language-features/server/dist/node/cssServerMain.js", - "--stdio" - }, - on_attach = require'lsp'.common_on_attach +require("lspconfig").cssls.setup { + cmd = { + "node", + DATA_PATH .. "/lspinstall/css/vscode-css/css-language-features/server/dist/node/cssServerMain.js", + "--stdio", + }, + on_attach = require("lsp").common_on_attach, } -vim.cmd("setl ts=2 sw=2") +vim.cmd "setl ts=2 sw=2" diff --git a/ftplugin/dart.lua b/ftplugin/dart.lua index fe4898e8..419d0400 100644 --- a/ftplugin/dart.lua +++ b/ftplugin/dart.lua @@ -1,11 +1,11 @@ -require'lspconfig'.dartls.setup{ - cmd = { "dart", O.lang.dart.sdk_path, "--lsp" }, - on_attach = require'lsp'.common_on_attach, - init_options = { - closingLabels = false, - flutterOutline = false, - onlyAnalyzeProjectsWithOpenFiles = false, - outline = false, - suggestFromUnimportedLibraries = true - } +require("lspconfig").dartls.setup { + cmd = { "dart", O.lang.dart.sdk_path, "--lsp" }, + on_attach = require("lsp").common_on_attach, + init_options = { + closingLabels = false, + flutterOutline = false, + onlyAnalyzeProjectsWithOpenFiles = false, + outline = false, + suggestFromUnimportedLibraries = true, + }, } diff --git a/ftplugin/docker.lua b/ftplugin/docker.lua index b477a239..37b4317f 100644 --- a/ftplugin/docker.lua +++ b/ftplugin/docker.lua @@ -1,6 +1,6 @@ -- npm install -g dockerfile-language-server-nodejs -require'lspconfig'.dockerls.setup { - cmd = {DATA_PATH .. "/lspinstall/dockerfile/node_modules/.bin/docker-langserver", "--stdio"}, - on_attach = require'lsp'.common_on_attach, - root_dir = vim.loop.cwd +require("lspconfig").dockerls.setup { + cmd = { DATA_PATH .. "/lspinstall/dockerfile/node_modules/.bin/docker-langserver", "--stdio" }, + on_attach = require("lsp").common_on_attach, + root_dir = vim.loop.cwd, } diff --git a/ftplugin/elixir.lua b/ftplugin/elixir.lua index 362ee010..fbb5b29b 100644 --- a/ftplugin/elixir.lua +++ b/ftplugin/elixir.lua @@ -1,5 +1,5 @@ -require'lspconfig'.elixirls.setup{ - cmd = { DATA_PATH .. "/lspinstall/elixir/elixir-ls/language_server.sh"}; +require("lspconfig").elixirls.setup { + cmd = { DATA_PATH .. "/lspinstall/elixir/elixir-ls/language_server.sh" }, } -- needed for the LSP to recognize elixir files (alternativly just use elixir-editors/vim-elixir) diff --git a/ftplugin/elm.lua b/ftplugin/elm.lua index 3572a607..ffd97a2a 100644 --- a/ftplugin/elm.lua +++ b/ftplugin/elm.lua @@ -1,9 +1,9 @@ -require'lspconfig'.elmls.setup { - cmd = {DATA_PATH .. "/lspinstall/elm/node_modules/.bin/elm-language-server"}, - init_options= { - elmAnalyseTrigger = "change", - elmFormatPath = DATA_PATH .. "/lspinstall/elm/node_modules/.bin/elm-format", - elmPath = DATA_PATH .. "/lspinstall/elm/node_modules/.bin/elm", - elmTestPath = DATA_PATH .. "/lspinstall/elm/node_modules/.bin/elm-test" - } +require("lspconfig").elmls.setup { + cmd = { DATA_PATH .. "/lspinstall/elm/node_modules/.bin/elm-language-server" }, + init_options = { + elmAnalyseTrigger = "change", + elmFormatPath = DATA_PATH .. "/lspinstall/elm/node_modules/.bin/elm-format", + elmPath = DATA_PATH .. "/lspinstall/elm/node_modules/.bin/elm", + elmTestPath = DATA_PATH .. "/lspinstall/elm/node_modules/.bin/elm-test", + }, } diff --git a/ftplugin/euphoria3.lua b/ftplugin/euphoria3.lua index adc0ac7d..c434c56a 100644 --- a/ftplugin/euphoria3.lua +++ b/ftplugin/euphoria3.lua @@ -1,6 +1,6 @@ -- TODO Remove this at some point -require'lspconfig'.elixirls.setup{ - cmd = { DATA_PATH .. "/lspinstall/elixir/elixir-ls/language_server.sh"}; +require("lspconfig").elixirls.setup { + cmd = { DATA_PATH .. "/lspinstall/elixir/elixir-ls/language_server.sh" }, } -- needed for the LSP to recognize elixir files (alternativly just use elixir-editors/vim-elixir) diff --git a/ftplugin/go.lua b/ftplugin/go.lua index b2d6a82a..0bee465f 100644 --- a/ftplugin/go.lua +++ b/ftplugin/go.lua @@ -1,22 +1,22 @@ -require'lspconfig'.gopls.setup { - cmd = {DATA_PATH .. "/lspinstall/go/gopls"}, - settings = {gopls = {analyses = {unusedparams = true}, staticcheck = true}}, - root_dir = require'lspconfig'.util.root_pattern(".git", "go.mod"), - init_options = {usePlaceholders = true, completeUnimported = true}, - on_attach = require'lsp'.common_on_attach +require("lspconfig").gopls.setup { + cmd = { DATA_PATH .. "/lspinstall/go/gopls" }, + settings = { gopls = { analyses = { unusedparams = true }, staticcheck = true } }, + root_dir = require("lspconfig").util.root_pattern(".git", "go.mod"), + init_options = { usePlaceholders = true, completeUnimported = true }, + on_attach = require("lsp").common_on_attach, } if O.lang.go.autoformat then - require('lv-utils').define_augroups({ - _go_format = { - {'BufWritePre', '*.go', 'lua vim.lsp.buf.formatting_sync(nil,1000)'} - }, - _go = { - -- Go generally requires Tabs instead of spaces. - {'FileType', 'go', 'setlocal tabstop=4'}, - {'FileType', 'go', 'setlocal shiftwidth=4'}, - {'FileType', 'go', 'setlocal softtabstop=4'}, - {'FileType', 'go', 'setlocal noexpandtab'} - } - }) + require("lv-utils").define_augroups { + _go_format = { + { "BufWritePre", "*.go", "lua vim.lsp.buf.formatting_sync(nil,1000)" }, + }, + _go = { + -- Go generally requires Tabs instead of spaces. + { "FileType", "go", "setlocal tabstop=4" }, + { "FileType", "go", "setlocal shiftwidth=4" }, + { "FileType", "go", "setlocal softtabstop=4" }, + { "FileType", "go", "setlocal noexpandtab" }, + }, + } end diff --git a/ftplugin/graphql.lua b/ftplugin/graphql.lua index 0bd97ed5..df3dce9b 100644 --- a/ftplugin/graphql.lua +++ b/ftplugin/graphql.lua @@ -1,2 +1,2 @@ -- npm install -g graphql-language-service-cli -require'lspconfig'.graphql.setup {on_attach = require'lsp'.common_on_attach} +require("lspconfig").graphql.setup { on_attach = require("lsp").common_on_attach } diff --git a/ftplugin/html.lua b/ftplugin/html.lua index 26f149d5..312301b1 100644 --- a/ftplugin/html.lua +++ b/ftplugin/html.lua @@ -2,9 +2,13 @@ local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities.textDocument.completion.completionItem.snippetSupport = true -require'lspconfig'.html.setup { - cmd = {"node", DATA_PATH .. "/lspinstall/html/vscode-html/html-language-features/server/dist/node/htmlServerMain.js", "--stdio"}, - on_attach = require'lsp'.common_on_attach, - capabilities = capabilities +require("lspconfig").html.setup { + cmd = { + "node", + DATA_PATH .. "/lspinstall/html/vscode-html/html-language-features/server/dist/node/htmlServerMain.js", + "--stdio", + }, + on_attach = require("lsp").common_on_attach, + capabilities = capabilities, } -vim.cmd("setl ts=2 sw=2") +vim.cmd "setl ts=2 sw=2" diff --git a/ftplugin/java.lua b/ftplugin/java.lua index 0b151b66..00ca0091 100644 --- a/ftplugin/java.lua +++ b/ftplugin/java.lua @@ -1,4 +1,4 @@ -local util = require 'lspconfig/util' +local util = require "lspconfig/util" -- In Vimscript -- augroup lsp -- au! @@ -20,17 +20,17 @@ local util = require 'lspconfig/util' -- }; local on_attach = function(client, bufr) - -- require('jdtls').setup_dap() - require'lsp'.common_on_attach(client, bufr) + -- require('jdtls').setup_dap() + require("lsp").common_on_attach(client, bufr) end -require'lspconfig'.jdtls.setup { - on_attach = on_attach, - cmd = {DATA_PATH .. "/lspinstall/java/jdtls.sh"}, - filetypes = { "java" }, - root_dir = util.root_pattern({'.git', 'build.gradle', 'pom.xml'}), - -- init_options = {bundles = bundles} - -- on_attach = require'lsp'.common_on_attach +require("lspconfig").jdtls.setup { + on_attach = on_attach, + cmd = { DATA_PATH .. "/lspinstall/java/jdtls.sh" }, + filetypes = { "java" }, + root_dir = util.root_pattern { ".git", "build.gradle", "pom.xml" }, + -- init_options = {bundles = bundles} + -- on_attach = require'lsp'.common_on_attach } -- require('jdtls').start_or_attach({ @@ -41,10 +41,10 @@ require'lspconfig'.jdtls.setup { -- }) -- TODO setup autoformat stuff later - -- _java = { - -- -- {'FileType', 'java', 'luafile '..CONFIG_PATH..'/lua/lsp/java-ls.lua'}, - -- { - -- 'FileType', 'java', - -- 'nnoremap ca lua require(\'jdtls\').code_action()' - -- } - -- } +-- _java = { +-- -- {'FileType', 'java', 'luafile '..CONFIG_PATH..'/lua/lsp/java-ls.lua'}, +-- { +-- 'FileType', 'java', +-- 'nnoremap ca lua require(\'jdtls\').code_action()' +-- } +-- } diff --git a/ftplugin/javascript.lua b/ftplugin/javascript.lua index 16254da3..1c4004c2 100644 --- a/ftplugin/javascript.lua +++ b/ftplugin/javascript.lua @@ -7,64 +7,67 @@ -- require'completion'.on_attach(client) -- require'illuminate'.on_attach(client) -- end -require'lspconfig'.tsserver.setup { - cmd = { - DATA_PATH .. - "/lspinstall/typescript/node_modules/.bin/typescript-language-server", - "--stdio" - }, - filetypes = { - "javascript", "javascriptreact", "javascript.jsx", "typescript", - "typescriptreact", "typescript.tsx" - }, - on_attach = require'lsp'.tsserver_on_attach, - -- This makes sure tsserver is not used for formatting (I prefer prettier) - -- on_attach = require'lsp'.common_on_attach, - root_dir = require('lspconfig/util').root_pattern("package.json", - "tsconfig.json", - "jsconfig.json", ".git"), - settings = {documentFormatting = false}, - handlers = { - ["textDocument/publishDiagnostics"] = vim.lsp.with( - vim.lsp.diagnostic.on_publish_diagnostics, { - virtual_text = O.lang.tsserver.diagnostics.virtual_text, - signs = O.lang.tsserver.diagnostics.signs, - underline = O.lang.tsserver.diagnostics.underline, - update_in_insert = true - - }) - } +require("lspconfig").tsserver.setup { + cmd = { + DATA_PATH .. "/lspinstall/typescript/node_modules/.bin/typescript-language-server", + "--stdio", + }, + filetypes = { + "javascript", + "javascriptreact", + "javascript.jsx", + "typescript", + "typescriptreact", + "typescript.tsx", + }, + on_attach = require("lsp").tsserver_on_attach, + -- This makes sure tsserver is not used for formatting (I prefer prettier) + -- on_attach = require'lsp'.common_on_attach, + root_dir = require("lspconfig/util").root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git"), + settings = { documentFormatting = false }, + handlers = { + ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { + virtual_text = O.lang.tsserver.diagnostics.virtual_text, + signs = O.lang.tsserver.diagnostics.signs, + underline = O.lang.tsserver.diagnostics.underline, + update_in_insert = true, + }), + }, } -require'lsp.ts-fmt-lint'.setup() +require("lsp.ts-fmt-lint").setup() if O.lang.tsserver.autoformat then - require('lv-utils').define_augroups({ - _javascript_autoformat = { - { + require("lv-utils").define_augroups { + _javascript_autoformat = { + { - 'BufWritePre', '*.js', - 'lua vim.lsp.buf.formatting_sync(nil, 1000)' - } - }, - _javascriptreact_autoformat = { - { - 'BufWritePre', '*.jsx', - 'lua vim.lsp.buf.formatting_sync(nil, 1000)' - } - }, - _typescript_autoformat = { - { - 'BufWritePre', '*.ts', - 'lua vim.lsp.buf.formatting_sync(nil, 1000)' - } - }, - _typescriptreact_autoformat = { - { - 'BufWritePre', '*.tsx', - 'lua vim.lsp.buf.formatting_sync(nil, 1000)' - } - } - }) + "BufWritePre", + "*.js", + "lua vim.lsp.buf.formatting_sync(nil, 1000)", + }, + }, + _javascriptreact_autoformat = { + { + "BufWritePre", + "*.jsx", + "lua vim.lsp.buf.formatting_sync(nil, 1000)", + }, + }, + _typescript_autoformat = { + { + "BufWritePre", + "*.ts", + "lua vim.lsp.buf.formatting_sync(nil, 1000)", + }, + }, + _typescriptreact_autoformat = { + { + "BufWritePre", + "*.tsx", + "lua vim.lsp.buf.formatting_sync(nil, 1000)", + }, + }, + } end -vim.cmd("setl ts=2 sw=2") +vim.cmd "setl ts=2 sw=2" diff --git a/ftplugin/javascriptreact.lua b/ftplugin/javascriptreact.lua index 16254da3..1c4004c2 100644 --- a/ftplugin/javascriptreact.lua +++ b/ftplugin/javascriptreact.lua @@ -7,64 +7,67 @@ -- require'completion'.on_attach(client) -- require'illuminate'.on_attach(client) -- end -require'lspconfig'.tsserver.setup { - cmd = { - DATA_PATH .. - "/lspinstall/typescript/node_modules/.bin/typescript-language-server", - "--stdio" - }, - filetypes = { - "javascript", "javascriptreact", "javascript.jsx", "typescript", - "typescriptreact", "typescript.tsx" - }, - on_attach = require'lsp'.tsserver_on_attach, - -- This makes sure tsserver is not used for formatting (I prefer prettier) - -- on_attach = require'lsp'.common_on_attach, - root_dir = require('lspconfig/util').root_pattern("package.json", - "tsconfig.json", - "jsconfig.json", ".git"), - settings = {documentFormatting = false}, - handlers = { - ["textDocument/publishDiagnostics"] = vim.lsp.with( - vim.lsp.diagnostic.on_publish_diagnostics, { - virtual_text = O.lang.tsserver.diagnostics.virtual_text, - signs = O.lang.tsserver.diagnostics.signs, - underline = O.lang.tsserver.diagnostics.underline, - update_in_insert = true - - }) - } +require("lspconfig").tsserver.setup { + cmd = { + DATA_PATH .. "/lspinstall/typescript/node_modules/.bin/typescript-language-server", + "--stdio", + }, + filetypes = { + "javascript", + "javascriptreact", + "javascript.jsx", + "typescript", + "typescriptreact", + "typescript.tsx", + }, + on_attach = require("lsp").tsserver_on_attach, + -- This makes sure tsserver is not used for formatting (I prefer prettier) + -- on_attach = require'lsp'.common_on_attach, + root_dir = require("lspconfig/util").root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git"), + settings = { documentFormatting = false }, + handlers = { + ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { + virtual_text = O.lang.tsserver.diagnostics.virtual_text, + signs = O.lang.tsserver.diagnostics.signs, + underline = O.lang.tsserver.diagnostics.underline, + update_in_insert = true, + }), + }, } -require'lsp.ts-fmt-lint'.setup() +require("lsp.ts-fmt-lint").setup() if O.lang.tsserver.autoformat then - require('lv-utils').define_augroups({ - _javascript_autoformat = { - { + require("lv-utils").define_augroups { + _javascript_autoformat = { + { - 'BufWritePre', '*.js', - 'lua vim.lsp.buf.formatting_sync(nil, 1000)' - } - }, - _javascriptreact_autoformat = { - { - 'BufWritePre', '*.jsx', - 'lua vim.lsp.buf.formatting_sync(nil, 1000)' - } - }, - _typescript_autoformat = { - { - 'BufWritePre', '*.ts', - 'lua vim.lsp.buf.formatting_sync(nil, 1000)' - } - }, - _typescriptreact_autoformat = { - { - 'BufWritePre', '*.tsx', - 'lua vim.lsp.buf.formatting_sync(nil, 1000)' - } - } - }) + "BufWritePre", + "*.js", + "lua vim.lsp.buf.formatting_sync(nil, 1000)", + }, + }, + _javascriptreact_autoformat = { + { + "BufWritePre", + "*.jsx", + "lua vim.lsp.buf.formatting_sync(nil, 1000)", + }, + }, + _typescript_autoformat = { + { + "BufWritePre", + "*.ts", + "lua vim.lsp.buf.formatting_sync(nil, 1000)", + }, + }, + _typescriptreact_autoformat = { + { + "BufWritePre", + "*.tsx", + "lua vim.lsp.buf.formatting_sync(nil, 1000)", + }, + }, + } end -vim.cmd("setl ts=2 sw=2") +vim.cmd "setl ts=2 sw=2" diff --git a/ftplugin/json.lua b/ftplugin/json.lua index 3a565095..da0c9ff2 100644 --- a/ftplugin/json.lua +++ b/ftplugin/json.lua @@ -1,28 +1,29 @@ -- npm install -g vscode-json-languageserver -require'lspconfig'.jsonls.setup { - cmd = { - "node", DATA_PATH .. - "/lspinstall/json/vscode-json/json-language-features/server/dist/node/jsonServerMain.js", - "--stdio" - }, - on_attach = require'lsp'.common_on_attach, +require("lspconfig").jsonls.setup { + cmd = { + "node", + DATA_PATH .. "/lspinstall/json/vscode-json/json-language-features/server/dist/node/jsonServerMain.js", + "--stdio", + }, + on_attach = require("lsp").common_on_attach, - commands = { - Format = { - function() - vim.lsp.buf.range_formatting({}, {0, 0}, {vim.fn.line("$"), 0}) - end - } - } + commands = { + Format = { + function() + vim.lsp.buf.range_formatting({}, { 0, 0 }, { vim.fn.line "$", 0 }) + end, + }, + }, } if O.lang.json.autoformat then - require('lv-utils').define_augroups({ - _json_format = { - { - 'BufWritePre', '*.json', - 'lua vim.lsp.buf.formatting_sync(nil, 1000)' - } - } - }) + require("lv-utils").define_augroups { + _json_format = { + { + "BufWritePre", + "*.json", + "lua vim.lsp.buf.formatting_sync(nil, 1000)", + }, + }, + } end diff --git a/ftplugin/kotlin.lua b/ftplugin/kotlin.lua index fcbb736b..dbd800b9 100644 --- a/ftplugin/kotlin.lua +++ b/ftplugin/kotlin.lua @@ -6,31 +6,29 @@ --- https://github.com/udalov/kotlin-vim (recommended) --- Note that there is no LICENSE specified yet. -local util = require 'lspconfig/util' +local util = require "lspconfig/util" local bin_name = DATA_PATH .. "/lspinstall/kotlin/server/bin/kotlin-language-server" -if vim.fn.has('win32') == 1 then - bin_name = bin_name..".bat" +if vim.fn.has "win32" == 1 then + bin_name = bin_name .. ".bat" end local root_files = { - 'settings.gradle', -- Gradle (multi-project) - 'settings.gradle.kts', -- Gradle (multi-project) - 'build.xml', -- Ant - 'pom.xml', -- Maven + "settings.gradle", -- Gradle (multi-project) + "settings.gradle.kts", -- Gradle (multi-project) + "build.xml", -- Ant + "pom.xml", -- Maven } local fallback_root_files = { - 'build.gradle', -- Gradle - 'build.gradle.kts', -- Gradle + "build.gradle", -- Gradle + "build.gradle.kts", -- Gradle } -require'lspconfig'.kotlin_language_server.setup { - cmd = {bin_name}, - on_attach = require'lsp'.common_on_attach, - root_dir = function(fname) - return util.root_pattern(unpack(root_files))(fname) or - util.root_pattern(unpack(fallback_root_files))(fname) - end +require("lspconfig").kotlin_language_server.setup { + cmd = { bin_name }, + on_attach = require("lsp").common_on_attach, + root_dir = function(fname) + return util.root_pattern(unpack(root_files))(fname) or util.root_pattern(unpack(fallback_root_files))(fname) + end, } - diff --git a/ftplugin/lua.lua b/ftplugin/lua.lua index bd541177..f3c3ac50 100644 --- a/ftplugin/lua.lua +++ b/ftplugin/lua.lua @@ -2,71 +2,72 @@ local sumneko_root_path = DATA_PATH .. "/lspinstall/lua" local sumneko_binary = sumneko_root_path .. "/sumneko-lua-language-server" -require'lspconfig'.sumneko_lua.setup { - cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"}, - on_attach = require'lsp'.common_on_attach, - settings = { - Lua = { - runtime = { - -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) - version = 'LuaJIT', - -- Setup your lua path - path = vim.split(package.path, ';') - }, - diagnostics = { - -- Get the language server to recognize the `vim` global - globals = {'vim'} - }, - workspace = { - -- Make the server aware of Neovim runtime files - library = { - [vim.fn.expand('$VIMRUNTIME/lua')] = true, - [vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true - }, - maxPreload = 100000, - preloadFileSize = 1000 - } - } - } +require("lspconfig").sumneko_lua.setup { + cmd = { sumneko_binary, "-E", sumneko_root_path .. "/main.lua" }, + on_attach = require("lsp").common_on_attach, + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + version = "LuaJIT", + -- Setup your lua path + path = vim.split(package.path, ";"), + }, + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = { "vim" }, + }, + workspace = { + -- Make the server aware of Neovim runtime files + library = { + [vim.fn.expand "$VIMRUNTIME/lua"] = true, + [vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true, + }, + maxPreload = 100000, + preloadFileSize = 1000, + }, + }, + }, } if O.lang.lua.autoformat then - require('lv-utils').define_augroups({ - _lua_autoformat = { - { - 'BufWritePre', '*.lua', - 'lua vim.lsp.buf.formatting_sync(nil, 1000)' - } - } - }) + require("lv-utils").define_augroups { + _lua_autoformat = { + { + "BufWritePre", + "*.lua", + "lua vim.lsp.buf.formatting_sync(nil, 1000)", + }, + }, + } end local lua_arguments = {} local luaFormat = { - formatCommand = "lua-format -i --no-keep-simple-function-one-line --column-limit=80", - formatStdin = true + formatCommand = "lua-format -i --no-keep-simple-function-one-line --column-limit=80", + formatStdin = true, } local lua_fmt = { - formatCommand = "luafmt --indent-count 2 --line-width 120 --stdin", - formatStdin = true + formatCommand = "luafmt --indent-count 2 --line-width 120 --stdin", + formatStdin = true, } -if O.lang.lua.formatter == 'lua-format' then +if O.lang.lua.formatter == "lua-format" then table.insert(lua_arguments, luaFormat) -elseif O.lang.lua.formatter == 'lua-fmt' then +elseif O.lang.lua.formatter == "lua-fmt" then table.insert(lua_arguments, lua_fmt) end -require"lspconfig".efm.setup { - -- init_options = {initializationOptions}, - cmd = {DATA_PATH .. "/lspinstall/efm/efm-langserver"}, - init_options = {documentFormatting = true, codeAction = false}, - filetypes = {"lua"}, - settings = { - rootMarkers = {".git/"}, - languages = { - lua = lua_arguments, - } - } +require("lspconfig").efm.setup { + -- init_options = {initializationOptions}, + cmd = { DATA_PATH .. "/lspinstall/efm/efm-langserver" }, + init_options = { documentFormatting = true, codeAction = false }, + filetypes = { "lua" }, + settings = { + rootMarkers = { ".git/" }, + languages = { + lua = lua_arguments, + }, + }, } diff --git a/ftplugin/php.lua b/ftplugin/php.lua index b571a213..4dc8e9e0 100644 --- a/ftplugin/php.lua +++ b/ftplugin/php.lua @@ -1,25 +1,23 @@ -require'lspconfig'.intelephense.setup { - cmd = { DATA_PATH .. "/lspinstall/php/node_modules/.bin/intelephense", "--stdio" }, - on_attach = require'lsp'.common_on_attach, - handlers = { - ["textDocument/publishDiagnostics"] = vim.lsp.with( - vim.lsp.diagnostic.on_publish_diagnostics, { - virtual_text = O.lang.php.diagnostics.virtual_text, - signs = O.lang.php.diagnostics.signs, - underline = O.lang.php.diagnostics.underline, - update_in_insert = true - - }) +require("lspconfig").intelephense.setup { + cmd = { DATA_PATH .. "/lspinstall/php/node_modules/.bin/intelephense", "--stdio" }, + on_attach = require("lsp").common_on_attach, + handlers = { + ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { + virtual_text = O.lang.php.diagnostics.virtual_text, + signs = O.lang.php.diagnostics.signs, + underline = O.lang.php.diagnostics.underline, + update_in_insert = true, + }), + }, + filetypes = O.lang.php.filetypes, + settings = { + intelephense = { + format = { + braces = O.lang.php.format.braces, + }, + environment = { + phpVersion = O.lang.php.environment.php_version, + }, }, - filetypes = O.lang.php.filetypes, - settings = { - intelephense = { - format = { - braces = O.lang.php.format.braces - }, - environment = { - phpVersion = O.lang.php.environment.php_version - }, - } - }; + }, } diff --git a/ftplugin/python.lua b/ftplugin/python.lua index 23e54880..abb75e2a 100644 --- a/ftplugin/python.lua +++ b/ftplugin/python.lua @@ -2,86 +2,76 @@ local python_arguments = {} -- TODO replace with path argument local flake8 = { - LintCommand = "flake8 --ignore=E501 --stdin-display-name ${INPUT} -", - lintStdin = true, - lintFormats = {"%f:%l:%c: %m"} + LintCommand = "flake8 --ignore=E501 --stdin-display-name ${INPUT} -", + lintStdin = true, + lintFormats = { "%f:%l:%c: %m" }, } -local isort = {formatCommand = "isort --quiet -", formatStdin = true} +local isort = { formatCommand = "isort --quiet -", formatStdin = true } -local yapf = {formatCommand = "yapf --quiet", formatStdin = true} -local black = {formatCommand = "black --quiet -", formatStdin = true} +local yapf = { formatCommand = "yapf --quiet", formatStdin = true } +local black = { formatCommand = "black --quiet -", formatStdin = true } -if O.lang.python.linter == 'flake8' then table.insert(python_arguments, flake8) end - -if O.lang.python.isort then table.insert(python_arguments, isort) end - -if O.lang.python.formatter == 'yapf' then - table.insert(python_arguments, yapf) -elseif O.lang.python.formatter == 'black' then - table.insert(python_arguments, black) +if O.lang.python.linter == "flake8" then + table.insert(python_arguments, flake8) end -require"lspconfig".efm.setup { - -- init_options = {initializationOptions}, - cmd = {DATA_PATH .. "/lspinstall/efm/efm-langserver"}, - init_options = {documentFormatting = true, codeAction = false}, - filetypes = {"python"}, - settings = { - rootMarkers = {".git/", "requirements.txt"}, - languages = { - python = python_arguments, - } - } +if O.lang.python.isort then + table.insert(python_arguments, isort) +end + +if O.lang.python.formatter == "yapf" then + table.insert(python_arguments, yapf) +elseif O.lang.python.formatter == "black" then + table.insert(python_arguments, black) +end + +require("lspconfig").efm.setup { + -- init_options = {initializationOptions}, + cmd = { DATA_PATH .. "/lspinstall/efm/efm-langserver" }, + init_options = { documentFormatting = true, codeAction = false }, + filetypes = { "python" }, + settings = { + rootMarkers = { ".git/", "requirements.txt" }, + languages = { + python = python_arguments, + }, + }, } - - - - - - - - - - - - -- npm i -g pyright -require'lspconfig'.pyright.setup { - cmd = { - DATA_PATH .. "/lspinstall/python/node_modules/.bin/pyright-langserver", - "--stdio" +require("lspconfig").pyright.setup { + cmd = { + DATA_PATH .. "/lspinstall/python/node_modules/.bin/pyright-langserver", + "--stdio", + }, + on_attach = require("lsp").common_on_attach, + handlers = { + ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { + virtual_text = O.lang.python.diagnostics.virtual_text, + signs = O.lang.python.diagnostics.signs, + underline = O.lang.python.diagnostics.underline, + update_in_insert = true, + }), + }, + settings = { + python = { + analysis = { + typeCheckingMode = O.lang.python.analysis.type_checking, + autoSearchPaths = O.lang.python.analysis.auto_search_paths, + useLibraryCodeForTypes = O.lang.python.analysis.use_library_code_types, + }, }, - on_attach = require'lsp'.common_on_attach, - handlers = { - ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic - .on_publish_diagnostics, - { - virtual_text = O.lang.python.diagnostics.virtual_text, - signs = O.lang.python.diagnostics.signs, - underline = O.lang.python.diagnostics.underline, - update_in_insert = true - }) - }, - settings = { - python = { - analysis = { - typeCheckingMode = O.lang.python.analysis.type_checking, - autoSearchPaths = O.lang.python.analysis.auto_search_paths, - useLibraryCodeForTypes = O.lang.python.analysis - .use_library_code_types - } - } - } + }, } if O.lang.python.autoformat then - require('lv-utils').define_augroups({ - _python_autoformat = { - { - 'BufWritePre', '*.py', - 'lua vim.lsp.buf.formatting_sync(nil, 1000)' - } - } - }) + require("lv-utils").define_augroups { + _python_autoformat = { + { + "BufWritePre", + "*.py", + "lua vim.lsp.buf.formatting_sync(nil, 1000)", + }, + }, + } end diff --git a/ftplugin/ruby.lua b/ftplugin/ruby.lua index 4f2c20f8..0cff96ff 100644 --- a/ftplugin/ruby.lua +++ b/ftplugin/ruby.lua @@ -1,24 +1,22 @@ -- If you are using rvm, make sure to change below configuration -require'lspconfig'.solargraph.setup { - cmd = {DATA_PATH .. "/lspinstall/ruby/solargraph/solargraph", "stdio"}, - on_attach = require'lsp'.common_on_attach, - handlers = { - ["textDocument/publishDiagnostics"] = vim.lsp.with( - vim.lsp.diagnostic.on_publish_diagnostics, { - virtual_text = O.lang.ruby.diagnostics.virtual_text, - signs = O.lang.ruby.diagnostics.signs, - underline = O.lang.ruby.diagnostics.underline, - update_in_insert = true - - }) - }, - filetypes = O.lang.ruby.filetypes +require("lspconfig").solargraph.setup { + cmd = { DATA_PATH .. "/lspinstall/ruby/solargraph/solargraph", "stdio" }, + on_attach = require("lsp").common_on_attach, + handlers = { + ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { + virtual_text = O.lang.ruby.diagnostics.virtual_text, + signs = O.lang.ruby.diagnostics.signs, + underline = O.lang.ruby.diagnostics.underline, + update_in_insert = true, + }), + }, + filetypes = O.lang.ruby.filetypes, } if O.lang.ruby.autoformat then - require('lv-utils').define_augroups({ - _ruby_format = { - {'BufWritePre', '*.rb', 'lua vim.lsp.buf.formatting_sync(nil,1000)'} - } - }) + require("lv-utils").define_augroups { + _ruby_format = { + { "BufWritePre", "*.rb", "lua vim.lsp.buf.formatting_sync(nil,1000)" }, + }, + } end diff --git a/ftplugin/rust.lua b/ftplugin/rust.lua index 2fddb982..34b211d6 100644 --- a/ftplugin/rust.lua +++ b/ftplugin/rust.lua @@ -1,99 +1,101 @@ if O.lang.rust.rust_tools.active then - local opts = { - tools = { -- rust-tools options - -- automatically set inlay hints (type hints) - -- There is an issue due to which the hints are not applied on the first - -- opened file. For now, write to the file to trigger a reapplication of - -- the hints or just run :RustSetInlayHints. - -- default: true - autoSetHints = true, + local opts = { + tools = { -- rust-tools options + -- automatically set inlay hints (type hints) + -- There is an issue due to which the hints are not applied on the first + -- opened file. For now, write to the file to trigger a reapplication of + -- the hints or just run :RustSetInlayHints. + -- default: true + autoSetHints = true, - -- whether to show hover actions inside the hover window - -- this overrides the default hover handler - -- default: true - hover_with_actions = true, + -- whether to show hover actions inside the hover window + -- this overrides the default hover handler + -- default: true + hover_with_actions = true, - runnables = { - -- whether to use telescope for selection menu or not - -- default: true - use_telescope = true + runnables = { + -- whether to use telescope for selection menu or not + -- default: true + use_telescope = true, - -- rest of the opts are forwarded to telescope - }, + -- rest of the opts are forwarded to telescope + }, - inlay_hints = { - -- wheter to show parameter hints with the inlay hints or not - -- default: true - show_parameter_hints = true, + inlay_hints = { + -- wheter to show parameter hints with the inlay hints or not + -- default: true + show_parameter_hints = true, - -- prefix for parameter hints - -- default: "<-" - parameter_hints_prefix = "<-", + -- prefix for parameter hints + -- default: "<-" + parameter_hints_prefix = "<-", - -- prefix for all the other hints (type, chaining) - -- default: "=>" - other_hints_prefix = "=>", + -- prefix for all the other hints (type, chaining) + -- default: "=>" + other_hints_prefix = "=>", - -- whether to align to the lenght of the longest line in the file - max_len_align = false, + -- whether to align to the lenght of the longest line in the file + max_len_align = false, - -- padding from the left if max_len_align is true - max_len_align_padding = 1, + -- padding from the left if max_len_align is true + max_len_align_padding = 1, - -- whether to align to the extreme right or not - right_align = false, + -- whether to align to the extreme right or not + right_align = false, - -- padding from the right if right_align is true - right_align_padding = 7 - }, + -- padding from the right if right_align is true + right_align_padding = 7, + }, - hover_actions = { - -- the border that is used for the hover window - -- see vim.api.nvim_open_win() - border = { - {"╭", "FloatBorder"}, {"─", "FloatBorder"}, - {"╮", "FloatBorder"}, {"│", "FloatBorder"}, - {"╯", "FloatBorder"}, {"─", "FloatBorder"}, - {"╰", "FloatBorder"}, {"│", "FloatBorder"} - } - } + hover_actions = { + -- the border that is used for the hover window + -- see vim.api.nvim_open_win() + border = { + { "╭", "FloatBorder" }, + { "─", "FloatBorder" }, + { "╮", "FloatBorder" }, + { "│", "FloatBorder" }, + { "╯", "FloatBorder" }, + { "─", "FloatBorder" }, + { "╰", "FloatBorder" }, + { "│", "FloatBorder" }, }, + }, + }, - -- all the opts to send to nvim-lspconfig - -- these override the defaults set by rust-tools.nvim - -- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer - server = { - cmd = {DATA_PATH .. "/lspinstall/rust/rust-analyzer"}, - on_attach = require'lsp'.common_on_attach - } -- rust-analyser options - } - require('rust-tools').setup(opts) - + -- all the opts to send to nvim-lspconfig + -- these override the defaults set by rust-tools.nvim + -- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer + server = { + cmd = { DATA_PATH .. "/lspinstall/rust/rust-analyzer" }, + on_attach = require("lsp").common_on_attach, + }, -- rust-analyser options + } + require("rust-tools").setup(opts) else - - require'lspconfig'.rust_analyzer.setup { - cmd = {DATA_PATH .. "/lspinstall/rust/rust-analyzer"}, - on_attach = require'lsp'.common_on_attach, - filetypes = {"rust"}, - root_dir = require'lspconfig.util'.root_pattern("Cargo.toml", - "rust-project.json") - } - + require("lspconfig").rust_analyzer.setup { + cmd = { DATA_PATH .. "/lspinstall/rust/rust-analyzer" }, + on_attach = require("lsp").common_on_attach, + filetypes = { "rust" }, + root_dir = require("lspconfig.util").root_pattern("Cargo.toml", "rust-project.json"), + } end -- TODO fix these mappings -vim.api.nvim_exec([[ +vim.api.nvim_exec( + [[ autocmd Filetype rust nnoremap lm RustExpandMacro autocmd Filetype rust nnoremap lH RustToggleInlayHints autocmd Filetype rust nnoremap le RustRunnables autocmd Filetype rust nnoremap lh RustHoverActions - ]], true) + ]], + true +) if O.lang.rust.autoformat then - require('lv-utils').define_augroups({ - _rust_format = { - {'BufWritePre', '*.rs', 'lua vim.lsp.buf.formatting_sync(nil,1000)'} - } - }) + require("lv-utils").define_augroups { + _rust_format = { + { "BufWritePre", "*.rs", "lua vim.lsp.buf.formatting_sync(nil,1000)" }, + }, + } end - diff --git a/ftplugin/sh.lua b/ftplugin/sh.lua index 7d9312f6..fa8f0785 100644 --- a/ftplugin/sh.lua +++ b/ftplugin/sh.lua @@ -1,33 +1,37 @@ -- npm i -g bash-language-server -require'lspconfig'.bashls.setup { - cmd = {DATA_PATH .. "/lspinstall/bash/node_modules/.bin/bash-language-server", "start"}, - on_attach = require'lsp'.common_on_attach, - filetypes = { "sh", "zsh" } +require("lspconfig").bashls.setup { + cmd = { DATA_PATH .. "/lspinstall/bash/node_modules/.bin/bash-language-server", "start" }, + on_attach = require("lsp").common_on_attach, + filetypes = { "sh", "zsh" }, } -- sh local sh_arguments = {} -local shfmt = {formatCommand = 'shfmt -ci -s -bn', formatStdin = true} +local shfmt = { formatCommand = "shfmt -ci -s -bn", formatStdin = true } local shellcheck = { - LintCommand = 'shellcheck -f gcc -x', - lintFormats = {'%f:%l:%c: %trror: %m', '%f:%l:%c: %tarning: %m', '%f:%l:%c: %tote: %m'} + LintCommand = "shellcheck -f gcc -x", + lintFormats = { "%f:%l:%c: %trror: %m", "%f:%l:%c: %tarning: %m", "%f:%l:%c: %tote: %m" }, } -if O.lang.sh.formatter == 'shfmt' then table.insert(sh_arguments, shfmt) end +if O.lang.sh.formatter == "shfmt" then + table.insert(sh_arguments, shfmt) +end -if O.lang.sh.linter == 'shellcheck' then table.insert(sh_arguments, shellcheck) end +if O.lang.sh.linter == "shellcheck" then + table.insert(sh_arguments, shellcheck) +end -require"lspconfig".efm.setup { - -- init_options = {initializationOptions}, - cmd = {DATA_PATH .. "/lspinstall/efm/efm-langserver"}, - init_options = {documentFormatting = true, codeAction = false}, - filetypes = {"sh"}, - settings = { - rootMarkers = {".git/"}, - languages = { - sh = sh_arguments, - } - } +require("lspconfig").efm.setup { + -- init_options = {initializationOptions}, + cmd = { DATA_PATH .. "/lspinstall/efm/efm-langserver" }, + init_options = { documentFormatting = true, codeAction = false }, + filetypes = { "sh" }, + settings = { + rootMarkers = { ".git/" }, + languages = { + sh = sh_arguments, + }, + }, } diff --git a/ftplugin/tex.lua b/ftplugin/tex.lua index 179c143c..71c484f7 100644 --- a/ftplugin/tex.lua +++ b/ftplugin/tex.lua @@ -1,4 +1,4 @@ -require'lspconfig'.texlab.setup{ - cmd = {DATA_PATH .. "/lspinstall/latex/texlab"}, - on_attach = require'lsp'.common_on_attach +require("lspconfig").texlab.setup { + cmd = { DATA_PATH .. "/lspinstall/latex/texlab" }, + on_attach = require("lsp").common_on_attach, } diff --git a/ftplugin/tf.lua b/ftplugin/tf.lua index a2e751a4..d46affd5 100644 --- a/ftplugin/tf.lua +++ b/ftplugin/tf.lua @@ -1,5 +1,5 @@ -require'lspconfig'.terraformls.setup{ - cmd = {DATA_PATH .. "/lspinstall/terraform/terraform-ls", "serve"}, - on_attach = require'lsp'.common_on_attach, - filetypes = { "tf", "terraform", "hcl" } +require("lspconfig").terraformls.setup { + cmd = { DATA_PATH .. "/lspinstall/terraform/terraform-ls", "serve" }, + on_attach = require("lsp").common_on_attach, + filetypes = { "tf", "terraform", "hcl" }, } diff --git a/ftplugin/typescript.lua b/ftplugin/typescript.lua index 16254da3..1c4004c2 100644 --- a/ftplugin/typescript.lua +++ b/ftplugin/typescript.lua @@ -7,64 +7,67 @@ -- require'completion'.on_attach(client) -- require'illuminate'.on_attach(client) -- end -require'lspconfig'.tsserver.setup { - cmd = { - DATA_PATH .. - "/lspinstall/typescript/node_modules/.bin/typescript-language-server", - "--stdio" - }, - filetypes = { - "javascript", "javascriptreact", "javascript.jsx", "typescript", - "typescriptreact", "typescript.tsx" - }, - on_attach = require'lsp'.tsserver_on_attach, - -- This makes sure tsserver is not used for formatting (I prefer prettier) - -- on_attach = require'lsp'.common_on_attach, - root_dir = require('lspconfig/util').root_pattern("package.json", - "tsconfig.json", - "jsconfig.json", ".git"), - settings = {documentFormatting = false}, - handlers = { - ["textDocument/publishDiagnostics"] = vim.lsp.with( - vim.lsp.diagnostic.on_publish_diagnostics, { - virtual_text = O.lang.tsserver.diagnostics.virtual_text, - signs = O.lang.tsserver.diagnostics.signs, - underline = O.lang.tsserver.diagnostics.underline, - update_in_insert = true - - }) - } +require("lspconfig").tsserver.setup { + cmd = { + DATA_PATH .. "/lspinstall/typescript/node_modules/.bin/typescript-language-server", + "--stdio", + }, + filetypes = { + "javascript", + "javascriptreact", + "javascript.jsx", + "typescript", + "typescriptreact", + "typescript.tsx", + }, + on_attach = require("lsp").tsserver_on_attach, + -- This makes sure tsserver is not used for formatting (I prefer prettier) + -- on_attach = require'lsp'.common_on_attach, + root_dir = require("lspconfig/util").root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git"), + settings = { documentFormatting = false }, + handlers = { + ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { + virtual_text = O.lang.tsserver.diagnostics.virtual_text, + signs = O.lang.tsserver.diagnostics.signs, + underline = O.lang.tsserver.diagnostics.underline, + update_in_insert = true, + }), + }, } -require'lsp.ts-fmt-lint'.setup() +require("lsp.ts-fmt-lint").setup() if O.lang.tsserver.autoformat then - require('lv-utils').define_augroups({ - _javascript_autoformat = { - { + require("lv-utils").define_augroups { + _javascript_autoformat = { + { - 'BufWritePre', '*.js', - 'lua vim.lsp.buf.formatting_sync(nil, 1000)' - } - }, - _javascriptreact_autoformat = { - { - 'BufWritePre', '*.jsx', - 'lua vim.lsp.buf.formatting_sync(nil, 1000)' - } - }, - _typescript_autoformat = { - { - 'BufWritePre', '*.ts', - 'lua vim.lsp.buf.formatting_sync(nil, 1000)' - } - }, - _typescriptreact_autoformat = { - { - 'BufWritePre', '*.tsx', - 'lua vim.lsp.buf.formatting_sync(nil, 1000)' - } - } - }) + "BufWritePre", + "*.js", + "lua vim.lsp.buf.formatting_sync(nil, 1000)", + }, + }, + _javascriptreact_autoformat = { + { + "BufWritePre", + "*.jsx", + "lua vim.lsp.buf.formatting_sync(nil, 1000)", + }, + }, + _typescript_autoformat = { + { + "BufWritePre", + "*.ts", + "lua vim.lsp.buf.formatting_sync(nil, 1000)", + }, + }, + _typescriptreact_autoformat = { + { + "BufWritePre", + "*.tsx", + "lua vim.lsp.buf.formatting_sync(nil, 1000)", + }, + }, + } end -vim.cmd("setl ts=2 sw=2") +vim.cmd "setl ts=2 sw=2" diff --git a/ftplugin/typescriptreact.lua b/ftplugin/typescriptreact.lua index 16254da3..1c4004c2 100644 --- a/ftplugin/typescriptreact.lua +++ b/ftplugin/typescriptreact.lua @@ -7,64 +7,67 @@ -- require'completion'.on_attach(client) -- require'illuminate'.on_attach(client) -- end -require'lspconfig'.tsserver.setup { - cmd = { - DATA_PATH .. - "/lspinstall/typescript/node_modules/.bin/typescript-language-server", - "--stdio" - }, - filetypes = { - "javascript", "javascriptreact", "javascript.jsx", "typescript", - "typescriptreact", "typescript.tsx" - }, - on_attach = require'lsp'.tsserver_on_attach, - -- This makes sure tsserver is not used for formatting (I prefer prettier) - -- on_attach = require'lsp'.common_on_attach, - root_dir = require('lspconfig/util').root_pattern("package.json", - "tsconfig.json", - "jsconfig.json", ".git"), - settings = {documentFormatting = false}, - handlers = { - ["textDocument/publishDiagnostics"] = vim.lsp.with( - vim.lsp.diagnostic.on_publish_diagnostics, { - virtual_text = O.lang.tsserver.diagnostics.virtual_text, - signs = O.lang.tsserver.diagnostics.signs, - underline = O.lang.tsserver.diagnostics.underline, - update_in_insert = true - - }) - } +require("lspconfig").tsserver.setup { + cmd = { + DATA_PATH .. "/lspinstall/typescript/node_modules/.bin/typescript-language-server", + "--stdio", + }, + filetypes = { + "javascript", + "javascriptreact", + "javascript.jsx", + "typescript", + "typescriptreact", + "typescript.tsx", + }, + on_attach = require("lsp").tsserver_on_attach, + -- This makes sure tsserver is not used for formatting (I prefer prettier) + -- on_attach = require'lsp'.common_on_attach, + root_dir = require("lspconfig/util").root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git"), + settings = { documentFormatting = false }, + handlers = { + ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { + virtual_text = O.lang.tsserver.diagnostics.virtual_text, + signs = O.lang.tsserver.diagnostics.signs, + underline = O.lang.tsserver.diagnostics.underline, + update_in_insert = true, + }), + }, } -require'lsp.ts-fmt-lint'.setup() +require("lsp.ts-fmt-lint").setup() if O.lang.tsserver.autoformat then - require('lv-utils').define_augroups({ - _javascript_autoformat = { - { + require("lv-utils").define_augroups { + _javascript_autoformat = { + { - 'BufWritePre', '*.js', - 'lua vim.lsp.buf.formatting_sync(nil, 1000)' - } - }, - _javascriptreact_autoformat = { - { - 'BufWritePre', '*.jsx', - 'lua vim.lsp.buf.formatting_sync(nil, 1000)' - } - }, - _typescript_autoformat = { - { - 'BufWritePre', '*.ts', - 'lua vim.lsp.buf.formatting_sync(nil, 1000)' - } - }, - _typescriptreact_autoformat = { - { - 'BufWritePre', '*.tsx', - 'lua vim.lsp.buf.formatting_sync(nil, 1000)' - } - } - }) + "BufWritePre", + "*.js", + "lua vim.lsp.buf.formatting_sync(nil, 1000)", + }, + }, + _javascriptreact_autoformat = { + { + "BufWritePre", + "*.jsx", + "lua vim.lsp.buf.formatting_sync(nil, 1000)", + }, + }, + _typescript_autoformat = { + { + "BufWritePre", + "*.ts", + "lua vim.lsp.buf.formatting_sync(nil, 1000)", + }, + }, + _typescriptreact_autoformat = { + { + "BufWritePre", + "*.tsx", + "lua vim.lsp.buf.formatting_sync(nil, 1000)", + }, + }, + } end -vim.cmd("setl ts=2 sw=2") +vim.cmd "setl ts=2 sw=2" diff --git a/ftplugin/vim.lua b/ftplugin/vim.lua index 39beb119..449210b9 100644 --- a/ftplugin/vim.lua +++ b/ftplugin/vim.lua @@ -1,5 +1,5 @@ -- npm install -g vim-language-server -require'lspconfig'.vimls.setup { - cmd = {DATA_PATH .. "/lspinstall/vim/node_modules/.bin/vim-language-server", "--stdio"}, - on_attach = require'lsp'.common_on_attach +require("lspconfig").vimls.setup { + cmd = { DATA_PATH .. "/lspinstall/vim/node_modules/.bin/vim-language-server", "--stdio" }, + on_attach = require("lsp").common_on_attach, } diff --git a/ftplugin/vue.lua b/ftplugin/vue.lua index 66fba01e..6787d12f 100644 --- a/ftplugin/vue.lua +++ b/ftplugin/vue.lua @@ -1,5 +1,5 @@ -require('lspconfig').vuels.setup { - cmd = {DATA_PATH .. "/lspinstall/vue/node_modules/.bin/vls", "--stdio"}, - on_attach = require'lsp'.common_on_attach, - root_dir = require('lspconfig').util.root_pattern(".git", ".") +require("lspconfig").vuels.setup { + cmd = { DATA_PATH .. "/lspinstall/vue/node_modules/.bin/vls", "--stdio" }, + on_attach = require("lsp").common_on_attach, + root_dir = require("lspconfig").util.root_pattern(".git", "."), } diff --git a/ftplugin/yaml.lua b/ftplugin/yaml.lua index 7b6f9a25..e2847365 100644 --- a/ftplugin/yaml.lua +++ b/ftplugin/yaml.lua @@ -1,6 +1,6 @@ -- npm install -g yaml-language-server -require'lspconfig'.yamlls.setup{ - cmd = {DATA_PATH .. "/lspinstall/yaml/node_modules/.bin/yaml-language-server", "--stdio"}, - on_attach = require'lsp'.common_on_attach, +require("lspconfig").yamlls.setup { + cmd = { DATA_PATH .. "/lspinstall/yaml/node_modules/.bin/yaml-language-server", "--stdio" }, + on_attach = require("lsp").common_on_attach, } -vim.cmd("setl ts=2 sw=2 ts=2 ai et") +vim.cmd "setl ts=2 sw=2 ts=2 ai et" diff --git a/ftplugin/zig.lua b/ftplugin/zig.lua index 06217ddd..7fc8d3fc 100644 --- a/ftplugin/zig.lua +++ b/ftplugin/zig.lua @@ -1,15 +1,15 @@ -- Because lspinstall don't support zig yet, -- So we need zls preset in global lib --- Further custom install zls in +-- Further custom install zls in -- https://github.com/zigtools/zls/wiki/Downloading-and-Building-ZLS -require'lspconfig'.zls.setup{ - root_dir = require'lspconfig'.util.root_pattern(".git", "build.zig", "zls.json"), - on_attach = require'lsp'.common_on_attach, +require("lspconfig").zls.setup { + root_dir = require("lspconfig").util.root_pattern(".git", "build.zig", "zls.json"), + on_attach = require("lsp").common_on_attach, } -require('lv-utils').define_augroups({ - _zig_autoformat = { - {'BufWritePre', '*.zig', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'}, - {'BufEnter', '*.zig', ':lua vim.api.nvim_buf_set_option(0, "commentstring", "// %s")'} - } -}) -vim.cmd("setl expandtab tabstop=8 softtabstop=4 shiftwidth=4") +require("lv-utils").define_augroups { + _zig_autoformat = { + { "BufWritePre", "*.zig", "lua vim.lsp.buf.formatting_sync(nil, 1000)" }, + { "BufEnter", "*.zig", ':lua vim.api.nvim_buf_set_option(0, "commentstring", "// %s")' }, + }, +} +vim.cmd "setl expandtab tabstop=8 softtabstop=4 shiftwidth=4" diff --git a/ftplugin/zsh.lua b/ftplugin/zsh.lua index 7e99ebd3..a2847f19 100644 --- a/ftplugin/zsh.lua +++ b/ftplugin/zsh.lua @@ -1,40 +1,44 @@ -- npm i -g bash-language-server -require'lspconfig'.bashls.setup { - cmd = {DATA_PATH .. "/lspinstall/bash/node_modules/.bin/bash-language-server", "start"}, - on_attach = require'lsp'.common_on_attach, - filetypes = { "sh", "zsh" } +require("lspconfig").bashls.setup { + cmd = { DATA_PATH .. "/lspinstall/bash/node_modules/.bin/bash-language-server", "start" }, + on_attach = require("lsp").common_on_attach, + filetypes = { "sh", "zsh" }, } -- npm i -g bash-language-server -require'lspconfig'.bashls.setup { - cmd = {DATA_PATH .. "/lspinstall/bash/node_modules/.bin/bash-language-server", "start"}, - on_attach = require'lsp'.common_on_attach, - filetypes = { "sh", "zsh" } +require("lspconfig").bashls.setup { + cmd = { DATA_PATH .. "/lspinstall/bash/node_modules/.bin/bash-language-server", "start" }, + on_attach = require("lsp").common_on_attach, + filetypes = { "sh", "zsh" }, } -- sh local sh_arguments = {} -local shfmt = {formatCommand = 'shfmt -ci -s -bn', formatStdin = true} +local shfmt = { formatCommand = "shfmt -ci -s -bn", formatStdin = true } local shellcheck = { - LintCommand = 'shellcheck -f gcc -x', - lintFormats = {'%f:%l:%c: %trror: %m', '%f:%l:%c: %tarning: %m', '%f:%l:%c: %tote: %m'} + LintCommand = "shellcheck -f gcc -x", + lintFormats = { "%f:%l:%c: %trror: %m", "%f:%l:%c: %tarning: %m", "%f:%l:%c: %tote: %m" }, } -if O.lang.sh.formatter == 'shfmt' then table.insert(sh_arguments, shfmt) end +if O.lang.sh.formatter == "shfmt" then + table.insert(sh_arguments, shfmt) +end -if O.lang.sh.linter == 'shellcheck' then table.insert(sh_arguments, shellcheck) end +if O.lang.sh.linter == "shellcheck" then + table.insert(sh_arguments, shellcheck) +end -require"lspconfig".efm.setup { - -- init_options = {initializationOptions}, - cmd = {DATA_PATH .. "/lspinstall/efm/efm-langserver"}, - init_options = {documentFormatting = true, codeAction = false}, - filetypes = {"zsh"}, - settings = { - rootMarkers = {".git/"}, - languages = { - sh = sh_arguments, - } - } +require("lspconfig").efm.setup { + -- init_options = {initializationOptions}, + cmd = { DATA_PATH .. "/lspinstall/efm/efm-langserver" }, + init_options = { documentFormatting = true, codeAction = false }, + filetypes = { "zsh" }, + settings = { + rootMarkers = { ".git/" }, + languages = { + sh = sh_arguments, + }, + }, } diff --git a/init.lua b/init.lua index 3e6a3b21..8e44e868 100644 --- a/init.lua +++ b/init.lua @@ -1,11 +1,13 @@ -require('default-config') -require('keymappings') -vim.cmd('luafile ' .. CONFIG_PATH .. '/lv-config.lua') -require('settings') -require('plugins') -require('lv-utils') -require('lv-galaxyline') -require('lv-treesitter') -require('lv-which-key') -require('lsp') -if O.lang.emmet.active then require('lsp.emmet-ls') end +require "default-config" +require "keymappings" +vim.cmd("luafile " .. CONFIG_PATH .. "/lv-config.lua") +require "settings" +require "plugins" +require "lv-utils" +require "lv-galaxyline" +require "lv-treesitter" +require "lv-which-key" +require "lsp" +if O.lang.emmet.active then + require "lsp.emmet-ls" +end diff --git a/lua/default-config.lua b/lua/default-config.lua index 0d33fe47..53c92832 100644 --- a/lua/default-config.lua +++ b/lua/default-config.lua @@ -1,280 +1,288 @@ -CONFIG_PATH = vim.fn.stdpath('config') -DATA_PATH = vim.fn.stdpath('data') -CACHE_PATH = vim.fn.stdpath('cache') -TERMINAL = vim.fn.expand('$TERMINAL') +CONFIG_PATH = vim.fn.stdpath "config" +DATA_PATH = vim.fn.stdpath "data" +CACHE_PATH = vim.fn.stdpath "cache" +TERMINAL = vim.fn.expand "$TERMINAL" O = { - auto_close_tree = 0, - auto_complete = true, - colorscheme = 'lunar', - hidden_files = true, - wrap_lines = false, - number = true, - relative_number = true, - cursorline = true, - shell = 'bash', - timeoutlen = 100, - nvim_tree_disable_netrw = 0, - extras = false, - ignore_case = true, - smart_case = true, - lushmode = false, - hl_search = false, - transparent_window = false; - leader_key = "space"; - vnsip_dir = vim.fn.stdpath('config') .. "/snippets", + auto_close_tree = 0, + auto_complete = true, + colorscheme = "lunar", + hidden_files = true, + wrap_lines = false, + number = true, + relative_number = true, + cursorline = true, + shell = "bash", + timeoutlen = 100, + nvim_tree_disable_netrw = 0, + extras = false, + ignore_case = true, + smart_case = true, + lushmode = false, + hl_search = false, + transparent_window = false, + leader_key = "space", + vnsip_dir = vim.fn.stdpath "config" .. "/snippets", - -- @usage pass a table with your desired languages - treesitter = { - ensure_installed = "all", - ignore_install = {"haskell"}, - highlight = {enabled = true}, - rainbow = {enabled = false} + -- @usage pass a table with your desired languages + treesitter = { + ensure_installed = "all", + ignore_install = { "haskell" }, + highlight = { enabled = true }, + rainbow = { enabled = false }, + }, + + database = { save_location = "~/.config/nvcode_db", auto_execute = 1 }, + + plugin = { + hop = { active = false }, + dial = { active = false }, + dashboard = { active = false }, + matchup = { active = false }, + colorizer = { active = false }, + numb = { active = false }, + zen = { active = false }, + ts_playground = { active = false }, + indent_line = { active = false }, + ts_context_commentstring = { active = false }, + symbol_outline = { active = false }, + debug = { active = false }, + bqf = { active = false }, + trouble = { active = false }, + floatterm = { active = false }, + spectre = { active = false }, + lsp_rooter = { active = false }, + markdown_preview = { active = false }, + codi = { active = false }, + telescope_fzy = { active = false }, + sanegx = { active = false }, + snap = { active = false }, + ranger = { active = false }, + todo_comments = { active = false }, + lsp_colors = { active = false }, + git_blame = { active = false }, + gist = { active = false }, + gitlinker = { active = false }, + lazygit = { active = false }, + octo = { active = false }, + lush = { active = false }, + diffview = { active = false }, + bracey = { active = false }, + telescope_project = { active = false }, + dap_install = { active = false }, + tabnine = { active = false }, + }, + + lang = { + python = { + linter = "", + -- @usage can be 'yapf', 'black' + formatter = "", + autoformat = false, + isort = false, + diagnostics = { + virtual_text = { spacing = 0, prefix = "" }, + signs = true, + underline = true, + }, + analysis = { + type_checking = "basic", + auto_search_paths = true, + use_library_code_types = true, + }, }, - - database = {save_location = '~/.config/nvcode_db', auto_execute = 1}, - - plugin = { - hop = {active = false}, - dial = {active = false}, - dashboard = {active = false}, - matchup = {active = false}, - colorizer = {active = false}, - numb = {active = false}, - zen = {active = false}, - ts_playground = {active = false}, - indent_line = {active = false}, - ts_context_commentstring = {active = false}, - symbol_outline = {active = false}, - debug = {active = false}, - bqf = {active = false}, - trouble = {active = false}, - floatterm = {active = false}, - spectre = {active = false}, - lsp_rooter = {active = false}, - markdown_preview = {active = false}, - codi = {active = false}, - telescope_fzy = {active = false}, - sanegx = {active = false}, - snap = {active = false}, - ranger = {active = false}, - todo_comments = {active = false}, - lsp_colors = {active = false}, - git_blame = {active = false}, - gist = {active = false}, - gitlinker = {active = false}, - lazygit = {active = false}, - octo = {active = false}, - lush = {active = false}, - diffview = {active = false}, - bracey = {active = false}, - telescope_project = {active = false}, - dap_install = {active = false}, - tabnine = {active = false} - + dart = { + sdk_path = "/usr/lib/dart/bin/snapshots/analysis_server.dart.snapshot", }, - - lang = { - python = { - linter = '', - -- @usage can be 'yapf', 'black' - formatter = '', - autoformat = false, - isort = false, - diagnostics = { - virtual_text = {spacing = 0, prefix = ""}, - signs = true, - underline = true - }, - analysis = { - type_checking = "basic", - auto_search_paths = true, - use_library_code_types = true - } - }, - dart = { - sdk_path = '/usr/lib/dart/bin/snapshots/analysis_server.dart.snapshot' - }, - lua = { - -- @usage can be 'lua-format' - formatter = '', - autoformat = false, - diagnostics = { - virtual_text = {spacing = 0, prefix = ""}, - signs = true, - underline = true - } - }, - sh = { - -- @usage can be 'shellcheck' - linter = '', - -- @usage can be 'shfmt' - formatter = '', - autoformat = false, - diagnostics = { - virtual_text = {spacing = 0, prefix = ""}, - signs = true, - underline = true - } - }, - tsserver = { - -- @usage can be 'eslint' - linter = '', - -- @usage can be 'prettier' - formatter = '', - autoformat = false, - diagnostics = { - virtual_text = {spacing = 0, prefix = ""}, - signs = true, - underline = true - } - }, - json = { - -- @usage can be 'prettier' - formatter = '', - autoformat = false, - diagnostics = { - virtual_text = {spacing = 0, prefix = ""}, - signs = true, - underline = true - } - }, - tailwindcss = { - filetypes = { - 'html', 'css', 'scss', 'javascript', 'javascriptreact', - 'typescript', 'typescriptreact' - } - }, - clang = { - diagnostics = { - virtual_text = {spacing = 0, prefix = ""}, - signs = true, - underline = true, - }, - cross_file_rename = true, - header_insertion = 'never', - autoformat = false -- update this to true for enabling autoformat - }, - ruby = { - diagnostics = { - virtualtext = {spacing = 0, prefix = ""}, - signs = true, - underline = true - }, - filetypes = {'rb', 'erb', 'rakefile', 'ruby'} - }, - go = {}, - elixir = {}, - vim = {}, - yaml = {}, - terraform = {}, - rust = { - rust_tools = { - active = false - }, - linter = '', - formatter = '', - autoformat = false, - diagnostics = { - virtual_text = {spacing = 0, prefix = ""}, - signs = true, - underline = true - } - }, - svelte = {}, - php = { - format = { - braces = "psr12" - }, - environment = { - php_version = "7.4" - }, - autoformat = false, - diagnostics = { - virtual_text = {spacing = 0, prefix = ""}, - signs = true, - underline = true - }, - filetypes = {'php', 'phtml'} - }, - latex = {}, - kotlin = {}, - html = {}, - elm = {}, - emmet = {active = true}, - graphql = {}, - efm = {}, - docker = {}, - cmake = {}, - java = {}, - css = { - formatter = '', - autoformat = false, - virtual_text = true - } - + lua = { + -- @usage can be 'lua-format' + formatter = "", + autoformat = false, + diagnostics = { + virtual_text = { spacing = 0, prefix = "" }, + signs = true, + underline = true, + }, }, + sh = { + -- @usage can be 'shellcheck' + linter = "", + -- @usage can be 'shfmt' + formatter = "", + autoformat = false, + diagnostics = { + virtual_text = { spacing = 0, prefix = "" }, + signs = true, + underline = true, + }, + }, + tsserver = { + -- @usage can be 'eslint' + linter = "", + -- @usage can be 'prettier' + formatter = "", + autoformat = false, + diagnostics = { + virtual_text = { spacing = 0, prefix = "" }, + signs = true, + underline = true, + }, + }, + json = { + -- @usage can be 'prettier' + formatter = "", + autoformat = false, + diagnostics = { + virtual_text = { spacing = 0, prefix = "" }, + signs = true, + underline = true, + }, + }, + tailwindcss = { + filetypes = { + "html", + "css", + "scss", + "javascript", + "javascriptreact", + "typescript", + "typescriptreact", + }, + }, + clang = { + diagnostics = { + virtual_text = { spacing = 0, prefix = "" }, + signs = true, + underline = true, + }, + cross_file_rename = true, + header_insertion = "never", + autoformat = false, -- update this to true for enabling autoformat + }, + ruby = { + diagnostics = { + virtualtext = { spacing = 0, prefix = "" }, + signs = true, + underline = true, + }, + filetypes = { "rb", "erb", "rakefile", "ruby" }, + }, + go = {}, + elixir = {}, + vim = {}, + yaml = {}, + terraform = {}, + rust = { + rust_tools = { + active = false, + }, + linter = "", + formatter = "", + autoformat = false, + diagnostics = { + virtual_text = { spacing = 0, prefix = "" }, + signs = true, + underline = true, + }, + }, + svelte = {}, + php = { + format = { + braces = "psr12", + }, + environment = { + php_version = "7.4", + }, + autoformat = false, + diagnostics = { + virtual_text = { spacing = 0, prefix = "" }, + signs = true, + underline = true, + }, + filetypes = { "php", "phtml" }, + }, + latex = {}, + kotlin = {}, + html = {}, + elm = {}, + emmet = { active = true }, + graphql = {}, + efm = {}, + docker = {}, + cmake = {}, + java = {}, + css = { + formatter = "", + autoformat = false, + virtual_text = true, + }, + }, - dashboard = { + dashboard = { - custom_header = { - '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⣀⣀⣀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀', - '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣤⣶⣾⠿⠿⠟⠛⠛⠛⠛⠿⠿⣿⣷⣤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀', - '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣾⡿⠋⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠿⣷⣤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀', - '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣤⡿⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⢿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀', - '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠒⠂⠉⠉⠉⠉⢩⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⣷⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀', - '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⡀⠀⠀⠀⠀⠀⢰⣿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀', - '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⠠⡀⠀⠀⢀⣾⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀', - '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢⢀⣸⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀', - '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡧⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀', - '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡇⠀⠈⠁⠒⠤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀', - '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣇⠀⠀⠀⠀⠀⠀⠉⠢⠤⠀⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⡟⠈⠑⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀', - '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠑⠒⠤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⡇⠀⠀⢀⣣⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀', - '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣷⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠀⠀⠒⠢⠤⠄⣀⣀⠀⠀⠀⢠⣿⡟⠀⠀⠀⣺⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀', - '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⠇⠀⠀⠀⠀⠀⣤⡄⠀⠀⢠⣤⡄⠀⢨⣭⣠⣤⣤⣤⡀⠀⠀⢀⣤⣤⣤⣤⡄⠀⠀⠀⣤⣄⣤⣤⣤⠀⠀⣿⣯⠉⠉⣿⡟⠀⠈⢩⣭⣤⣤⠀⠀⠀⠀⣠⣤⣤⣤⣄⣤⣤⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀', - '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⠀⠀⠀⠀⠀⠀⣿⠃⠀⠀⣸⣿⠁⠀⣿⣿⠉⠀⠈⣿⡇⠀⠀⠛⠋⠀⠀⢹⣿⠀⠀⠀⣿⠏⠀⠸⠿⠃⠀⣿⣿⠀⣰⡟⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⠀⣿⡟⢸⣿⡇⢀⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀', - '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⡇⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⣿⡟⠀⢠⣿⡇⠀⠀⢰⣿⡇⠀⣰⣾⠟⠛⠛⣻⡇⠀⠀⢸⡿⠀⠀⠀⠀⠀⠀⢻⣿⢰⣿⠀⠀⠀⠀⠀⠀⣾⡇⠀⠀⠀⢸⣿⠇⢸⣿⠀⢸⡏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀', - '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣧⣤⣤⣤⡄⠀⠘⣿⣤⣤⡤⣿⠇⠀⢸⣿⠁⠀⠀⣼⣿⠀⠀⢿⣿⣤⣤⠔⣿⠃⠀⠀⣾⡇⠀⠀⠀⠀⠀⠀⢸⣿⣿⠋⠀⠀⠀⢠⣤⣤⣿⣥⣤⡄⠀⣼⣿⠀⣸⡏⠀⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀', - '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠉⠁⠀⠀⠈⠉⠉⠀⠉⠀⠀⠈⠉⠀⠀⠀⠉⠉⠀⠀⠀⠉⠉⠁⠈⠉⠀⠀⠀⠉⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠀⠀⠀⠀⠈⠉⠉⠉⠉⠉⠁⠀⠉⠁⠀⠉⠁⠀⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀' - - }, - footer = {'chrisatmachine.com'} - } + custom_header = { + "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⣀⣀⣀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", + "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣤⣶⣾⠿⠿⠟⠛⠛⠛⠛⠿⠿⣿⣷⣤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", + "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣾⡿⠋⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠿⣷⣤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", + "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣤⡿⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⢿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", + "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠒⠂⠉⠉⠉⠉⢩⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⣷⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", + "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⡀⠀⠀⠀⠀⠀⢰⣿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", + "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⠠⡀⠀⠀⢀⣾⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", + "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢⢀⣸⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", + "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡧⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", + "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡇⠀⠈⠁⠒⠤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", + "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣇⠀⠀⠀⠀⠀⠀⠉⠢⠤⠀⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⡟⠈⠑⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", + "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠑⠒⠤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⡇⠀⠀⢀⣣⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", + "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣷⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠀⠀⠒⠢⠤⠄⣀⣀⠀⠀⠀⢠⣿⡟⠀⠀⠀⣺⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", + "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⠇⠀⠀⠀⠀⠀⣤⡄⠀⠀⢠⣤⡄⠀⢨⣭⣠⣤⣤⣤⡀⠀⠀⢀⣤⣤⣤⣤⡄⠀⠀⠀⣤⣄⣤⣤⣤⠀⠀⣿⣯⠉⠉⣿⡟⠀⠈⢩⣭⣤⣤⠀⠀⠀⠀⣠⣤⣤⣤⣄⣤⣤⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", + "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⠀⠀⠀⠀⠀⠀⣿⠃⠀⠀⣸⣿⠁⠀⣿⣿⠉⠀⠈⣿⡇⠀⠀⠛⠋⠀⠀⢹⣿⠀⠀⠀⣿⠏⠀⠸⠿⠃⠀⣿⣿⠀⣰⡟⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⠀⣿⡟⢸⣿⡇⢀⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", + "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⡇⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⣿⡟⠀⢠⣿⡇⠀⠀⢰⣿⡇⠀⣰⣾⠟⠛⠛⣻⡇⠀⠀⢸⡿⠀⠀⠀⠀⠀⠀⢻⣿⢰⣿⠀⠀⠀⠀⠀⠀⣾⡇⠀⠀⠀⢸⣿⠇⢸⣿⠀⢸⡏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", + "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣧⣤⣤⣤⡄⠀⠘⣿⣤⣤⡤⣿⠇⠀⢸⣿⠁⠀⠀⣼⣿⠀⠀⢿⣿⣤⣤⠔⣿⠃⠀⠀⣾⡇⠀⠀⠀⠀⠀⠀⢸⣿⣿⠋⠀⠀⠀⢠⣤⣤⣿⣥⣤⡄⠀⣼⣿⠀⣸⡏⠀⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", + "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠉⠁⠀⠀⠈⠉⠉⠀⠉⠀⠀⠈⠉⠀⠀⠀⠉⠉⠀⠀⠀⠉⠉⠁⠈⠉⠀⠀⠀⠉⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠀⠀⠀⠀⠈⠉⠉⠉⠉⠉⠁⠀⠉⠁⠀⠉⠁⠀⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", + }, + footer = { "chrisatmachine.com" }, + }, } -- TODO find a new home for these autocommands -require('lv-utils').define_augroups({ - _general_settings = { - { - 'TextYankPost', '*', - 'lua require(\'vim.highlight\').on_yank({higroup = \'Search\', timeout = 200})' - }, { - 'BufWinEnter', '*', - 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o' - }, - { - 'BufRead', '*', - 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o' - }, { - 'BufNewFile', '*', - 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o' - }, {'VimLeavePre', '*', 'set title set titleold='}, - {'FileType', 'qf', 'set nobuflisted'} +require("lv-utils").define_augroups { + _general_settings = { + { + "TextYankPost", + "*", + "lua require('vim.highlight').on_yank({higroup = 'Search', timeout = 200})", }, - -- _solidity = { - -- {'BufWinEnter', '.sol', 'setlocal filetype=solidity'}, {'BufRead', '*.sol', 'setlocal filetype=solidity'}, - -- {'BufNewFile', '*.sol', 'setlocal filetype=solidity'} - -- }, - -- _gemini = { - -- {'BufWinEnter', '.gmi', 'setlocal filetype=markdown'}, {'BufRead', '*.gmi', 'setlocal filetype=markdown'}, - -- {'BufNewFile', '*.gmi', 'setlocal filetype=markdown'} - -- }, - _markdown = { - {'FileType', 'markdown', 'setlocal wrap'}, - {'FileType', 'markdown', 'setlocal spell'} + { + "BufWinEnter", + "*", + "setlocal formatoptions-=c formatoptions-=r formatoptions-=o", }, - _buffer_bindings = { - {'FileType', 'floaterm', 'nnoremap q :q'} - } -}) - + { + "BufRead", + "*", + "setlocal formatoptions-=c formatoptions-=r formatoptions-=o", + }, + { + "BufNewFile", + "*", + "setlocal formatoptions-=c formatoptions-=r formatoptions-=o", + }, + { "VimLeavePre", "*", "set title set titleold=" }, + { "FileType", "qf", "set nobuflisted" }, + }, + -- _solidity = { + -- {'BufWinEnter', '.sol', 'setlocal filetype=solidity'}, {'BufRead', '*.sol', 'setlocal filetype=solidity'}, + -- {'BufNewFile', '*.sol', 'setlocal filetype=solidity'} + -- }, + -- _gemini = { + -- {'BufWinEnter', '.gmi', 'setlocal filetype=markdown'}, {'BufRead', '*.gmi', 'setlocal filetype=markdown'}, + -- {'BufNewFile', '*.gmi', 'setlocal filetype=markdown'} + -- }, + _markdown = { + { "FileType", "markdown", "setlocal wrap" }, + { "FileType", "markdown", "setlocal spell" }, + }, + _buffer_bindings = { + { "FileType", "floaterm", "nnoremap q :q" }, + }, +} diff --git a/lua/keymappings.lua b/lua/keymappings.lua index 7224a432..2161b8e9 100644 --- a/lua/keymappings.lua +++ b/lua/keymappings.lua @@ -1,12 +1,12 @@ -- better window movement -vim.api.nvim_set_keymap('n', '', 'h', {silent = true}) -vim.api.nvim_set_keymap('n', '', 'j', {silent = true}) -vim.api.nvim_set_keymap('n', '', 'k', {silent = true}) -vim.api.nvim_set_keymap('n', '', 'l', {silent = true}) +vim.api.nvim_set_keymap("n", "", "h", { silent = true }) +vim.api.nvim_set_keymap("n", "", "j", { silent = true }) +vim.api.nvim_set_keymap("n", "", "k", { silent = true }) +vim.api.nvim_set_keymap("n", "", "l", { silent = true }) -- TODO fix this -- Terminal window navigation -vim.cmd([[ +vim.cmd [[ tnoremap h tnoremap j tnoremap k @@ -16,50 +16,50 @@ vim.cmd([[ inoremap k inoremap l tnoremap -]]) +]] -- TODO fix this -- resize with arrows -vim.api.nvim_set_keymap('n', '', ':resize -2', {silent = true}) -vim.api.nvim_set_keymap('n', '', ':resize +2', {silent = true}) -vim.api.nvim_set_keymap('n', '', ':vertical resize -2', {silent = true}) -vim.api.nvim_set_keymap('n', '', ':vertical resize +2', {silent = true}) +vim.api.nvim_set_keymap("n", "", ":resize -2", { silent = true }) +vim.api.nvim_set_keymap("n", "", ":resize +2", { silent = true }) +vim.api.nvim_set_keymap("n", "", ":vertical resize -2", { silent = true }) +vim.api.nvim_set_keymap("n", "", ":vertical resize +2", { silent = true }) -- better indenting -vim.api.nvim_set_keymap('v', '<', '', '>gv', {noremap = true, silent = true}) +vim.api.nvim_set_keymap("v", "<", "", ">gv", { noremap = true, silent = true }) -- I hate escape -vim.api.nvim_set_keymap('i', 'jk', '', {noremap = true, silent = true}) -vim.api.nvim_set_keymap('i', 'kj', '', {noremap = true, silent = true}) -vim.api.nvim_set_keymap('i', 'jj', '', {noremap = true, silent = true}) +vim.api.nvim_set_keymap("i", "jk", "", { noremap = true, silent = true }) +vim.api.nvim_set_keymap("i", "kj", "", { noremap = true, silent = true }) +vim.api.nvim_set_keymap("i", "jj", "", { noremap = true, silent = true }) -- Tab switch buffer -vim.api.nvim_set_keymap('n', '', ':bnext', {noremap = true, silent = true}) -vim.api.nvim_set_keymap('n', '', ':bprevious', {noremap = true, silent = true}) +vim.api.nvim_set_keymap("n", "", ":bnext", { noremap = true, silent = true }) +vim.api.nvim_set_keymap("n", "", ":bprevious", { noremap = true, silent = true }) -- Move selected line / block of text in visual mode -vim.api.nvim_set_keymap('x', 'K', ':move \'<-2gv-gv', {noremap = true, silent = true}) -vim.api.nvim_set_keymap('x', 'J', ':move \'>+1gv-gv', {noremap = true, silent = true}) +vim.api.nvim_set_keymap("x", "K", ":move '<-2gv-gv", { noremap = true, silent = true }) +vim.api.nvim_set_keymap("x", "J", ":move '>+1gv-gv", { noremap = true, silent = true }) -- Move current line / block with Alt-j/k ala vscode. -vim.api.nvim_set_keymap('n', '', ':m .+1==', {noremap = true, silent = true}) -vim.api.nvim_set_keymap('n', '', ':m .-2==', {noremap = true, silent = true}) -vim.api.nvim_set_keymap('i', '', ':m .+1==gi', {noremap = true, silent = true}) -vim.api.nvim_set_keymap('i', '', ':m .-2==gi', {noremap = true, silent = true}) -vim.api.nvim_set_keymap('x', '', ':m \'>+1gv-gv', {noremap = true, silent = true}) -vim.api.nvim_set_keymap('x', '', ':m \'<-2gv-gv', {noremap = true, silent = true}) +vim.api.nvim_set_keymap("n", "", ":m .+1==", { noremap = true, silent = true }) +vim.api.nvim_set_keymap("n", "", ":m .-2==", { noremap = true, silent = true }) +vim.api.nvim_set_keymap("i", "", ":m .+1==gi", { noremap = true, silent = true }) +vim.api.nvim_set_keymap("i", "", ":m .-2==gi", { noremap = true, silent = true }) +vim.api.nvim_set_keymap("x", "", ":m '>+1gv-gv", { noremap = true, silent = true }) +vim.api.nvim_set_keymap("x", "", ":m '<-2gv-gv", { noremap = true, silent = true }) -- QuickFix -vim.api.nvim_set_keymap('n', ']q', ':cnext', {noremap = true, silent = true}) -vim.api.nvim_set_keymap('n', '[q', ':cprev', {noremap = true, silent = true}) +vim.api.nvim_set_keymap("n", "]q", ":cnext", { noremap = true, silent = true }) +vim.api.nvim_set_keymap("n", "[q", ":cprev", { noremap = true, silent = true }) -- Better nav for omnicomplete -vim.cmd('inoremap (\"\\\")') -vim.cmd('inoremap (\"\\\")') +vim.cmd 'inoremap ("\\")' +vim.cmd 'inoremap ("\\")' -vim.cmd('vnoremap p "0p') -vim.cmd('vnoremap P "0P') +vim.cmd 'vnoremap p "0p' +vim.cmd 'vnoremap P "0P' -- vim.api.nvim_set_keymap('v', 'p', '"0p', {silent = true}) -- vim.api.nvim_set_keymap('v', 'P', '"0P', {silent = true}) @@ -76,4 +76,4 @@ vim.cmd('vnoremap P "0P') -- ]]) -- Toggle the QuickFix window -vim.api.nvim_set_keymap('', '', ':call QuickFixToggle()', {noremap = true, silent = true}) +vim.api.nvim_set_keymap("", "", ":call QuickFixToggle()", { noremap = true, silent = true }) diff --git a/lua/lv-autopairs/init.lua b/lua/lv-autopairs/init.lua index 057525a3..6a9e4286 100644 --- a/lua/lv-autopairs/init.lua +++ b/lua/lv-autopairs/init.lua @@ -1,47 +1,47 @@ -- if not package.loaded['nvim-autopairs'] then -- return -- end -local npairs = require('nvim-autopairs') -local Rule = require('nvim-autopairs.rule') +local npairs = require "nvim-autopairs" +local Rule = require "nvim-autopairs.rule" -- skip it, if you use another global object _G.MUtils = {} vim.g.completion_confirm_key = "" MUtils.completion_confirm = function() - if vim.fn.pumvisible() ~= 0 then - if vim.fn.complete_info()["selected"] ~= -1 then - return vim.fn["compe#confirm"](npairs.esc("")) - else - return npairs.esc("") - end + if vim.fn.pumvisible() ~= 0 then + if vim.fn.complete_info()["selected"] ~= -1 then + return vim.fn["compe#confirm"](npairs.esc "") else - return npairs.autopairs_cr() + return npairs.esc "" end + else + return npairs.autopairs_cr() + end end -if package.loaded['compe'] then - require("nvim-autopairs.completion.compe").setup({ - map_cr = true, -- map on insert mode - map_complete = true -- it will auto insert `(` after select function or method item - }) +if package.loaded["compe"] then + require("nvim-autopairs.completion.compe").setup { + map_cr = true, -- map on insert mode + map_complete = true, -- it will auto insert `(` after select function or method item + } end -npairs.setup({ - check_ts = true, - ts_config = { - lua = {'string'}, -- it will not add pair on that treesitter node - javascript = {'template_string'}, - java = false -- don't check treesitter on java - } -}) +npairs.setup { + check_ts = true, + ts_config = { + lua = { "string" }, -- it will not add pair on that treesitter node + javascript = { "template_string" }, + java = false, -- don't check treesitter on java + }, +} -require('nvim-treesitter.configs').setup {autopairs = {enable = true}} +require("nvim-treesitter.configs").setup { autopairs = { enable = true } } -local ts_conds = require('nvim-autopairs.ts-conds') +local ts_conds = require "nvim-autopairs.ts-conds" -- press % => %% is only inside comment or string -npairs.add_rules({ - Rule("%", "%", "lua"):with_pair(ts_conds.is_ts_node({'string', 'comment'})), - Rule("$", "$", "lua"):with_pair(ts_conds.is_not_ts_node({'function'})) -}) +npairs.add_rules { + Rule("%", "%", "lua"):with_pair(ts_conds.is_ts_node { "string", "comment" }), + Rule("$", "$", "lua"):with_pair(ts_conds.is_not_ts_node { "function" }), +} diff --git a/lua/lv-bufferline/init.lua b/lua/lv-bufferline/init.lua index 0dbaaceb..af1a2d20 100644 --- a/lua/lv-bufferline/init.lua +++ b/lua/lv-bufferline/init.lua @@ -1,76 +1,73 @@ local M = {} M.config = function() - - -- Buffer line setup - require'bufferline'.setup { - options = { - indicator_icon = '▎', - buffer_close_icon = '', - modified_icon = '●', - close_icon = '', - close_command = "bdelete %d", - right_mouse_command = "bdelete! %d", - left_trunc_marker = '', - right_trunc_marker = '', - offsets = { - { - filetype = "NvimTree", - text = "", - text_align = "center", - padding = 1 - } - }, - show_tab_indicators = true, - show_close_icon = false + -- Buffer line setup + require("bufferline").setup { + options = { + indicator_icon = "▎", + buffer_close_icon = "", + modified_icon = "●", + close_icon = "", + close_command = "bdelete %d", + right_mouse_command = "bdelete! %d", + left_trunc_marker = "", + right_trunc_marker = "", + offsets = { + { + filetype = "NvimTree", + text = "", + text_align = "center", + padding = 1, }, - highlights = { - fill = { - guifg = {attribute = "fg", highlight = "Normal"}, - guibg = {attribute = "bg", highlight = "StatusLineNC"} - }, - -- background = { - -- guifg = {attribute = "fg", highlight = "Normal"}, - -- guibg = {attribute = "bg", highlight = "StatusLine"} - -- }, - -- buffer_visible = { - -- gui = "", - -- guifg = {attribute = "fg", highlight = "Normal"}, - -- guibg = {attribute = "bg", highlight = "Normal"} - -- }, - -- buffer_selected = { - -- gui = "", - -- guifg = {attribute = "fg", highlight = "Normal"}, - -- guibg = {attribute = "bg", highlight = "Normal"} - -- }, - -- separator = { - -- guifg = {attribute = "bg", highlight = "Normal"}, - -- guibg = {attribute = "bg", highlight = "StatusLine"} - -- }, - -- separator_selected = { - -- guifg = {attribute = "fg", highlight = "Special"}, - -- guibg = {attribute = "bg", highlight = "Normal"} - -- }, - -- separator_visible = { - -- guifg = {attribute = "fg", highlight = "Normal"}, - -- guibg = {attribute = "bg", highlight = "StatusLineNC"} - -- }, - -- close_button = { - -- guifg = {attribute = "fg", highlight = "Normal"}, - -- guibg = {attribute = "bg", highlight = "StatusLine"} - -- }, - -- close_button_selected = { - -- guifg = {attribute = "fg", highlight = "normal"}, - -- guibg = {attribute = "bg", highlight = "normal"} - -- }, - -- close_button_visible = { - -- guifg = {attribute = "fg", highlight = "normal"}, - -- guibg = {attribute = "bg", highlight = "normal"} - -- } - - } - } - + }, + show_tab_indicators = true, + show_close_icon = false, + }, + highlights = { + fill = { + guifg = { attribute = "fg", highlight = "Normal" }, + guibg = { attribute = "bg", highlight = "StatusLineNC" }, + }, + -- background = { + -- guifg = {attribute = "fg", highlight = "Normal"}, + -- guibg = {attribute = "bg", highlight = "StatusLine"} + -- }, + -- buffer_visible = { + -- gui = "", + -- guifg = {attribute = "fg", highlight = "Normal"}, + -- guibg = {attribute = "bg", highlight = "Normal"} + -- }, + -- buffer_selected = { + -- gui = "", + -- guifg = {attribute = "fg", highlight = "Normal"}, + -- guibg = {attribute = "bg", highlight = "Normal"} + -- }, + -- separator = { + -- guifg = {attribute = "bg", highlight = "Normal"}, + -- guibg = {attribute = "bg", highlight = "StatusLine"} + -- }, + -- separator_selected = { + -- guifg = {attribute = "fg", highlight = "Special"}, + -- guibg = {attribute = "bg", highlight = "Normal"} + -- }, + -- separator_visible = { + -- guifg = {attribute = "fg", highlight = "Normal"}, + -- guibg = {attribute = "bg", highlight = "StatusLineNC"} + -- }, + -- close_button = { + -- guifg = {attribute = "fg", highlight = "Normal"}, + -- guibg = {attribute = "bg", highlight = "StatusLine"} + -- }, + -- close_button_selected = { + -- guifg = {attribute = "fg", highlight = "normal"}, + -- guibg = {attribute = "bg", highlight = "normal"} + -- }, + -- close_button_visible = { + -- guifg = {attribute = "fg", highlight = "normal"}, + -- guibg = {attribute = "bg", highlight = "normal"} + -- } + }, + } end return M diff --git a/lua/lv-colorizer/init.lua b/lua/lv-colorizer/init.lua index ed8fd408..ac5f1356 100644 --- a/lua/lv-colorizer/init.lua +++ b/lua/lv-colorizer/init.lua @@ -1,13 +1,10 @@ -require'colorizer'.setup( - {'*';}, - { - RGB = true; -- #RGB hex codes - RRGGBB = true; -- #RRGGBB hex codes - RRGGBBAA = true; -- #RRGGBBAA hex codes - rgb_fn = true; -- CSS rgb() and rgba() functions - hsl_fn = true; -- CSS hsl() and hsla() functions - css = true; -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB - css_fn = true; -- Enable all CSS *functions*: rgb_fn, hsl_fn - }) - -- names = true; -- "Name" codes like Blue - +require("colorizer").setup({ "*" }, { + RGB = true, -- #RGB hex codes + RRGGBB = true, -- #RRGGBB hex codes + RRGGBBAA = true, -- #RRGGBBAA hex codes + rgb_fn = true, -- CSS rgb() and rgba() functions + hsl_fn = true, -- CSS hsl() and hsla() functions + css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB + css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn +}) +-- names = true; -- "Name" codes like Blue diff --git a/lua/lv-compe/init.lua b/lua/lv-compe/init.lua index 4a8e3230..cd3be5ae 100644 --- a/lua/lv-compe/init.lua +++ b/lua/lv-compe/init.lua @@ -7,12 +7,12 @@ local M = {} vim.g.vsnip_snippet_dir = O.vnsip_dir M.config = function() -opt = { + opt = { enabled = O.auto_complete, autocomplete = true, debug = false, min_length = 1, - preselect = 'enable', + preselect = "enable", throttle_time = 80, source_timeout = 200, incomplete_delay = 400, @@ -22,79 +22,78 @@ opt = { documentation = true, source = { - path = {kind = "  (Path)"}, - buffer = {kind = "  (Buffer)"}, - calc = {kind = "  (Calc)"}, - vsnip = {kind = "  (Snippet)"}, - nvim_lsp = {kind = "  (LSP)"}, - -- nvim_lua = {kind = "  "}, - nvim_lua = false, - spell = {kind = "  (Spell)"}, - tags = false, - vim_dadbod_completion = true, - -- snippets_nvim = {kind = "  "}, - -- ultisnips = {kind = "  "}, - -- treesitter = {kind = "  "}, - emoji = {kind = " ﲃ (Emoji)", filetypes={"markdown", "text"}} - -- for emoji press : (idk if that in compe tho) - } -} + path = { kind = "  (Path)" }, + buffer = { kind = "  (Buffer)" }, + calc = { kind = "  (Calc)" }, + vsnip = { kind = "  (Snippet)" }, + nvim_lsp = { kind = "  (LSP)" }, + -- nvim_lua = {kind = "  "}, + nvim_lua = false, + spell = { kind = "  (Spell)" }, + tags = false, + vim_dadbod_completion = true, + -- snippets_nvim = {kind = "  "}, + -- ultisnips = {kind = "  "}, + -- treesitter = {kind = "  "}, + emoji = { kind = " ﲃ (Emoji)", filetypes = { "markdown", "text" } }, + -- for emoji press : (idk if that in compe tho) + }, + } -if O.plugin.tabnine.active then - opt.source.tabnine = {kind = " ", priority=200, max_reslts=6} -end + if O.plugin.tabnine.active then + opt.source.tabnine = { kind = " ", priority = 200, max_reslts = 6 } + end -require'compe'.setup(opt) + require("compe").setup(opt) -local t = function(str) - return vim.api.nvim_replace_termcodes(str, true, true, true) -end + local t = function(str) + return vim.api.nvim_replace_termcodes(str, true, true, true) + end -local check_back_space = function() - local col = vim.fn.col('.') - 1 - if col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then - return true + local check_back_space = function() + local col = vim.fn.col "." - 1 + if col == 0 or vim.fn.getline("."):sub(col, col):match "%s" then + return true else - return false + return false end -end - --- Use (s-)tab to: ---- move to prev/next item in completion menuone ---- jump to prev/next snippet's placeholder -_G.tab_complete = function() - if vim.fn.pumvisible() == 1 then - return t "" - elseif vim.fn.call("vsnip#available", {1}) == 1 then - return t "(vsnip-expand-or-jump)" - elseif check_back_space() then - return t "" - else - return vim.fn['compe#complete']() end -end -_G.s_tab_complete = function() - if vim.fn.pumvisible() == 1 then - return t "" - elseif vim.fn.call("vsnip#jumpable", {-1}) == 1 then - return t "(vsnip-jump-prev)" - else - return t "" + -- Use (s-)tab to: + --- move to prev/next item in completion menuone + --- jump to prev/next snippet's placeholder + _G.tab_complete = function() + if vim.fn.pumvisible() == 1 then + return t "" + elseif vim.fn.call("vsnip#available", { 1 }) == 1 then + return t "(vsnip-expand-or-jump)" + elseif check_back_space() then + return t "" + else + return vim.fn["compe#complete"]() + end end -end + _G.s_tab_complete = function() + if vim.fn.pumvisible() == 1 then + return t "" + elseif vim.fn.call("vsnip#jumpable", { -1 }) == 1 then + return t "(vsnip-jump-prev)" + else + return t "" + end + end -vim.api.nvim_set_keymap("i", "", "v:lua.tab_complete()", {expr = true}) -vim.api.nvim_set_keymap("s", "", "v:lua.tab_complete()", {expr = true}) -vim.api.nvim_set_keymap("i", "", "v:lua.s_tab_complete()", {expr = true}) -vim.api.nvim_set_keymap("s", "", "v:lua.s_tab_complete()", {expr = true}) + vim.api.nvim_set_keymap("i", "", "v:lua.tab_complete()", { expr = true }) + vim.api.nvim_set_keymap("s", "", "v:lua.tab_complete()", { expr = true }) + vim.api.nvim_set_keymap("i", "", "v:lua.s_tab_complete()", { expr = true }) + vim.api.nvim_set_keymap("s", "", "v:lua.s_tab_complete()", { expr = true }) -vim.api.nvim_set_keymap("i", "", "compe#complete()", {noremap = true, silent = true, expr = true}) -vim.api.nvim_set_keymap("i", "", "compe#confirm('')", {noremap = true, silent = true, expr = true}) -vim.api.nvim_set_keymap("i", "", "compe#close('')", {noremap = true, silent = true, expr = true}) -vim.api.nvim_set_keymap("i", "", "compe#scroll({ 'delta': +4 })", {noremap = true, silent = true, expr = true}) -vim.api.nvim_set_keymap("i", "", "compe#scroll({ 'delta': -4 })", {noremap = true, silent = true, expr = true}) + vim.api.nvim_set_keymap("i", "", "compe#complete()", { noremap = true, silent = true, expr = true }) + vim.api.nvim_set_keymap("i", "", "compe#confirm('')", { noremap = true, silent = true, expr = true }) + vim.api.nvim_set_keymap("i", "", "compe#close('')", { noremap = true, silent = true, expr = true }) + vim.api.nvim_set_keymap("i", "", "compe#scroll({ 'delta': +4 })", { noremap = true, silent = true, expr = true }) + vim.api.nvim_set_keymap("i", "", "compe#scroll({ 'delta': -4 })", { noremap = true, silent = true, expr = true }) end return M diff --git a/lua/lv-dashboard/init.lua b/lua/lv-dashboard/init.lua index 99fcb10f..7a6c77cd 100644 --- a/lua/lv-dashboard/init.lua +++ b/lua/lv-dashboard/init.lua @@ -1,65 +1,70 @@ local M = {} M.config = function() - vim.g.dashboard_disable_at_vimenter = 0 + vim.g.dashboard_disable_at_vimenter = 0 - vim.g.dashboard_custom_header = O.dashboard.custom_header + vim.g.dashboard_custom_header = O.dashboard.custom_header - vim.g.dashboard_default_executive = 'telescope' + vim.g.dashboard_default_executive = "telescope" - vim.g.dashboard_custom_section = { - a = { - description = {' Find File '}, - command = 'Telescope find_files' - }, - b = { - description = {' Recently Used Files'}, - command = 'Telescope oldfiles' - }, - c = { - description = {' Load Last Session '}, - command = 'SessionLoad' - }, - d = { - description = {' Find Word '}, - command = 'Telescope live_grep' - }, - e = { - description = {' Settings '}, - command = ':e ' .. CONFIG_PATH .. '/lv-config.lua' - }, - f = { - description = {' Neovim Config Files'}, - command = 'Telescope find_files cwd=' .. CONFIG_PATH - } - -- e = {description = {' Marks '}, command = 'Telescope marks'} - } - vim.cmd( - "let g:dashboard_session_directory = $HOME..'/.config/nvim/.sessions'") - vim.cmd( - "let packages = len(globpath('~/.local/share/nvim/site/pack/packer/start', '*', 0, 1))") + vim.g.dashboard_custom_section = { + a = { + description = { " Find File " }, + command = "Telescope find_files", + }, + b = { + description = { " Recently Used Files" }, + command = "Telescope oldfiles", + }, + c = { + description = { " Load Last Session " }, + command = "SessionLoad", + }, + d = { + description = { " Find Word " }, + command = "Telescope live_grep", + }, + e = { + description = { " Settings " }, + command = ":e " .. CONFIG_PATH .. "/lv-config.lua", + }, + f = { + description = { " Neovim Config Files" }, + command = "Telescope find_files cwd=" .. CONFIG_PATH, + }, + -- e = {description = {' Marks '}, command = 'Telescope marks'} + } + vim.cmd "let g:dashboard_session_directory = $HOME..'/.config/nvim/.sessions'" + vim.cmd "let packages = len(globpath('~/.local/share/nvim/site/pack/packer/start', '*', 0, 1))" - vim.api.nvim_exec([[ + vim.api.nvim_exec( + [[ let g:dashboard_custom_footer = ['LuaJIT loaded '..packages..' plugins'] -]], false) +]], + false + ) - -- file_browser = {description = {' File Browser'}, command = 'Telescope find_files'}, + -- file_browser = {description = {' File Browser'}, command = 'Telescope find_files'}, - -- vim.g.dashboard_session_directory = CACHE_PATH..'/session' - -- vim.g.dashboard_custom_footer = O.dashboard.footer + -- vim.g.dashboard_session_directory = CACHE_PATH..'/session' + -- vim.g.dashboard_custom_footer = O.dashboard.footer end -require('lv-utils').define_augroups({ - _dashboard = { - -- seems to be nobuflisted that makes my stuff disapear will do more testing - { - 'FileType', 'dashboard', - 'setlocal nocursorline noswapfile synmaxcol& signcolumn=no norelativenumber nocursorcolumn nospell nolist nonumber bufhidden=wipe colorcolumn= foldcolumn=0 matchpairs= ' - }, { - 'FileType', 'dashboard', - 'set showtabline=0 | autocmd BufLeave set showtabline=2' - }, {'FileType', 'dashboard', 'nnoremap q :q'} - } -}) +require("lv-utils").define_augroups { + _dashboard = { + -- seems to be nobuflisted that makes my stuff disapear will do more testing + { + "FileType", + "dashboard", + "setlocal nocursorline noswapfile synmaxcol& signcolumn=no norelativenumber nocursorcolumn nospell nolist nonumber bufhidden=wipe colorcolumn= foldcolumn=0 matchpairs= ", + }, + { + "FileType", + "dashboard", + "set showtabline=0 | autocmd BufLeave set showtabline=2", + }, + { "FileType", "dashboard", "nnoremap q :q" }, + }, +} return M diff --git a/lua/lv-dial/init.lua b/lua/lv-dial/init.lua index aa32e050..c299f18a 100644 --- a/lua/lv-dial/init.lua +++ b/lua/lv-dial/init.lua @@ -1,7 +1,7 @@ local M = {} M.config = function() - vim.cmd [[ + vim.cmd [[ nmap (dial-increment) nmap (dial-decrement) vmap (dial-increment) @@ -10,13 +10,13 @@ vmap g (dial-increment-additional) vmap g (dial-decrement-additional) ]] - local dial = require("dial") + local dial = require "dial" - dial.augends["custom#boolean"] = dial.common.enum_cyclic { - name = "boolean", - strlist = {"true", "false"} - } - table.insert(dial.config.searchlist.normal, "custom#boolean") + dial.augends["custom#boolean"] = dial.common.enum_cyclic { + name = "boolean", + strlist = { "true", "false" }, + } + table.insert(dial.config.searchlist.normal, "custom#boolean") end return M diff --git a/lua/lv-galaxyline/init.lua b/lua/lv-galaxyline/init.lua index fece7a04..f063a146 100644 --- a/lua/lv-galaxyline/init.lua +++ b/lua/lv-galaxyline/init.lua @@ -2,28 +2,28 @@ -- return -- end -local gl = require('galaxyline') +local gl = require "galaxyline" -- get my theme in galaxyline repo -- local colors = require('galaxyline.theme').default local colors = { - bg = '#2E2E2E', - -- bg = '#292D38', - yellow = '#DCDCAA', - dark_yellow = '#D7BA7D', - cyan = '#4EC9B0', - green = '#608B4E', - light_green = '#B5CEA8', - string_orange = '#CE9178', - orange = '#FF8800', - purple = '#C586C0', - magenta = '#D16D9E', - grey = '#858585', - blue = '#569CD6', - vivid_blue = '#4FC1FF', - light_blue = '#9CDCFE', - red = '#D16969', - error_red = '#F44747', - info_yellow = '#FFCC66' + bg = "#2E2E2E", + -- bg = '#292D38', + yellow = "#DCDCAA", + dark_yellow = "#D7BA7D", + cyan = "#4EC9B0", + green = "#608B4E", + light_green = "#B5CEA8", + string_orange = "#CE9178", + orange = "#FF8800", + purple = "#C586C0", + magenta = "#D16D9E", + grey = "#858585", + blue = "#569CD6", + vivid_blue = "#4FC1FF", + light_blue = "#9CDCFE", + red = "#D16969", + error_red = "#F44747", + info_yellow = "#FFCC66", } -- galaxyline themes for Gruvbox and NVCode. @@ -71,259 +71,263 @@ local colors = { -- info_yellow = '#FFCC66' -- } -local condition = require('galaxyline.condition') +local condition = require "galaxyline.condition" local gls = gl.section -gl.short_line_list = {'NvimTree', 'vista', 'dbui', 'packer'} +gl.short_line_list = { "NvimTree", "vista", "dbui", "packer" } table.insert(gls.left, { - ViMode = { - provider = function() - -- auto change color according the vim mode - local mode_color = { - n = colors.blue, - i = colors.green, - v = colors.purple, - [''] = colors.purple, - V = colors.purple, - c = colors.magenta, - no = colors.blue, - s = colors.orange, - S = colors.orange, - [''] = colors.orange, - ic = colors.yellow, - R = colors.red, - Rv = colors.red, - cv = colors.blue, - ce = colors.blue, - r = colors.cyan, - rm = colors.cyan, - ['r?'] = colors.cyan, - ['!'] = colors.blue, - t = colors.blue - } - vim.api.nvim_command('hi GalaxyViMode guifg=' .. mode_color[vim.fn.mode()]) - return '▊' - end, - -- highlight = 'TabLineSel' - -- highlight = {colors.red, colors.bg} - } + ViMode = { + provider = function() + -- auto change color according the vim mode + local mode_color = { + n = colors.blue, + i = colors.green, + v = colors.purple, + [""] = colors.purple, + V = colors.purple, + c = colors.magenta, + no = colors.blue, + s = colors.orange, + S = colors.orange, + [""] = colors.orange, + ic = colors.yellow, + R = colors.red, + Rv = colors.red, + cv = colors.blue, + ce = colors.blue, + r = colors.cyan, + rm = colors.cyan, + ["r?"] = colors.cyan, + ["!"] = colors.blue, + t = colors.blue, + } + vim.api.nvim_command("hi GalaxyViMode guifg=" .. mode_color[vim.fn.mode()]) + return "▊" + end, + -- highlight = 'TabLineSel' + -- highlight = {colors.red, colors.bg} + }, }) -- print(vim.fn.getbufvar(0, 'ts')) -vim.fn.getbufvar(0, 'ts') +vim.fn.getbufvar(0, "ts") table.insert(gls.left, { - GitIcon = { - provider = function() - return ' ' - end, - condition = condition.check_git_workspace, - separator = ' ', - separator_highlight = 'StatusLineSeparator', - highlight = 'StatusLineGit' - } + GitIcon = { + provider = function() + return " " + end, + condition = condition.check_git_workspace, + separator = " ", + separator_highlight = "StatusLineSeparator", + highlight = "StatusLineGit", + }, }) table.insert(gls.left, { - GitBranch = { - provider = 'GitBranch', - condition = condition.check_git_workspace, - separator = ' ', - separator_highlight = 'StatusLineSeparator', - highlight = 'StatusLineNC' - } + GitBranch = { + provider = "GitBranch", + condition = condition.check_git_workspace, + separator = " ", + separator_highlight = "StatusLineSeparator", + highlight = "StatusLineNC", + }, }) table.insert(gls.left, { - DiffAdd = { - provider = 'DiffAdd', - condition = condition.hide_in_width, - icon = '  ', - highlight = 'StatusLineGitAdd' - } + DiffAdd = { + provider = "DiffAdd", + condition = condition.hide_in_width, + icon = "  ", + highlight = "StatusLineGitAdd", + }, }) table.insert(gls.left, { - DiffModified = { - provider = 'DiffModified', - condition = condition.hide_in_width, - icon = ' 柳', - highlight = 'StatusLineGitChange' - } + DiffModified = { + provider = "DiffModified", + condition = condition.hide_in_width, + icon = " 柳", + highlight = "StatusLineGitChange", + }, }) table.insert(gls.left, { - DiffRemove = { - provider = 'DiffRemove', - condition = condition.hide_in_width, - icon = '  ', - highlight = 'StatusLineGitDelete' - } + DiffRemove = { + provider = "DiffRemove", + condition = condition.hide_in_width, + icon = "  ", + highlight = "StatusLineGitDelete", + }, }) table.insert(gls.right, { - DiagnosticError = {provider = 'DiagnosticError', icon = '  ', - highlight = 'StatusLineLspDiagnosticsError' - } + DiagnosticError = { + provider = "DiagnosticError", + icon = "  ", + highlight = "StatusLineLspDiagnosticsError", + }, }) -table.insert(gls.right, {DiagnosticWarn = {provider = 'DiagnosticWarn', icon = '  ', - - - highlight = 'StatusLineLspDiagnosticsWarning' - - -}}) - - -table.insert(gls.right, {DiagnosticInfo = {provider = 'DiagnosticInfo', icon = '  ', - - highlight = 'StatusLineLspDiagnosticsInformation' - - -}}) - - - table.insert(gls.right, { - DiagnosticHint = {provider = 'DiagnosticHint', icon = '  ', + DiagnosticWarn = { + provider = "DiagnosticWarn", + icon = "  ", - - highlight = 'StatusLineLspDiagnosticsHint' - - - } + highlight = "StatusLineLspDiagnosticsWarning", + }, }) table.insert(gls.right, { - TreesitterIcon = { - provider = function() - if next(vim.treesitter.highlighter.active) ~= nil then return ' ' end - return '' - end, - separator = ' ', - separator_highlight = 'StatusLineSeparator', - highlight = 'StatusLineTreeSitter' - } + DiagnosticInfo = { + provider = "DiagnosticInfo", + icon = "  ", + + highlight = "StatusLineLspDiagnosticsInformation", + }, }) -local get_lsp_client = function (msg) - msg = msg or "No Active LSP Client" - local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') - local clients = vim.lsp.get_active_clients() - if next(clients) == nil then - return msg - end - local lsps = "" - for _,client in ipairs(clients) do - local filetypes = client.config.filetypes - if filetypes and vim.fn.index(filetypes, buf_ft) ~=1 then - -- print(client.name) - if lsps == "" then - -- print("first", lsps) - lsps = client.name - else - lsps = lsps .. ", " .. client.name - -- print("more", lsps) - end - end - end - if lsps == "" then - return msg - else - return lsps +table.insert(gls.right, { + DiagnosticHint = { + provider = "DiagnosticHint", + icon = "  ", + + highlight = "StatusLineLspDiagnosticsHint", + }, +}) + +table.insert(gls.right, { + TreesitterIcon = { + provider = function() + if next(vim.treesitter.highlighter.active) ~= nil then + return " " + end + return "" + end, + separator = " ", + separator_highlight = "StatusLineSeparator", + highlight = "StatusLineTreeSitter", + }, +}) + +local get_lsp_client = function(msg) + msg = msg or "No Active LSP Client" + local buf_ft = vim.api.nvim_buf_get_option(0, "filetype") + local clients = vim.lsp.get_active_clients() + if next(clients) == nil then + return msg + end + local lsps = "" + for _, client in ipairs(clients) do + local filetypes = client.config.filetypes + if filetypes and vim.fn.index(filetypes, buf_ft) ~= 1 then + -- print(client.name) + if lsps == "" then + -- print("first", lsps) + lsps = client.name + else + lsps = lsps .. ", " .. client.name + -- print("more", lsps) + end end + end + if lsps == "" then + return msg + else + return lsps + end end - table.insert(gls.right, { - ShowLspClient = { - provider = get_lsp_client, - condition = function() - local tbl = {['dashboard'] = true, [' '] = true} - if tbl[vim.bo.filetype] then return false end - return true - end, - icon = ' ', - highlight = 'StatusLineNC' - } + ShowLspClient = { + provider = get_lsp_client, + condition = function() + local tbl = { ["dashboard"] = true, [" "] = true } + if tbl[vim.bo.filetype] then + return false + end + return true + end, + icon = " ", + highlight = "StatusLineNC", + }, }) table.insert(gls.right, { - LineInfo = { - provider = 'LineColumn', - separator = ' ', - separator_highlight = 'StatusLineSeparator', - highlight = 'StatusLineNC' - } + LineInfo = { + provider = "LineColumn", + separator = " ", + separator_highlight = "StatusLineSeparator", + highlight = "StatusLineNC", + }, }) table.insert(gls.right, { - PerCent = { - provider = 'LinePercent', - separator = ' ', - separator_highlight = 'StatusLineSeparator', - highlight = 'StatusLineNC' - } + PerCent = { + provider = "LinePercent", + separator = " ", + separator_highlight = "StatusLineSeparator", + highlight = "StatusLineNC", + }, }) table.insert(gls.right, { - Tabstop = { - provider = function() - return "Spaces: " .. vim.api.nvim_buf_get_option(0, "shiftwidth") .. " " - end, - condition = condition.hide_in_width, - separator = ' ', - separator_highlight = 'StatusLineSeparator', - highlight = 'StatusLineNC' - } + Tabstop = { + provider = function() + return "Spaces: " .. vim.api.nvim_buf_get_option(0, "shiftwidth") .. " " + end, + condition = condition.hide_in_width, + separator = " ", + separator_highlight = "StatusLineSeparator", + highlight = "StatusLineNC", + }, }) table.insert(gls.right, { - BufferType = { - provider = 'FileTypeName', - condition = condition.hide_in_width, - separator = ' ', - separator_highlight = 'StatusLineSeparator', - highlight = 'StatusLineNC' - } + BufferType = { + provider = "FileTypeName", + condition = condition.hide_in_width, + separator = " ", + separator_highlight = "StatusLineSeparator", + highlight = "StatusLineNC", + }, }) table.insert(gls.right, { - FileEncode = { - provider = 'FileEncode', - condition = condition.hide_in_width, - separator = ' ', - separator_highlight = 'StatusLineSeparator', - highlight = 'StatusLineNC' - } + FileEncode = { + provider = "FileEncode", + condition = condition.hide_in_width, + separator = " ", + separator_highlight = "StatusLineSeparator", + highlight = "StatusLineNC", + }, }) table.insert(gls.right, { - Space = { - provider = function() - return ' ' - end, - separator = ' ', - separator_highlight = 'StatusLineSeparator', - highlight = 'StatusLineNC' - } + Space = { + provider = function() + return " " + end, + separator = " ", + separator_highlight = "StatusLineSeparator", + highlight = "StatusLineNC", + }, }) table.insert(gls.short_line_left, { - BufferType = { - provider = 'FileTypeName', - separator = ' ', - separator_highlight = 'StatusLineSeparator', - highlight = 'StatusLineNC' - } + BufferType = { + provider = "FileTypeName", + separator = " ", + separator_highlight = "StatusLineSeparator", + highlight = "StatusLineNC", + }, }) table.insert(gls.short_line_left, { - SFileName = {provider = 'SFileName', condition = condition.buffer_not_empty, + SFileName = { + provider = "SFileName", + condition = condition.buffer_not_empty, - highlight = 'StatusLineNC' - - - } + highlight = "StatusLineNC", + }, }) --table.insert(gls.short_line_right[1] = {BufferIcon = {provider = 'BufferIcon', highlight = {colors.grey, colors.bg}}}) diff --git a/lua/lv-gitblame/init.lua b/lua/lv-gitblame/init.lua index 12645a7f..3ed93a2b 100644 --- a/lua/lv-gitblame/init.lua +++ b/lua/lv-gitblame/init.lua @@ -1,2 +1,2 @@ -vim.cmd('highlight default link gitblame SpecialComment') +vim.cmd "highlight default link gitblame SpecialComment" vim.g.gitblame_enabled = 0 diff --git a/lua/lv-gitsigns/init.lua b/lua/lv-gitsigns/init.lua index 7f0db565..7f1fbff4 100644 --- a/lua/lv-gitsigns/init.lua +++ b/lua/lv-gitsigns/init.lua @@ -1,53 +1,53 @@ local M = {} M.config = function() - require('gitsigns').setup { - signs = { - -- TODO add hl to colorscheme - add = { - hl = 'GitSignsAdd', - text = '▎', - numhl = 'GitSignsAddNr', - linehl = 'GitSignsAddLn' - }, - change = { - hl = 'GitSignsChange', - text = '▎', - numhl = 'GitSignsChangeNr', - linehl = 'GitSignsChangeLn' - }, - delete = { - hl = 'GitSignsDelete', - text = '契', - numhl = 'GitSignsDeleteNr', - linehl = 'GitSignsDeleteLn' - }, - topdelete = { - hl = 'GitSignsDelete', - text = '契', - numhl = 'GitSignsDeleteNr', - linehl = 'GitSignsDeleteLn' - }, - changedelete = { - hl = 'GitSignsChange', - text = '▎', - numhl = 'GitSignsChangeNr', - linehl = 'GitSignsChangeLn' - } - }, - numhl = false, - linehl = false, - keymaps = { - -- Default keymap options - noremap = true, - buffer = true - }, - watch_index = {interval = 1000}, - sign_priority = 6, - update_debounce = 200, - status_formatter = nil, -- Use default - use_decoration_api = false - } + require("gitsigns").setup { + signs = { + -- TODO add hl to colorscheme + add = { + hl = "GitSignsAdd", + text = "▎", + numhl = "GitSignsAddNr", + linehl = "GitSignsAddLn", + }, + change = { + hl = "GitSignsChange", + text = "▎", + numhl = "GitSignsChangeNr", + linehl = "GitSignsChangeLn", + }, + delete = { + hl = "GitSignsDelete", + text = "契", + numhl = "GitSignsDeleteNr", + linehl = "GitSignsDeleteLn", + }, + topdelete = { + hl = "GitSignsDelete", + text = "契", + numhl = "GitSignsDeleteNr", + linehl = "GitSignsDeleteLn", + }, + changedelete = { + hl = "GitSignsChange", + text = "▎", + numhl = "GitSignsChangeNr", + linehl = "GitSignsChangeLn", + }, + }, + numhl = false, + linehl = false, + keymaps = { + -- Default keymap options + noremap = true, + buffer = true, + }, + watch_index = { interval = 1000 }, + sign_priority = 6, + update_debounce = 200, + status_formatter = nil, -- Use default + use_decoration_api = false, + } end return M diff --git a/lua/lv-hop/init.lua b/lua/lv-hop/init.lua index 8e30a1c8..3d2610ce 100644 --- a/lua/lv-hop/init.lua +++ b/lua/lv-hop/init.lua @@ -1,9 +1,9 @@ local M = {} M.config = function() - require('hop').setup() - vim.api.nvim_set_keymap('n', 's', ":HopChar2", {silent = true}) - vim.api.nvim_set_keymap('n', 'S', ":HopWord", {silent = true}) + require("hop").setup() + vim.api.nvim_set_keymap("n", "s", ":HopChar2", { silent = true }) + vim.api.nvim_set_keymap("n", "S", ":HopWord", { silent = true }) end return M diff --git a/lua/lv-lsp-rooter/init.lua b/lua/lv-lsp-rooter/init.lua index 7f849072..f4c16a9f 100644 --- a/lua/lv-lsp-rooter/init.lua +++ b/lua/lv-lsp-rooter/init.lua @@ -1,5 +1,5 @@ require("lsp-rooter").setup { - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below - } + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below +} diff --git a/lua/lv-lspinstall/init.lua b/lua/lv-lspinstall/init.lua index 0ad1cd08..68fcfa2b 100644 --- a/lua/lv-lspinstall/init.lua +++ b/lua/lv-lspinstall/init.lua @@ -1,7 +1,7 @@ -- 1. get the config for this server from nvim-lspconfig and adjust the cmd path. -- relative paths are allowed, lspinstall automatically adjusts the cmd and cmd_cwd for us! -local config = require'lspconfig'.jdtls.document_config -require'lspconfig/configs'.jdtls = nil -- important, unset the loaded config again +local config = require("lspconfig").jdtls.document_config +require("lspconfig/configs").jdtls = nil -- important, unset the loaded config again -- config.default_config.cmd[1] = "./node_modules/.bin/bash-language-server" -- 2. extend the config with an install_script and (optionally) uninstall_script @@ -24,4 +24,4 @@ require'lspconfig/configs'.jdtls = nil -- important, unset the loaded config aga -- uninstall_script = nil -- can be omitted -- }) -require'lspinstall'.setup() +require("lspinstall").setup() diff --git a/lua/lv-matchup/init.lua b/lua/lv-matchup/init.lua index a14c5ce4..92df923b 100644 --- a/lua/lv-matchup/init.lua +++ b/lua/lv-matchup/init.lua @@ -1,8 +1,7 @@ local M = {} M.config = function() - vim.g.matchup_matchparen_offscreen = {method = 'popup'} + vim.g.matchup_matchparen_offscreen = { method = "popup" } end return M - diff --git a/lua/lv-nvimtree/init.lua b/lua/lv-nvimtree/init.lua index 7b560038..37a931ef 100644 --- a/lua/lv-nvimtree/init.lua +++ b/lua/lv-nvimtree/init.lua @@ -5,78 +5,77 @@ local M = {} M.config = function() - local g = vim.g + local g = vim.g - vim.o.termguicolors = true + vim.o.termguicolors = true - g.nvim_tree_side = "left" - g.nvim_tree_width = 30 - g.nvim_tree_ignore = {".git", "node_modules", ".cache"} - g.nvim_tree_auto_open = 1 - g.nvim_tree_auto_close = 0 - g.nvim_tree_quit_on_open = 0 - g.nvim_tree_follow = 1 - g.nvim_tree_indent_markers = 1 - g.nvim_tree_hide_dotfiles = 1 - g.nvim_tree_git_hl = 1 - g.nvim_tree_root_folder_modifier = ":t" - g.nvim_tree_tab_open = 0 - g.nvim_tree_allow_resize = 1 - g.nvim_tree_lsp_diagnostics = 1 - g.nvim_tree_auto_ignore_ft = {'startify', 'dashboard'} + g.nvim_tree_side = "left" + g.nvim_tree_width = 30 + g.nvim_tree_ignore = { ".git", "node_modules", ".cache" } + g.nvim_tree_auto_open = 1 + g.nvim_tree_auto_close = 0 + g.nvim_tree_quit_on_open = 0 + g.nvim_tree_follow = 1 + g.nvim_tree_indent_markers = 1 + g.nvim_tree_hide_dotfiles = 1 + g.nvim_tree_git_hl = 1 + g.nvim_tree_root_folder_modifier = ":t" + g.nvim_tree_tab_open = 0 + g.nvim_tree_allow_resize = 1 + g.nvim_tree_lsp_diagnostics = 1 + g.nvim_tree_auto_ignore_ft = { "startify", "dashboard" } - g.nvim_tree_show_icons = { - git = 1, - folders = 1, - files = 1, - folder_arrows = 1 - } + g.nvim_tree_show_icons = { + git = 1, + folders = 1, + files = 1, + folder_arrows = 1, + } - vim.g.nvim_tree_icons = { - default = '', - symlink = '', - git = { - unstaged = "", - staged = "S", - unmerged = "", - renamed = "➜", - deleted = "", - untracked = "U", - ignored = "◌" - }, - folder = { - default = "", - open = "", - empty = "", - empty_open = "", - symlink = "" - } - } - local tree_cb = require'nvim-tree.config'.nvim_tree_callback + vim.g.nvim_tree_icons = { + default = "", + symlink = "", + git = { + unstaged = "", + staged = "S", + unmerged = "", + renamed = "➜", + deleted = "", + untracked = "U", + ignored = "◌", + }, + folder = { + default = "", + open = "", + empty = "", + empty_open = "", + symlink = "", + }, + } + local tree_cb = require("nvim-tree.config").nvim_tree_callback - vim.g.nvim_tree_bindings = { - {key = {"l", "", "o"}, cb = tree_cb("edit")}, - {key = "h", cb = tree_cb("close_node")}, - {key = "v", cb = tree_cb("vsplit")} - } + vim.g.nvim_tree_bindings = { + { key = { "l", "", "o" }, cb = tree_cb "edit" }, + { key = "h", cb = tree_cb "close_node" }, + { key = "v", cb = tree_cb "vsplit" }, + } end -local view = require 'nvim-tree.view' +local view = require "nvim-tree.view" M.toggle_tree = function() - if view.win_open() then - require'nvim-tree'.close() - if package.loaded['bufferline.state'] then - require'bufferline.state'.set_offset(0) - end - else - if package.loaded['bufferline.state'] then - -- require'bufferline.state'.set_offset(31, 'File Explorer') - require'bufferline.state'.set_offset(31, '') - end - require'nvim-tree'.find_file(true) + if view.win_open() then + require("nvim-tree").close() + if package.loaded["bufferline.state"] then + require("bufferline.state").set_offset(0) end - + else + if package.loaded["bufferline.state"] then + -- require'bufferline.state'.set_offset(31, 'File Explorer') + require("bufferline.state").set_offset(31, "") + end + require("nvim-tree").find_file(true) + end end return M diff --git a/lua/lv-quickscope/init.lua b/lua/lv-quickscope/init.lua index 817bc6dc..8ae441d3 100644 --- a/lua/lv-quickscope/init.lua +++ b/lua/lv-quickscope/init.lua @@ -1,4 +1,4 @@ -- Trigger a highlight in the appropriate direction when pressing these keys: -- vim.cmd('let g:qs_highlight_on_keys = [\'f\', \'F\', \'t\', \'T\']') -vim.g.qs_highlight_on_keys = {'f', 'F', 't', 'T'} -vim.g.qs_max_chars=150 +vim.g.qs_highlight_on_keys = { "f", "F", "t", "T" } +vim.g.qs_max_chars = 150 diff --git a/lua/lv-rnvimr/init.lua b/lua/lv-rnvimr/init.lua index c1140a72..d05307b1 100644 --- a/lua/lv-rnvimr/init.lua +++ b/lua/lv-rnvimr/init.lua @@ -3,4 +3,4 @@ vim.g.rnvimr_draw_border = 1 vim.g.rnvimr_pick_enable = 1 vim.g.rnvimr_bw_enable = 1 -vim.api.nvim_set_keymap('n', '-', ':RnvimrToggle', {noremap = true, silent = true}) +vim.api.nvim_set_keymap("n", "-", ":RnvimrToggle", { noremap = true, silent = true }) diff --git a/lua/lv-snap/init.lua b/lua/lv-snap/init.lua index 115b1eda..c37f068a 100644 --- a/lua/lv-snap/init.lua +++ b/lua/lv-snap/init.lua @@ -1,14 +1,14 @@ local M = {} M.config = function() - local snap = require "snap" - local layout = snap.get"layout".bottom - local file = snap.config.file:with {consumer = "fzy", layout = layout} - local vimgrep = snap.config.vimgrep:with {layout = layout} - snap.register.command("find_files", file {producer = "ripgrep.file"}) - snap.register.command("buffers", file {producer = "vim.buffer"}) - snap.register.command("oldfiles", file {producer = "vim.oldfile"}) - snap.register.command("live_grep", vimgrep {}) + local snap = require "snap" + local layout = snap.get("layout").bottom + local file = snap.config.file:with { consumer = "fzy", layout = layout } + local vimgrep = snap.config.vimgrep:with { layout = layout } + snap.register.command("find_files", file { producer = "ripgrep.file" }) + snap.register.command("buffers", file { producer = "vim.buffer" }) + snap.register.command("oldfiles", file { producer = "vim.oldfile" }) + snap.register.command("live_grep", vimgrep {}) end return M diff --git a/lua/lv-spectre/init.lua b/lua/lv-spectre/init.lua index aaa411bc..cd7757f3 100644 --- a/lua/lv-spectre/init.lua +++ b/lua/lv-spectre/init.lua @@ -1,51 +1,50 @@ -require('spectre').setup({ - mapping={ - ['toggle_line'] = { - map = "dd", - cmd = "lua require('spectre').toggle_line()", - desc = "toggle current item" +require("spectre").setup { + mapping = { + ["toggle_line"] = { + map = "dd", + cmd = "lua require('spectre').toggle_line()", + desc = "toggle current item", }, - ['enter_file'] = { - map = "", - cmd = "lua require('spectre.actions').select_entry()", - desc = "goto current file" + ["enter_file"] = { + map = "", + cmd = "lua require('spectre.actions').select_entry()", + desc = "goto current file", }, - ['send_to_qf'] = { - map = "q", - cmd = "lua require('spectre.actions').send_to_qf()", - desc = "send all item to quickfix" + ["send_to_qf"] = { + map = "q", + cmd = "lua require('spectre.actions').send_to_qf()", + desc = "send all item to quickfix", }, - ['replace_cmd'] = { - map = "c", - cmd = "lua require('spectre.actions').replace_cmd()", - desc = "input replace vim command" + ["replace_cmd"] = { + map = "c", + cmd = "lua require('spectre.actions').replace_cmd()", + desc = "input replace vim command", }, - ['show_option_menu'] = { - map = "o", - cmd = "lua require('spectre').show_options()", - desc = "show option" + ["show_option_menu"] = { + map = "o", + cmd = "lua require('spectre').show_options()", + desc = "show option", }, - ['run_replace'] = { - map = "R", - cmd = "lua require('spectre.actions').run_replace()", - desc = "replace all" + ["run_replace"] = { + map = "R", + cmd = "lua require('spectre.actions').run_replace()", + desc = "replace all", }, - ['change_view_mode'] = { - map = "v", - cmd = "lua require('spectre').change_view()", - desc = "change result view mode" + ["change_view_mode"] = { + map = "v", + cmd = "lua require('spectre').change_view()", + desc = "change result view mode", }, - ['toggle_ignore_case'] = { + ["toggle_ignore_case"] = { map = "ti", cmd = "lua require('spectre').change_options('ignore-case')", - desc = "toggle ignore case" + desc = "toggle ignore case", }, - ['toggle_ignore_hidden'] = { + ["toggle_ignore_hidden"] = { map = "th", cmd = "lua require('spectre').change_options('hidden')", - desc = "toggle search hidden" + desc = "toggle search hidden", }, -- you can put your mapping here it only use normal mode - } -}) - + }, +} diff --git a/lua/lv-symbols-outline/init.lua b/lua/lv-symbols-outline/init.lua index 63fb2cfc..f15b5dfb 100644 --- a/lua/lv-symbols-outline/init.lua +++ b/lua/lv-symbols-outline/init.lua @@ -1,15 +1,15 @@ vim.g.symbols_outline = { - highlight_hovered_item = true, - show_guides = true, - auto_preview = true, - position = 'right', - keymaps = { - close = "", - goto_location = "", - focus_location = "o", - hover_symbol = "", - rename_symbol = "r", - code_actions = "a", - }, - lsp_blacklist = {}, + highlight_hovered_item = true, + show_guides = true, + auto_preview = true, + position = "right", + keymaps = { + close = "", + goto_location = "", + focus_location = "o", + hover_symbol = "", + rename_symbol = "r", + code_actions = "a", + }, + lsp_blacklist = {}, } diff --git a/lua/lv-telescope/init.lua b/lua/lv-telescope/init.lua index 8bf73369..6bbce291 100644 --- a/lua/lv-telescope/init.lua +++ b/lua/lv-telescope/init.lua @@ -1,82 +1,86 @@ -local actions = require('telescope.actions') +local actions = require "telescope.actions" -- if O.plugin.trouble.active then -- local trouble = require("trouble.providers.telescope") -- end -- Global remapping ------------------------------ -- '--color=never', -require('telescope').setup { - defaults = { - find_command = { - 'rg', '--no-heading', '--with-filename', '--line-number', - '--column', '--smart-case' - }, - prompt_prefix = " ", - selection_caret = " ", - entry_prefix = " ", - initial_mode = "insert", - selection_strategy = "reset", - sorting_strategy = "descending", - layout_strategy = "horizontal", - layout_config = { - width = 0.75, - prompt_position = "bottom", - preview_cutoff = 120, - horizontal = {mirror = false}, - vertical = {mirror = false} - }, - file_sorter = require'telescope.sorters'.get_fzy_sorter, - file_ignore_patterns = {}, - generic_sorter = require'telescope.sorters'.get_generic_fuzzy_sorter, - shorten_path = true, - winblend = 0, - border = {}, - borderchars = {'─', '│', '─', '│', '╭', '╮', '╯', '╰'}, - color_devicons = true, - use_less = true, - set_env = {['COLORTERM'] = 'truecolor'}, -- default = nil, - file_previewer = require'telescope.previewers'.vim_buffer_cat.new, - grep_previewer = require'telescope.previewers'.vim_buffer_vimgrep.new, - qflist_previewer = require'telescope.previewers'.vim_buffer_qflist.new, - - -- Developer configurations: Not meant for general override - buffer_previewer_maker = require'telescope.previewers'.buffer_previewer_maker, - mappings = { - i = { - [""] = actions.close, - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - -- [""] = trouble.open_with_trouble, - [""] = actions.smart_send_to_qflist + actions.open_qflist, - -- To disable a keymap, put [map] = false - -- So, to not map "", just put - -- [""] = false, - -- [""] = actions.close, - - -- Otherwise, just set the mapping to the function that you want it to be. - -- [""] = actions.select_horizontal, - - -- Add up multiple actions - [""] = actions.select_default + actions.center - - -- You can perform as many actions in a row as you like - -- [""] = actions.select_default + actions.center + my_cool_custom_action, - }, - n = { - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - -- [""] = trouble.open_with_trouble, - [""] = actions.smart_send_to_qflist + actions.open_qflist - -- [""] = my_cool_custom_action, - } - } +require("telescope").setup { + defaults = { + find_command = { + "rg", + "--no-heading", + "--with-filename", + "--line-number", + "--column", + "--smart-case", }, - extensions = { - fzy_native = { - override_generic_sorter = false, - override_file_sorter = true - } - } + prompt_prefix = " ", + selection_caret = " ", + entry_prefix = " ", + initial_mode = "insert", + selection_strategy = "reset", + sorting_strategy = "descending", + layout_strategy = "horizontal", + layout_config = { + width = 0.75, + prompt_position = "bottom", + preview_cutoff = 120, + horizontal = { mirror = false }, + vertical = { mirror = false }, + }, + file_sorter = require("telescope.sorters").get_fzy_sorter, + file_ignore_patterns = {}, + generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter, + shorten_path = true, + winblend = 0, + border = {}, + borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, + color_devicons = true, + use_less = true, + set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil, + file_previewer = require("telescope.previewers").vim_buffer_cat.new, + grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new, + qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new, + + -- Developer configurations: Not meant for general override + buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker, + mappings = { + i = { + [""] = actions.close, + [""] = actions.move_selection_next, + [""] = actions.move_selection_previous, + -- [""] = trouble.open_with_trouble, + [""] = actions.smart_send_to_qflist + actions.open_qflist, + -- To disable a keymap, put [map] = false + -- So, to not map "", just put + -- [""] = false, + -- [""] = actions.close, + + -- Otherwise, just set the mapping to the function that you want it to be. + -- [""] = actions.select_horizontal, + + -- Add up multiple actions + [""] = actions.select_default + actions.center, + + -- You can perform as many actions in a row as you like + -- [""] = actions.select_default + actions.center + my_cool_custom_action, + }, + n = { + [""] = actions.move_selection_next, + [""] = actions.move_selection_previous, + -- [""] = trouble.open_with_trouble, + [""] = actions.smart_send_to_qflist + actions.open_qflist, + -- [""] = my_cool_custom_action, + }, + }, + }, + extensions = { + fzy_native = { + override_generic_sorter = false, + override_file_sorter = true, + }, + }, } -- require'telescope'.load_extension('project') diff --git a/lua/lv-themes/spacegray.lua b/lua/lv-themes/spacegray.lua index ef4ecc17..0bb695c0 100644 --- a/lua/lv-themes/spacegray.lua +++ b/lua/lv-themes/spacegray.lua @@ -1,371 +1,370 @@ -local lush = require('lush') +local lush = require "lush" local hsl = lush.hsl local theme = lush(function() - local c = { - bg = hsl("#212121"), - bg1 = hsl("#2a2a2a"), - -- bg2 = hsl("#3a3a3a"), - bg2 = hsl("#383d45"), + local c = { + bg = hsl "#212121", + bg1 = hsl "#2a2a2a", + -- bg2 = hsl("#3a3a3a"), + bg2 = hsl "#383d45", - white = hsl("#c8c9d1"), + white = hsl "#c8c9d1", - gray = hsl("#858585"), - light_gray = hsl("#c8c9c1"), + gray = hsl "#858585", + light_gray = hsl "#c8c9c1", - error_red = hsl("#F44747"), - warning_orange = hsl("#ff8800"), - info_yellow = hsl("#ffcc66"), - hint_blue = hsl("#4fc1ff"), + error_red = hsl "#F44747", + warning_orange = hsl "#ff8800", + info_yellow = hsl "#ffcc66", + hint_blue = hsl "#4fc1ff", - red = hsl("#b04b57"), + red = hsl "#b04b57", - blue = hsl("#5486c0"), - gray_blue = hsl("#66899d"), + blue = hsl "#5486c0", + gray_blue = hsl "#66899d", - -- yellow = hsl("#ffcb6b"), - yellow = hsl("#eeba5a"), + -- yellow = hsl("#ffcb6b"), + yellow = hsl "#eeba5a", - -- orange = hsl("#c98a75"), - orange = hsl("#c6735a"), + -- orange = hsl("#c98a75"), + orange = hsl "#c6735a", - green = hsl("#87b379"), - light_green = hsl("#b2d77c"), + green = hsl "#87b379", + light_green = hsl "#b2d77c", - -- aqua = hsl("#46b1d0"), - aqua = hsl("#65a7c5"), + -- aqua = hsl("#46b1d0"), + aqua = hsl "#65a7c5", - purple = hsl("#bf83c1"), - pale_purple = hsl("#7199ee"), + purple = hsl "#bf83c1", + pale_purple = hsl "#7199ee", - sign_add = hsl("#587C0C"), - sign_change = hsl("#0C7D9D"), - sign_delete = hsl("#94151B"), + sign_add = hsl "#587C0C", + sign_change = hsl "#0C7D9D", + sign_delete = hsl "#94151B", - test = hsl("#ff00ff") - } - return { - Normal {bg = c.bg, fg = c.white, gui = "NONE"}, -- used for the columns set with 'colorcolumn' - SignColumn {Normal}, - ModeMsg {Normal}, - MsgArea {Normal}, - MsgSeparator {Normal}, - SpellBad {bg = "NONE", fg = c.white, gui = "underline", sp = c.red}, - SpellCap {bg = "NONE", fg = c.white, gui = "underline", sp = c.yellow}, - SpellLocal {bg = "NONE", fg = c.white, gui = "underline", sp = c.green}, - SpellRare {bg = "NONE", fg = c.white, gui = "underline", sp = c.blue}, - NormalNC {Normal}, - Pmenu {bg = c.bg2, fg = c.white, gui = "NONE"}, - PmenuSel {bg = c.gray_blue, fg = c.bg1.da(5), gui = "NONE"}, - WildMenu {PmenuSel}, -- Non Defaults - CursorLineNr {bg = "NONE", fg = c.light_gray, gui = "bold"}, - Comment {bg = "NONE", fg = c.gray, gui = "italic"}, -- any comment - Folded {bg = c.bg1, fg = c.gray, gui = "NONE"}, - FoldColumn {Normal, fg = c.gray, gui = "NONE"}, - LineNr {bg = "NONE", fg = c.gray, gui = "NONE"}, - FloatBorder {bg = c.bg1, fg = c.gray, gui = "NONE"}, - Whitespace {bg = "NONE", fg = c.gray.da(35), gui = "NONE"}, - VertSplit {bg = "NONE", fg = c.bg2, gui = "NONE"}, - CursorLine {bg = c.bg1, fg = "NONE", gui = "NONE"}, - CursorColumn {CursorLine}, - ColorColumn {CursorLine}, - NormalFloat {bg = c.bg2.da(30), fg = "NONE", gui = "NONE"}, - Visual {bg = c.bg2.da(25), fg = "NONE", gui = "NONE"}, - VisualNOS {Visual}, WarningMsg {bg = "NONE", fg = c.red, gui = "NONE"}, - DiffText {bg = "NONE", fg = "NONE", gui = "NONE"}, - DiffAdd {bg = c.sign_add, fg = "NONE", gui = "NONE"}, - DiffChange {bg = c.sign_change, fg = "NONE", gui = "NONE"}, - DiffDelete {bg = c.sign_delete, fg = "NONE", gui = "NONE"}, - QuickFixLine {CursorLine}, - PmenuSbar {bg = c.bg2.li(15), fg = "NONE", gui = "NONE"}, - PmenuThumb {bg = c.white, fg = "NONE", gui = "NONE"}, - MatchParen {CursorLine, fg = "NONE", gui = "NONE"}, - Cursor {fg = "NONE", bg = "NONE", gui = "reverse"}, - lCursor {Cursor}, - CursorIM {Cursor}, - TermCursor {Cursor}, TermCursorNC {Cursor}, - Conceal {bg = "NONE", fg = c.blue, gui = "NONE"}, - Directory {bg = "NONE", fg = c.blue, gui = "NONE"}, - SpecialKey {bg = "NONE", fg = c.blue, gui = "bold"}, - Title {bg = "NONE", fg = c.blue, gui = "bold"}, - ErrorMsg {bg = "NONE", fg = c.error_red, gui = "NONE"}, - Search {bg = c.gray_blue, fg = c.white}, - IncSearch {Search}, - Substitute {Search}, - MoreMsg {bg = "NONE", fg = c.aqua, gui = "NONE"}, - Question {MoreMsg}, - EndOfBuffer {bg = "NONE", fg = c.bg, gui = "NONE"}, - NonText {EndOfBuffer}, + test = hsl "#ff00ff", + } + return { + Normal { bg = c.bg, fg = c.white, gui = "NONE" }, -- used for the columns set with 'colorcolumn' + SignColumn { Normal }, + ModeMsg { Normal }, + MsgArea { Normal }, + MsgSeparator { Normal }, + SpellBad { bg = "NONE", fg = c.white, gui = "underline", sp = c.red }, + SpellCap { bg = "NONE", fg = c.white, gui = "underline", sp = c.yellow }, + SpellLocal { bg = "NONE", fg = c.white, gui = "underline", sp = c.green }, + SpellRare { bg = "NONE", fg = c.white, gui = "underline", sp = c.blue }, + NormalNC { Normal }, + Pmenu { bg = c.bg2, fg = c.white, gui = "NONE" }, + PmenuSel { bg = c.gray_blue, fg = c.bg1.da(5), gui = "NONE" }, + WildMenu { PmenuSel }, -- Non Defaults + CursorLineNr { bg = "NONE", fg = c.light_gray, gui = "bold" }, + Comment { bg = "NONE", fg = c.gray, gui = "italic" }, -- any comment + Folded { bg = c.bg1, fg = c.gray, gui = "NONE" }, + FoldColumn { Normal, fg = c.gray, gui = "NONE" }, + LineNr { bg = "NONE", fg = c.gray, gui = "NONE" }, + FloatBorder { bg = c.bg1, fg = c.gray, gui = "NONE" }, + Whitespace { bg = "NONE", fg = c.gray.da(35), gui = "NONE" }, + VertSplit { bg = "NONE", fg = c.bg2, gui = "NONE" }, + CursorLine { bg = c.bg1, fg = "NONE", gui = "NONE" }, + CursorColumn { CursorLine }, + ColorColumn { CursorLine }, + NormalFloat { bg = c.bg2.da(30), fg = "NONE", gui = "NONE" }, + Visual { bg = c.bg2.da(25), fg = "NONE", gui = "NONE" }, + VisualNOS { Visual }, + WarningMsg { bg = "NONE", fg = c.red, gui = "NONE" }, + DiffText { bg = "NONE", fg = "NONE", gui = "NONE" }, + DiffAdd { bg = c.sign_add, fg = "NONE", gui = "NONE" }, + DiffChange { bg = c.sign_change, fg = "NONE", gui = "NONE" }, + DiffDelete { bg = c.sign_delete, fg = "NONE", gui = "NONE" }, + QuickFixLine { CursorLine }, + PmenuSbar { bg = c.bg2.li(15), fg = "NONE", gui = "NONE" }, + PmenuThumb { bg = c.white, fg = "NONE", gui = "NONE" }, + MatchParen { CursorLine, fg = "NONE", gui = "NONE" }, + Cursor { fg = "NONE", bg = "NONE", gui = "reverse" }, + lCursor { Cursor }, + CursorIM { Cursor }, + TermCursor { Cursor }, + TermCursorNC { Cursor }, + Conceal { bg = "NONE", fg = c.blue, gui = "NONE" }, + Directory { bg = "NONE", fg = c.blue, gui = "NONE" }, + SpecialKey { bg = "NONE", fg = c.blue, gui = "bold" }, + Title { bg = "NONE", fg = c.blue, gui = "bold" }, + ErrorMsg { bg = "NONE", fg = c.error_red, gui = "NONE" }, + Search { bg = c.gray_blue, fg = c.white }, + IncSearch { Search }, + Substitute { Search }, + MoreMsg { bg = "NONE", fg = c.aqua, gui = "NONE" }, + Question { MoreMsg }, + EndOfBuffer { bg = "NONE", fg = c.bg, gui = "NONE" }, + NonText { EndOfBuffer }, - String {fg = c.green}, - Character {fg = c.light_green}, - Constant {fg = c.orange}, - Number {fg = c.red}, - Boolean {fg = c.red}, - Float {fg = c.red}, + String { fg = c.green }, + Character { fg = c.light_green }, + Constant { fg = c.orange }, + Number { fg = c.red }, + Boolean { fg = c.red }, + Float { fg = c.red }, - Identifier {fg = c.white}, - Function {fg = c.yellow}, - Operator {fg = c.gray_blue}, + Identifier { fg = c.white }, + Function { fg = c.yellow }, + Operator { fg = c.gray_blue }, - Type {fg = c.purple}, - StorageClass {Type}, - Structure {Type}, - Typedef {Type}, + Type { fg = c.purple }, + StorageClass { Type }, + Structure { Type }, + Typedef { Type }, - Keyword {fg = c.blue}, - Statement {Keyword }, - Conditional {Keyword}, - Repeat {Keyword}, - Label {Keyword}, - Exception {Keyword}, + Keyword { fg = c.blue }, + Statement { Keyword }, + Conditional { Keyword }, + Repeat { Keyword }, + Label { Keyword }, + Exception { Keyword }, - Include {Keyword}, - PreProc {fg = c.aqua}, - Define {PreProc}, - Macro {PreProc}, - PreCondit {PreProc}, + Include { Keyword }, + PreProc { fg = c.aqua }, + Define { PreProc }, + Macro { PreProc }, + PreCondit { PreProc }, + Special { fg = c.orange }, + SpecialChar { Character }, + Tag { fg = c.pale_purple }, + Debug { fg = c.red }, + Delimiter { fg = c.white.da(25) }, + SpecialComment { fg = c.gray }, + Underlined { fg = "NONE", gui = "underline" }, + Bold { fg = "NONE", gui = "bold" }, + Italic { fg = "NONE", gui = "italic" }, - Special {fg = c.orange}, - SpecialChar {Character}, - Tag {fg = c.pale_purple}, - Debug {fg = c.red}, - Delimiter {fg = c.white.da(25)}, - SpecialComment {fg = c.gray}, - Underlined {fg = "NONE", gui = "underline"}, - Bold {fg = "NONE", gui = "bold"}, - Italic {fg = "NONE", gui = "italic"}, + -- Todo + -- ("Ignore", below, may be invisible...) + Ignore { fg = c.white }, + Todo { bg = "NONE", fg = c.red, gui = "bold" }, + Error { fg = c.error_red }, - -- Todo - -- ("Ignore", below, may be invisible...) - Ignore {fg = c.white}, - Todo {bg = "NONE", fg = c.red, gui = "bold"}, - Error {fg = c.error_red}, + -- Treesitter + TSComment { Comment }, -- comment blocks. + luaTSConstructor { bg = "NONE", fg = c.white.da(25) }, -- override Lua curly braces + TSAnnotation { bg = "NONE", fg = c.aqua }, -- For C++/Dart attributes, annotations that can be attached to the code to denote some kind of meta information. + TSAttribute { bg = "NONE", fg = c.aqua }, -- (unstable) TODO: docs + TSConstructor { Type }, -- For constructor calls and definitions: `{ }` in Lua, and Java constructors. + TSType { Type }, -- types. + TSTypeBuiltin { Type }, -- builtin types. + TSConditional { Conditional }, -- keywords related to conditionnals. + TSException { Exception }, -- exception related keywords. + TSInclude { Include }, -- includes: `#include` in C, `use` or `extern crate` in Rust, or `require` in Lua. + TSKeyword { Keyword }, -- keywords that don't fall in previous categories. + TSKeywordFunction { Keyword }, -- keywords used to define a fuction. + TSLabel { Label }, -- labels: `label:` in C and `:label:` in Lua. + TSNamespace { bg = "NONE", fg = c.blue }, -- For identifiers referring to modules and namespaces. + TSRepeat { Repeat }, -- keywords related to loops. + TSConstant { Constant }, -- constants + TSConstBuiltin { Constant }, -- constant that are built in the language: `nil` in Lua. + TSFloat { Float }, -- floats. + TSNumber { Number }, -- all numbers + TSBoolean { Boolean }, -- booleans. + TSCharacter { Character }, -- characters. + TSError { bg = "NONE", fg = "NONE" }, -- For syntax/parser errors. + TSFunction { Function }, -- function (calls and definitions). + TSFuncBuiltin { Function }, -- builtin functions: `table.insert` in Lua. + TSMethod { Function }, -- method calls and definitions. + TSConstMacro { Macro }, -- constants that are defined by macros: `NULL` in C. + TSFuncMacro { Macro }, -- macro defined fuctions (calls and definitions): each `macro_rules` in Rust. + TSVariableBuiltin { bg = "NONE", fg = c.aqua }, -- Variable names that are defined by the languages, like `this` or `self`. + TSProperty { fg = c.aqua }, + TSOperator { Operator }, -- any operator: `+`, but also `->` and `*` in C. + TSVariable { bg = "NONE", fg = c.white }, -- Any variable name that does not have another highlight. + TSField { bg = "NONE", fg = c.white }, -- For fields. + TSParameter { TSField }, -- parameters of a function. + TSParameterReference { TSParameter }, -- references to parameters of a function. + TSSymbol { Identifier }, -- identifiers referring to symbols or atoms. + TSText { fg = c.white }, -- strings considered text in a markup language. + TSPunctDelimiter { Delimiter }, -- delimiters ie: `.` + TSTagDelimiter { Delimiter }, -- Tag delimiter like `<` `>` `/` + TSPunctBracket { Delimiter }, -- brackets and parens. + TSPunctSpecial { Delimiter }, -- special punctutation that does not fall in the catagories before. + TSString { String }, -- strings. + TSStringRegex { TSString }, -- regexes. + TSStringEscape { Character }, -- escape characters within a string. + TSWarning { Todo }, -- Variable names that are defined by the languages, like `this` or `self`. + TSTag { Tag }, -- Tags like html tag names. + TSEmphasis { gui = "italic" }, -- text to be represented with emphasis. + TSUnderline { gui = "underline" }, -- text to be represented with an underline. + TSStrike { gui = "strikethrough" }, -- strikethrough text. + TSTitle { Title }, -- Text that is part of a title. + TSLiteral { String }, -- Literal text. + TSURI { fg = c.aqua }, -- Any URI like a link or email. + -- TSNone { }, -- TODO: docs - -- Treesitter - TSComment {Comment}, -- comment blocks. - luaTSConstructor {bg = "NONE", fg = c.white.da(25)}, -- override Lua curly braces - TSAnnotation {bg = "NONE", fg = c.aqua}, -- For C++/Dart attributes, annotations that can be attached to the code to denote some kind of meta information. - TSAttribute {bg = "NONE", fg = c.aqua}, -- (unstable) TODO: docs - TSConstructor {Type}, -- For constructor calls and definitions: `{ }` in Lua, and Java constructors. - TSType {Type}, -- types. - TSTypeBuiltin {Type}, -- builtin types. - TSConditional {Conditional}, -- keywords related to conditionnals. - TSException {Exception}, -- exception related keywords. - TSInclude {Include}, -- includes: `#include` in C, `use` or `extern crate` in Rust, or `require` in Lua. - TSKeyword {Keyword}, -- keywords that don't fall in previous categories. - TSKeywordFunction {Keyword}, -- keywords used to define a fuction. - TSLabel {Label}, -- labels: `label:` in C and `:label:` in Lua. - TSNamespace {bg = "NONE", fg = c.blue}, -- For identifiers referring to modules and namespaces. - TSRepeat {Repeat}, -- keywords related to loops. - TSConstant {Constant}, -- constants - TSConstBuiltin {Constant}, -- constant that are built in the language: `nil` in Lua. - TSFloat {Float}, -- floats. - TSNumber {Number}, -- all numbers - TSBoolean {Boolean}, -- booleans. - TSCharacter {Character}, -- characters. - TSError {bg = "NONE", fg = "NONE"}, -- For syntax/parser errors. - TSFunction {Function}, -- function (calls and definitions). - TSFuncBuiltin {Function}, -- builtin functions: `table.insert` in Lua. - TSMethod {Function}, -- method calls and definitions. - TSConstMacro {Macro}, -- constants that are defined by macros: `NULL` in C. - TSFuncMacro {Macro}, -- macro defined fuctions (calls and definitions): each `macro_rules` in Rust. - TSVariableBuiltin {bg = "NONE", fg = c.aqua}, -- Variable names that are defined by the languages, like `this` or `self`. - TSProperty {fg = c.aqua}, - TSOperator {Operator}, -- any operator: `+`, but also `->` and `*` in C. - TSVariable {bg = "NONE", fg = c.white}, -- Any variable name that does not have another highlight. - TSField {bg = "NONE", fg = c.white}, -- For fields. - TSParameter {TSField}, -- parameters of a function. - TSParameterReference {TSParameter}, -- references to parameters of a function. - TSSymbol {Identifier}, -- identifiers referring to symbols or atoms. - TSText {fg = c.white}, -- strings considered text in a markup language. - TSPunctDelimiter {Delimiter}, -- delimiters ie: `.` - TSTagDelimiter {Delimiter}, -- Tag delimiter like `<` `>` `/` - TSPunctBracket {Delimiter}, -- brackets and parens. - TSPunctSpecial {Delimiter}, -- special punctutation that does not fall in the catagories before. - TSString {String}, -- strings. - TSStringRegex {TSString}, -- regexes. - TSStringEscape {Character}, -- escape characters within a string. - TSWarning {Todo}, -- Variable names that are defined by the languages, like `this` or `self`. - TSTag {Tag}, -- Tags like html tag names. - TSEmphasis {gui = "italic"}, -- text to be represented with emphasis. - TSUnderline {gui = "underline"}, -- text to be represented with an underline. - TSStrike {gui = "strikethrough"}, -- strikethrough text. - TSTitle {Title}, -- Text that is part of a title. - TSLiteral {String}, -- Literal text. - TSURI {fg = c.aqua}, -- Any URI like a link or email. - -- TSNone { }, -- TODO: docs + -- These groups are for the native LSP client. Some other LSP clients may + -- use these groups, or use their own. Consult your LSP client's + -- documentation. - -- These groups are for the native LSP client. Some other LSP clients may - -- use these groups, or use their own. Consult your LSP client's - -- documentation. + LspDiagnosticsDefaultError { bg = "NONE", fg = c.error_red, gui = "NONE" }, + LspDiagnosticsDefaultWarning { bg = "NONE", fg = c.warning_orange, gui = "NONE" }, + LspDiagnosticsDefaultInformation { bg = "NONE", fg = c.info_yellow, gui = "NONE" }, + LspDiagnosticsDefaultHint { bg = "NONE", fg = c.hint_blue, gui = "NONE" }, - LspDiagnosticsDefaultError {bg = "NONE", fg = c.error_red, gui = "NONE"}, - LspDiagnosticsDefaultWarning {bg = "NONE", fg = c.warning_orange, gui = "NONE"}, - LspDiagnosticsDefaultInformation {bg = "NONE", fg = c.info_yellow, gui = "NONE"}, - LspDiagnosticsDefaultHint {bg = "NONE", fg = c.hint_blue, gui = "NONE"}, + LspDiagnosticsVirtualTextError { LspDiagnosticsDefaultError }, + LspDiagnosticsVirtualTextWarning { LspDiagnosticsDefaultWarning }, + LspDiagnosticsVirtualTextInformation { LspDiagnosticsDefaultInformation }, + LspDiagnosticsVirtualTextHint { LspDiagnosticsDefaultHint }, - LspDiagnosticsVirtualTextError {LspDiagnosticsDefaultError}, - LspDiagnosticsVirtualTextWarning {LspDiagnosticsDefaultWarning}, - LspDiagnosticsVirtualTextInformation {LspDiagnosticsDefaultInformation}, - LspDiagnosticsVirtualTextHint {LspDiagnosticsDefaultHint}, - - LspDiagnosticsFloatingError {fg = c.error_red, gui = "NONE"}, - LspDiagnosticsFloatingWarning {fg = c.warning_orange, gui = "NONE"}, - LspDiagnosticsFloatingInformation {fg = c.info_yellow, gui = "NONE"}, - LspDiagnosticsFloatingHint {fg = c.hint_blue, gui = "NONE"}, + LspDiagnosticsFloatingError { fg = c.error_red, gui = "NONE" }, + LspDiagnosticsFloatingWarning { fg = c.warning_orange, gui = "NONE" }, + LspDiagnosticsFloatingInformation { fg = c.info_yellow, gui = "NONE" }, + LspDiagnosticsFloatingHint { fg = c.hint_blue, gui = "NONE" }, - LspDiagnosticsSignError {fg = c.error_red, gui = "NONE"}, - LspDiagnosticsSignWarning {fg = c.warning_orange, gui = "NONE"}, - LspDiagnosticsSignInformation {fg = c.info_yellow, gui = "NONE"}, - LspDiagnosticsSignHint {fg = c.hint_blue, gui = "NONE"}, -- Tree-Sitter + LspDiagnosticsSignError { fg = c.error_red, gui = "NONE" }, + LspDiagnosticsSignWarning { fg = c.warning_orange, gui = "NONE" }, + LspDiagnosticsSignInformation { fg = c.info_yellow, gui = "NONE" }, + LspDiagnosticsSignHint { fg = c.hint_blue, gui = "NONE" }, -- Tree-Sitter - LspDiagnosticsError {LspDiagnosticsSignError}, - LspDiagnosticsWarning {LspDiagnosticsSignWarning}, - LspDiagnosticsInformation {LspDiagnosticsSignInformation}, - LspDiagnosticsHint {LspDiagnosticsSignHint}, + LspDiagnosticsError { LspDiagnosticsSignError }, + LspDiagnosticsWarning { LspDiagnosticsSignWarning }, + LspDiagnosticsInformation { LspDiagnosticsSignInformation }, + LspDiagnosticsHint { LspDiagnosticsSignHint }, - -- LspReferenceText {bg = c.bg1, fg = "NONE", gui = "underline"}, - -- LspReferenceRead {bg = c.bg1, fg = "NONE", gui = "underline"}, - -- LspReferenceWrite {bg = c.bg1, fg = "NONE", gui = "underline"}, + -- LspReferenceText {bg = c.bg1, fg = "NONE", gui = "underline"}, + -- LspReferenceRead {bg = c.bg1, fg = "NONE", gui = "underline"}, + -- LspReferenceWrite {bg = c.bg1, fg = "NONE", gui = "underline"}, - LspDiagnosticsUnderlineError {fg = "NONE", gui = "underline", sp = c.red}, - LspDiagnosticsUnderlineWarning {fg = "NONE", gui = "underline", sp = c.yellow}, - LspDiagnosticsUnderlineInformation {fg = "NONE", gui = "underline", sp = c.blue}, - LspDiagnosticsUnderlineHint {fg = "NONE", gui = "underline", sp = c.green}, + LspDiagnosticsUnderlineError { fg = "NONE", gui = "underline", sp = c.red }, + LspDiagnosticsUnderlineWarning { fg = "NONE", gui = "underline", sp = c.yellow }, + LspDiagnosticsUnderlineInformation { fg = "NONE", gui = "underline", sp = c.blue }, + LspDiagnosticsUnderlineHint { fg = "NONE", gui = "underline", sp = c.green }, - -- gitsigns.nvim - SignAdd {fg = c.sign_add}, - SignChange {fg = c.sign_change}, - SignDelete {fg = c.sign_delete}, -- Any URI like a link or email. - GitSignsAdd {fg = c.sign_add}, - GitSignsChange { fg = c.sign_change}, - GitSignsDelete {fg = c.sign_delete}, + -- gitsigns.nvim + SignAdd { fg = c.sign_add }, + SignChange { fg = c.sign_change }, + SignDelete { fg = c.sign_delete }, -- Any URI like a link or email. + GitSignsAdd { fg = c.sign_add }, + GitSignsChange { fg = c.sign_change }, + GitSignsDelete { fg = c.sign_delete }, - -- telescope.nvim - TelescopeSelection {bg = "NONE", fg = c.aqua}, - TelescopeMatching {bg = "NONE", fg = c.red, gui = "bold"}, - TelescopeBorder {bg = c.bg1, fg = c.gray}, -- nvim-tree.lua + -- telescope.nvim + TelescopeSelection { bg = "NONE", fg = c.aqua }, + TelescopeMatching { bg = "NONE", fg = c.red, gui = "bold" }, + TelescopeBorder { bg = c.bg1, fg = c.gray }, -- nvim-tree.lua - -- Nvimtree - NvimTreeFolderIcon {fg = c.blue}, - NvimTreeIndentMarker {fg = c.gray}, - NvimTreeNormal {fg = c.white.da(10), bg = c.bg1}, - NvimTreeFolderName {fg = c.blue}, - NvimTreeOpenedFolderName {fg = c.aqua.da(10), gui = "italic"}, - NvimTreeOpenedFile {NvimTreeOpenedFolderName}, - NvimTreeRootFolder {fg = c.blue.da(20)}, - NvimTreeExecFile {fg = c.green}, - NvimTreeImageFile {fg = c.purple}, - NvimTreeSpecialFile {fg = c.aqua}, + -- Nvimtree + NvimTreeFolderIcon { fg = c.blue }, + NvimTreeIndentMarker { fg = c.gray }, + NvimTreeNormal { fg = c.white.da(10), bg = c.bg1 }, + NvimTreeFolderName { fg = c.blue }, + NvimTreeOpenedFolderName { fg = c.aqua.da(10), gui = "italic" }, + NvimTreeOpenedFile { NvimTreeOpenedFolderName }, + NvimTreeRootFolder { fg = c.blue.da(20) }, + NvimTreeExecFile { fg = c.green }, + NvimTreeImageFile { fg = c.purple }, + NvimTreeSpecialFile { fg = c.aqua }, - NvimTreeGitStaged {fg = c.sign_add}, - NvimTreeGitNew {fg = c.sign_add}, - NvimTreeGitDirty {fg = c.sign_add}, - NvimTreeGitRenamed {fg = c.sign_change}, - NvimTreeGitMerge {fg = c.sign_change}, - NvimTreeGitDelete {fg = c.sign_delete}, - NvimTreeVertSplit {fg = c.bg1, bg = c.bg1}, + NvimTreeGitStaged { fg = c.sign_add }, + NvimTreeGitNew { fg = c.sign_add }, + NvimTreeGitDirty { fg = c.sign_add }, + NvimTreeGitRenamed { fg = c.sign_change }, + NvimTreeGitMerge { fg = c.sign_change }, + NvimTreeGitDelete { fg = c.sign_delete }, + NvimTreeVertSplit { fg = c.bg1, bg = c.bg1 }, - -- BarBar - TabLine {bg = c.bg1, fg = c.white, gui = "NONE"}, - TabLineFill {bg = c.bg1, fg = c.white, gui = "NONE"}, - TabLineSel {bg = c.blue, fg = c.bg1, gui = "NONE"}, + -- BarBar + TabLine { bg = c.bg1, fg = c.white, gui = "NONE" }, + TabLineFill { bg = c.bg1, fg = c.white, gui = "NONE" }, + TabLineSel { bg = c.blue, fg = c.bg1, gui = "NONE" }, - BufferCurrent {fg = c.fg, bg = c.bg}, - BufferCurrentIndex {fg = c.aqua, bg = c.bg}, - BufferCurrentMod {fg = c.info_yellow, bg = c.bg}, - BufferCurrentSign {fg = c.aqua, bg = c.bg}, - BufferCurrentTarget {fg = c.red, bg = c.bg, gui = "bold"}, + BufferCurrent { fg = c.fg, bg = c.bg }, + BufferCurrentIndex { fg = c.aqua, bg = c.bg }, + BufferCurrentMod { fg = c.info_yellow, bg = c.bg }, + BufferCurrentSign { fg = c.aqua, bg = c.bg }, + BufferCurrentTarget { fg = c.red, bg = c.bg, gui = "bold" }, - BufferVisible {fg = c.fg, bg = c.bg}, - BufferVisibleIndex {fg = c.fg, bg = c.bg}, - BufferVisibleMod {fg = c.info_yellow, bg = c.bg}, - BufferVisibleSign {fg = c.info_yellow, bg = c.bg}, - BufferVisibleTarget {fg = c.red, bg = c.bg, gui = "bold"}, + BufferVisible { fg = c.fg, bg = c.bg }, + BufferVisibleIndex { fg = c.fg, bg = c.bg }, + BufferVisibleMod { fg = c.info_yellow, bg = c.bg }, + BufferVisibleSign { fg = c.info_yellow, bg = c.bg }, + BufferVisibleTarget { fg = c.red, bg = c.bg, gui = "bold" }, - BufferInactive {fg = c.gray, bg = c.bg1}, - BufferInactiveIndex {fg = c.gray, bg = c.bg1}, - BufferInactiveMod {fg = c.info_yellow, bg = c.bg1}, - BufferInactiveSign {fg = c.gray, bg = c.bg1}, - BufferInactiveTarget {fg = c.red, bg = c.bg1}, + BufferInactive { fg = c.gray, bg = c.bg1 }, + BufferInactiveIndex { fg = c.gray, bg = c.bg1 }, + BufferInactiveMod { fg = c.info_yellow, bg = c.bg1 }, + BufferInactiveSign { fg = c.gray, bg = c.bg1 }, + BufferInactiveTarget { fg = c.red, bg = c.bg1 }, - -- some fix for html related stuff - htmlH1 {Title}, -- markdown stuff - mkdLink {fg = c.aqua, gui = "underline"}, - mkdLineBreak {bg = "NONE", fg = "NONE", gui = "NONE"}, - mkdHeading {fg = c.white}, - mkdInlineURL {mkdLink}, - mkdUnderline {fg = c.gray}, - markdownUrl {mkdLink}, - markdownCode {fg = c.orange, bg = "NONE"}, - markdownLinkTextDelimiter {Delimiter}, - markdownLinkDelimiter {Delimiter}, - markdownIdDelimiter {Delimiter}, - markdownLinkText {fg = c.aqua}, - markdownItalic {fg = "NONE", gui = "italic"}, -- flutter-tools.nvim - FlutterWidgetGuides {fg = c.gray.li(10)}, -- statusline + -- some fix for html related stuff + htmlH1 { Title }, -- markdown stuff + mkdLink { fg = c.aqua, gui = "underline" }, + mkdLineBreak { bg = "NONE", fg = "NONE", gui = "NONE" }, + mkdHeading { fg = c.white }, + mkdInlineURL { mkdLink }, + mkdUnderline { fg = c.gray }, + markdownUrl { mkdLink }, + markdownCode { fg = c.orange, bg = "NONE" }, + markdownLinkTextDelimiter { Delimiter }, + markdownLinkDelimiter { Delimiter }, + markdownIdDelimiter { Delimiter }, + markdownLinkText { fg = c.aqua }, + markdownItalic { fg = "NONE", gui = "italic" }, -- flutter-tools.nvim + FlutterWidgetGuides { fg = c.gray.li(10) }, -- statusline - StatusLine {bg = c.bg1, fg = c.white}, -- status line of current window - StatusLineNC {bg = c.bg1, fg = c.light_gray}, -- status lines of not-current windows Note: if this is equal to "StatusLine" Vim will use "^^^" in the status line of the current window. - StatusLineSeparator {bg = c.bg1, fg = "NONE"}, - StatusLineGit {bg = c.bg1, fg = c.orange}, - StatusLineGitAdd {bg = c.bg1, fg = c.green}, - StatusLineGitChange {bg = c.bg1, fg = c.blue}, - StatusLineGitDelete {bg = c.bg1, fg = c.red}, - StatusLineLspDiagnosticsError {bg = c.bg1, fg = c.error_red, gui = "NONE"}, - StatusLineLspDiagnosticsWarning {bg = c.bg1, fg = c.warning_orange, gui = "NONE"}, - StatusLineLspDiagnosticsInformation {bg = c.bg1, fg = c.info_yellow, gui = "NONE"}, - StatusLineLspDiagnosticsHint {bg = c.bg1, fg = c.hint_blue, gui = "NONE"}, - StatusLineTreeSitter {bg = c.bg1, fg = c.green}, + StatusLine { bg = c.bg1, fg = c.white }, -- status line of current window + StatusLineNC { bg = c.bg1, fg = c.light_gray }, -- status lines of not-current windows Note: if this is equal to "StatusLine" Vim will use "^^^" in the status line of the current window. + StatusLineSeparator { bg = c.bg1, fg = "NONE" }, + StatusLineGit { bg = c.bg1, fg = c.orange }, + StatusLineGitAdd { bg = c.bg1, fg = c.green }, + StatusLineGitChange { bg = c.bg1, fg = c.blue }, + StatusLineGitDelete { bg = c.bg1, fg = c.red }, + StatusLineLspDiagnosticsError { bg = c.bg1, fg = c.error_red, gui = "NONE" }, + StatusLineLspDiagnosticsWarning { bg = c.bg1, fg = c.warning_orange, gui = "NONE" }, + StatusLineLspDiagnosticsInformation { bg = c.bg1, fg = c.info_yellow, gui = "NONE" }, + StatusLineLspDiagnosticsHint { bg = c.bg1, fg = c.hint_blue, gui = "NONE" }, + StatusLineTreeSitter { bg = c.bg1, fg = c.green }, - -- StatusLineMode {bg = c.gray, fg = c.bg, gui = "bold"}, - -- StatusLineDeco {bg = c.bg2, fg = c.yellow}, - -- StatusLineLCol {bg = c.bg2, fg = c.white}, - -- StatusLineLColAlt {bg = c.bg1, fg = c.white}, - -- StatusLineFT {bg = c.bg2, fg = c.white}, - -- StatusLineFTAlt {bg = c.bg2, fg = c.white}, - -- StatusLineGitAlt {bg = c.gray, fg = c.bg}, - -- StatusLineLSP {bg = c.bg1, fg = c.gray.li(25)}, - -- StatusLineFileName {bg = c.bg1, fg = c.white, gui = "bold"}, + -- StatusLineMode {bg = c.gray, fg = c.bg, gui = "bold"}, + -- StatusLineDeco {bg = c.bg2, fg = c.yellow}, + -- StatusLineLCol {bg = c.bg2, fg = c.white}, + -- StatusLineLColAlt {bg = c.bg1, fg = c.white}, + -- StatusLineFT {bg = c.bg2, fg = c.white}, + -- StatusLineFTAlt {bg = c.bg2, fg = c.white}, + -- StatusLineGitAlt {bg = c.gray, fg = c.bg}, + -- StatusLineLSP {bg = c.bg1, fg = c.gray.li(25)}, + -- StatusLineFileName {bg = c.bg1, fg = c.white, gui = "bold"}, + -- lsp-trouble.nvim + LspTroubleIndent { fg = c.gray.li(10) }, -- tabline stuff - -- lsp-trouble.nvim - LspTroubleIndent {fg = c.gray.li(10)}, -- tabline stuff + -- tabline diagnostic + TabLineError { LspDiagnosticsSignError }, + TabLineWarning { LspDiagnosticsSignWarning }, + TabLineHint { LspDiagnosticsSignHint }, + TabLineInformation { LspDiagnosticsSignInformation }, -- which-key.nvim - -- tabline diagnostic - TabLineError {LspDiagnosticsSignError}, - TabLineWarning {LspDiagnosticsSignWarning}, - TabLineHint {LspDiagnosticsSignHint}, - TabLineInformation {LspDiagnosticsSignInformation}, -- which-key.nvim + WhichKey { fg = c.purple }, -- nvim-compe + WhichKeySeperator { fg = c.green }, -- nvim-compe + WhichKeyGroup { fg = c.blue }, -- nvim-compe + WhichKeyDesc { fg = c.aqua }, -- nvim-compe + WhichKeyFloat { bg = c.bg1 }, -- nvim-compe - WhichKey {fg = c.purple}, -- nvim-compe - WhichKeySeperator {fg = c.green}, -- nvim-compe - WhichKeyGroup {fg = c.blue}, -- nvim-compe - WhichKeyDesc {fg = c.aqua}, -- nvim-compe - WhichKeyFloat {bg = c.bg1}, -- nvim-compe + CompeDocumentation { Pmenu, fg = "NONE" }, -- diffview + DiffviewNormal { NvimTreeNormal }, + DiffviewStatusAdded { SignAdd }, + DiffviewStatusModified { SignChange }, + DiffviewStatusRenamed { SignChange }, + DiffviewStatusDeleted { SignDelete }, + DiffviewFilePanelInsertion { SignAdd }, + DiffviewFilePanelDeletion { SignDelete }, + DiffviewVertSplit { fg = c.gray, bg = c.bg }, - CompeDocumentation {Pmenu, fg = "NONE"}, -- diffview + DashboardHeader { fg = c.blue }, + DashboardCenter { fg = c.purple }, + DashboardFooter { fg = c.aqua }, - DiffviewNormal {NvimTreeNormal}, - DiffviewStatusAdded {SignAdd}, - DiffviewStatusModified {SignChange}, - DiffviewStatusRenamed {SignChange}, - DiffviewStatusDeleted {SignDelete}, - DiffviewFilePanelInsertion {SignAdd}, - DiffviewFilePanelDeletion {SignDelete}, - DiffviewVertSplit {fg = c.gray, bg = c.bg}, + IndentBlanklineContextChar { fg = c.gray.da(20) }, - DashboardHeader {fg = c.blue}, - DashboardCenter {fg = c.purple}, - DashboardFooter {fg = c.aqua}, - - IndentBlanklineContextChar {fg = c.gray.da(20)}, - - CodiVirtualText {fg = c.hint_blue} - } + CodiVirtualText { fg = c.hint_blue }, + } end) -- return our parsed theme for extension or use else where. diff --git a/lua/lv-treesitter/init.lua b/lua/lv-treesitter/init.lua index ee88120b..ea7ff56f 100644 --- a/lua/lv-treesitter/init.lua +++ b/lua/lv-treesitter/init.lua @@ -2,39 +2,38 @@ -- return -- end -require'nvim-treesitter.configs'.setup { - ensure_installed = O.treesitter.ensure_installed, -- one of "all", "maintained" (parsers with maintainers), or a list of languages - ignore_install = O.treesitter.ignore_install, - matchup = { - enable = true -- mandatory, false will disable the whole extension - -- disable = { "c", "ruby" }, -- optional, list of language that will be disabled - }, - highlight = { - enable = O.treesitter.highlight.enabled -- false will disable the whole extension - }, - context_commentstring = {enable = O.plugin.ts_context_commentstring, config = {css = '// %s'}}, - -- indent = {enable = true, disable = {"python", "html", "javascript"}}, - -- TODO seems to be broken - indent = {enable = {"javascriptreact"}}, - autotag = {enable = true}, +require("nvim-treesitter.configs").setup { + ensure_installed = O.treesitter.ensure_installed, -- one of "all", "maintained" (parsers with maintainers), or a list of languages + ignore_install = O.treesitter.ignore_install, + matchup = { + enable = true, -- mandatory, false will disable the whole extension + -- disable = { "c", "ruby" }, -- optional, list of language that will be disabled + }, + highlight = { + enable = O.treesitter.highlight.enabled, -- false will disable the whole extension + }, + context_commentstring = { enable = O.plugin.ts_context_commentstring, config = { css = "// %s" } }, + -- indent = {enable = true, disable = {"python", "html", "javascript"}}, + -- TODO seems to be broken + indent = { enable = { "javascriptreact" } }, + autotag = { enable = true }, - playground = { - enable = O.plugin.ts_playground.active, - disable = {}, - updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code - persist_queries = false, -- Whether the query persists across vim sessions - keybindings = { - toggle_query_editor = 'o', - toggle_hl_groups = 'i', - toggle_injected_languages = 't', - toggle_anonymous_nodes = 'a', - toggle_language_display = 'I', - focus_language = 'f', - unfocus_language = 'F', - update = 'R', - goto_node = '', - show_help = '?' - } - } + playground = { + enable = O.plugin.ts_playground.active, + disable = {}, + updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code + persist_queries = false, -- Whether the query persists across vim sessions + keybindings = { + toggle_query_editor = "o", + toggle_hl_groups = "i", + toggle_injected_languages = "t", + toggle_anonymous_nodes = "a", + toggle_language_display = "I", + focus_language = "f", + unfocus_language = "F", + update = "R", + goto_node = "", + show_help = "?", + }, + }, } - diff --git a/lua/lv-utils/init.lua b/lua/lv-utils/init.lua index 016bba62..c836af97 100644 --- a/lua/lv-utils/init.lua +++ b/lua/lv-utils/init.lua @@ -1,27 +1,25 @@ local lv_utils = {} function lv_utils.define_augroups(definitions) -- {{{1 - -- Create autocommand groups based on the passed definitions - -- - -- The key will be the name of the group, and each definition - -- within the group should have: - -- 1. Trigger - -- 2. Pattern - -- 3. Text - -- just like how they would normally be defined from Vim itself - for group_name, definition in pairs(definitions) do - vim.cmd('augroup ' .. group_name) - vim.cmd('autocmd!') + -- Create autocommand groups based on the passed definitions + -- + -- The key will be the name of the group, and each definition + -- within the group should have: + -- 1. Trigger + -- 2. Pattern + -- 3. Text + -- just like how they would normally be defined from Vim itself + for group_name, definition in pairs(definitions) do + vim.cmd("augroup " .. group_name) + vim.cmd "autocmd!" - for _, def in pairs(definition) do - local command = table.concat(vim.tbl_flatten {'autocmd', def}, ' ') - vim.cmd(command) - end - - vim.cmd('augroup END') + for _, def in pairs(definition) do + local command = table.concat(vim.tbl_flatten { "autocmd", def }, " ") + vim.cmd(command) end + + vim.cmd "augroup END" + end end - return lv_utils - diff --git a/lua/lv-vimtex/init.lua b/lua/lv-vimtex/init.lua index f4d1cc0c..11ed68bc 100644 --- a/lua/lv-vimtex/init.lua +++ b/lua/lv-vimtex/init.lua @@ -1,15 +1,15 @@ -vim.g.vimtex_compiler_method='latexmk' -vim.g.vimtex_view_method='zathura' -vim.g.vimtex_fold_enabled=0 +vim.g.vimtex_compiler_method = "latexmk" +vim.g.vimtex_view_method = "zathura" +vim.g.vimtex_fold_enabled = 0 -- Compile on initialization, cleanup on quit vim.api.nvim_exec( - [[ + [[ augroup vimtex_event_1 au! au User VimtexEventQuit call vimtex#compiler#clean(0) au User VimtexEventInitPost call vimtex#compiler#compile() augroup END - ]], false + ]], + false ) - diff --git a/lua/lv-which-key/init.lua b/lua/lv-which-key/init.lua index 69572dce..4e27a528 100644 --- a/lua/lv-which-key/init.lua +++ b/lua/lv-which-key/init.lua @@ -3,331 +3,329 @@ -- end require("which-key").setup { - plugins = { - marks = true, -- shows a list of your marks on ' and ` - registers = true, -- shows your registers on " in NORMAL or in INSERT mode - -- the presets plugin, adds help for a bunch of default keybindings in Neovim - -- No actual key bindings are created - presets = { - operators = false, -- adds help for operators like d, y, ... - motions = false, -- adds help for motions - text_objects = false, -- help for text objects triggered after entering an operator - windows = true, -- default bindings on - nav = true, -- misc bindings to work with windows - z = true, -- bindings for folds, spelling and others prefixed with z - g = true -- bindings for prefixed with g - } + plugins = { + marks = true, -- shows a list of your marks on ' and ` + registers = true, -- shows your registers on " in NORMAL or in INSERT mode + -- the presets plugin, adds help for a bunch of default keybindings in Neovim + -- No actual key bindings are created + presets = { + operators = false, -- adds help for operators like d, y, ... + motions = false, -- adds help for motions + text_objects = false, -- help for text objects triggered after entering an operator + windows = true, -- default bindings on + nav = true, -- misc bindings to work with windows + z = true, -- bindings for folds, spelling and others prefixed with z + g = true, -- bindings for prefixed with g }, - icons = { - breadcrumb = "»", -- symbol used in the command line area that shows your active key combo - separator = "➜", -- symbol used between a key and it's label - group = "+" -- symbol prepended to a group - }, - window = { - border = "single", -- none, single, double, shadow - position = "bottom", -- bottom, top - margin = {1, 0, 1, 0}, -- extra window margin [top, right, bottom, left] - padding = {2, 2, 2, 2} -- extra window padding [top, right, bottom, left] - }, - layout = { - height = {min = 4, max = 25}, -- min and max height of the columns - width = {min = 20, max = 50}, -- min and max width of the columns - spacing = 3 -- spacing between columns - }, - hidden = {"", "", "", "", "call", "lua", "^:", "^ "}, -- hide mapping boilerplate - show_help = true -- show help message on the command line when the popup is visible + }, + icons = { + breadcrumb = "»", -- symbol used in the command line area that shows your active key combo + separator = "➜", -- symbol used between a key and it's label + group = "+", -- symbol prepended to a group + }, + window = { + border = "single", -- none, single, double, shadow + position = "bottom", -- bottom, top + margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left] + padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left] + }, + layout = { + height = { min = 4, max = 25 }, -- min and max height of the columns + width = { min = 20, max = 50 }, -- min and max width of the columns + spacing = 3, -- spacing between columns + }, + hidden = { "", "", "", "", "call", "lua", "^:", "^ " }, -- hide mapping boilerplate + show_help = true, -- show help message on the command line when the popup is visible } -- Set leader -if O.leader_key == ' ' or O.leader_key == 'space' then - vim.api.nvim_set_keymap('n', '', '', - {noremap = true, silent = true}) - vim.g.mapleader = ' ' +if O.leader_key == " " or O.leader_key == "space" then + vim.api.nvim_set_keymap("n", "", "", { noremap = true, silent = true }) + vim.g.mapleader = " " else - vim.api.nvim_set_keymap('n', O.leader_key, '', - {noremap = true, silent = true}) - vim.g.mapleader = O.leader_key + vim.api.nvim_set_keymap("n", O.leader_key, "", { noremap = true, silent = true }) + vim.g.mapleader = O.leader_key end local opts = { - mode = "n", -- NORMAL mode - prefix = "", - buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings - silent = true, -- use `silent` when creating keymaps - noremap = true, -- use `noremap` when creating keymaps - nowait = false -- use `nowait` when creating keymaps + mode = "n", -- NORMAL mode + prefix = "", + buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings + silent = true, -- use `silent` when creating keymaps + noremap = true, -- use `noremap` when creating keymaps + nowait = false, -- use `nowait` when creating keymaps } -- no hl -vim.api.nvim_set_keymap('n', 'h', ':let @/=""', - {noremap = true, silent = true}) +vim.api.nvim_set_keymap("n", "h", ':let @/=""', { noremap = true, silent = true }) -- explorer -- TODO this introduces some bugs unfortunately -vim.api.nvim_set_keymap('n', 'e', - ":lua require'lv-nvimtree'.toggle_tree()", - {noremap = true, silent = true}) +vim.api.nvim_set_keymap( + "n", + "e", + ":lua require'lv-nvimtree'.toggle_tree()", + { noremap = true, silent = true } +) -- vim.api.nvim_set_keymap('n', 'e', -- ":NvimTreeToggle", -- {noremap = true, silent = true}) -- telescope or snap if O.plugin.snap.active then - vim.api.nvim_set_keymap('n', 'f', ':Snap find_files', - {noremap = true, silent = true}) + vim.api.nvim_set_keymap("n", "f", ":Snap find_files", { noremap = true, silent = true }) else - vim.api.nvim_set_keymap('n', 'f', ':Telescope find_files', - {noremap = true, silent = true}) + vim.api.nvim_set_keymap("n", "f", ":Telescope find_files", { noremap = true, silent = true }) end -- dashboard -vim.api.nvim_set_keymap('n', ';', ':Dashboard', - {noremap = true, silent = true}) +vim.api.nvim_set_keymap("n", ";", ":Dashboard", { noremap = true, silent = true }) -- Comments -vim.api.nvim_set_keymap("n", "/", ":CommentToggle", - {noremap = true, silent = true}) -vim.api.nvim_set_keymap("v", "/", ":CommentToggle", - {noremap = true, silent = true}) +vim.api.nvim_set_keymap("n", "/", ":CommentToggle", { noremap = true, silent = true }) +vim.api.nvim_set_keymap("v", "/", ":CommentToggle", { noremap = true, silent = true }) -- close buffer -vim.api.nvim_set_keymap("n", "c", ":bdelete", - {noremap = true, silent = true}) +vim.api.nvim_set_keymap("n", "c", ":bdelete", { noremap = true, silent = true }) -- TODO create entire treesitter section local mappings = { - ["/"] = "Comment", - ["c"] = "Close Buffer", - ["e"] = "Explorer", - ["f"] = "Find File", - ["h"] = "No Highlight", - b = { - name = "Buffers", - j = {"BufferPick", "jump to buffer"}, - f = {O.plugin.snap.active and "Snap buffers" or "Telescope buffers", "Find buffer"}, - w = {"BufferWipeout", "wipeout buffer"}, - e = { - "BufferCloseAllButCurrent", "close all but current buffer" - }, - h = {"BufferCloseBuffersLeft", "close all buffers to the left"}, - l = { - "BufferCloseBuffersRight", - "close all BufferLines to the right" - }, - D = { - "BufferOrderByDirectory", - "sort BufferLines automatically by directory" - }, - L = { - "BufferOrderByLanguage", - "sort BufferLines automatically by language" - } - }, - - -- diagnostics vanilla nvim - -- -- diagnostic - -- function lv_utils.get_all() - -- vim.lsp.diagnostic.get_all() - -- end - -- function lv_utils.get_next() - -- vim.lsp.diagnostic.get_next() - -- end - -- function lv_utils.get_prev() - -- vim.lsp.diagnostic.get_prev() - -- end - -- function lv_utils.goto_next() - -- vim.lsp.diagnostic.goto_next() - -- end - -- function lv_utils.goto_prev() - -- vim.lsp.diagnostic.goto_prev() - -- end - -- function lv_utils.show_line_diagnostics() - -- vim.lsp.diagnostic.show_line_diagnostics() - -- end - - -- " Available Debug Adapters: - -- " https://microsoft.github.io/debug-adapter-protocol/implementors/adapters/ - -- " Adapter configuration and installation instructions: - -- " https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation - -- " Debug Adapter protocol: - -- " https://microsoft.github.io/debug-adapter-protocol/ - -- " Debugging - -- command! DebugToggleBreakpoint lua require'dap'.toggle_breakpoint() - -- command! DebugStart lua require'dap'.continue() - -- command! DebugContinue lua require'dap'.continue() - -- command! DebugStepOver lua require'dap'.step_over() - -- command! DebugStepOut lua require'dap'.step_out() - -- command! DebugStepInto lua require'dap'.step_into() - -- command! DebugToggleRepl lua require'dap'.repl.toggle() - -- command! DebugGetSession lua require'dap'.session() - -- D = { - -- name = "Debug", - -- b = {"DebugToggleBreakpoint", "Toggle Breakpoint"}, - -- c = {"DebugContinue", "Continue"}, - -- i = {"DebugStepInto", "Step Into"}, - -- o = {"DebugStepOver", "Step Over"}, - -- r = {"DebugToggleRepl", "Toggle Repl"}, - -- s = {"DebugStart", "Start"} - -- }, - g = { - name = "Git", - j = {"lua require 'gitsigns'.next_hunk()", "Next Hunk"}, - k = {"lua require 'gitsigns'.prev_hunk()", "Prev Hunk"}, - l = {"lua require 'gitsigns'.blame_line()", "Blame"}, - p = {"lua require 'gitsigns'.preview_hunk()", "Preview Hunk"}, - r = {"lua require 'gitsigns'.reset_hunk()", "Reset Hunk"}, - R = {"lua require 'gitsigns'.reset_buffer()", "Reset Buffer"}, - s = {"lua require 'gitsigns'.stage_hunk()", "Stage Hunk"}, - u = { - "lua require 'gitsigns'.undo_stage_hunk()", - "Undo Stage Hunk" - }, - o = {"Telescope git_status", "Open changed file"}, - b = {"Telescope git_branches", "Checkout branch"}, - c = {"Telescope git_commits", "Checkout commit"}, - C = { - "Telescope git_bcommits", - "Checkout commit(for current file)" - } + ["/"] = "Comment", + ["c"] = "Close Buffer", + ["e"] = "Explorer", + ["f"] = "Find File", + ["h"] = "No Highlight", + b = { + name = "Buffers", + j = { "BufferPick", "jump to buffer" }, + f = { O.plugin.snap.active and "Snap buffers" or "Telescope buffers", "Find buffer" }, + w = { "BufferWipeout", "wipeout buffer" }, + e = { + "BufferCloseAllButCurrent", + "close all but current buffer", }, + h = { "BufferCloseBuffersLeft", "close all buffers to the left" }, l = { - name = "LSP", - a = {"Lspsaga code_action", "Code Action"}, - A = {"Lspsaga range_code_action", "Selected Action"}, - d = { - "Telescope lsp_document_diagnostics", - "Document Diagnostics" - }, - D = { - "Telescope lsp_workspace_diagnostics", - "Workspace Diagnostics" - }, - f = {"lua vim.lsp.buf.formatting()", "Format"}, - h = {"Lspsaga hover_doc", "Hover Doc"}, - i = {"LspInfo", "Info"}, - j = {"Lspsaga diagnostic_jump_prev", "Prev Diagnostic"}, - k = {"Lspsaga diagnostic_jump_next", "Next Diagnostic"}, - l = {"Lspsaga lsp_finder", "LSP Finder"}, - L = {"Lspsaga show_line_diagnostics", "Line Diagnostics"}, - p = {"Lspsaga preview_definition", "Preview Definition"}, - q = {"Telescope quickfix", "Quickfix"}, - r = {"Lspsaga rename", "Rename"}, - t = {"LspTypeDefinition", "Type Definition"}, - x = {"cclose", "Close Quickfix"}, - s = {O.plugin.symbol_outline.active and "SymbolsOutline" or - " Telescope lsp_document_symbols", "Document Symbols"}, - S = { - "Telescope lsp_dynamic_workspace_symbols", - "Workspace Symbols" - } + "BufferCloseBuffersRight", + "close all BufferLines to the right", }, + D = { + "BufferOrderByDirectory", + "sort BufferLines automatically by directory", + }, + L = { + "BufferOrderByLanguage", + "sort BufferLines automatically by language", + }, + }, + + -- diagnostics vanilla nvim + -- -- diagnostic + -- function lv_utils.get_all() + -- vim.lsp.diagnostic.get_all() + -- end + -- function lv_utils.get_next() + -- vim.lsp.diagnostic.get_next() + -- end + -- function lv_utils.get_prev() + -- vim.lsp.diagnostic.get_prev() + -- end + -- function lv_utils.goto_next() + -- vim.lsp.diagnostic.goto_next() + -- end + -- function lv_utils.goto_prev() + -- vim.lsp.diagnostic.goto_prev() + -- end + -- function lv_utils.show_line_diagnostics() + -- vim.lsp.diagnostic.show_line_diagnostics() + -- end + + -- " Available Debug Adapters: + -- " https://microsoft.github.io/debug-adapter-protocol/implementors/adapters/ + -- " Adapter configuration and installation instructions: + -- " https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation + -- " Debug Adapter protocol: + -- " https://microsoft.github.io/debug-adapter-protocol/ + -- " Debugging + -- command! DebugToggleBreakpoint lua require'dap'.toggle_breakpoint() + -- command! DebugStart lua require'dap'.continue() + -- command! DebugContinue lua require'dap'.continue() + -- command! DebugStepOver lua require'dap'.step_over() + -- command! DebugStepOut lua require'dap'.step_out() + -- command! DebugStepInto lua require'dap'.step_into() + -- command! DebugToggleRepl lua require'dap'.repl.toggle() + -- command! DebugGetSession lua require'dap'.session() + -- D = { + -- name = "Debug", + -- b = {"DebugToggleBreakpoint", "Toggle Breakpoint"}, + -- c = {"DebugContinue", "Continue"}, + -- i = {"DebugStepInto", "Step Into"}, + -- o = {"DebugStepOver", "Step Over"}, + -- r = {"DebugToggleRepl", "Toggle Repl"}, + -- s = {"DebugStart", "Start"} + -- }, + g = { + name = "Git", + j = { "lua require 'gitsigns'.next_hunk()", "Next Hunk" }, + k = { "lua require 'gitsigns'.prev_hunk()", "Prev Hunk" }, + l = { "lua require 'gitsigns'.blame_line()", "Blame" }, + p = { "lua require 'gitsigns'.preview_hunk()", "Preview Hunk" }, + r = { "lua require 'gitsigns'.reset_hunk()", "Reset Hunk" }, + R = { "lua require 'gitsigns'.reset_buffer()", "Reset Buffer" }, + s = { "lua require 'gitsigns'.stage_hunk()", "Stage Hunk" }, + u = { + "lua require 'gitsigns'.undo_stage_hunk()", + "Undo Stage Hunk", + }, + o = { "Telescope git_status", "Open changed file" }, + b = { "Telescope git_branches", "Checkout branch" }, + c = { "Telescope git_commits", "Checkout commit" }, + C = { + "Telescope git_bcommits", + "Checkout commit(for current file)", + }, + }, + l = { + name = "LSP", + a = { "Lspsaga code_action", "Code Action" }, + A = { "Lspsaga range_code_action", "Selected Action" }, + d = { + "Telescope lsp_document_diagnostics", + "Document Diagnostics", + }, + D = { + "Telescope lsp_workspace_diagnostics", + "Workspace Diagnostics", + }, + f = { "lua vim.lsp.buf.formatting()", "Format" }, + h = { "Lspsaga hover_doc", "Hover Doc" }, + i = { "LspInfo", "Info" }, + j = { "Lspsaga diagnostic_jump_prev", "Prev Diagnostic" }, + k = { "Lspsaga diagnostic_jump_next", "Next Diagnostic" }, + l = { "Lspsaga lsp_finder", "LSP Finder" }, + L = { "Lspsaga show_line_diagnostics", "Line Diagnostics" }, + p = { "Lspsaga preview_definition", "Preview Definition" }, + q = { "Telescope quickfix", "Quickfix" }, + r = { "Lspsaga rename", "Rename" }, + t = { "LspTypeDefinition", "Type Definition" }, + x = { "cclose", "Close Quickfix" }, s = { - name = "Search", - b = {"Telescope git_branches", "Checkout branch"}, - c = {"Telescope colorscheme", "Colorscheme"}, - -- d = { - -- "Telescope lsp_document_diagnostics", - -- "Document Diagnostics" - -- }, - -- D = { - -- "Telescope lsp_workspace_diagnostics", - -- "Workspace Diagnostics" - -- }, - f = {O.plugin.snap.active and "Snap find_files" or "Telescope find_files", "Find File"}, - h = {"Telescope help_tags", "Find Help"}, - -- m = {"Telescope marks", "Marks"}, - M = {"Telescope man_pages", "Man Pages"}, - r = {O.plugin.snap.active and "Snap oldfiles" or "Telescope oldfiles", "Open Recent File"}, - R = {"Telescope registers", "Registers"}, - t = {O.plugin.snap.active and "Snap live_grep" or "Telescope live_grep", "Text"} + O.plugin.symbol_outline.active and "SymbolsOutline" or " Telescope lsp_document_symbols", + "Document Symbols", }, S = { - name = "Session", - s = {"SessionSave", "Save Session"}, - l = {"SessionLoad", "Load Session"} + "Telescope lsp_dynamic_workspace_symbols", + "Workspace Symbols", }, - T = { - name = "Treesitter", - i = {":TSConfigInfo", "Info"} - } + }, + s = { + name = "Search", + b = { "Telescope git_branches", "Checkout branch" }, + c = { "Telescope colorscheme", "Colorscheme" }, + -- d = { + -- "Telescope lsp_document_diagnostics", + -- "Document Diagnostics" + -- }, + -- D = { + -- "Telescope lsp_workspace_diagnostics", + -- "Workspace Diagnostics" + -- }, + f = { O.plugin.snap.active and "Snap find_files" or "Telescope find_files", "Find File" }, + h = { "Telescope help_tags", "Find Help" }, + -- m = {"Telescope marks", "Marks"}, + M = { "Telescope man_pages", "Man Pages" }, + r = { O.plugin.snap.active and "Snap oldfiles" or "Telescope oldfiles", "Open Recent File" }, + R = { "Telescope registers", "Registers" }, + t = { O.plugin.snap.active and "Snap live_grep" or "Telescope live_grep", "Text" }, + }, + S = { + name = "Session", + s = { "SessionSave", "Save Session" }, + l = { "SessionLoad", "Load Session" }, + }, + T = { + name = "Treesitter", + i = { ":TSConfigInfo", "Info" }, + }, } - if O.plugin.spectre.active then - mappings['r'] = { - name = "Replace", - f = { - "lua require('spectre').open_file_search()", "Current File" - }, - p = {"lua require('spectre').open()", "Project"} - } + mappings["r"] = { + name = "Replace", + f = { + "lua require('spectre').open_file_search()", + "Current File", + }, + p = { "lua require('spectre').open()", "Project" }, + } end if O.plugin.trouble.active then - mappings['d'] = { - name = "Diagnostics", - t = {"TroubleToggle", "trouble"}, - w = {"TroubleToggle lsp_workspace_diagnostics", "workspace"}, - d = {"TroubleToggle lsp_document_diagnostics", "document"}, - q = {"TroubleToggle quickfix", "quickfix"}, - l = {"TroubleToggle loclist", "loclist"}, - r = {"TroubleToggle lsp_references", "references"} - } + mappings["d"] = { + name = "Diagnostics", + t = { "TroubleToggle", "trouble" }, + w = { "TroubleToggle lsp_workspace_diagnostics", "workspace" }, + d = { "TroubleToggle lsp_document_diagnostics", "document" }, + q = { "TroubleToggle quickfix", "quickfix" }, + l = { "TroubleToggle loclist", "loclist" }, + r = { "TroubleToggle lsp_references", "references" }, + } end -if O.plugin.gitlinker.active then mappings["gy"] = "Gitlink" end +if O.plugin.gitlinker.active then + mappings["gy"] = "Gitlink" +end if O.plugin.ts_playground.active then - vim.api.nvim_set_keymap("n", "Th", - ":TSHighlightCapturesUnderCursor", - {noremap = true, silent = true}) - mappings[""] = "Highlight Capture" + vim.api.nvim_set_keymap("n", "Th", ":TSHighlightCapturesUnderCursor", { noremap = true, silent = true }) + mappings[""] = "Highlight Capture" end if O.plugin.zen.active then - vim.api.nvim_set_keymap("n", "z", ":ZenMode", - {noremap = true, silent = true}) - mappings["z"] = "Zen" + vim.api.nvim_set_keymap("n", "z", ":ZenMode", { noremap = true, silent = true }) + mappings["z"] = "Zen" end if O.plugin.lazygit.active then - vim.api.nvim_set_keymap("n", "gg", ":LazyGit", - {noremap = true, silent = true}) - mappings["gg"] = "LazyGit" + vim.api.nvim_set_keymap("n", "gg", ":LazyGit", { noremap = true, silent = true }) + mappings["gg"] = "LazyGit" end if O.plugin.telescope_project.active then - -- open projects - vim.api.nvim_set_keymap('n', 'p', - ":lua require'telescope'.extensions.project.project{}", - {noremap = true, silent = true}) - mappings["p"] = "Projects" + -- open projects + vim.api.nvim_set_keymap( + "n", + "p", + ":lua require'telescope'.extensions.project.project{}", + { noremap = true, silent = true } + ) + mappings["p"] = "Projects" end -- [";"] = "Dashboard", if O.lang.latex.active then - mappings["L"] = { - name = "+Latex", - c = {"VimtexCompile", "Toggle Compilation Mode"}, - f = {"call vimtex#fzf#run()", "Fzf Find"}, - i = {"VimtexInfo", "Project Information"}, - s = {"VimtexStop", "Stop Project Compilation"}, - t = {"VimtexTocToggle", "Toggle Table Of Content"}, - v = {"VimtexView", "View PDF"} - } + mappings["L"] = { + name = "+Latex", + c = { "VimtexCompile", "Toggle Compilation Mode" }, + f = { "call vimtex#fzf#run()", "Fzf Find" }, + i = { "VimtexInfo", "Project Information" }, + s = { "VimtexStop", "Stop Project Compilation" }, + t = { "VimtexTocToggle", "Toggle Table Of Content" }, + v = { "VimtexView", "View PDF" }, + } end if O.lushmode then - mappings["L"] = { - name = "+Lush", - l = {":Lushify", "Lushify"}, - x = {":lua require('lush').export_to_buffer(require('lush_theme.cool_name'))", "Lush Export"}, - t = {":LushRunTutorial", "Lush Tutorial"}, - q = {":LushRunQuickstart", "Lush Quickstart"} - } + mappings["L"] = { + name = "+Lush", + l = { ":Lushify", "Lushify" }, + x = { ":lua require('lush').export_to_buffer(require('lush_theme.cool_name'))", "Lush Export" }, + t = { ":LushRunTutorial", "Lush Tutorial" }, + q = { ":LushRunQuickstart", "Lush Quickstart" }, + } end -local wk = require("which-key") +local wk = require "which-key" wk.register(mappings, opts) diff --git a/lua/lv-zen/init.lua b/lua/lv-zen/init.lua index 2a87d6f4..0d6bfca0 100644 --- a/lua/lv-zen/init.lua +++ b/lua/lv-zen/init.lua @@ -1,26 +1,26 @@ local M = {} M.config = function() - require("zen-mode").setup { - window = { - backdrop = 1, - height = .85, -- height of the Zen window - options = { - signcolumn = "no", -- disable signcolumn - number = false, -- disable number column - relativenumber = false -- disable relative numbers - -- cursorline = false, -- disable cursorline - -- cursorcolumn = false, -- disable cursor column - -- foldcolumn = "0", -- disable fold column - -- list = false, -- disable whitespace characters - } - }, - plugins = { - gitsigns = {enabled = false} -- disables git signs - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below - } - } + require("zen-mode").setup { + window = { + backdrop = 1, + height = 0.85, -- height of the Zen window + options = { + signcolumn = "no", -- disable signcolumn + number = false, -- disable number column + relativenumber = false, -- disable relative numbers + -- cursorline = false, -- disable cursorline + -- cursorcolumn = false, -- disable cursor column + -- foldcolumn = "0", -- disable fold column + -- list = false, -- disable whitespace characters + }, + }, + plugins = { + gitsigns = { enabled = false }, -- disables git signs + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + }, + } end return M diff --git a/lua/plugins.lua b/lua/plugins.lua index e202100f..5a67b430 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -1,458 +1,459 @@ local execute = vim.api.nvim_command local fn = vim.fn -local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim" +local install_path = fn.stdpath "data" .. "/site/pack/packer/start/packer.nvim" if fn.empty(fn.glob(install_path)) > 0 then - execute("!git clone https://github.com/wbthomason/packer.nvim " .. - install_path) - execute "packadd packer.nvim" + execute("!git clone https://github.com/wbthomason/packer.nvim " .. install_path) + execute "packadd packer.nvim" end local packer_ok, packer = pcall(require, "packer") -if not packer_ok then return end +if not packer_ok then + return +end packer.init { - -- compile_path = vim.fn.stdpath('data')..'/site/pack/loader/start/packer.nvim/plugin/packer_compiled.vim', - compile_path = require("packer.util").join_paths(vim.fn.stdpath('config'), - 'plugin', - 'packer_compiled.vim'), - git = {clone_timeout = 300}, - display = { - open_fn = function() - return require("packer.util").float {border = "single"} - end - } + -- compile_path = vim.fn.stdpath('data')..'/site/pack/loader/start/packer.nvim/plugin/packer_compiled.vim', + compile_path = require("packer.util").join_paths(vim.fn.stdpath "config", "plugin", "packer_compiled.vim"), + git = { clone_timeout = 300 }, + display = { + open_fn = function() + return require("packer.util").float { border = "single" } + end, + }, } -vim.cmd "autocmd BufWritePost plugins.lua PackerCompile" -- Auto compile when there are changes in plugins.lua +vim.cmd "autocmd BufWritePost plugins.lua PackerCompile" return require("packer").startup(function(use) - -- Packer can manage itself as an optional plugin - use "wbthomason/packer.nvim" + -- Packer can manage itself as an optional plugin + use "wbthomason/packer.nvim" - -- TODO refactor all of this (for now it works, but yes I know it could be wrapped in a simpler function) - use {"neovim/nvim-lspconfig"} - use {"glepnir/lspsaga.nvim", cmd = "Lspsaga"} - use {"kabouzeid/nvim-lspinstall", cmd = "LspInstall"} - -- Telescope - use {"nvim-lua/popup.nvim"} - use {"nvim-lua/plenary.nvim"} - use {"tjdevries/astronauta.nvim"} - use { - "nvim-telescope/telescope.nvim", - config = [[require('lv-telescope')]], - cmd = "Telescope" - } - -- Snap TODO disable for now, need to only install fzy when user specifies they want to use snap - -- use { - -- "camspiers/snap", - -- rocks = "fzy", - -- config = function() - -- require("lv-snap").config() - -- end, - -- disable = not O.plugin.snap.active - -- } - -- Autocomplete - use { - "hrsh7th/nvim-compe", - event = "InsertEnter", - config = function() - require("lv-compe").config() - end - } + -- TODO refactor all of this (for now it works, but yes I know it could be wrapped in a simpler function) + use { "neovim/nvim-lspconfig" } + use { "glepnir/lspsaga.nvim", cmd = "Lspsaga" } + use { "kabouzeid/nvim-lspinstall", cmd = "LspInstall" } + -- Telescope + use { "nvim-lua/popup.nvim" } + use { "nvim-lua/plenary.nvim" } + use { "tjdevries/astronauta.nvim" } + use { + "nvim-telescope/telescope.nvim", + config = [[require('lv-telescope')]], + cmd = "Telescope", + } + -- Snap TODO disable for now, need to only install fzy when user specifies they want to use snap + -- use { + -- "camspiers/snap", + -- rocks = "fzy", + -- config = function() + -- require("lv-snap").config() + -- end, + -- disable = not O.plugin.snap.active + -- } + -- Autocomplete + use { + "hrsh7th/nvim-compe", + event = "InsertEnter", + config = function() + require("lv-compe").config() + end, + } - use {"hrsh7th/vim-vsnip", event = "InsertEnter"} - use {"rafamadriz/friendly-snippets", event = "InsertEnter"} + use { "hrsh7th/vim-vsnip", event = "InsertEnter" } + use { "rafamadriz/friendly-snippets", event = "InsertEnter" } - -- Treesitter - use {"nvim-treesitter/nvim-treesitter", run = ":TSUpdate"} + -- Treesitter + use { "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" } - use { - "kyazdani42/nvim-tree.lua", - -- cmd = "NvimTreeToggle", - config = function() - require("lv-nvimtree").config() - end - } + use { + "kyazdani42/nvim-tree.lua", + -- cmd = "NvimTreeToggle", + config = function() + require("lv-nvimtree").config() + end, + } - use { - "lewis6991/gitsigns.nvim", + use { + "lewis6991/gitsigns.nvim", - config = function() - require("lv-gitsigns").config() - end, - event = "BufRead" - } + config = function() + require("lv-gitsigns").config() + end, + event = "BufRead", + } - -- whichkey - use {"folke/which-key.nvim"} + -- whichkey + use { "folke/which-key.nvim" } - -- Autopairs - use { - "windwp/nvim-autopairs", - event = "InsertEnter", - after = {"telescope.nvim", "nvim-compe"}, - config = function() - require 'lv-autopairs' - end - } + -- Autopairs + use { + "windwp/nvim-autopairs", + event = "InsertEnter", + after = { "telescope.nvim", "nvim-compe" }, + config = function() + require "lv-autopairs" + end, + } - -- Comments - use { - "terrortylor/nvim-comment", - cmd = "CommentToggle", - config = function() - require('nvim_comment').setup() - end - } + -- Comments + use { + "terrortylor/nvim-comment", + cmd = "CommentToggle", + config = function() + require("nvim_comment").setup() + end, + } - -- Color - use {"christianchiarulli/nvcode-color-schemes.vim", opt = true} + -- Color + use { "christianchiarulli/nvcode-color-schemes.vim", opt = true } - -- Icons - use {"kyazdani42/nvim-web-devicons"} + -- Icons + use { "kyazdani42/nvim-web-devicons" } - -- Status Line and Bufferline - use {"glepnir/galaxyline.nvim"} + -- Status Line and Bufferline + use { "glepnir/galaxyline.nvim" } - use { - "akinsho/nvim-bufferline.lua", - config = function() - require("lv-bufferline").config() - end, - event = "BufRead" + use { + "akinsho/nvim-bufferline.lua", + config = function() + require("lv-bufferline").config() + end, + event = "BufRead", + } - } + -- Extras, these do not load by default - -- Extras, these do not load by default + -- Better motions + use { + "phaazon/hop.nvim", + event = "BufRead", + config = function() + require("lv-hop").config() + end, + disable = not O.plugin.hop.active, + opt = true, + } + -- Enhanced increment/decrement + use { + "monaqa/dial.nvim", + event = "BufRead", + config = function() + require("lv-dial").config() + end, + disable = not O.plugin.dial.active, + opt = true, + } + -- Dashboard + use { + "ChristianChiarulli/dashboard-nvim", + event = "BufWinEnter", + cmd = { "Dashboard", "DashboardNewFile", "DashboardJumpMarks" }, + config = function() + require("lv-dashboard").config() + end, + disable = not O.plugin.dashboard.active, + opt = true, + } + -- Zen Mode + use { + "folke/zen-mode.nvim", + cmd = "ZenMode", + -- event = "BufRead", + config = function() + require("lv-zen").config() + end, + disable = not O.plugin.zen.active, + } + -- Ranger + use { + "kevinhwang91/rnvimr", + cmd = "Rnvimr", + config = function() + require("lv-rnvimr").config() + end, + disable = not O.plugin.ranger.active, + } - -- Better motions - use { - 'phaazon/hop.nvim', - event = 'BufRead', - config = function() - require('lv-hop').config() - end, - disable = not O.plugin.hop.active, - opt = true - } - -- Enhanced increment/decrement - use { - 'monaqa/dial.nvim', - event = 'BufRead', - config = function() - require('lv-dial').config() - end, - disable = not O.plugin.dial.active, - opt = true - } - -- Dashboard - use { - "ChristianChiarulli/dashboard-nvim", - event = 'BufWinEnter', - cmd = {"Dashboard", "DashboardNewFile", "DashboardJumpMarks"}, - config = function() - require('lv-dashboard').config() - end, - disable = not O.plugin.dashboard.active, - opt = true - } - -- Zen Mode - use { - "folke/zen-mode.nvim", - cmd = "ZenMode", - -- event = "BufRead", - config = function() - require('lv-zen').config() - end, - disable = not O.plugin.zen.active - } - -- Ranger - use { - "kevinhwang91/rnvimr", - cmd = "Rnvimr", - config = function() - require('lv-rnvimr').config() - end, - disable = not O.plugin.ranger.active - } + -- matchup + use { + "andymass/vim-matchup", + event = "CursorMoved", + config = function() + require("lv-matchup").config() + end, + disable = not O.plugin.matchup.active, + } - -- matchup - use { - 'andymass/vim-matchup', - event = "CursorMoved", - config = function() - require('lv-matchup').config() - end, - disable = not O.plugin.matchup.active - } + use { + "norcalli/nvim-colorizer.lua", + event = "BufRead", + config = function() + require("colorizer").setup() + vim.cmd "ColorizerReloadAllBuffers" + end, + disable = not O.plugin.colorizer.active, + } - use { - "norcalli/nvim-colorizer.lua", - event = "BufRead", - config = function() - require("colorizer").setup() - vim.cmd("ColorizerReloadAllBuffers") - end, - disable = not O.plugin.colorizer.active - } + use { + "nacro90/numb.nvim", + event = "BufRead", + config = function() + require("numb").setup { + show_numbers = true, -- Enable 'number' for the window while peeking + show_cursorline = true, -- Enable 'cursorline' for the window while peeking + } + end, + disable = not O.plugin.numb.active, + } - use { - "nacro90/numb.nvim", - event = "BufRead", - config = function() - require('numb').setup { - show_numbers = true, -- Enable 'number' for the window while peeking - show_cursorline = true -- Enable 'cursorline' for the window while peeking - } - end, - disable = not O.plugin.numb.active - } + -- Treesitter playground + use { + "nvim-treesitter/playground", + event = "BufRead", + disable = not O.plugin.ts_playground.active, + } - -- Treesitter playground - use { - 'nvim-treesitter/playground', - event = "BufRead", - disable = not O.plugin.ts_playground.active - } + use { + "lukas-reineke/indent-blankline.nvim", + event = "BufRead", + setup = function() + vim.g.indentLine_enabled = 1 + vim.g.indent_blankline_char = "▏" - use { - "lukas-reineke/indent-blankline.nvim", - event = "BufRead", - setup = function() + vim.g.indent_blankline_filetype_exclude = { "help", "terminal", "dashboard" } + vim.g.indent_blankline_buftype_exclude = { "terminal" } - vim.g.indentLine_enabled = 1 - vim.g.indent_blankline_char = "▏" + vim.g.indent_blankline_show_trailing_blankline_indent = false + vim.g.indent_blankline_show_first_indent_level = true + end, + disable = not O.plugin.indent_line.active, + } - vim.g.indent_blankline_filetype_exclude = - {"help", "terminal", "dashboard"} - vim.g.indent_blankline_buftype_exclude = {"terminal"} + -- comments in context + use { + "JoosepAlviste/nvim-ts-context-commentstring", + event = "BufRead", + disable = not O.plugin.ts_context_commentstring.active, + } - vim.g.indent_blankline_show_trailing_blankline_indent = false - vim.g.indent_blankline_show_first_indent_level = true - end, - disable = not O.plugin.indent_line.active - } - - -- comments in context - use { - 'JoosepAlviste/nvim-ts-context-commentstring', - event = "BufRead", - disable = not O.plugin.ts_context_commentstring.active - } - - -- Symbol Outline - use { - 'simrat39/symbols-outline.nvim', - cmd = 'SymbolsOutline', - disable = not O.plugin.symbol_outline.active - } - -- diagnostics - use { - "folke/trouble.nvim", - cmd = 'TroubleToggle', - disable = not O.plugin.trouble.active - } - -- Debugging - use { - "mfussenegger/nvim-dap", - event = "BufRead", - disable = not O.plugin.debug.active - } - -- Better quickfix - use { - "kevinhwang91/nvim-bqf", - event = "BufRead", - disable = not O.plugin.bqf.active - } - -- Floating terminal - use { - 'numToStr/FTerm.nvim', - event = "BufRead", - config = function() - require'FTerm'.setup({ - dimensions = {height = 0.8, width = 0.8, x = 0.5, y = 0.5}, - border = 'single' -- or 'double' - }) - end, - disable = not O.plugin.floatterm.active - } - -- Search & Replace - use { - 'windwp/nvim-spectre', - event = "BufRead", - config = function() - require('spectre').setup() - end, - disable = not O.plugin.spectre.active - } - -- lsp root with this nvim-tree will follow you - use { - "ahmedkhalf/lsp-rooter.nvim", - event = "BufRead", - config = function() - require("lsp-rooter").setup() - end, - disable = not O.plugin.lsp_rooter.active - } - -- Markdown preview - use { - 'iamcco/markdown-preview.nvim', - run = 'cd app && npm install', - ft = 'markdown', - disable = not O.plugin.markdown_preview.active - } - -- Interactive scratchpad - use { - 'metakirby5/codi.vim', - cmd = 'Codi', - disable = not O.plugin.codi.active - } - -- Use fzy for telescope - use { - "nvim-telescope/telescope-fzy-native.nvim", - event = "BufRead", - disable = not O.plugin.telescope_fzy.active - } - -- Use project for telescope - use { - "nvim-telescope/telescope-project.nvim", - event = "BufRead", - after = "telescope.nvim", - disable = not O.plugin.telescope_project.active - } - -- Sane gx for netrw_gx bug - use { - "felipec/vim-sanegx", - event = "BufRead", - disable = not O.plugin.sanegx.active - } - -- Sane gx for netrw_gx bug - use { - "folke/todo-comments.nvim", - event = "BufRead", - disable = not O.plugin.todo_comments.active - } - -- LSP Colors - use { - "folke/lsp-colors.nvim", - event = "BufRead", - disable = not O.plugin.lsp_colors.active - } - -- Git Blame - use { - "f-person/git-blame.nvim", - event = "BufRead", - disable = not O.plugin.git_blame.active - } - use { - 'ruifm/gitlinker.nvim', - event = "BufRead", - config = function() - require"gitlinker".setup({ - opts = { - -- remote = 'github', -- force the use of a specific remote - -- adds current line nr in the url for normal mode - add_current_line_on_normal_mode = true, - -- callback for what to do with the url - action_callback = require"gitlinker.actions".open_in_browser, - -- print the url after performing the action - print_url = false, - -- mapping to call url generation - mappings = "gy" - } - }) - - end, - disable = not O.plugin.gitlinker.active, - requires = 'nvim-lua/plenary.nvim' - - } - -- Lazygit - use { - "kdheepak/lazygit.nvim", - cmd = "LazyGit", - disable = not O.plugin.lazygit.active - } - -- Octo - use { - "pwntester/octo.nvim", - event = "BufRead", - disable = not O.plugin.octo.active - } - -- Diffview - use { - "sindrets/diffview.nvim", - event = "BufRead", - disable = not O.plugin.diffview.active - } - -- Easily Create Gists - use { - "mattn/vim-gist", - event = "BufRead", - disable = not O.plugin.gist.active, - requires = 'mattn/webapi-vim' - } - -- Lush Create Color Schemes - use { - "rktjmp/lush.nvim", - -- cmd = {"LushRunQuickstart", "LushRunTutorial", "Lushify"}, - disable = not O.plugin.lush.active - } - -- HTML preview - use { - 'turbio/bracey.vim', - event = "BufRead", - run = 'npm install --prefix server', - disable = not O.plugin.bracey.active - } - -- Debugger management - use { - 'Pocco81/DAPInstall.nvim', - event = "BufRead", - disable = not O.plugin.dap_install.active - } - - -- LANGUAGE SPECIFIC GOES HERE - - use {"lervag/vimtex", ft = "tex" } - - - -- Rust tools - -- TODO: use lazy loading maybe? - use { - "simrat39/rust-tools.nvim", - disable = not O.lang.rust.rust_tools.active - } - - -- Elixir - use {"elixir-editors/vim-elixir", ft = {"elixir", "eelixir", "euphoria3"}} - - -- Javascript / Typescript - use { - "jose-elias-alvarez/nvim-lsp-ts-utils", - ft = { - "javascript", "javascriptreact", "javascript.jsx", "typescript", - "typescriptreact", "typescript.tsx" - } - } - use { - "jose-elias-alvarez/null-ls.nvim", - ft = { - "javascript", "javascriptreact", "javascript.jsx", "typescript", - "typescriptreact", "typescript.tsx" + -- Symbol Outline + use { + "simrat39/symbols-outline.nvim", + cmd = "SymbolsOutline", + disable = not O.plugin.symbol_outline.active, + } + -- diagnostics + use { + "folke/trouble.nvim", + cmd = "TroubleToggle", + disable = not O.plugin.trouble.active, + } + -- Debugging + use { + "mfussenegger/nvim-dap", + event = "BufRead", + disable = not O.plugin.debug.active, + } + -- Better quickfix + use { + "kevinhwang91/nvim-bqf", + event = "BufRead", + disable = not O.plugin.bqf.active, + } + -- Floating terminal + use { + "numToStr/FTerm.nvim", + event = "BufRead", + config = function() + require("FTerm").setup { + dimensions = { height = 0.8, width = 0.8, x = 0.5, y = 0.5 }, + border = "single", -- or 'double' + } + end, + disable = not O.plugin.floatterm.active, + } + -- Search & Replace + use { + "windwp/nvim-spectre", + event = "BufRead", + config = function() + require("spectre").setup() + end, + disable = not O.plugin.spectre.active, + } + -- lsp root with this nvim-tree will follow you + use { + "ahmedkhalf/lsp-rooter.nvim", + event = "BufRead", + config = function() + require("lsp-rooter").setup() + end, + disable = not O.plugin.lsp_rooter.active, + } + -- Markdown preview + use { + "iamcco/markdown-preview.nvim", + run = "cd app && npm install", + ft = "markdown", + disable = not O.plugin.markdown_preview.active, + } + -- Interactive scratchpad + use { + "metakirby5/codi.vim", + cmd = "Codi", + disable = not O.plugin.codi.active, + } + -- Use fzy for telescope + use { + "nvim-telescope/telescope-fzy-native.nvim", + event = "BufRead", + disable = not O.plugin.telescope_fzy.active, + } + -- Use project for telescope + use { + "nvim-telescope/telescope-project.nvim", + event = "BufRead", + after = "telescope.nvim", + disable = not O.plugin.telescope_project.active, + } + -- Sane gx for netrw_gx bug + use { + "felipec/vim-sanegx", + event = "BufRead", + disable = not O.plugin.sanegx.active, + } + -- Sane gx for netrw_gx bug + use { + "folke/todo-comments.nvim", + event = "BufRead", + disable = not O.plugin.todo_comments.active, + } + -- LSP Colors + use { + "folke/lsp-colors.nvim", + event = "BufRead", + disable = not O.plugin.lsp_colors.active, + } + -- Git Blame + use { + "f-person/git-blame.nvim", + event = "BufRead", + disable = not O.plugin.git_blame.active, + } + use { + "ruifm/gitlinker.nvim", + event = "BufRead", + config = function() + require("gitlinker").setup { + opts = { + -- remote = 'github', -- force the use of a specific remote + -- adds current line nr in the url for normal mode + add_current_line_on_normal_mode = true, + -- callback for what to do with the url + action_callback = require("gitlinker.actions").open_in_browser, + -- print the url after performing the action + print_url = false, + -- mapping to call url generation + mappings = "gy", }, - config = function() - require('null-ls').setup() - end - } + } + end, + disable = not O.plugin.gitlinker.active, + requires = "nvim-lua/plenary.nvim", + } + -- Lazygit + use { + "kdheepak/lazygit.nvim", + cmd = "LazyGit", + disable = not O.plugin.lazygit.active, + } + -- Octo + use { + "pwntester/octo.nvim", + event = "BufRead", + disable = not O.plugin.octo.active, + } + -- Diffview + use { + "sindrets/diffview.nvim", + event = "BufRead", + disable = not O.plugin.diffview.active, + } + -- Easily Create Gists + use { + "mattn/vim-gist", + event = "BufRead", + disable = not O.plugin.gist.active, + requires = "mattn/webapi-vim", + } + -- Lush Create Color Schemes + use { + "rktjmp/lush.nvim", + -- cmd = {"LushRunQuickstart", "LushRunTutorial", "Lushify"}, + disable = not O.plugin.lush.active, + } + -- HTML preview + use { + "turbio/bracey.vim", + event = "BufRead", + run = "npm install --prefix server", + disable = not O.plugin.bracey.active, + } + -- Debugger management + use { + "Pocco81/DAPInstall.nvim", + event = "BufRead", + disable = not O.plugin.dap_install.active, + } - -- Tabnine - use { - "tzachar/compe-tabnine", - run = "./install.sh", - requires = "hrsh7th/nvim-compe", - disable = not O.plugin.tabnine.active - } + -- LANGUAGE SPECIFIC GOES HERE + + use { "lervag/vimtex", ft = "tex" } + + -- Rust tools + -- TODO: use lazy loading maybe? + use { + "simrat39/rust-tools.nvim", + disable = not O.lang.rust.rust_tools.active, + } + + -- Elixir + use { "elixir-editors/vim-elixir", ft = { "elixir", "eelixir", "euphoria3" } } + + -- Javascript / Typescript + use { + "jose-elias-alvarez/nvim-lsp-ts-utils", + ft = { + "javascript", + "javascriptreact", + "javascript.jsx", + "typescript", + "typescriptreact", + "typescript.tsx", + }, + } + use { + "jose-elias-alvarez/null-ls.nvim", + ft = { + "javascript", + "javascriptreact", + "javascript.jsx", + "typescript", + "typescriptreact", + "typescript.tsx", + }, + config = function() + require("null-ls").setup() + end, + } + + -- Tabnine + use { + "tzachar/compe-tabnine", + run = "./install.sh", + requires = "hrsh7th/nvim-compe", + disable = not O.plugin.tabnine.active, + } end) diff --git a/lua/settings.lua b/lua/settings.lua index 7930f9cd..43c1bf77 100644 --- a/lua/settings.lua +++ b/lua/settings.lua @@ -3,17 +3,16 @@ local cmd = vim.cmd local opt = vim.opt - --- VIM ONLY COMMANDS --- -cmd('filetype plugin on') -- filetype detection -cmd('let &titleold="'..TERMINAL..'"') -cmd('set inccommand=split') -- show what you are substituting in real time -cmd('set iskeyword+=-') -- treat dash as a separate word -cmd('set whichwrap+=<,>,[,],h,l') -- move to next line with theses keys +cmd "filetype plugin on" +cmd('let &titleold="' .. TERMINAL .. '"') +cmd "set inccommand=split" +cmd "set iskeyword+=-" +cmd "set whichwrap+=<,>,[,],h,l" if O.transparent_window then - cmd('au ColorScheme * hi Normal ctermbg=none guibg=none') - end + cmd "au ColorScheme * hi Normal ctermbg=none guibg=none" +end --- COLORSCHEME --- @@ -21,41 +20,40 @@ vim.g.colors_name = O.colorscheme --- SETTINGS --- -opt.backup = false -- creates a backup file -opt.clipboard = "unnamedplus" -- allows neovim to access the system clipboard -opt.cmdheight = 2 -- more space in the neovim command line for displaying messages -opt.colorcolumn = "99999" -- fix indentline for now -opt.completeopt = {'menuone', 'noselect'} -opt.conceallevel = 0 -- so that `` is visible in markdown files -opt.fileencoding = "utf-8" -- the encoding written to a file -opt.guifont = "monospace:h17" -- the font used in graphical neovim applications -opt.hidden = O.hidden_files -- required to keep multiple buffers and open multiple buffers -opt.hlsearch = O.hl_search -- highlight all matches on previous search pattern -opt.ignorecase = O.ignore_case -- ignore case in search patterns -opt.mouse = "a" -- allow the mouse to be used in neovim -opt.pumheight = 10 -- pop up menu height -opt.showmode = false -- we don't need to see things like -- INSERT -- anymore -opt.showtabline = 2 -- always show tabs -opt.smartcase = O.smart_case -- smart case -opt.smartindent = true -- make indenting smarter again -opt.splitbelow = true -- force all horizontal splits to go below current window -opt.splitright = true -- force all vertical splits to go to the right of current window -opt.swapfile = false -- creates a swapfile -opt.termguicolors = true -- set term gui colors (most terminals support this) -opt.timeoutlen = O.timeoutlen -- time to wait for a mapped sequence to complete (in milliseconds) -opt.title = true -- set the title of window to the value of the titlestring -opt.titlestring = "%<%F%=%l/%L - nvim" -- what the title of the window will be set to -opt.undodir = CACHE_PATH .. '/undo' -- set an undo directory -opt.undofile = true -- enable persisten undo -opt.updatetime = 300 -- faster completion -opt.writebackup = false -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited -opt.expandtab = true -- convert tabs to spaces -opt.shiftwidth = 4 -- the number of spaces inserted for each indentation -opt.shortmess:append("c") -- don't pass messages to |ins-completion-menu| -opt.tabstop = 4 -- insert 4 spaces for a tab -opt.cursorline = O.cursorline -- highlight the current line -opt.number = O.number -- set numbered lines -opt.relativenumber = O.relative_number -- set relative numbered lines -opt.signcolumn = "yes" -- always show the sign column, otherwise it would shift the text each time -opt.wrap = O.wrap_lines -- display lines as one long line - +opt.backup = false -- creates a backup file +opt.clipboard = "unnamedplus" -- allows neovim to access the system clipboard +opt.cmdheight = 2 -- more space in the neovim command line for displaying messages +opt.colorcolumn = "99999" -- fix indentline for now +opt.completeopt = { "menuone", "noselect" } +opt.conceallevel = 0 -- so that `` is visible in markdown files +opt.fileencoding = "utf-8" -- the encoding written to a file +opt.guifont = "monospace:h17" -- the font used in graphical neovim applications +opt.hidden = O.hidden_files -- required to keep multiple buffers and open multiple buffers +opt.hlsearch = O.hl_search -- highlight all matches on previous search pattern +opt.ignorecase = O.ignore_case -- ignore case in search patterns +opt.mouse = "a" -- allow the mouse to be used in neovim +opt.pumheight = 10 -- pop up menu height +opt.showmode = false -- we don't need to see things like -- INSERT -- anymore +opt.showtabline = 2 -- always show tabs +opt.smartcase = O.smart_case -- smart case +opt.smartindent = true -- make indenting smarter again +opt.splitbelow = true -- force all horizontal splits to go below current window +opt.splitright = true -- force all vertical splits to go to the right of current window +opt.swapfile = false -- creates a swapfile +opt.termguicolors = true -- set term gui colors (most terminals support this) +opt.timeoutlen = O.timeoutlen -- time to wait for a mapped sequence to complete (in milliseconds) +opt.title = true -- set the title of window to the value of the titlestring +opt.titlestring = "%<%F%=%l/%L - nvim" -- what the title of the window will be set to +opt.undodir = CACHE_PATH .. "/undo" -- set an undo directory +opt.undofile = true -- enable persisten undo +opt.updatetime = 300 -- faster completion +opt.writebackup = false -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited +opt.expandtab = true -- convert tabs to spaces +opt.shiftwidth = 4 -- the number of spaces inserted for each indentation +opt.shortmess:append "c" +opt.tabstop = 4 -- insert 4 spaces for a tab +opt.cursorline = O.cursorline -- highlight the current line +opt.number = O.number -- set numbered lines +opt.relativenumber = O.relative_number -- set relative numbered lines +opt.signcolumn = "yes" -- always show the sign column, otherwise it would shift the text each time +opt.wrap = O.wrap_lines -- display lines as one long line diff --git a/utils/installer/lv-config.example.lua b/utils/installer/lv-config.example.lua index 6910a2cb..b043ea3b 100644 --- a/utils/installer/lv-config.example.lua +++ b/utils/installer/lv-config.example.lua @@ -5,16 +5,17 @@ Formatters and linters should be filled in as strings with either a global executable or a path to an executable -]] -- THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT +]] +-- THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT -- general O.auto_complete = true -O.colorscheme = 'spacegray' +O.colorscheme = "spacegray" O.auto_close_tree = 0 O.wrap_lines = false O.timeoutlen = 100 O.document_highlight = true O.extras = false -O.leader_key = ' ' +O.leader_key = " " O.ignore_case = true O.smart_case = true O.lushmode = false @@ -38,7 +39,7 @@ O.plugin.zen.active = false -- if you don't want all the parsers change this to a table of the ones you want O.treesitter.ensure_installed = "all" -O.treesitter.ignore_install = {"haskell"} +O.treesitter.ignore_install = { "haskell" } O.treesitter.highlight.enabled = true O.lang.clang.diagnostics.virtual_text = true @@ -49,7 +50,7 @@ O.lang.clang.diagnostics.underline = true -- add things like O.python.formatter.yapf.exec_path -- add things like O.python.linter.flake8.exec_path -- add things like O.python.formatter.isort.exec_path -O.lang.python.formatter = 'yapf' +O.lang.python.formatter = "yapf" -- O.python.linter = 'flake8' O.lang.python.isort = true O.lang.python.autoformat = true @@ -60,15 +61,14 @@ O.lang.python.analysis.type_checking = "off" O.lang.python.analysis.auto_search_paths = true O.lang.python.analysis.use_library_code_types = true - -- lua -- TODO look into stylua -O.lang.lua.formatter = 'lua-format' +O.lang.lua.formatter = "lua-format" -- O.lua.formatter = 'lua-format' O.lang.lua.autoformat = false -- javascript -O.lang.tsserver.formatter = 'prettier' +O.lang.tsserver.formatter = "prettier" O.lang.tsserver.linter = nil O.lang.tsserver.autoformat = true @@ -94,7 +94,7 @@ O.lang.php.environment.php_version = "7.4" O.lang.php.autoformat = false O.lang.php.diagnostics.signs = true O.lang.php.diagnostics.underline = true -O.lang.php.filetypes = { "php", "phtml" } +O.lang.php.filetypes = { "php", "phtml" } -- TODO Autocommands -- https://neovim.io/doc/user/autocmd.html @@ -102,4 +102,3 @@ O.lang.php.filetypes = { "php", "phtml" } -- TODO Additional Plugins -- TODO User Config for plugins - diff --git a/utils/lush-template/lua/lush_theme/lush_template.lua b/utils/lush-template/lua/lush_theme/lush_template.lua index bd3f0849..26b04d8b 100644 --- a/utils/lush-template/lua/lush_theme/lush_template.lua +++ b/utils/lush-template/lua/lush_theme/lush_template.lua @@ -42,7 +42,7 @@ -- -- `:lua require('lush').ify()` -local lush = require('lush') +local lush = require "lush" local hsl = lush.hsl local theme = lush(function() @@ -101,7 +101,7 @@ local theme = lush(function() -- QuickFixLine { }, -- Current |quickfix| item in the quickfix window. Combined with |hl-CursorLine| when the cursor is there. -- Search { }, -- Last search pattern highlighting (see 'hlsearch'). Also used for similar items that need to stand out. -- SpecialKey { }, -- Unprintable characters: text displayed differently from what it really is. But not 'listchars' whitespace. |hl-Whitespace| - -- SpellBad { }, -- Word that is not recognized by the spellchecker. |spell| Combined with the highlighting used otherwise. + -- SpellBad { }, -- Word that is not recognized by the spellchecker. |spell| Combined with the highlighting used otherwise. -- SpellCap { }, -- Word that should start with a capital. |spell| Combined with the highlighting used otherwise. -- SpellLocal { }, -- Word that is recognized by the spellchecker as one that is used in another region. |spell| Combined with the highlighting used otherwise. -- SpellRare { }, -- Word that is recognized by the spellchecker as one that is hardly ever used. |spell| Combined with the highlighting used otherwise. @@ -260,7 +260,6 @@ local theme = lush(function() -- TSTitle { }; -- Text that is part of a title. -- TSLiteral { }; -- Literal text. -- TSURI { }; -- Any URI like a link or email. - } end) From d8a3a552d6f2c420cfa8673f6293209eda850878 Mon Sep 17 00:00:00 2001 From: Rafael Date: Sun, 4 Jul 2021 22:34:46 -0300 Subject: [PATCH 28/54] [IMPORTANT] Now using stylua for formatting. * This was discussed in #652 * For now on, we're gonna use stylua for formatting the project, the config is located in `utils/.stylua.toml`, Use it before pushing changes. --- .gitignore | 1 + utils/.stylua.toml | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 utils/.stylua.toml diff --git a/.gitignore b/.gitignore index c441ffa0..4d767ea7 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ eclipse.jdt.ls/ spell/ nv-settings.lua lv-settings.lua +./.stylua.toml diff --git a/utils/.stylua.toml b/utils/.stylua.toml new file mode 100644 index 00000000..df96b7b0 --- /dev/null +++ b/utils/.stylua.toml @@ -0,0 +1,6 @@ +column_width = 120 +line_endings = "Unix" +indent_type = "Spaces" +indent_width = 2 +quote_style = "AutoPreferDouble" +no_call_parentheses = true From d876d89c303c54e6a0cc3ef211e303f09cb9cb74 Mon Sep 17 00:00:00 2001 From: maxime50 <51096534+maxime50@users.noreply.github.com> Date: Sun, 4 Jul 2021 22:14:09 -0400 Subject: [PATCH 29/54] Remove `extras` Config option since extras plugins are enabled individualy now (#673) * Remove `extras` Global Config * remove white space Co-authored-by: maxime50 <> --- lua/default-config.lua | 1 - utils/installer/lv-config.example.lua | 1 - 2 files changed, 2 deletions(-) diff --git a/lua/default-config.lua b/lua/default-config.lua index 53c92832..3f8bbc34 100644 --- a/lua/default-config.lua +++ b/lua/default-config.lua @@ -15,7 +15,6 @@ O = { shell = "bash", timeoutlen = 100, nvim_tree_disable_netrw = 0, - extras = false, ignore_case = true, smart_case = true, lushmode = false, diff --git a/utils/installer/lv-config.example.lua b/utils/installer/lv-config.example.lua index b043ea3b..c68a9bda 100644 --- a/utils/installer/lv-config.example.lua +++ b/utils/installer/lv-config.example.lua @@ -14,7 +14,6 @@ O.auto_close_tree = 0 O.wrap_lines = false O.timeoutlen = 100 O.document_highlight = true -O.extras = false O.leader_key = " " O.ignore_case = true O.smart_case = true From 81dc6b918b9d24c74d4974c67ca5160f40b2397b Mon Sep 17 00:00:00 2001 From: Rafael Date: Sun, 4 Jul 2021 23:35:14 -0300 Subject: [PATCH 30/54] (typo) ingore .stylua.toml in root of project --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4d767ea7..51f14bc0 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,4 @@ eclipse.jdt.ls/ spell/ nv-settings.lua lv-settings.lua -./.stylua.toml +.stylua.toml From 0b251be44cf941cde2d49909b29855e97bc97d45 Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 4 Jul 2021 22:49:47 -0400 Subject: [PATCH 31/54] shelfing null-ls for now, seems to slow things down significantly --- lua/lsp/ts-fmt-lint.lua | 3 +-- lua/plugins.lua | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/lua/lsp/ts-fmt-lint.lua b/lua/lsp/ts-fmt-lint.lua index 5cca9c60..1ebf2e20 100644 --- a/lua/lsp/ts-fmt-lint.lua +++ b/lua/lsp/ts-fmt-lint.lua @@ -21,7 +21,7 @@ M.setup = function() -- init_options = {initializationOptions}, cmd = {DATA_PATH .. "/lspinstall/efm/efm-langserver"}, init_options = {documentFormatting = true, codeAction = false}, - filetypes = {"html", "css", "yaml", "vue"}, + filetypes = {"html", "css", "yaml", "vue", "javascript", "javascriptreact", "typescript", "typescriptreact"}, settings = { rootMarkers = {".git/", "package.json"}, languages = { @@ -29,7 +29,6 @@ M.setup = function() css = {prettier}, json = {prettier}, yaml = {prettier} - -- markdown = {markdownPandocFormat, markdownlint}, } } } diff --git a/lua/plugins.lua b/lua/plugins.lua index 5a67b430..00417b6e 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -432,22 +432,22 @@ return require("packer").startup(function(use) "typescript", "typescriptreact", "typescript.tsx", - }, - } - use { - "jose-elias-alvarez/null-ls.nvim", - ft = { - "javascript", - "javascriptreact", - "javascript.jsx", - "typescript", - "typescriptreact", - "typescript.tsx", - }, - config = function() - require("null-ls").setup() - end, + } } + -- use { + -- "jose-elias-alvarez/null-ls.nvim", + -- ft = { + -- "javascript", + -- "javascriptreact", + -- "javascript.jsx", + -- "typescript", + -- "typescriptreact", + -- "typescript.tsx", + -- }, + -- config = function() + -- require("null-ls").setup() + -- end, + -- } -- Tabnine use { From 33761183044522286cda2fd0378f469270eb802a Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Sun, 4 Jul 2021 22:56:20 -0400 Subject: [PATCH 32/54] emmet-ls technically doesn't support react --- lua/lsp/emmet-ls.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lsp/emmet-ls.lua b/lua/lsp/emmet-ls.lua index 277adc7f..fcb7f62d 100644 --- a/lua/lsp/emmet-ls.lua +++ b/lua/lsp/emmet-ls.lua @@ -10,7 +10,7 @@ capabilities.textDocument.completion.completionItem.snippetSupport = true configs.emmet_ls = { default_config = { cmd = {'emmet-ls', '--stdio'}; - filetypes = {'html', 'css', 'javascript', 'javascriptreact', 'typescript', 'typescriptreact'}; + filetypes = {'html', 'css', 'javascript', 'typescript'}; root_dir = function() return vim.loop.cwd() end; From 4bbf4c290a4a61e70717f3ea52567d2cacfdedae Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 4 Jul 2021 23:25:16 -0400 Subject: [PATCH 33/54] rename to docker file --- ftplugin/{docker.lua => dockerfile.lua} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ftplugin/{docker.lua => dockerfile.lua} (100%) diff --git a/ftplugin/docker.lua b/ftplugin/dockerfile.lua similarity index 100% rename from ftplugin/docker.lua rename to ftplugin/dockerfile.lua From af5d292fbf51946ed508222cdefca3caed364971 Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 5 Jul 2021 00:52:36 -0400 Subject: [PATCH 34/54] basic python debugging --- ftplugin/python.lua | 3 +++ lua/lv-which-key/init.lua | 55 +++++++++++++++++++-------------------- lua/plugins.lua | 8 ++++-- 3 files changed, 36 insertions(+), 30 deletions(-) diff --git a/ftplugin/python.lua b/ftplugin/python.lua index abb75e2a..04fe2ded 100644 --- a/ftplugin/python.lua +++ b/ftplugin/python.lua @@ -75,3 +75,6 @@ if O.lang.python.autoformat then }, } end + +local dap_install = require("dap-install") +dap_install.config("python_dbg", {}) diff --git a/lua/lv-which-key/init.lua b/lua/lv-which-key/init.lua index 4e27a528..fb060b78 100644 --- a/lua/lv-which-key/init.lua +++ b/lua/lv-which-key/init.lua @@ -150,23 +150,22 @@ local mappings = { -- " Debug Adapter protocol: -- " https://microsoft.github.io/debug-adapter-protocol/ -- " Debugging - -- command! DebugToggleBreakpoint lua require'dap'.toggle_breakpoint() - -- command! DebugStart lua require'dap'.continue() - -- command! DebugContinue lua require'dap'.continue() - -- command! DebugStepOver lua require'dap'.step_over() - -- command! DebugStepOut lua require'dap'.step_out() - -- command! DebugStepInto lua require'dap'.step_into() - -- command! DebugToggleRepl lua require'dap'.repl.toggle() - -- command! DebugGetSession lua require'dap'.session() - -- D = { - -- name = "Debug", - -- b = {"DebugToggleBreakpoint", "Toggle Breakpoint"}, - -- c = {"DebugContinue", "Continue"}, - -- i = {"DebugStepInto", "Step Into"}, - -- o = {"DebugStepOver", "Step Over"}, - -- r = {"DebugToggleRepl", "Toggle Repl"}, - -- s = {"DebugStart", "Start"} - -- }, + d = { + name = "Debug", + t = {"lua require'dap'.toggle_breakpoint()", "Toggle Breakpoint"}, + b = {"lua require'dap'.step_back()", "Step Back"}, + c = {"lua require'dap'.continue()", "Continue"}, + C = {"lua require'dap'.run_to_cursor()", "Run To Cursor"}, + d = {"lua require'dap'.disconnect()", "Disconnect"}, + g = {"lua require'dap'.session()", "Get Session"}, + i = {"lua require'dap'.step_into()", "Step Into"}, + o = {"lua require'dap'.step_over()", "Step Over"}, + u = {"lua require'dap'.step_out()", "Step Out"}, + p = {"lua require'dap'.pause.toggle()", "Pause"}, + r = {"lua require'dap'.repl.toggle()", "Toggle Repl"}, + s = {"lua require'dap'.continue()", "Start"}, + q = {"lua require'dap'.stop()", "Quit"} + }, g = { name = "Git", j = { "lua require 'gitsigns'.next_hunk()", "Next Hunk" }, @@ -263,17 +262,17 @@ if O.plugin.spectre.active then } end -if O.plugin.trouble.active then - mappings["d"] = { - name = "Diagnostics", - t = { "TroubleToggle", "trouble" }, - w = { "TroubleToggle lsp_workspace_diagnostics", "workspace" }, - d = { "TroubleToggle lsp_document_diagnostics", "document" }, - q = { "TroubleToggle quickfix", "quickfix" }, - l = { "TroubleToggle loclist", "loclist" }, - r = { "TroubleToggle lsp_references", "references" }, - } -end +-- if O.plugin.trouble.active then +-- mappings["d"] = { +-- name = "Diagnostics", +-- t = { "TroubleToggle", "trouble" }, +-- w = { "TroubleToggle lsp_workspace_diagnostics", "workspace" }, +-- d = { "TroubleToggle lsp_document_diagnostics", "document" }, +-- q = { "TroubleToggle quickfix", "quickfix" }, +-- l = { "TroubleToggle loclist", "loclist" }, +-- r = { "TroubleToggle lsp_references", "references" }, +-- } +-- end if O.plugin.gitlinker.active then mappings["gy"] = "Gitlink" diff --git a/lua/plugins.lua b/lua/plugins.lua index 00417b6e..e03f5037 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -253,7 +253,11 @@ return require("packer").startup(function(use) -- Debugging use { "mfussenegger/nvim-dap", - event = "BufRead", + config = function() + require('dap') + vim.fn.sign_define('DapBreakpoint', {text='🛑', texthl='', linehl='', numhl=''}) + require('dap').defaults.fallback.terminal_win_cmd = '50vsplit new' + end, disable = not O.plugin.debug.active, } -- Better quickfix @@ -404,7 +408,7 @@ return require("packer").startup(function(use) -- Debugger management use { "Pocco81/DAPInstall.nvim", - event = "BufRead", + -- event = "BufRead", disable = not O.plugin.dap_install.active, } From 8fba9ecfd1fd1d1f4769b6171fc0bd804bbde751 Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 5 Jul 2021 01:08:56 -0400 Subject: [PATCH 35/54] add ! to close the tab --- lua/lv-which-key/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lv-which-key/init.lua b/lua/lv-which-key/init.lua index fb060b78..f78c0a5e 100644 --- a/lua/lv-which-key/init.lua +++ b/lua/lv-which-key/init.lua @@ -87,7 +87,7 @@ vim.api.nvim_set_keymap("n", "/", ":CommentToggle", { noremap = true vim.api.nvim_set_keymap("v", "/", ":CommentToggle", { noremap = true, silent = true }) -- close buffer -vim.api.nvim_set_keymap("n", "c", ":bdelete", { noremap = true, silent = true }) +vim.api.nvim_set_keymap("n", "c", ":bdelete!", { noremap = true, silent = true }) -- TODO create entire treesitter section From b4a9023c9e531ad021cf9da7e701350f489aba45 Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 5 Jul 2021 02:57:06 -0400 Subject: [PATCH 36/54] remove lspsaga --- lua/lsp/init.lua | 8 +++----- lua/lv-which-key/init.lua | 17 +++++------------ lua/plugins.lua | 1 - 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/lua/lsp/init.lua b/lua/lsp/init.lua index 7c78d054..ad8985d8 100644 --- a/lua/lsp/init.lua +++ b/lua/lsp/init.lua @@ -20,14 +20,12 @@ vim.cmd("nnoremap gd lua vim.lsp.buf.definition()") vim.cmd("nnoremap gD lua vim.lsp.buf.declaration()") vim.cmd("nnoremap gr lua vim.lsp.buf.references()") vim.cmd("nnoremap gi lua vim.lsp.buf.implementation()") -vim.cmd("nnoremap K :Lspsaga hover_doc") +vim.cmd("nnoremap K :lua vim.lsp.buf.hover()") -- vim.cmd('nnoremap lua vim.lsp.buf.signature_help()') -vim.cmd("nnoremap :Lspsaga diagnostic_jump_prev") -vim.cmd("nnoremap :Lspsaga diagnostic_jump_next") +vim.cmd("nnoremap :lua vim.lsp.diagnostic.goto_prev()") +vim.cmd("nnoremap :lua vim.lsp.diagnostic.goto_next()") -- scroll down hover doc or scroll in definition preview -vim.cmd("nnoremap lua require('lspsaga.action').smart_scroll_with_saga(1)") -- scroll up hover doc -vim.cmd("nnoremap lua require('lspsaga.action').smart_scroll_with_saga(-1)") vim.cmd('command! -nargs=0 LspVirtualTextToggle lua require("lsp/virtual_text").toggle()') -- Set Default Prefix. diff --git a/lua/lv-which-key/init.lua b/lua/lv-which-key/init.lua index f78c0a5e..31ecf94c 100644 --- a/lua/lv-which-key/init.lua +++ b/lua/lv-which-key/init.lua @@ -189,28 +189,21 @@ local mappings = { }, l = { name = "LSP", - a = { "Lspsaga code_action", "Code Action" }, - A = { "Lspsaga range_code_action", "Selected Action" }, + a = { "lua vim.lsp.buf.code_action()", "Code Action" }, d = { "Telescope lsp_document_diagnostics", "Document Diagnostics", }, - D = { + w = { "Telescope lsp_workspace_diagnostics", "Workspace Diagnostics", }, f = { "lua vim.lsp.buf.formatting()", "Format" }, - h = { "Lspsaga hover_doc", "Hover Doc" }, i = { "LspInfo", "Info" }, - j = { "Lspsaga diagnostic_jump_prev", "Prev Diagnostic" }, - k = { "Lspsaga diagnostic_jump_next", "Next Diagnostic" }, - l = { "Lspsaga lsp_finder", "LSP Finder" }, - L = { "Lspsaga show_line_diagnostics", "Line Diagnostics" }, - p = { "Lspsaga preview_definition", "Preview Definition" }, + j = { "lua vim.lsp.diagnostic.goto_next()", "Next Diagnostic" }, + k = { "lua vim.lsp.diagnostic.goto_prev()", "Prev Diagnostic" }, q = { "Telescope quickfix", "Quickfix" }, - r = { "Lspsaga rename", "Rename" }, - t = { "LspTypeDefinition", "Type Definition" }, - x = { "cclose", "Close Quickfix" }, + r = { "lua vim.lsp.buf.rename()", "Rename" }, s = { O.plugin.symbol_outline.active and "SymbolsOutline" or " Telescope lsp_document_symbols", "Document Symbols", diff --git a/lua/plugins.lua b/lua/plugins.lua index e03f5037..a6f0d646 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -32,7 +32,6 @@ return require("packer").startup(function(use) -- TODO refactor all of this (for now it works, but yes I know it could be wrapped in a simpler function) use { "neovim/nvim-lspconfig" } - use { "glepnir/lspsaga.nvim", cmd = "Lspsaga" } use { "kabouzeid/nvim-lspinstall", cmd = "LspInstall" } -- Telescope use { "nvim-lua/popup.nvim" } From bd9296c4e86b9223cce9ee3dd0d04c3f9e7cc370 Mon Sep 17 00:00:00 2001 From: Robin Kautz Date: Mon, 5 Jul 2021 09:21:41 +0200 Subject: [PATCH 37/54] fixes condition to use local prettier (#678) --- lua/lsp/ts-fmt-lint.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lsp/ts-fmt-lint.lua b/lua/lsp/ts-fmt-lint.lua index 1ebf2e20..36d4ca8a 100644 --- a/lua/lsp/ts-fmt-lint.lua +++ b/lua/lsp/ts-fmt-lint.lua @@ -10,7 +10,7 @@ M.setup = function() formatStdin = true } - if vim.fn.glob("node_modules/.bin/prettier") then + if vim.fn.glob("node_modules/.bin/prettier") ~= "" then prettier = { formatCommand = "./node_modules/.bin/prettier --stdin-filepath ${INPUT}", formatStdin = true From a569128faac772d05648b07ec93206010f12bc3d Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 5 Jul 2021 10:36:01 -0400 Subject: [PATCH 38/54] only when dap install is active --- ftplugin/python.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ftplugin/python.lua b/ftplugin/python.lua index 04fe2ded..d7db1977 100644 --- a/ftplugin/python.lua +++ b/ftplugin/python.lua @@ -76,5 +76,7 @@ if O.lang.python.autoformat then } end -local dap_install = require("dap-install") -dap_install.config("python_dbg", {}) +if O.plugin.dap_install.active then + local dap_install = require("dap-install") + dap_install.config("python_dbg", {}) +end From 5eed5cf3ec13de0ce2a82ff032a1967e759d6a26 Mon Sep 17 00:00:00 2001 From: kjssad Date: Mon, 5 Jul 2021 14:43:37 +0000 Subject: [PATCH 39/54] Add borders to lsp popups (#686) * feat(lsp): add single type border to hover popup * feat(lsp): add single type border to signatureHelp * feat(lsp): add border to line diagnostic popup * feat(lsp): use global option to configure borders --- lua/default-config.lua | 4 ++++ lua/lsp/init.lua | 16 ++++++++++++++-- lua/lv-which-key/init.lua | 4 ++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/lua/default-config.lua b/lua/default-config.lua index 3f8bbc34..661f8f23 100644 --- a/lua/default-config.lua +++ b/lua/default-config.lua @@ -31,6 +31,10 @@ O = { rainbow = { enabled = false }, }, + lsp = { + popup_border = "single" + }, + database = { save_location = "~/.config/nvcode_db", auto_execute = 1 }, plugin = { diff --git a/lua/lsp/init.lua b/lua/lsp/init.lua index ad8985d8..0292064a 100644 --- a/lua/lsp/init.lua +++ b/lua/lsp/init.lua @@ -22,8 +22,8 @@ vim.cmd("nnoremap gr lua vim.lsp.buf.references()") vim.cmd("nnoremap gi lua vim.lsp.buf.implementation()") vim.cmd("nnoremap K :lua vim.lsp.buf.hover()") -- vim.cmd('nnoremap lua vim.lsp.buf.signature_help()') -vim.cmd("nnoremap :lua vim.lsp.diagnostic.goto_prev()") -vim.cmd("nnoremap :lua vim.lsp.diagnostic.goto_next()") +vim.cmd("nnoremap :lua vim.lsp.diagnostic.goto_prev({popup_opts = {border = O.lsp.popup_border}})") +vim.cmd("nnoremap :lua vim.lsp.diagnostic.goto_next({popup_opts = {border = O.lsp.popup_border}})") -- scroll down hover doc or scroll in definition preview -- scroll up hover doc vim.cmd('command! -nargs=0 LspVirtualTextToggle lua require("lsp/virtual_text").toggle()') @@ -41,6 +41,18 @@ vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( } ) +vim.lsp.handlers["textDocument/hover"] = vim.lsp.with( + vim.lsp.handlers.hover, { + border = O.lsp.popup_border + } +) + +vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( + vim.lsp.handlers.signature_help, { + border = O.lsp.popup_border + } +) + -- symbols for autocomplete vim.lsp.protocol.CompletionItemKind = { "  (Text) ", diff --git a/lua/lv-which-key/init.lua b/lua/lv-which-key/init.lua index 31ecf94c..b35b546e 100644 --- a/lua/lv-which-key/init.lua +++ b/lua/lv-which-key/init.lua @@ -200,8 +200,8 @@ local mappings = { }, f = { "lua vim.lsp.buf.formatting()", "Format" }, i = { "LspInfo", "Info" }, - j = { "lua vim.lsp.diagnostic.goto_next()", "Next Diagnostic" }, - k = { "lua vim.lsp.diagnostic.goto_prev()", "Prev Diagnostic" }, + j = { "lua vim.lsp.diagnostic.goto_next({popup_opts = {border = O.lsp.popup_border}})", "Next Diagnostic" }, + k = { "lua vim.lsp.diagnostic.goto_prev({popup_opts = {border = O.lsp.popup_border}})", "Prev Diagnostic" }, q = { "Telescope quickfix", "Quickfix" }, r = { "lua vim.lsp.buf.rename()", "Rename" }, s = { From c7ff6f2b6f9eb78fe5f9d794c820026a6d2f4e1d Mon Sep 17 00:00:00 2001 From: jimcornmell Date: Mon, 5 Jul 2021 17:01:10 +0100 Subject: [PATCH 40/54] Add True/False to dial (#707) For languages like Python. --- lua/lv-dial/init.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lua/lv-dial/init.lua b/lua/lv-dial/init.lua index c299f18a..842e86be 100644 --- a/lua/lv-dial/init.lua +++ b/lua/lv-dial/init.lua @@ -17,6 +17,14 @@ vmap g (dial-decrement-additional) strlist = { "true", "false" }, } table.insert(dial.config.searchlist.normal, "custom#boolean") + + -- For Languages which prefer True/False, e.g. python. + dial.augends["custom#Boolean"] = dial.common.enum_cyclic { + name = "Boolean", + strlist = { "True", "False" }, + } + table.insert(dial.config.searchlist.normal, "custom#Boolean") + end return M From 246afe05d06fa3d61f46aa40139195c95e7c3da7 Mon Sep 17 00:00:00 2001 From: Pasquale <48988058+Pasqat@users.noreply.github.com> Date: Mon, 5 Jul 2021 18:01:38 +0200 Subject: [PATCH 41/54] add SignColumn to transparent window option (#701) --- lua/settings.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/settings.lua b/lua/settings.lua index 43c1bf77..371cdb08 100644 --- a/lua/settings.lua +++ b/lua/settings.lua @@ -12,6 +12,7 @@ cmd "set iskeyword+=-" cmd "set whichwrap+=<,>,[,],h,l" if O.transparent_window then cmd "au ColorScheme * hi Normal ctermbg=none guibg=none" + cmd "au ColorScheme * hi SignColumn ctermbg=none guibg=none" end --- COLORSCHEME --- From 1940bd26a6538210f2e03dd657705d532c67a097 Mon Sep 17 00:00:00 2001 From: Robin Kautz Date: Mon, 5 Jul 2021 18:02:05 +0200 Subject: [PATCH 42/54] evenly resize split windows (#698) * evenly resize split windows * fixed indention --- lua/default-config.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/default-config.lua b/lua/default-config.lua index 661f8f23..01b3ff83 100644 --- a/lua/default-config.lua +++ b/lua/default-config.lua @@ -288,4 +288,8 @@ require("lv-utils").define_augroups { _buffer_bindings = { { "FileType", "floaterm", "nnoremap q :q" }, }, + _auto_resize = { + -- will cause split windows to be resized evenly if main window is resized + {'VimResized ', '*', 'wincmd ='}, + }, } From 279e01f2f35948afa185115b100254cd1496277b Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Mon, 5 Jul 2021 13:58:38 -0400 Subject: [PATCH 43/54] debugging updates --- ftplugin/python.lua | 2 +- lua/lv-galaxyline/init.lua | 2 +- lua/plugins.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ftplugin/python.lua b/ftplugin/python.lua index d7db1977..62464397 100644 --- a/ftplugin/python.lua +++ b/ftplugin/python.lua @@ -76,7 +76,7 @@ if O.lang.python.autoformat then } end -if O.plugin.dap_install.active then +if O.plugin.debug.active and O.plugin.dap_install.active then local dap_install = require("dap-install") dap_install.config("python_dbg", {}) end diff --git a/lua/lv-galaxyline/init.lua b/lua/lv-galaxyline/init.lua index f063a146..efb6a988 100644 --- a/lua/lv-galaxyline/init.lua +++ b/lua/lv-galaxyline/init.lua @@ -104,7 +104,7 @@ table.insert(gls.left, { vim.api.nvim_command("hi GalaxyViMode guifg=" .. mode_color[vim.fn.mode()]) return "▊" end, - -- highlight = 'TabLineSel' + highlight = 'StatusLineNC' -- highlight = {colors.red, colors.bg} }, }) diff --git a/lua/plugins.lua b/lua/plugins.lua index a6f0d646..1a857c66 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -254,7 +254,7 @@ return require("packer").startup(function(use) "mfussenegger/nvim-dap", config = function() require('dap') - vim.fn.sign_define('DapBreakpoint', {text='🛑', texthl='', linehl='', numhl=''}) + vim.fn.sign_define('DapBreakpoint', {text='', texthl='LspDiagnosticsSignError', linehl='', numhl=''}) require('dap').defaults.fallback.terminal_win_cmd = '50vsplit new' end, disable = not O.plugin.debug.active, From a0e2823f7f6b5e5c23422ac3c4eec44d70780090 Mon Sep 17 00:00:00 2001 From: rebuilt Date: Mon, 5 Jul 2021 20:36:30 +0200 Subject: [PATCH 44/54] Adds: packer keybindings (#709) --- lua/lv-which-key/init.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lua/lv-which-key/init.lua b/lua/lv-which-key/init.lua index b35b546e..6ea74ef7 100644 --- a/lua/lv-which-key/init.lua +++ b/lua/lv-which-key/init.lua @@ -121,7 +121,14 @@ local mappings = { "sort BufferLines automatically by language", }, }, - + p = { + name = "Packer", + c = {"PackerCompile", "Compile"}, + i = {"PackerInstall", "Install"}, + r = {":luafile %", "Reload"}, + s = {"PackerSync", "Sync"}, + u = {"PackerUpdate", "Update"} + }, -- diagnostics vanilla nvim -- -- diagnostic -- function lv_utils.get_all() From cea49760660acc366940b51ccd13e03e28b7acda Mon Sep 17 00:00:00 2001 From: Robin Kautz Date: Mon, 5 Jul 2021 20:37:01 +0200 Subject: [PATCH 45/54] switch to absolute line numbers in insert mode (#702) * switch to absolute line numbers in insert mode * made aucmd respect cursorline setting --- lua/default-config.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lua/default-config.lua b/lua/default-config.lua index 01b3ff83..cd49c136 100644 --- a/lua/default-config.lua +++ b/lua/default-config.lua @@ -292,4 +292,11 @@ require("lv-utils").define_augroups { -- will cause split windows to be resized evenly if main window is resized {'VimResized ', '*', 'wincmd ='}, }, + _mode_switching = { + -- will switch between absolute and relative line numbers depending on mode + {'InsertEnter', '*', 'if &relativenumber | let g:ms_relativenumberoff = 1 | setlocal number norelativenumber | endif'}, + {'InsertLeave', '*', 'if exists("g:ms_relativenumberoff") | setlocal relativenumber | endif'}, + {'InsertEnter', '*', 'if &cursorline | let g:ms_cursorlineoff = 1 | setlocal nocursorline | endif'}, + {'InsertLeave', '*', 'if exists("g:ms_cursorlineoff") | setlocal cursorline | endif'}, + }, } From d178870db6a49edccf799c97efe65f5340d5c054 Mon Sep 17 00:00:00 2001 From: Nawfal bin Mohmad Rouyan Date: Tue, 6 Jul 2021 02:47:27 +0800 Subject: [PATCH 46/54] Ensure the keymap set in lua/lv-autopairs/init.lua works as expected. (#684) Please refer to https://github.com/windwp/nvim-autopairs#mapping-cr nvim-compe section. If this keymap is preferred, maybe we can remove the map set in autopairs. --- lua/lv-compe/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lv-compe/init.lua b/lua/lv-compe/init.lua index cd3be5ae..19998b62 100644 --- a/lua/lv-compe/init.lua +++ b/lua/lv-compe/init.lua @@ -90,7 +90,7 @@ M.config = function() vim.api.nvim_set_keymap("s", "", "v:lua.s_tab_complete()", { expr = true }) vim.api.nvim_set_keymap("i", "", "compe#complete()", { noremap = true, silent = true, expr = true }) - vim.api.nvim_set_keymap("i", "", "compe#confirm('')", { noremap = true, silent = true, expr = true }) + -- vim.api.nvim_set_keymap("i", "", "compe#confirm('')", { noremap = true, silent = true, expr = true }) vim.api.nvim_set_keymap("i", "", "compe#close('')", { noremap = true, silent = true, expr = true }) vim.api.nvim_set_keymap("i", "", "compe#scroll({ 'delta': +4 })", { noremap = true, silent = true, expr = true }) vim.api.nvim_set_keymap("i", "", "compe#scroll({ 'delta': -4 })", { noremap = true, silent = true, expr = true }) From 6b41286d70b71184b915724a0a03ccd8ec3b4e16 Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Mon, 5 Jul 2021 14:49:07 -0400 Subject: [PATCH 47/54] updated autocommands for user --- lua/default-config.lua | 59 +++------------------------ lua/lv-utils/init.lua | 56 +++++++++++++++++++++++++ utils/installer/lv-config.example.lua | 2 + 3 files changed, 64 insertions(+), 53 deletions(-) diff --git a/lua/default-config.lua b/lua/default-config.lua index cd49c136..830a77d4 100644 --- a/lua/default-config.lua +++ b/lua/default-config.lua @@ -4,6 +4,7 @@ CACHE_PATH = vim.fn.stdpath "cache" TERMINAL = vim.fn.expand "$TERMINAL" O = { + auto_close_tree = 0, auto_complete = true, colorscheme = "lunar", @@ -76,6 +77,10 @@ O = { tabnine = { active = false }, }, + user_autocommands = { + { "FileType", "qf", "set nobuflisted" }, + }, + lang = { python = { linter = "", @@ -247,56 +252,4 @@ O = { }, } --- TODO find a new home for these autocommands -require("lv-utils").define_augroups { - _general_settings = { - { - "TextYankPost", - "*", - "lua require('vim.highlight').on_yank({higroup = 'Search', timeout = 200})", - }, - { - "BufWinEnter", - "*", - "setlocal formatoptions-=c formatoptions-=r formatoptions-=o", - }, - { - "BufRead", - "*", - "setlocal formatoptions-=c formatoptions-=r formatoptions-=o", - }, - { - "BufNewFile", - "*", - "setlocal formatoptions-=c formatoptions-=r formatoptions-=o", - }, - { "VimLeavePre", "*", "set title set titleold=" }, - { "FileType", "qf", "set nobuflisted" }, - }, - -- _solidity = { - -- {'BufWinEnter', '.sol', 'setlocal filetype=solidity'}, {'BufRead', '*.sol', 'setlocal filetype=solidity'}, - -- {'BufNewFile', '*.sol', 'setlocal filetype=solidity'} - -- }, - -- _gemini = { - -- {'BufWinEnter', '.gmi', 'setlocal filetype=markdown'}, {'BufRead', '*.gmi', 'setlocal filetype=markdown'}, - -- {'BufNewFile', '*.gmi', 'setlocal filetype=markdown'} - -- }, - _markdown = { - { "FileType", "markdown", "setlocal wrap" }, - { "FileType", "markdown", "setlocal spell" }, - }, - _buffer_bindings = { - { "FileType", "floaterm", "nnoremap q :q" }, - }, - _auto_resize = { - -- will cause split windows to be resized evenly if main window is resized - {'VimResized ', '*', 'wincmd ='}, - }, - _mode_switching = { - -- will switch between absolute and relative line numbers depending on mode - {'InsertEnter', '*', 'if &relativenumber | let g:ms_relativenumberoff = 1 | setlocal number norelativenumber | endif'}, - {'InsertLeave', '*', 'if exists("g:ms_relativenumberoff") | setlocal relativenumber | endif'}, - {'InsertEnter', '*', 'if &cursorline | let g:ms_cursorlineoff = 1 | setlocal nocursorline | endif'}, - {'InsertLeave', '*', 'if exists("g:ms_cursorlineoff") | setlocal cursorline | endif'}, - }, -} + diff --git a/lua/lv-utils/init.lua b/lua/lv-utils/init.lua index c836af97..db3deb87 100644 --- a/lua/lv-utils/init.lua +++ b/lua/lv-utils/init.lua @@ -22,4 +22,60 @@ function lv_utils.define_augroups(definitions) -- {{{1 end end +lv_utils.define_augroups { + + _user_autocommands = O.user_autocommands, + _general_settings = { + { + "TextYankPost", + "*", + "lua require('vim.highlight').on_yank({higroup = 'Search', timeout = 200})", + }, + { + "BufWinEnter", + "*", + "setlocal formatoptions-=c formatoptions-=r formatoptions-=o", + }, + { + "BufRead", + "*", + "setlocal formatoptions-=c formatoptions-=r formatoptions-=o", + }, + { + "BufNewFile", + "*", + "setlocal formatoptions-=c formatoptions-=r formatoptions-=o", + }, + { "VimLeavePre", "*", "set title set titleold=" }, + }, + -- _solidity = { + -- {'BufWinEnter', '.sol', 'setlocal filetype=solidity'}, {'BufRead', '*.sol', 'setlocal filetype=solidity'}, + -- {'BufNewFile', '*.sol', 'setlocal filetype=solidity'} + -- }, + -- _gemini = { + -- {'BufWinEnter', '.gmi', 'setlocal filetype=markdown'}, {'BufRead', '*.gmi', 'setlocal filetype=markdown'}, + -- {'BufNewFile', '*.gmi', 'setlocal filetype=markdown'} + -- }, + _markdown = { + { "FileType", "markdown", "setlocal wrap" }, + { "FileType", "markdown", "setlocal spell" }, + }, + _buffer_bindings = { + { "FileType", "floaterm", "nnoremap q :q" }, + }, + _auto_resize = { + -- will cause split windows to be resized evenly if main window is resized + {'VimResized ', '*', 'wincmd ='}, + }, + -- _mode_switching = { + -- -- will switch between absolute and relative line numbers depending on mode + -- {'InsertEnter', '*', 'if &relativenumber | let g:ms_relativenumberoff = 1 | setlocal number norelativenumber | endif'}, + -- {'InsertLeave', '*', 'if exists("g:ms_relativenumberoff") | setlocal relativenumber | endif'}, + -- {'InsertEnter', '*', 'if &cursorline | let g:ms_cursorlineoff = 1 | setlocal nocursorline | endif'}, + -- {'InsertLeave', '*', 'if exists("g:ms_cursorlineoff") | setlocal cursorline | endif'}, + -- }, +} + return lv_utils + +-- TODO find a new home for these autocommands diff --git a/utils/installer/lv-config.example.lua b/utils/installer/lv-config.example.lua index c68a9bda..ba4bedb2 100644 --- a/utils/installer/lv-config.example.lua +++ b/utils/installer/lv-config.example.lua @@ -97,6 +97,8 @@ O.lang.php.filetypes = { "php", "phtml" } -- TODO Autocommands -- https://neovim.io/doc/user/autocmd.html +-- local test = { "BufWinEnter", "*", "echo \"hi again\""} +-- table.insert(O.user_autocommands, test) -- TODO Additional Plugins From b6f724a2b5eda368a81fb94dc8ecfee33778eabb Mon Sep 17 00:00:00 2001 From: "J.B.C" <57237705+juanCortelezzi@users.noreply.github.com> Date: Mon, 5 Jul 2021 16:32:45 -0300 Subject: [PATCH 48/54] Testimonials (#713) * testimonial test * testimonial test2 * fix(testimonials): moving testimonials to the bottom --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index dd4b8ceb..d37ba7b6 100644 --- a/README.md +++ b/README.md @@ -110,4 +110,8 @@ cd ~/.config/nvim && git pull - [Twitter](https://twitter.com/chrisatmachine) +## Testimonials + +> "I have the processing power of a potato with 4 gb of ram and LunarVim runs perfectly." +> - @juanCortelezzi, LunarVim user. From be9a5a08893b2c45ffa43e8372b3135747ee0df8 Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Mon, 5 Jul 2021 15:35:06 -0400 Subject: [PATCH 49/54] user defined plugins --- lua/default-config.lua | 51 +++++++++++++++++---------- lua/lv-which-key/init.lua | 2 +- lua/plugins.lua | 2 ++ utils/installer/lv-config.example.lua | 13 ++++--- 4 files changed, 41 insertions(+), 27 deletions(-) diff --git a/lua/default-config.lua b/lua/default-config.lua index 830a77d4..ce7b1062 100644 --- a/lua/default-config.lua +++ b/lua/default-config.lua @@ -39,42 +39,55 @@ O = { database = { save_location = "~/.config/nvcode_db", auto_execute = 1 }, plugin = { - hop = { active = false }, - dial = { active = false }, + -- TODO remove non built-ins + -- Builtins dashboard = { active = false }, - matchup = { active = false }, colorizer = { active = false }, - numb = { active = false }, zen = { active = false }, ts_playground = { active = false }, - indent_line = { active = false }, ts_context_commentstring = { active = false }, + telescope_fzy = { active = false }, + telescope_project = { active = false }, + indent_line = { active = false }, symbol_outline = { active = false }, debug = { active = false }, + dap_install = { active = false }, + lazygit = { active = false }, + lush = { active = false }, + diffview = { active = false }, + + ---------------------------------------------------------------------- + -- Non builtins + + octo = { active = false }, + gitlinker = { active = false }, + todo_comments = { active = false }, + gist = { active = false }, + git_blame = { active = false }, + lsp_colors = { active = false }, + ranger = { active = false }, + hop = { active = false }, + dial = { active = false }, + matchup = { active = false }, + numb = { active = false }, bqf = { active = false }, trouble = { active = false }, floatterm = { active = false }, spectre = { active = false }, lsp_rooter = { active = false }, markdown_preview = { active = false }, + bracey = { active = false }, codi = { active = false }, - telescope_fzy = { active = false }, sanegx = { active = false }, snap = { active = false }, - ranger = { active = false }, - todo_comments = { active = false }, - lsp_colors = { active = false }, - git_blame = { active = false }, - gist = { active = false }, - gitlinker = { active = false }, - lazygit = { active = false }, - octo = { active = false }, - lush = { active = false }, - diffview = { active = false }, - bracey = { active = false }, - telescope_project = { active = false }, - dap_install = { active = false }, tabnine = { active = false }, + + + + }, + + custom_plugins = { + -- use lv-config.lua for this not put here }, user_autocommands = { diff --git a/lua/lv-which-key/init.lua b/lua/lv-which-key/init.lua index 6ea74ef7..d5ad771f 100644 --- a/lua/lv-which-key/init.lua +++ b/lua/lv-which-key/init.lua @@ -299,7 +299,7 @@ if O.plugin.telescope_project.active then ":lua require'telescope'.extensions.project.project{}", { noremap = true, silent = true } ) - mappings["p"] = "Projects" + mappings["P"] = "Projects" end -- [";"] = "Dashboard", diff --git a/lua/plugins.lua b/lua/plugins.lua index 1a857c66..b14cac46 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -459,4 +459,6 @@ return require("packer").startup(function(use) requires = "hrsh7th/nvim-compe", disable = not O.plugin.tabnine.active, } + for _, plugin in pairs(O.custom_plugins) do packer.use(plugin) end + end) diff --git a/utils/installer/lv-config.example.lua b/utils/installer/lv-config.example.lua index ba4bedb2..56fe7176 100644 --- a/utils/installer/lv-config.example.lua +++ b/utils/installer/lv-config.example.lua @@ -20,8 +20,9 @@ O.smart_case = true O.lushmode = false O.transparent_window = false +-- TODO User Config for predefined plugins -- After changing plugin config exit and reopen LunarVim, Run :PackerInstall :PackerCompile -O.plugin.hop.active = false +O.bultin_plugin.hop.active = false O.plugin.dial.active = false O.plugin.dashboard.active = true O.plugin.matchup.active = false @@ -95,11 +96,9 @@ O.lang.php.diagnostics.signs = true O.lang.php.diagnostics.underline = true O.lang.php.filetypes = { "php", "phtml" } --- TODO Autocommands --- https://neovim.io/doc/user/autocmd.html --- local test = { "BufWinEnter", "*", "echo \"hi again\""} --- table.insert(O.user_autocommands, test) +-- Autocommands (https://neovim.io/doc/user/autocmd.html) +-- O.user_autocommands = {{ "BufWinEnter", "*", "echo \"hi again\""}} --- TODO Additional Plugins +-- Additional Plugins +-- O.custom_plugins = {{"windwp/nvim-ts-autotag"}} --- TODO User Config for plugins From 71c5cb4f0be89d3a175e99b0c2ebc5e55178e8a9 Mon Sep 17 00:00:00 2001 From: Rafael Date: Mon, 5 Jul 2021 20:01:19 +0000 Subject: [PATCH 50/54] (feat) use neoformat as the defalt format option (#715) --- ftplugin/c.lua | 11 --------- ftplugin/go.lua | 18 +++----------- ftplugin/javascript.lua | 35 --------------------------- ftplugin/javascriptreact.lua | 35 --------------------------- ftplugin/json.lua | 12 --------- ftplugin/lua.lua | 31 ------------------------ ftplugin/python.lua | 17 ------------- ftplugin/ruby.lua | 8 ------ ftplugin/rust.lua | 8 ------ ftplugin/sh.lua | 4 --- ftplugin/typescript.lua | 35 --------------------------- ftplugin/typescriptreact.lua | 35 --------------------------- ftplugin/zig.lua | 1 - ftplugin/zsh.lua | 6 ----- init.lua | 13 ++++++++++ lua/default-config.lua | 31 +++--------------------- lua/plugins.lua | 5 +++- utils/installer/lv-config.example.lua | 33 ++----------------------- 18 files changed, 26 insertions(+), 312 deletions(-) diff --git a/ftplugin/c.lua b/ftplugin/c.lua index ef371c03..7443cabe 100644 --- a/ftplugin/c.lua +++ b/ftplugin/c.lua @@ -18,14 +18,3 @@ require("lspconfig").clangd.setup { }), }, } - -if O.lang.clang.autoformat then - require("lv-utils").define_augroups { - _clang_autoformat = { - { "BufWritePre *.c lua vim.lsp.buf.formatting_sync(nil,1000)" }, - { "BufWritePre *.h lua vim.lsp.buf.formatting_sync(nil,1000)" }, - { "BufWritePre *.cpp lua vim.lsp.buf.formatting_sync(nil,1000)" }, - { "BufWritePre *.hpp lua vim.lsp.buf.formatting_sync(nil,1000)" }, - }, - } -end diff --git a/ftplugin/go.lua b/ftplugin/go.lua index 0bee465f..56b9cacc 100644 --- a/ftplugin/go.lua +++ b/ftplugin/go.lua @@ -6,17 +6,7 @@ require("lspconfig").gopls.setup { on_attach = require("lsp").common_on_attach, } -if O.lang.go.autoformat then - require("lv-utils").define_augroups { - _go_format = { - { "BufWritePre", "*.go", "lua vim.lsp.buf.formatting_sync(nil,1000)" }, - }, - _go = { - -- Go generally requires Tabs instead of spaces. - { "FileType", "go", "setlocal tabstop=4" }, - { "FileType", "go", "setlocal shiftwidth=4" }, - { "FileType", "go", "setlocal softtabstop=4" }, - { "FileType", "go", "setlocal noexpandtab" }, - }, - } -end +vim.opt_local.tabstop = 4 +vim.opt_local.shiftwidth = 4 +vim.opt_local.softtabstop = 4 +vim.opt_local.expandtab = false diff --git a/ftplugin/javascript.lua b/ftplugin/javascript.lua index 1c4004c2..ab370364 100644 --- a/ftplugin/javascript.lua +++ b/ftplugin/javascript.lua @@ -34,40 +34,5 @@ require("lspconfig").tsserver.setup { }), }, } - require("lsp.ts-fmt-lint").setup() - -if O.lang.tsserver.autoformat then - require("lv-utils").define_augroups { - _javascript_autoformat = { - { - - "BufWritePre", - "*.js", - "lua vim.lsp.buf.formatting_sync(nil, 1000)", - }, - }, - _javascriptreact_autoformat = { - { - "BufWritePre", - "*.jsx", - "lua vim.lsp.buf.formatting_sync(nil, 1000)", - }, - }, - _typescript_autoformat = { - { - "BufWritePre", - "*.ts", - "lua vim.lsp.buf.formatting_sync(nil, 1000)", - }, - }, - _typescriptreact_autoformat = { - { - "BufWritePre", - "*.tsx", - "lua vim.lsp.buf.formatting_sync(nil, 1000)", - }, - }, - } -end vim.cmd "setl ts=2 sw=2" diff --git a/ftplugin/javascriptreact.lua b/ftplugin/javascriptreact.lua index 1c4004c2..ab370364 100644 --- a/ftplugin/javascriptreact.lua +++ b/ftplugin/javascriptreact.lua @@ -34,40 +34,5 @@ require("lspconfig").tsserver.setup { }), }, } - require("lsp.ts-fmt-lint").setup() - -if O.lang.tsserver.autoformat then - require("lv-utils").define_augroups { - _javascript_autoformat = { - { - - "BufWritePre", - "*.js", - "lua vim.lsp.buf.formatting_sync(nil, 1000)", - }, - }, - _javascriptreact_autoformat = { - { - "BufWritePre", - "*.jsx", - "lua vim.lsp.buf.formatting_sync(nil, 1000)", - }, - }, - _typescript_autoformat = { - { - "BufWritePre", - "*.ts", - "lua vim.lsp.buf.formatting_sync(nil, 1000)", - }, - }, - _typescriptreact_autoformat = { - { - "BufWritePre", - "*.tsx", - "lua vim.lsp.buf.formatting_sync(nil, 1000)", - }, - }, - } -end vim.cmd "setl ts=2 sw=2" diff --git a/ftplugin/json.lua b/ftplugin/json.lua index da0c9ff2..29a3096f 100644 --- a/ftplugin/json.lua +++ b/ftplugin/json.lua @@ -15,15 +15,3 @@ require("lspconfig").jsonls.setup { }, }, } - -if O.lang.json.autoformat then - require("lv-utils").define_augroups { - _json_format = { - { - "BufWritePre", - "*.json", - "lua vim.lsp.buf.formatting_sync(nil, 1000)", - }, - }, - } -end diff --git a/ftplugin/lua.lua b/ftplugin/lua.lua index f3c3ac50..32c24e80 100644 --- a/ftplugin/lua.lua +++ b/ftplugin/lua.lua @@ -40,34 +40,3 @@ if O.lang.lua.autoformat then }, } end - -local lua_arguments = {} - -local luaFormat = { - formatCommand = "lua-format -i --no-keep-simple-function-one-line --column-limit=80", - formatStdin = true, -} - -local lua_fmt = { - formatCommand = "luafmt --indent-count 2 --line-width 120 --stdin", - formatStdin = true, -} - -if O.lang.lua.formatter == "lua-format" then - table.insert(lua_arguments, luaFormat) -elseif O.lang.lua.formatter == "lua-fmt" then - table.insert(lua_arguments, lua_fmt) -end - -require("lspconfig").efm.setup { - -- init_options = {initializationOptions}, - cmd = { DATA_PATH .. "/lspinstall/efm/efm-langserver" }, - init_options = { documentFormatting = true, codeAction = false }, - filetypes = { "lua" }, - settings = { - rootMarkers = { ".git/" }, - languages = { - lua = lua_arguments, - }, - }, -} diff --git a/ftplugin/python.lua b/ftplugin/python.lua index 62464397..a9b41648 100644 --- a/ftplugin/python.lua +++ b/ftplugin/python.lua @@ -20,12 +20,6 @@ if O.lang.python.isort then table.insert(python_arguments, isort) end -if O.lang.python.formatter == "yapf" then - table.insert(python_arguments, yapf) -elseif O.lang.python.formatter == "black" then - table.insert(python_arguments, black) -end - require("lspconfig").efm.setup { -- init_options = {initializationOptions}, cmd = { DATA_PATH .. "/lspinstall/efm/efm-langserver" }, @@ -64,17 +58,6 @@ require("lspconfig").pyright.setup { }, }, } -if O.lang.python.autoformat then - require("lv-utils").define_augroups { - _python_autoformat = { - { - "BufWritePre", - "*.py", - "lua vim.lsp.buf.formatting_sync(nil, 1000)", - }, - }, - } -end if O.plugin.debug.active and O.plugin.dap_install.active then local dap_install = require("dap-install") diff --git a/ftplugin/ruby.lua b/ftplugin/ruby.lua index 0cff96ff..bc844cd3 100644 --- a/ftplugin/ruby.lua +++ b/ftplugin/ruby.lua @@ -12,11 +12,3 @@ require("lspconfig").solargraph.setup { }, filetypes = O.lang.ruby.filetypes, } - -if O.lang.ruby.autoformat then - require("lv-utils").define_augroups { - _ruby_format = { - { "BufWritePre", "*.rb", "lua vim.lsp.buf.formatting_sync(nil,1000)" }, - }, - } -end diff --git a/ftplugin/rust.lua b/ftplugin/rust.lua index 34b211d6..2a106e7e 100644 --- a/ftplugin/rust.lua +++ b/ftplugin/rust.lua @@ -91,11 +91,3 @@ vim.api.nvim_exec( ]], true ) - -if O.lang.rust.autoformat then - require("lv-utils").define_augroups { - _rust_format = { - { "BufWritePre", "*.rs", "lua vim.lsp.buf.formatting_sync(nil,1000)" }, - }, - } -end diff --git a/ftplugin/sh.lua b/ftplugin/sh.lua index fa8f0785..c146e45f 100644 --- a/ftplugin/sh.lua +++ b/ftplugin/sh.lua @@ -15,10 +15,6 @@ local shellcheck = { lintFormats = { "%f:%l:%c: %trror: %m", "%f:%l:%c: %tarning: %m", "%f:%l:%c: %tote: %m" }, } -if O.lang.sh.formatter == "shfmt" then - table.insert(sh_arguments, shfmt) -end - if O.lang.sh.linter == "shellcheck" then table.insert(sh_arguments, shellcheck) end diff --git a/ftplugin/typescript.lua b/ftplugin/typescript.lua index 1c4004c2..ab370364 100644 --- a/ftplugin/typescript.lua +++ b/ftplugin/typescript.lua @@ -34,40 +34,5 @@ require("lspconfig").tsserver.setup { }), }, } - require("lsp.ts-fmt-lint").setup() - -if O.lang.tsserver.autoformat then - require("lv-utils").define_augroups { - _javascript_autoformat = { - { - - "BufWritePre", - "*.js", - "lua vim.lsp.buf.formatting_sync(nil, 1000)", - }, - }, - _javascriptreact_autoformat = { - { - "BufWritePre", - "*.jsx", - "lua vim.lsp.buf.formatting_sync(nil, 1000)", - }, - }, - _typescript_autoformat = { - { - "BufWritePre", - "*.ts", - "lua vim.lsp.buf.formatting_sync(nil, 1000)", - }, - }, - _typescriptreact_autoformat = { - { - "BufWritePre", - "*.tsx", - "lua vim.lsp.buf.formatting_sync(nil, 1000)", - }, - }, - } -end vim.cmd "setl ts=2 sw=2" diff --git a/ftplugin/typescriptreact.lua b/ftplugin/typescriptreact.lua index 1c4004c2..ab370364 100644 --- a/ftplugin/typescriptreact.lua +++ b/ftplugin/typescriptreact.lua @@ -34,40 +34,5 @@ require("lspconfig").tsserver.setup { }), }, } - require("lsp.ts-fmt-lint").setup() - -if O.lang.tsserver.autoformat then - require("lv-utils").define_augroups { - _javascript_autoformat = { - { - - "BufWritePre", - "*.js", - "lua vim.lsp.buf.formatting_sync(nil, 1000)", - }, - }, - _javascriptreact_autoformat = { - { - "BufWritePre", - "*.jsx", - "lua vim.lsp.buf.formatting_sync(nil, 1000)", - }, - }, - _typescript_autoformat = { - { - "BufWritePre", - "*.ts", - "lua vim.lsp.buf.formatting_sync(nil, 1000)", - }, - }, - _typescriptreact_autoformat = { - { - "BufWritePre", - "*.tsx", - "lua vim.lsp.buf.formatting_sync(nil, 1000)", - }, - }, - } -end vim.cmd "setl ts=2 sw=2" diff --git a/ftplugin/zig.lua b/ftplugin/zig.lua index 7fc8d3fc..92b4120d 100644 --- a/ftplugin/zig.lua +++ b/ftplugin/zig.lua @@ -8,7 +8,6 @@ require("lspconfig").zls.setup { } require("lv-utils").define_augroups { _zig_autoformat = { - { "BufWritePre", "*.zig", "lua vim.lsp.buf.formatting_sync(nil, 1000)" }, { "BufEnter", "*.zig", ':lua vim.api.nvim_buf_set_option(0, "commentstring", "// %s")' }, }, } diff --git a/ftplugin/zsh.lua b/ftplugin/zsh.lua index a2847f19..b6fa9d5d 100644 --- a/ftplugin/zsh.lua +++ b/ftplugin/zsh.lua @@ -15,17 +15,11 @@ require("lspconfig").bashls.setup { -- sh local sh_arguments = {} -local shfmt = { formatCommand = "shfmt -ci -s -bn", formatStdin = true } - local shellcheck = { LintCommand = "shellcheck -f gcc -x", lintFormats = { "%f:%l:%c: %trror: %m", "%f:%l:%c: %tarning: %m", "%f:%l:%c: %tote: %m" }, } -if O.lang.sh.formatter == "shfmt" then - table.insert(sh_arguments, shfmt) -end - if O.lang.sh.linter == "shellcheck" then table.insert(sh_arguments, shellcheck) end diff --git a/init.lua b/init.lua index 8e44e868..2b5a9515 100644 --- a/init.lua +++ b/init.lua @@ -11,3 +11,16 @@ require "lsp" if O.lang.emmet.active then require "lsp.emmet-ls" end + +-- autoformat +if O.format_on_save then + require("lv-utils").define_augroups { + autoformat = { + { + "BufWritePre", + "*", + [[try | undojoin | Neoformat | catch /^Vim\%((\a\+)\)\=:E790/ | finally | silent Neoformat | endtry]], + }, + }, + } +end diff --git a/lua/default-config.lua b/lua/default-config.lua index ce7b1062..e05fc9e3 100644 --- a/lua/default-config.lua +++ b/lua/default-config.lua @@ -4,7 +4,7 @@ CACHE_PATH = vim.fn.stdpath "cache" TERMINAL = vim.fn.expand "$TERMINAL" O = { - + format_on_save = true, auto_close_tree = 0, auto_complete = true, colorscheme = "lunar", @@ -33,7 +33,7 @@ O = { }, lsp = { - popup_border = "single" + popup_border = "single", }, database = { save_location = "~/.config/nvcode_db", auto_execute = 1 }, @@ -97,9 +97,6 @@ O = { lang = { python = { linter = "", - -- @usage can be 'yapf', 'black' - formatter = "", - autoformat = false, isort = false, diagnostics = { virtual_text = { spacing = 0, prefix = "" }, @@ -116,9 +113,6 @@ O = { sdk_path = "/usr/lib/dart/bin/snapshots/analysis_server.dart.snapshot", }, lua = { - -- @usage can be 'lua-format' - formatter = "", - autoformat = false, diagnostics = { virtual_text = { spacing = 0, prefix = "" }, signs = true, @@ -129,8 +123,6 @@ O = { -- @usage can be 'shellcheck' linter = "", -- @usage can be 'shfmt' - formatter = "", - autoformat = false, diagnostics = { virtual_text = { spacing = 0, prefix = "" }, signs = true, @@ -140,9 +132,6 @@ O = { tsserver = { -- @usage can be 'eslint' linter = "", - -- @usage can be 'prettier' - formatter = "", - autoformat = false, diagnostics = { virtual_text = { spacing = 0, prefix = "" }, signs = true, @@ -150,9 +139,6 @@ O = { }, }, json = { - -- @usage can be 'prettier' - formatter = "", - autoformat = false, diagnostics = { virtual_text = { spacing = 0, prefix = "" }, signs = true, @@ -178,7 +164,6 @@ O = { }, cross_file_rename = true, header_insertion = "never", - autoformat = false, -- update this to true for enabling autoformat }, ruby = { diagnostics = { @@ -198,8 +183,6 @@ O = { active = false, }, linter = "", - formatter = "", - autoformat = false, diagnostics = { virtual_text = { spacing = 0, prefix = "" }, signs = true, @@ -208,13 +191,9 @@ O = { }, svelte = {}, php = { - format = { - braces = "psr12", - }, environment = { php_version = "7.4", }, - autoformat = false, diagnostics = { virtual_text = { spacing = 0, prefix = "" }, signs = true, @@ -233,8 +212,6 @@ O = { cmake = {}, java = {}, css = { - formatter = "", - autoformat = false, virtual_text = true, }, }, @@ -263,6 +240,4 @@ O = { }, footer = { "chrisatmachine.com" }, }, -} - - +} \ No newline at end of file diff --git a/lua/plugins.lua b/lua/plugins.lua index b14cac46..8752a1ba 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -66,6 +66,9 @@ return require("packer").startup(function(use) -- Treesitter use { "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" } + -- Neoformat + use { "sbdchd/neoformat", event = "BufEnter" } + use { "kyazdani42/nvim-tree.lua", -- cmd = "NvimTreeToggle", @@ -435,7 +438,7 @@ return require("packer").startup(function(use) "typescript", "typescriptreact", "typescript.tsx", - } + }, } -- use { -- "jose-elias-alvarez/null-ls.nvim", diff --git a/utils/installer/lv-config.example.lua b/utils/installer/lv-config.example.lua index 56fe7176..d5c3e40d 100644 --- a/utils/installer/lv-config.example.lua +++ b/utils/installer/lv-config.example.lua @@ -1,13 +1,14 @@ --[[ O is the global options object -Formatters and linters should be +Linters should be filled in as strings with either a global executable or a path to an executable ]] -- THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT -- general +O.format_on_save = true O.auto_complete = true O.colorscheme = "spacegray" O.auto_close_tree = 0 @@ -47,13 +48,9 @@ O.lang.clang.diagnostics.signs = true O.lang.clang.diagnostics.underline = true -- python --- add things like O.python.formatter.yapf.exec_path -- add things like O.python.linter.flake8.exec_path --- add things like O.python.formatter.isort.exec_path -O.lang.python.formatter = "yapf" -- O.python.linter = 'flake8' O.lang.python.isort = true -O.lang.python.autoformat = true O.lang.python.diagnostics.virtual_text = true O.lang.python.diagnostics.signs = true O.lang.python.diagnostics.underline = true @@ -61,37 +58,11 @@ O.lang.python.analysis.type_checking = "off" O.lang.python.analysis.auto_search_paths = true O.lang.python.analysis.use_library_code_types = true --- lua --- TODO look into stylua -O.lang.lua.formatter = "lua-format" --- O.lua.formatter = 'lua-format' -O.lang.lua.autoformat = false - -- javascript -O.lang.tsserver.formatter = "prettier" O.lang.tsserver.linter = nil -O.lang.tsserver.autoformat = true - --- json -O.lang.json.autoformat = true - --- ruby -O.lang.ruby.autoformat = true - --- go -O.lang.go.autoformat = true - --- rust -O.lang.rust.autoformat = true - --- clang -O.lang.clang.autoformat = false -- Set to true to enable auto-format in C/C++ files. -- php -O.lang.php.format.braces = "k&r" -- options: psr12, allman, k&r O.lang.php.environment.php_version = "7.4" --- TODO: autoformat seems not to work at the moment -O.lang.php.autoformat = false O.lang.php.diagnostics.signs = true O.lang.php.diagnostics.underline = true O.lang.php.filetypes = { "php", "phtml" } From 5c73e9bea50695e6b399351c2443068d23f41047 Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Mon, 5 Jul 2021 16:05:15 -0400 Subject: [PATCH 51/54] fix user config --- utils/installer/lv-config.example.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/utils/installer/lv-config.example.lua b/utils/installer/lv-config.example.lua index d5c3e40d..71d9dfc8 100644 --- a/utils/installer/lv-config.example.lua +++ b/utils/installer/lv-config.example.lua @@ -5,8 +5,7 @@ Linters should be filled in as strings with either a global executable or a path to an executable -]] --- THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT +]] -- THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT -- general O.format_on_save = true O.auto_complete = true @@ -23,7 +22,7 @@ O.transparent_window = false -- TODO User Config for predefined plugins -- After changing plugin config exit and reopen LunarVim, Run :PackerInstall :PackerCompile -O.bultin_plugin.hop.active = false +O.plugin.hop.active = false O.plugin.dial.active = false O.plugin.dashboard.active = true O.plugin.matchup.active = false @@ -40,7 +39,7 @@ O.plugin.zen.active = false -- if you don't want all the parsers change this to a table of the ones you want O.treesitter.ensure_installed = "all" -O.treesitter.ignore_install = { "haskell" } +O.treesitter.ignore_install = {"haskell"} O.treesitter.highlight.enabled = true O.lang.clang.diagnostics.virtual_text = true @@ -65,7 +64,7 @@ O.lang.tsserver.linter = nil O.lang.php.environment.php_version = "7.4" O.lang.php.diagnostics.signs = true O.lang.php.diagnostics.underline = true -O.lang.php.filetypes = { "php", "phtml" } +O.lang.php.filetypes = {"php", "phtml"} -- Autocommands (https://neovim.io/doc/user/autocmd.html) -- O.user_autocommands = {{ "BufWinEnter", "*", "echo \"hi again\""}} From 9b10d9298c58981b59beea11c140907f32533022 Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Mon, 5 Jul 2021 16:17:51 -0400 Subject: [PATCH 52/54] going back to barbar --- lua/lv-which-key/init.lua | 46 +++++++++++++++++++-------------------- lua/plugins.lua | 34 ++++++++++++++++++++++------- 2 files changed, 49 insertions(+), 31 deletions(-) diff --git a/lua/lv-which-key/init.lua b/lua/lv-which-key/init.lua index d5ad771f..084be113 100644 --- a/lua/lv-which-key/init.lua +++ b/lua/lv-which-key/init.lua @@ -87,7 +87,7 @@ vim.api.nvim_set_keymap("n", "/", ":CommentToggle", { noremap = true vim.api.nvim_set_keymap("v", "/", ":CommentToggle", { noremap = true, silent = true }) -- close buffer -vim.api.nvim_set_keymap("n", "c", ":bdelete!", { noremap = true, silent = true }) +vim.api.nvim_set_keymap("n", "c", ":BufferClose", { noremap = true, silent = true }) -- TODO create entire treesitter section @@ -121,14 +121,14 @@ local mappings = { "sort BufferLines automatically by language", }, }, - p = { - name = "Packer", - c = {"PackerCompile", "Compile"}, - i = {"PackerInstall", "Install"}, - r = {":luafile %", "Reload"}, - s = {"PackerSync", "Sync"}, - u = {"PackerUpdate", "Update"} - }, + p = { + name = "Packer", + c = { "PackerCompile", "Compile" }, + i = { "PackerInstall", "Install" }, + r = { ":luafile %", "Reload" }, + s = { "PackerSync", "Sync" }, + u = { "PackerUpdate", "Update" }, + }, -- diagnostics vanilla nvim -- -- diagnostic -- function lv_utils.get_all() @@ -158,20 +158,20 @@ local mappings = { -- " https://microsoft.github.io/debug-adapter-protocol/ -- " Debugging d = { - name = "Debug", - t = {"lua require'dap'.toggle_breakpoint()", "Toggle Breakpoint"}, - b = {"lua require'dap'.step_back()", "Step Back"}, - c = {"lua require'dap'.continue()", "Continue"}, - C = {"lua require'dap'.run_to_cursor()", "Run To Cursor"}, - d = {"lua require'dap'.disconnect()", "Disconnect"}, - g = {"lua require'dap'.session()", "Get Session"}, - i = {"lua require'dap'.step_into()", "Step Into"}, - o = {"lua require'dap'.step_over()", "Step Over"}, - u = {"lua require'dap'.step_out()", "Step Out"}, - p = {"lua require'dap'.pause.toggle()", "Pause"}, - r = {"lua require'dap'.repl.toggle()", "Toggle Repl"}, - s = {"lua require'dap'.continue()", "Start"}, - q = {"lua require'dap'.stop()", "Quit"} + name = "Debug", + t = { "lua require'dap'.toggle_breakpoint()", "Toggle Breakpoint" }, + b = { "lua require'dap'.step_back()", "Step Back" }, + c = { "lua require'dap'.continue()", "Continue" }, + C = { "lua require'dap'.run_to_cursor()", "Run To Cursor" }, + d = { "lua require'dap'.disconnect()", "Disconnect" }, + g = { "lua require'dap'.session()", "Get Session" }, + i = { "lua require'dap'.step_into()", "Step Into" }, + o = { "lua require'dap'.step_over()", "Step Over" }, + u = { "lua require'dap'.step_out()", "Step Out" }, + p = { "lua require'dap'.pause.toggle()", "Pause" }, + r = { "lua require'dap'.repl.toggle()", "Toggle Repl" }, + s = { "lua require'dap'.continue()", "Start" }, + q = { "lua require'dap'.stop()", "Quit" }, }, g = { name = "Git", diff --git a/lua/plugins.lua b/lua/plugins.lua index 8752a1ba..4ae2ec1a 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -118,13 +118,21 @@ return require("packer").startup(function(use) use { "glepnir/galaxyline.nvim" } use { - "akinsho/nvim-bufferline.lua", + "romgrk/barbar.nvim", config = function() - require("lv-bufferline").config() + vim.api.nvim_set_keymap("n", "", ":BufferNext", { noremap = true, silent = true }) + vim.api.nvim_set_keymap("n", "", ":BufferPrevious", { noremap = true, silent = true }) + vim.api.nvim_set_keymap("n", "", ":BufferClose", { noremap = true, silent = true }) end, event = "BufRead", } + -- use { + -- "akinsho/nvim-bufferline.lua", + -- config = function() require("lv-bufferline").config() end, + -- event = "BufRead" + -- } + -- Extras, these do not load by default -- Better motions @@ -224,7 +232,11 @@ return require("packer").startup(function(use) vim.g.indentLine_enabled = 1 vim.g.indent_blankline_char = "▏" - vim.g.indent_blankline_filetype_exclude = { "help", "terminal", "dashboard" } + vim.g.indent_blankline_filetype_exclude = { + "help", + "terminal", + "dashboard", + } vim.g.indent_blankline_buftype_exclude = { "terminal" } vim.g.indent_blankline_show_trailing_blankline_indent = false @@ -256,9 +268,14 @@ return require("packer").startup(function(use) use { "mfussenegger/nvim-dap", config = function() - require('dap') - vim.fn.sign_define('DapBreakpoint', {text='', texthl='LspDiagnosticsSignError', linehl='', numhl=''}) - require('dap').defaults.fallback.terminal_win_cmd = '50vsplit new' + require "dap" + vim.fn.sign_define("DapBreakpoint", { + text = "", + texthl = "LspDiagnosticsSignError", + linehl = "", + numhl = "", + }) + require("dap").defaults.fallback.terminal_win_cmd = "50vsplit new" end, disable = not O.plugin.debug.active, } @@ -462,6 +479,7 @@ return require("packer").startup(function(use) requires = "hrsh7th/nvim-compe", disable = not O.plugin.tabnine.active, } - for _, plugin in pairs(O.custom_plugins) do packer.use(plugin) end - + for _, plugin in pairs(O.custom_plugins) do + packer.use(plugin) + end end) From d4822c2920336287579c74a5b37f0aa08402b871 Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Mon, 5 Jul 2021 16:20:14 -0400 Subject: [PATCH 53/54] no lazyloading barbar --- lua/plugins.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins.lua b/lua/plugins.lua index 4ae2ec1a..7c35c264 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -124,7 +124,7 @@ return require("packer").startup(function(use) vim.api.nvim_set_keymap("n", "", ":BufferPrevious", { noremap = true, silent = true }) vim.api.nvim_set_keymap("n", "", ":BufferClose", { noremap = true, silent = true }) end, - event = "BufRead", + -- event = "BufRead", } -- use { From a469c710bfc01f291df68dba40464caaa2b496da Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Mon, 5 Jul 2021 16:21:26 -0400 Subject: [PATCH 54/54] no lazyload lspinstall --- lua/plugins.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins.lua b/lua/plugins.lua index 7c35c264..2b215291 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -32,7 +32,7 @@ return require("packer").startup(function(use) -- TODO refactor all of this (for now it works, but yes I know it could be wrapped in a simpler function) use { "neovim/nvim-lspconfig" } - use { "kabouzeid/nvim-lspinstall", cmd = "LspInstall" } + use { "kabouzeid/nvim-lspinstall" } -- Telescope use { "nvim-lua/popup.nvim" } use { "nvim-lua/plenary.nvim" }