null-ls
authorGeorgios Atheridis <atheridis@tutamail.com>
Sun, 5 Jun 2022 17:13:26 +0000 (20:13 +0300)
committerGeorgios Atheridis <atheridis@tutamail.com>
Sun, 5 Jun 2022 17:13:26 +0000 (20:13 +0300)
20 files changed:
nvim/init.lua
nvim/lua/nvim/autopairs.lua
nvim/lua/nvim/bufferline.lua
nvim/lua/nvim/cmp.lua
nvim/lua/nvim/colorscheme.lua
nvim/lua/nvim/comment.lua
nvim/lua/nvim/gitsigns.lua
nvim/lua/nvim/keymaps.lua
nvim/lua/nvim/lsp/handlers.lua
nvim/lua/nvim/lsp/init.lua
nvim/lua/nvim/lsp/lsp-installer.lua
nvim/lua/nvim/lsp/settings/jsonls.lua
nvim/lua/nvim/lsp/settings/pyright.lua
nvim/lua/nvim/lsp/settings/sumneko_lua.lua
nvim/lua/nvim/null-ls.lua [new file with mode: 0644]
nvim/lua/nvim/nvim-tree.lua
nvim/lua/nvim/options.lua
nvim/lua/nvim/plugins.lua
nvim/lua/nvim/telescope.lua
nvim/lua/nvim/treesitter.lua

index e57a557634c6da1a965eb11c6b771479ca780284..2fd4ae4ca2c80e9927d2d80e5c47c624bb76a640 100644 (file)
@@ -4,8 +4,11 @@ require("nvim.plugins")
 require("nvim.colorscheme")
 require("nvim.cmp")
 require("nvim.lsp")
+require("nvim.telescope")
 require("nvim.autopairs")
 require("nvim.treesitter")
 require("nvim.gitsigns")
+require("nvim.comment")
 require("nvim.nvim-tree")
 require("nvim.bufferline")
+require("nvim.null-ls")
index 1b3a2fbb1cbb94b4bd71422ffe0aa81bf39cb54d..bdeb26a8d82f7423dc8fd15f238743157560cd0b 100644 (file)
@@ -1,19 +1,19 @@
 -- If you want insert `(` after select function or method item
 local status_ok, npairs = pcall(require, "nvim-autopairs")
 if not status_ok then
-    return
+       return
 end
 
 local Rule = require("nvim-autopairs.rule")
 
-npairs.setup ({
-    check_ts = true,
-    ts_config = {
-        lua = {"string"}, -- it will not add a pair on that treesitter node
-        javascript = {"template_string"},
-        java = false, -- don't check treesitter on java
-    },
-    map_cr = true,
+npairs.setup({
+       check_ts = true,
+       ts_config = {
+               lua = { "string" }, -- it will not add a pair on that treesitter node
+               javascript = { "template_string" },
+               java = false, -- don't check treesitter on java
+       },
+       map_cr = true,
 })
 
 -- npairs.add_rules {
@@ -22,45 +22,45 @@ npairs.setup ({
 -- }
 
 --Add spaces between parentheses
-npairs.add_rules {
-       Rule('{%', '%'),
-       Rule('{% ', ' '),
-    Rule(' ', ' ')
-        :with_pair(function (opts)
-            local pair = opts.line:sub(opts.col - 1, opts.col)
-            return vim.tbl_contains({ '()', '[]', '{}' }, pair)
-        end),
-    Rule('( ', ' )')
-        :with_pair(function() return false end)
-        :with_move(function(opts)
-            return opts.prev_char:match('.%)') ~= nil
-        end)
-        :use_key(')'),
-    Rule('{ ', ' }')
-        :with_pair(function() return false end)
-        :with_move(function(opts)
-            return opts.prev_char:match('.%}') ~= nil
-        end)
-        :use_key('}'),
-    Rule('[ ', ' ]')
-        :with_pair(function() return false end)
-        :with_move(function(opts)
-            return opts.prev_char:match('.%]') ~= nil
-        end)
-        :use_key(']'),
-}
-
+npairs.add_rules({
+       Rule("{%", "%"),
+       Rule("{% ", " "),
+       Rule(" ", " "):with_pair(function(opts)
+               local pair = opts.line:sub(opts.col - 1, opts.col)
+               return vim.tbl_contains({ "()", "[]", "{}" }, pair)
+       end),
+       Rule("( ", " )")
+               :with_pair(function()
+                       return false
+               end)
+               :with_move(function(opts)
+                       return opts.prev_char:match(".%)") ~= nil
+               end)
+               :use_key(")"),
+       Rule("{ ", " }")
+               :with_pair(function()
+                       return false
+               end)
+               :with_move(function(opts)
+                       return opts.prev_char:match(".%}") ~= nil
+               end)
+               :use_key("}"),
+       Rule("[ ", " ]")
+               :with_pair(function()
+                       return false
+               end)
+               :with_move(function(opts)
+                       return opts.prev_char:match(".%]") ~= nil
+               end)
+               :use_key("]"),
+})
 
-local cmp_autopairs = require('nvim-autopairs.completion.cmp')
+local cmp_autopairs = require("nvim-autopairs.completion.cmp")
 local cmp_status_ok, cmp = pcall(require, "cmp")
 if not cmp_status_ok then
-    return
+       return
 end
-cmp.event:on( 'confirm_done', cmp_autopairs.on_confirm_done({  map_char = { tex = '' } }))
-
-
-
+cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } }))
 
 -- add a lisp filetype (wrap my-function), FYI: Hardcoded = { "clojure", "clojurescript", "fennel", "janet" }
-cmp_autopairs.lisp[#cmp_autopairs.lisp+1] = "racket"
-
+cmp_autopairs.lisp[#cmp_autopairs.lisp + 1] = "racket"
index 5fd63227f9b8844831d32975cf238a504d647341..b23f016f04562cee957fa8494ce83753d9a6de90 100644 (file)
@@ -3,7 +3,7 @@ if not status_ok then
        return
 end
 
-bufferline.setup {
+bufferline.setup({
        options = {
                numbers = "none",
                close_command = "Bdelete! %d",
@@ -24,4 +24,4 @@ bufferline.setup {
                enforce_regular_tabs = true,
                always_show_bufferline = true,
        },
-}
+})
index 711d6a77aa203408d521f20f3eb2752e41fe7247..b968023b4b45680ea9faa0ee0647d23fae50fe85 100644 (file)
 local cmp_status_ok, cmp = pcall(require, "cmp")
 if not cmp_status_ok then
-    print("Error loading cmp")
-    return
+       print("Error loading cmp")
+       return
 end
 
 local snip_status_ok, luasnip = pcall(require, "luasnip")
 if not snip_status_ok then
-    print("Error loading snip")
-    return
+       print("Error loading snip")
+       return
 end
 
 require("luasnip/loaders/from_vscode").lazy_load()
 
 local check_backspace = function()
-    local col = vim.fn.col "." - 1
-    return col == 0 or vim.fn.getline("."):sub(col, col):match "%s"
+       local col = vim.fn.col(".") - 1
+       return col == 0 or vim.fn.getline("."):sub(col, col):match("%s")
 end
 
 --   פּ ﯟ   some other good icons
 local kind_icons = {
-    Text = "",
-    Method = "m",
-    Function = "",
-    Constructor = "",
-    Field = "",
-    Variable = "",
-    Class = "",
-    Interface = "",
-    Module = "",
-    Property = "",
-    Unit = "",
-    Value = "",
-    Enum = "",
-    Keyword = "",
-    Snippet = "",
-    Color = "",
-    File = "",
-    Reference = "",
-    Folder = "",
-    EnumMember = "",
-    Constant = "",
-    Struct = "",
-    Event = "",
-    Operator = "",
-    TypeParameter = "",
+       Text = "",
+       Method = "m",
+       Function = "",
+       Constructor = "",
+       Field = "",
+       Variable = "",
+       Class = "",
+       Interface = "",
+       Module = "",
+       Property = "",
+       Unit = "",
+       Value = "",
+       Enum = "",
+       Keyword = "",
+       Snippet = "",
+       Color = "",
+       File = "",
+       Reference = "",
+       Folder = "",
+       EnumMember = "",
+       Constant = "",
+       Struct = "",
+       Event = "",
+       Operator = "",
+       TypeParameter = "",
 }
 
-cmp.setup {
-    snippet = {
-        expand = function(args)
-            luasnip.lsp_expand(args.body)
-        end,
-    },
-    mapping = {
-        ["<C-k>"] = cmp.mapping.select_prev_item(),
-        ["<C-j>"] = cmp.mapping.select_next_item(),
-        ["<C-p>"] = cmp.mapping.select_prev_item(),
-        ["<C-n>"] = cmp.mapping.select_next_item(),
-        ["<C-b>"] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }),
-        ["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }),
-        ["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
-        ["<C-e>"] = cmp.mapping {
-            i = cmp.mapping.abort(),
-            c = cmp.mapping.close(),
-        },
-        ["<CR>"] = cmp.mapping.confirm { select = false },
-        ["<Tab>"] = cmp.mapping(function(fallback)
-            if cmp.visible() then
-                cmp.select_next_item()
-            elseif luasnip.expandable() then
-                luasnip.expand()
-            elseif luasnip.expand_or_jumpable() then
-                luasnip.expand_or_jump()
-            elseif check_backspace() then
-                fallback()
-            else
-                fallback()
-            end
-        end, {
-              "i",
-              "s",
-        }),
-        ["<S-Tab>"] = cmp.mapping(function(fallback)
-            if cmp.visible() then
-                cmp.select_prev_item()
-            elseif luasnip.jumpable(-1) then
-                luasnip.jump(-1)
-            else
-                fallback()
-            end
-        end, {
-            "i",
-            "s",
-        }),
-    },
-    formatting = {
-        fields = { "kind", "abbr", "menu" },
-    },
-    sources = {
-        { name = "nvim_lsp" },
-        { name = "nvim_lua" },
-        { name = "luasnip" },
-        { name = "buffer" },
-        { name = "path" },
-    },
-    confirm_opts = {
-        behavior = cmp.ConfirmBehavior.Replace,
-        select = false,
-    },
-    window = {
-        completion = cmp.config.window.bordered(),
-        documentation = cmp.config.window.bordered(),
-    },
-    experimental = {
-        ghost_text = true,
-    },
-}
+cmp.setup({
+       snippet = {
+               expand = function(args)
+                       luasnip.lsp_expand(args.body)
+               end,
+       },
+       mapping = {
+               ["<C-k>"] = cmp.mapping.select_prev_item(),
+               ["<C-j>"] = cmp.mapping.select_next_item(),
+               ["<C-p>"] = cmp.mapping.select_prev_item(),
+               ["<C-n>"] = cmp.mapping.select_next_item(),
+               ["<C-b>"] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }),
+               ["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }),
+               ["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
+               ["<C-e>"] = cmp.mapping({
+                       i = cmp.mapping.abort(),
+                       c = cmp.mapping.close(),
+               }),
+               ["<CR>"] = cmp.mapping.confirm({ select = false }),
+               ["<Tab>"] = cmp.mapping(function(fallback)
+                       if cmp.visible() then
+                               cmp.select_next_item()
+                       elseif luasnip.expandable() then
+                               luasnip.expand()
+                       elseif luasnip.expand_or_jumpable() then
+                               luasnip.expand_or_jump()
+                       elseif check_backspace() then
+                               fallback()
+                       else
+                               fallback()
+                       end
+               end, {
+                       "i",
+                       "s",
+               }),
+               ["<S-Tab>"] = cmp.mapping(function(fallback)
+                       if cmp.visible() then
+                               cmp.select_prev_item()
+                       elseif luasnip.jumpable(-1) then
+                               luasnip.jump(-1)
+                       else
+                               fallback()
+                       end
+               end, {
+                       "i",
+                       "s",
+               }),
+       },
+       formatting = {
+               fields = { "kind", "abbr", "menu" },
+       },
+       sources = {
+               { name = "nvim_lsp" },
+               { name = "nvim_lua" },
+               { name = "luasnip" },
+               { name = "buffer" },
+               { name = "path" },
+       },
+       confirm_opts = {
+               behavior = cmp.ConfirmBehavior.Replace,
+               select = false,
+       },
+       window = {
+               completion = cmp.config.window.bordered(),
+               documentation = cmp.config.window.bordered(),
+       },
+       experimental = {
+               ghost_text = true,
+       },
+})
 
 -- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
-cmp.setup.cmdline('/', {
-    mapping = cmp.mapping.preset.cmdline(),
-    sources = {
-        { name = 'buffer' }
-    }
+cmp.setup.cmdline("/", {
+       mapping = cmp.mapping.preset.cmdline(),
+       sources = {
+               { name = "buffer" },
+       },
 })
 
 -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
-cmp.setup.cmdline(':', {
-    mapping = cmp.mapping.preset.cmdline(),
-    sources = cmp.config.sources({
-        { name = 'path' }
-    }, {
-        { name = 'cmdline' }
-    })
+cmp.setup.cmdline(":", {
+       mapping = cmp.mapping.preset.cmdline(),
+       sources = cmp.config.sources({
+               { name = "path" },
+       }, {
+               { name = "cmdline" },
+       }),
 })
index 7c7ca341ae58ab375e5a729dea291532308fba13..328ac47f02a065cb5fd4774a8c8a7d9d6d9971ea 100644 (file)
@@ -1,10 +1,10 @@
 local status_ok, onedark = pcall(require, "onedark")
 if not status_ok then
-    vim.notify("Error with colorscheme") 
-    return
+       vim.notify("Error with colorscheme")
+       return
 end
 
-onedark.setup {
-    style = "deep"
-}
+onedark.setup({
+       style = "deep",
+})
 onedark.load()
index 228352828b1b15ad01722b1d683f83fea494b515..1a52688bff3ed52c5f8eadb516a2d53f99778556 100644 (file)
@@ -3,7 +3,7 @@ if not status_ok then
        return
 end
 
-comment.setup {
+comment.setup({
        pre_hook = function(ctx)
                local U = require("Comment.utils")
 
@@ -14,9 +14,9 @@ comment.setup {
                        location = require("ts_context_commentstring.utils").get_visual_start_location()
                end
 
-               return require("ts_context_commentstring.internal").calculate_commentstring {
+               return require("ts_context_commentstring.internal").calculate_commentstring({
                        key = ctx.ctype == U.ctype.line and "__default" or "__multiline",
                        location = location,
-               }
+               })
        end,
-}
+})
index 064fe38eb2cdfb96f50520b0a4d3e04d0eaccdb3..f14187051ed7dc7476d65ce1e7418aa5d6ecd59d 100644 (file)
@@ -3,44 +3,44 @@ if not status_ok then
        return
 end
 
-gitsigns.setup {
-       signs = {
-       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'},
-       },
-       signcolumn = true,  -- Toggle with `:Gitsigns toggle_signs`
-       numhl      = false, -- Toggle with `:Gitsigns toggle_numhl`
-       linehl     = false, -- Toggle with `:Gitsigns toggle_linehl`
-       word_diff  = false, -- Toggle with `:Gitsigns toggle_word_diff`
-       watch_gitdir = {
-       interval = 1000,
-       follow_files = true
-       },
-       attach_to_untracked = true,
-       current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
-       current_line_blame_opts = {
-       virt_text = true,
-       virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
-       delay = 1000,
-       ignore_whitespace = false,
-       },
-       current_line_blame_formatter = '<author>, <author_time:%Y-%m-%d> - <summary>',
-       sign_priority = 6,
-       update_debounce = 100,
-       status_formatter = nil, -- Use default
-       max_file_length = 40000,
-       preview_config = {
-       -- Options passed to nvim_open_win
-       border = 'single',
-       style = 'minimal',
-       relative = 'cursor',
-       row = 0,
-       col = 1
-       },
-       yadm = {
-       enable = false
-       },
-}
+gitsigns.setup({
+       signs = {
+               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" },
+       },
+       signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
+       numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
+       linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
+       word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
+       watch_gitdir = {
+               interval = 1000,
+               follow_files = true,
+       },
+       attach_to_untracked = true,
+       current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
+       current_line_blame_opts = {
+               virt_text = true,
+               virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
+               delay = 1000,
+               ignore_whitespace = false,
+       },
+       current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>",
+       sign_priority = 6,
+       update_debounce = 100,
+       status_formatter = nil, -- Use default
+       max_file_length = 40000,
+       preview_config = {
+               -- Options passed to nvim_open_win
+               border = "single",
+               style = "minimal",
+               relative = "cursor",
+               row = 0,
+               col = 1,
+       },
+       yadm = {
+               enable = false,
+       },
+})
index b4d10f10228456f7109b10ea429ad07fea8fc7e1..3bf231e1a26fde14b4ee3f9c9f73114548d2ba4c 100644 (file)
@@ -1,19 +1,19 @@
 local opts = { noremap = true, silent = true }
 
 local function nnoremap(shortcut, command)
-    vim.keymap.set("n", shortcut, command, opts)
+       vim.keymap.set("n", shortcut, command, opts)
 end
 local function inoremap(shortcut, command)
-    vim.keymap.set("i", shortcut, command, opts)
+       vim.keymap.set("i", shortcut, command, opts)
 end
 local function vnoremap(shortcut, command)
-    vim.keymap.set("v", shortcut, command, opts)
+       vim.keymap.set("v", shortcut, command, opts)
 end
 local function xnoremap(shortcut, command)
-    vim.keymap.set("x", shortcut, command, opts)
+       vim.keymap.set("x", shortcut, command, opts)
 end
 local function tnoremap(shortcut, command)
-    vim.keymap.set("t", shortcut, command, opts)
+       vim.keymap.set("t", shortcut, command, opts)
 end
 
 -- Define leader key
@@ -47,7 +47,7 @@ inoremap("jk", "<ESC>")
 
 -- Don't copy replaced text into register
 -- while in visual mode, when pasting
-vnoremap("p", "\"_dP")
+vnoremap("p", '"_dP')
 
 -- Move text up and down
 vnoremap("<M-j>", ":m .+1<CR>==")
@@ -66,5 +66,8 @@ tnoremap("<C-k>", "<C-\\><C-N><C-w>k")
 tnoremap("<C-l>", "<C-\\><C-N><C-w>l")
 
 -- Telescope
-nnoremap("<leader>f", "<cmd>lua require'telescope.builtin'.find_files(require('telescope.themes').get_dropdown({ previewer = false }))<CR>")
+nnoremap(
+       "<leader>f",
+       "<cmd>lua require'telescope.builtin'.find_files(require('telescope.themes').get_dropdown({ previewer = false }))<CR>"
+)
 nnoremap("<C-t>", "<cmd>Telescope live_grep<CR>")
index 551a5269941ac398d577e2ee3eb4da25a4a6568c..64d1e5ff988741c83c9eaa93ccacfbc1cc450d52 100644 (file)
@@ -2,101 +2,101 @@ local M = {}
 
 -- TODO: backfill this to template
 M.setup = function()
-    local signs = {
-        { name = "DiagnosticSignError", text = "" },
-        { name = "DiagnosticSignWarn", text = "" },
-        { name = "DiagnosticSignHint", text = "" },
-        { name = "DiagnosticSignInfo", text = "" },
-    }
-    
-    for _, sign in ipairs(signs) do
-        vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" })
-    end
+       local signs = {
+               { name = "DiagnosticSignError", text = "" },
+               { name = "DiagnosticSignWarn", text = "" },
+               { name = "DiagnosticSignHint", text = "" },
+               { name = "DiagnosticSignInfo", text = "" },
+       }
 
-    local config = {
-        -- disable virtual text
-        virtual_text = true,
-        -- show signs
-        signs = {
-            active = signs,
-        },
-        update_in_insert = true,
-        underline = true,
-        severity_sort = true,
-        float = {
-            focusable = false,
-            style = "minimal",
-            border = "rounded",
-            source = "always",
-            header = "",
-            prefix = "",
-        },
-    }
+       for _, sign in ipairs(signs) do
+               vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" })
+       end
 
-    vim.diagnostic.config(config)
+       local config = {
+               -- disable virtual text
+               virtual_text = true,
+               -- show signs
+               signs = {
+                       active = signs,
+               },
+               update_in_insert = true,
+               underline = true,
+               severity_sort = true,
+               float = {
+                       focusable = false,
+                       style = "minimal",
+                       border = "rounded",
+                       source = "always",
+                       header = "",
+                       prefix = "",
+               },
+       }
 
-    vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
-        border = "rounded",
-    })
+       vim.diagnostic.config(config)
 
-    vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
-        border = "rounded",
-    })
+       vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
+               border = "rounded",
+       })
+
+       vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
+               border = "rounded",
+       })
 end
 
 local function lsp_highlight_document(client)
-    -- Set autocommands conditional on server_capabilities
-    if client.resolved_capabilities.document_highlight then
-        vim.api.nvim_exec(
-        [[
+       -- Set autocommands conditional on server_capabilities
+       if client.resolved_capabilities.document_highlight then
+               vim.api.nvim_exec(
+                       [[
             augroup lsp_document_highlight
                 autocmd! * <buffer>
                 autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
                 autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
             augroup END
         ]],
-        false
-        )
-    end
+                       false
+               )
+       end
 end
 
 local function lsp_keymaps(bufnr)
-    local opts = { noremap = true, silent = true }
-    vim.api.nvim_buf_set_keymap(bufnr, "n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opts)
-    vim.api.nvim_buf_set_keymap(bufnr, "n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
-    vim.api.nvim_buf_set_keymap(bufnr, "n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", opts)
-    vim.api.nvim_buf_set_keymap(bufnr, "n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
-    vim.api.nvim_buf_set_keymap(bufnr, "n", "<C-k>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
-    vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
-    vim.api.nvim_buf_set_keymap(bufnr, "n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
-    -- vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>ca", "<cmd>lua vim.lsp.buf.code_action()<CR>", opts)
-    -- vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>f", "<cmd>lua vim.diagnostic.open_float()<CR>", opts)
-    vim.api.nvim_buf_set_keymap(bufnr, "n", "[d", '<cmd>lua vim.diagnostic.goto_prev({ border = "rounded" })<CR>', opts)
-    vim.api.nvim_buf_set_keymap(
-        bufnr,
-        "n",
-        "gl",
-        '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics({ border = "rounded" })<CR>',
-        opts
-    )
-    vim.api.nvim_buf_set_keymap(bufnr, "n", "]d", '<cmd>lua vim.diagnostic.goto_next({ border = "rounded" })<CR>', opts)
-    vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>q", "<cmd>lua vim.diagnostic.setloclist()<CR>", opts)
-    vim.cmd [[ command! Format execute 'lua vim.lsp.buf.formatting()' ]]
+       local opts = { noremap = true, silent = true }
+       vim.api.nvim_buf_set_keymap(bufnr, "n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opts)
+       vim.api.nvim_buf_set_keymap(bufnr, "n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
+       vim.api.nvim_buf_set_keymap(bufnr, "n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", opts)
+       vim.api.nvim_buf_set_keymap(bufnr, "n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
+       vim.api.nvim_buf_set_keymap(bufnr, "n", "<C-k>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
+       vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
+       vim.api.nvim_buf_set_keymap(bufnr, "n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
+       -- vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>ca", "<cmd>lua vim.lsp.buf.code_action()<CR>", opts)
+       -- vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>f", "<cmd>lua vim.diagnostic.open_float()<CR>", opts)
+       vim.api.nvim_buf_set_keymap(bufnr, "n", "[d", '<cmd>lua vim.diagnostic.goto_prev({ border = "rounded" })<CR>', opts)
+       vim.api.nvim_buf_set_keymap(
+               bufnr,
+               "n",
+               "gl",
+               '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics({ border = "rounded" })<CR>',
+               opts
+       )
+       vim.api.nvim_buf_set_keymap(bufnr, "n", "]d", '<cmd>lua vim.diagnostic.goto_next({ border = "rounded" })<CR>', opts)
+       vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>q", "<cmd>lua vim.diagnostic.setloclist()<CR>", opts)
+       vim.cmd([[ command! Format execute 'lua vim.lsp.buf.formatting()' ]])
 end
 
 M.on_attach = function(client, bufnr)
-    if client.name == "tsserver" then
-        client.resolved_capabilities.document_formatting = false
-    end
-    lsp_keymaps(bufnr)
-    lsp_highlight_document(client)
+       if client.name == "tsserver" or client.name == "sumneko_lua" then
+               client.resolved_capabilities.document_formatting = false
+       end
+       lsp_keymaps(bufnr)
+       lsp_highlight_document(client)
 end
 
 local capabilities = vim.lsp.protocol.make_client_capabilities()
 
 local status_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
 if not status_ok then
-    return
+       return
 end
 
 M.capabilities = cmp_nvim_lsp.update_capabilities(capabilities)
index e66a9292214d132195ef668b06a4197e15bc80f4..64a82e74f1fcf9967bbac9ff981e8bab4475c401 100644 (file)
@@ -1,7 +1,7 @@
 local status_ok, _ = pcall(require, "lspconfig")
 if not status_ok then
-    print("Error with lspconfig")
-    return
+       print("Error with lspconfig")
+       return
 end
 
 require("nvim.lsp.lsp-installer")
index cef26acffe2aa30685cc9e9357a9776975cf983c..6e2188feb38ee4748b80dec6f3d9a1eeefb5a90c 100644 (file)
@@ -1,33 +1,33 @@
 local status_ok, lsp_installer = pcall(require, "nvim-lsp-installer")
 if not status_ok then
-    print("Error with nvim-lsp-installer")
-    return
+       print("Error with nvim-lsp-installer")
+       return
 end
 
 -- Register a handler that will be called for all installed servers.
 -- Alternatively, you may also register handlers on specific server instances instead (see example below).
 lsp_installer.on_server_ready(function(server)
-    local opts = {
-        on_attach = require("nvim.lsp.handlers").on_attach,
-        capabilities = require("nvim.lsp.handlers").capabilities,
-    }
+       local opts = {
+               on_attach = require("nvim.lsp.handlers").on_attach,
+               capabilities = require("nvim.lsp.handlers").capabilities,
+       }
 
-    if server.name == "jsonls" then
-        local jsonls_opts = require("nvim.lsp.settings.jsonls")
-        opts = vim.tbl_deep_extend("force", jsonls_opts, opts)
-    end
+       if server.name == "jsonls" then
+               local jsonls_opts = require("nvim.lsp.settings.jsonls")
+               opts = vim.tbl_deep_extend("force", jsonls_opts, opts)
+       end
 
-    if server.name == "sumneko_lua" then
-        local sumneko_opts = require("nvim.lsp.settings.sumneko_lua")
-        opts = vim.tbl_deep_extend("force", sumneko_opts, opts)
-    end
+       if server.name == "sumneko_lua" then
+               local sumneko_opts = require("nvim.lsp.settings.sumneko_lua")
+               opts = vim.tbl_deep_extend("force", sumneko_opts, opts)
+       end
 
-    if server.name == "pyright" then
-        local pyright_opts = require("nvim.lsp.settings.pyright")
-        opts = vim.tbl_deep_extend("force", pyright_opts, opts)
-    end
+       if server.name == "pyright" then
+               local pyright_opts = require("nvim.lsp.settings.pyright")
+               opts = vim.tbl_deep_extend("force", pyright_opts, opts)
+       end
 
-    -- This setup() function is exactly the same as lspconfig's setup function.
-    -- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
-    server:setup(opts)
+       -- This setup() function is exactly the same as lspconfig's setup function.
+       -- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
+       server:setup(opts)
 end)
index be362c9171053604d2fc245c839f869196ab7ba5..31fb9143798e71096646440ea8ae500cb9023c18 100644 (file)
 -- Find more schemas here: https://www.schemastore.org/json/
 local schemas = {
-  {
-    description = "TypeScript compiler configuration file",
-    fileMatch = {
-      "tsconfig.json",
-      "tsconfig.*.json",
-    },
-    url = "https://json.schemastore.org/tsconfig.json",
-  },
-  {
-    description = "Lerna config",
-    fileMatch = { "lerna.json" },
-    url = "https://json.schemastore.org/lerna.json",
-  },
-  {
-    description = "Babel configuration",
-    fileMatch = {
-      ".babelrc.json",
-      ".babelrc",
-      "babel.config.json",
-    },
-    url = "https://json.schemastore.org/babelrc.json",
-  },
-  {
-    description = "ESLint config",
-    fileMatch = {
-      ".eslintrc.json",
-      ".eslintrc",
-    },
-    url = "https://json.schemastore.org/eslintrc.json",
-  },
-  {
-    description = "Bucklescript config",
-    fileMatch = { "bsconfig.json" },
-    url = "https://raw.githubusercontent.com/rescript-lang/rescript-compiler/8.2.0/docs/docson/build-schema.json",
-  },
-  {
-    description = "Prettier config",
-    fileMatch = {
-      ".prettierrc",
-      ".prettierrc.json",
-      "prettier.config.json",
-    },
-    url = "https://json.schemastore.org/prettierrc",
-  },
-  {
-    description = "Vercel Now config",
-    fileMatch = { "now.json" },
-    url = "https://json.schemastore.org/now",
-  },
-  {
-    description = "Stylelint config",
-    fileMatch = {
-      ".stylelintrc",
-      ".stylelintrc.json",
-      "stylelint.config.json",
-    },
-    url = "https://json.schemastore.org/stylelintrc",
-  },
-  {
-    description = "A JSON schema for the ASP.NET LaunchSettings.json files",
-    fileMatch = { "launchsettings.json" },
-    url = "https://json.schemastore.org/launchsettings.json",
-  },
-  {
-    description = "Schema for CMake Presets",
-    fileMatch = {
-      "CMakePresets.json",
-      "CMakeUserPresets.json",
-    },
-    url = "https://raw.githubusercontent.com/Kitware/CMake/master/Help/manual/presets/schema.json",
-  },
-  {
-    description = "Configuration file as an alternative for configuring your repository in the settings page.",
-    fileMatch = {
-      ".codeclimate.json",
-    },
-    url = "https://json.schemastore.org/codeclimate.json",
-  },
-  {
-    description = "LLVM compilation database",
-    fileMatch = {
-      "compile_commands.json",
-    },
-    url = "https://json.schemastore.org/compile-commands.json",
-  },
-  {
-    description = "Config file for Command Task Runner",
-    fileMatch = {
-      "commands.json",
-    },
-    url = "https://json.schemastore.org/commands.json",
-  },
-  {
-    description = "AWS CloudFormation provides a common language for you to describe and provision all the infrastructure resources in your cloud environment.",
-    fileMatch = {
-      "*.cf.json",
-      "cloudformation.json",
-    },
-    url = "https://raw.githubusercontent.com/awslabs/goformation/v5.2.9/schema/cloudformation.schema.json",
-  },
-  {
-    description = "The AWS Serverless Application Model (AWS SAM, previously known as Project Flourish) extends AWS CloudFormation to provide a simplified way of defining the Amazon API Gateway APIs, AWS Lambda functions, and Amazon DynamoDB tables needed by your serverless application.",
-    fileMatch = {
-      "serverless.template",
-      "*.sam.json",
-      "sam.json",
-    },
-    url = "https://raw.githubusercontent.com/awslabs/goformation/v5.2.9/schema/sam.schema.json",
-  },
-  {
-    description = "Json schema for properties json file for a GitHub Workflow template",
-    fileMatch = {
-      ".github/workflow-templates/**.properties.json",
-    },
-    url = "https://json.schemastore.org/github-workflow-template-properties.json",
-  },
-  {
-    description = "golangci-lint configuration file",
-    fileMatch = {
-      ".golangci.toml",
-      ".golangci.json",
-    },
-    url = "https://json.schemastore.org/golangci-lint.json",
-  },
-  {
-    description = "JSON schema for the JSON Feed format",
-    fileMatch = {
-      "feed.json",
-    },
-    url = "https://json.schemastore.org/feed.json",
-    versions = {
-      ["1"] = "https://json.schemastore.org/feed-1.json",
-      ["1.1"] = "https://json.schemastore.org/feed.json",
-    },
-  },
-  {
-    description = "Packer template JSON configuration",
-    fileMatch = {
-      "packer.json",
-    },
-    url = "https://json.schemastore.org/packer.json",
-  },
-  {
-    description = "NPM configuration file",
-    fileMatch = {
-      "package.json",
-    },
-    url = "https://json.schemastore.org/package.json",
-  },
-  {
-    description = "JSON schema for Visual Studio component configuration files",
-    fileMatch = {
-      "*.vsconfig",
-    },
-    url = "https://json.schemastore.org/vsconfig.json",
-  },
-  {
-    description = "Resume json",
-    fileMatch = { "resume.json" },
-    url = "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
-  },
+       {
+               description = "TypeScript compiler configuration file",
+               fileMatch = {
+                       "tsconfig.json",
+                       "tsconfig.*.json",
+               },
+               url = "https://json.schemastore.org/tsconfig.json",
+       },
+       {
+               description = "Lerna config",
+               fileMatch = { "lerna.json" },
+               url = "https://json.schemastore.org/lerna.json",
+       },
+       {
+               description = "Babel configuration",
+               fileMatch = {
+                       ".babelrc.json",
+                       ".babelrc",
+                       "babel.config.json",
+               },
+               url = "https://json.schemastore.org/babelrc.json",
+       },
+       {
+               description = "ESLint config",
+               fileMatch = {
+                       ".eslintrc.json",
+                       ".eslintrc",
+               },
+               url = "https://json.schemastore.org/eslintrc.json",
+       },
+       {
+               description = "Bucklescript config",
+               fileMatch = { "bsconfig.json" },
+               url = "https://raw.githubusercontent.com/rescript-lang/rescript-compiler/8.2.0/docs/docson/build-schema.json",
+       },
+       {
+               description = "Prettier config",
+               fileMatch = {
+                       ".prettierrc",
+                       ".prettierrc.json",
+                       "prettier.config.json",
+               },
+               url = "https://json.schemastore.org/prettierrc",
+       },
+       {
+               description = "Vercel Now config",
+               fileMatch = { "now.json" },
+               url = "https://json.schemastore.org/now",
+       },
+       {
+               description = "Stylelint config",
+               fileMatch = {
+                       ".stylelintrc",
+                       ".stylelintrc.json",
+                       "stylelint.config.json",
+               },
+               url = "https://json.schemastore.org/stylelintrc",
+       },
+       {
+               description = "A JSON schema for the ASP.NET LaunchSettings.json files",
+               fileMatch = { "launchsettings.json" },
+               url = "https://json.schemastore.org/launchsettings.json",
+       },
+       {
+               description = "Schema for CMake Presets",
+               fileMatch = {
+                       "CMakePresets.json",
+                       "CMakeUserPresets.json",
+               },
+               url = "https://raw.githubusercontent.com/Kitware/CMake/master/Help/manual/presets/schema.json",
+       },
+       {
+               description = "Configuration file as an alternative for configuring your repository in the settings page.",
+               fileMatch = {
+                       ".codeclimate.json",
+               },
+               url = "https://json.schemastore.org/codeclimate.json",
+       },
+       {
+               description = "LLVM compilation database",
+               fileMatch = {
+                       "compile_commands.json",
+               },
+               url = "https://json.schemastore.org/compile-commands.json",
+       },
+       {
+               description = "Config file for Command Task Runner",
+               fileMatch = {
+                       "commands.json",
+               },
+               url = "https://json.schemastore.org/commands.json",
+       },
+       {
+               description = "AWS CloudFormation provides a common language for you to describe and provision all the infrastructure resources in your cloud environment.",
+               fileMatch = {
+                       "*.cf.json",
+                       "cloudformation.json",
+               },
+               url = "https://raw.githubusercontent.com/awslabs/goformation/v5.2.9/schema/cloudformation.schema.json",
+       },
+       {
+               description = "The AWS Serverless Application Model (AWS SAM, previously known as Project Flourish) extends AWS CloudFormation to provide a simplified way of defining the Amazon API Gateway APIs, AWS Lambda functions, and Amazon DynamoDB tables needed by your serverless application.",
+               fileMatch = {
+                       "serverless.template",
+                       "*.sam.json",
+                       "sam.json",
+               },
+               url = "https://raw.githubusercontent.com/awslabs/goformation/v5.2.9/schema/sam.schema.json",
+       },
+       {
+               description = "Json schema for properties json file for a GitHub Workflow template",
+               fileMatch = {
+                       ".github/workflow-templates/**.properties.json",
+               },
+               url = "https://json.schemastore.org/github-workflow-template-properties.json",
+       },
+       {
+               description = "golangci-lint configuration file",
+               fileMatch = {
+                       ".golangci.toml",
+                       ".golangci.json",
+               },
+               url = "https://json.schemastore.org/golangci-lint.json",
+       },
+       {
+               description = "JSON schema for the JSON Feed format",
+               fileMatch = {
+                       "feed.json",
+               },
+               url = "https://json.schemastore.org/feed.json",
+               versions = {
+                       ["1"] = "https://json.schemastore.org/feed-1.json",
+                       ["1.1"] = "https://json.schemastore.org/feed.json",
+               },
+       },
+       {
+               description = "Packer template JSON configuration",
+               fileMatch = {
+                       "packer.json",
+               },
+               url = "https://json.schemastore.org/packer.json",
+       },
+       {
+               description = "NPM configuration file",
+               fileMatch = {
+                       "package.json",
+               },
+               url = "https://json.schemastore.org/package.json",
+       },
+       {
+               description = "JSON schema for Visual Studio component configuration files",
+               fileMatch = {
+                       "*.vsconfig",
+               },
+               url = "https://json.schemastore.org/vsconfig.json",
+       },
+       {
+               description = "Resume json",
+               fileMatch = { "resume.json" },
+               url = "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
+       },
 }
 
 local opts = {
-  settings = {
-    json = {
-      schemas = schemas,
-    },
-  },
-  setup = {
-    commands = {
-      Format = {
-        function()
-          vim.lsp.buf.range_formatting({}, { 0, 0 }, { vim.fn.line "$", 0 })
-        end,
-      },
-    },
-  },
+       settings = {
+               json = {
+                       schemas = schemas,
+               },
+       },
+       setup = {
+               commands = {
+                       Format = {
+                               function()
+                                       vim.lsp.buf.range_formatting({}, { 0, 0 }, { vim.fn.line("$"), 0 })
+                               end,
+                       },
+               },
+       },
 }
 
 return opts
index 1fe7686477ebf89bb3e74f07539ec00c9a7b59da..8b899835c41e3ba1aed06ad6c8236271efb93713 100644 (file)
@@ -1,9 +1,9 @@
 return {
-    settings = {
-        python = {
-            analysis = {
-                typeCheckingMode = "basic",
-            }
-        }
-    },
+       settings = {
+               python = {
+                       analysis = {
+                               typeCheckingMode = "basic",
+                       },
+               },
+       },
 }
index 9848bdd8543c5dd1d085fc458acd739a29565f8e..6d27e62706558db715e093ccbeb0df386486859c 100644 (file)
@@ -1,15 +1,15 @@
 return {
-    settings = {
-        Lua = {
-            diagnostics = {
-                globals = { "vim" },
-            },
-            workspace = {
-                library = {
-                    [vim.fn.expand("$VIMRUNTIME/lua")] = true,
-                    [vim.fn.stdpath("config") .. "/lua"] = true,
-                },
-            },
-        },
-    },
+       settings = {
+               Lua = {
+                       diagnostics = {
+                               globals = { "vim" },
+                       },
+                       workspace = {
+                               library = {
+                                       [vim.fn.expand("$VIMRUNTIME/lua")] = true,
+                                       [vim.fn.stdpath("config") .. "/lua"] = true,
+                               },
+                       },
+               },
+       },
 }
diff --git a/nvim/lua/nvim/null-ls.lua b/nvim/lua/nvim/null-ls.lua
new file mode 100644 (file)
index 0000000..23639ca
--- /dev/null
@@ -0,0 +1,16 @@
+local null_ls_status_ok, null_ls = pcall(require, "null-ls")
+if not null_ls_status_ok then
+       return
+end
+
+local formatting = null_ls.builtins.formatting
+local diagnostics = null_ls.builtins.diagnostics
+
+null_ls.setup({
+       debug = false,
+       sources = {
+               formatting.black,
+               formatting.stylua,
+               diagnostics.flake8,
+       },
+})
index 11938981e4dd574a1589fd5ec2a646b7fcf669a4..e5ea9a4c4a0e1909d27cde641b032dfe85b18eea 100644 (file)
@@ -8,175 +8,175 @@ local tree_cb = nvim_tree_config.nvim_tree_callback
 -- setup with all defaults
 -- each of these are documented in `:help nvim-tree.OPTION_NAME`
 -- nested options are documented by accessing them with `.` (eg: `:help nvim-tree.view.mappings.list`).
-require'nvim-tree'.setup { -- BEGIN_DEFAULT_OPTS
-  auto_reload_on_write = true,
-  create_in_closed_folder = false,
-  disable_netrw = false,
-  hijack_cursor = false,
-  hijack_netrw = true,
-  hijack_unnamed_buffer_when_opening = false,
-  ignore_buffer_on_setup = false,
-  open_on_setup = false,
-  open_on_setup_file = false,
-  open_on_tab = false,
-  sort_by = "name",
-  update_cwd = false,
-  reload_on_bufenter = false,
-  respect_buf_cwd = false,
-  view = {
-    adaptive_size = false,
-    width = 20,
-    height = 30,
-    hide_root_folder = false,
-    side = "left",
-    preserve_window_proportions = false,
-    number = false,
-    relativenumber = false,
-    signcolumn = "yes",
-    mappings = {
-      custom_only = false,
-      list = {
-        { key = { "l", "<CR>", "o" }, cb = tree_cb "edit" },
-               { key = "h", cb = tree_cb "close_node" },
-               { key = "v", cb = tree_cb "vsplit" },
-      },
-    },
-  },
-  renderer = {
-    add_trailing = false,
-    group_empty = false,
-    highlight_git = false,
-    highlight_opened_files = "none",
-    root_folder_modifier = ":~",
-    indent_markers = {
-      enable = false,
-      icons = {
-        corner = "└ ",
-        edge = "│ ",
-        item = "│ ",
-        none = "  ",
-      },
-    },
-    icons = {
-      webdev_colors = true,
-      git_placement = "before",
-      padding = " ",
-      symlink_arrow = " ➛ ",
-      show = {
-        file = true,
-        folder = true,
-        folder_arrow = true,
-        git = true,
-      },
-      glyphs = {
-        default = "",
-        symlink = "",
-        folder = {
-          arrow_closed = "",
-          arrow_open = "",
-          default = "",
-          open = "",
-          empty = "",
-          empty_open = "",
-          symlink = "",
-          symlink_open = "",
-        },
-        git = {
-          unstaged = "✗",
-          staged = "✓",
-          unmerged = "",
-          renamed = "➜",
-          untracked = "★",
-          deleted = "",
-          ignored = "◌",
-        },
-      },
-    },
-    special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md" },
-  },
-  hijack_directories = {
-    enable = true,
-    auto_open = true,
-  },
-  update_focused_file = {
-    enable = false,
-    update_cwd = false,
-    ignore_list = {},
-  },
-  ignore_ft_on_setup = {},
-  system_open = {
-    cmd = "",
-    args = {},
-  },
-  diagnostics = {
-    enable = true,
-    show_on_dirs = true,
-    icons = {
-      hint = "",
-      info = "",
-      warning = "",
-      error = "",
-    },
-  },
-  filters = {
-    dotfiles = false,
-    custom = {},
-    exclude = {},
-  },
-  filesystem_watchers = {
-    enable = false,
-    interval = 100,
-  },
-  git = {
-    enable = true,
-    ignore = true,
-    timeout = 400,
-  },
-  actions = {
-    use_system_clipboard = true,
-    change_dir = {
-      enable = true,
-      global = false,
-      restrict_above_cwd = false,
-    },
-    expand_all = {
-      max_folder_discovery = 300,
-    },
-    open_file = {
-      quit_on_open = false,
-      resize_window = true,
-      window_picker = {
-        enable = true,
-        chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
-        exclude = {
-          filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" },
-          buftype = { "nofile", "terminal", "help" },
-        },
-      },
-    },
-    remove_file = {
-      close_window = true,
-    },
-  },
-  trash = {
-    cmd = "trash",
-    require_confirm = true,
-  },
-  live_filter = {
-    prefix = "[FILTER]: ",
-    always_show_folders = true,
-  },
-  log = {
-    enable = false,
-    truncate = false,
-    types = {
-      all = false,
-      config = false,
-      copy_paste = false,
-      diagnostics = false,
-      git = false,
-      profile = false,
-      watcher = false,
-    },
-  },
-} -- END_DEFAULT_OPTS
+require("nvim-tree").setup({ -- BEGIN_DEFAULT_OPTS
+       auto_reload_on_write = true,
+       create_in_closed_folder = false,
+       disable_netrw = false,
+       hijack_cursor = false,
+       hijack_netrw = true,
+       hijack_unnamed_buffer_when_opening = false,
+       ignore_buffer_on_setup = false,
+       open_on_setup = false,
+       open_on_setup_file = false,
+       open_on_tab = false,
+       sort_by = "name",
+       update_cwd = false,
+       reload_on_bufenter = false,
+       respect_buf_cwd = false,
+       view = {
+               adaptive_size = false,
+               width = 30,
+               height = 30,
+               hide_root_folder = false,
+               side = "left",
+               preserve_window_proportions = false,
+               number = false,
+               relativenumber = false,
+               signcolumn = "yes",
+               mappings = {
+                       custom_only = false,
+                       list = {
+                               { key = { "l", "<CR>", "o" }, cb = tree_cb("edit") },
+                               { key = "h", cb = tree_cb("close_node") },
+                               { key = "v", cb = tree_cb("vsplit") },
+                       },
+               },
+       },
+       renderer = {
+               add_trailing = false,
+               group_empty = false,
+               highlight_git = false,
+               highlight_opened_files = "none",
+               root_folder_modifier = ":~",
+               indent_markers = {
+                       enable = false,
+                       icons = {
+                               corner = "└ ",
+                               edge = "│ ",
+                               item = "│ ",
+                               none = "  ",
+                       },
+               },
+               icons = {
+                       webdev_colors = true,
+                       git_placement = "before",
+                       padding = " ",
+                       symlink_arrow = " ➛ ",
+                       show = {
+                               file = true,
+                               folder = true,
+                               folder_arrow = true,
+                               git = true,
+                       },
+                       glyphs = {
+                               default = "",
+                               symlink = "",
+                               folder = {
+                                       arrow_closed = "",
+                                       arrow_open = "",
+                                       default = "",
+                                       open = "",
+                                       empty = "",
+                                       empty_open = "",
+                                       symlink = "",
+                                       symlink_open = "",
+                               },
+                               git = {
+                                       unstaged = "✗",
+                                       staged = "✓",
+                                       unmerged = "",
+                                       renamed = "➜",
+                                       untracked = "★",
+                                       deleted = "",
+                                       ignored = "◌",
+                               },
+                       },
+               },
+               special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md" },
+       },
+       hijack_directories = {
+               enable = true,
+               auto_open = true,
+       },
+       update_focused_file = {
+               enable = false,
+               update_cwd = false,
+               ignore_list = {},
+       },
+       ignore_ft_on_setup = {},
+       system_open = {
+               cmd = "",
+               args = {},
+       },
+       diagnostics = {
+               enable = true,
+               show_on_dirs = true,
+               icons = {
+                       hint = "",
+                       info = "",
+                       warning = "",
+                       error = "",
+               },
+       },
+       filters = {
+               dotfiles = false,
+               custom = {},
+               exclude = {},
+       },
+       filesystem_watchers = {
+               enable = false,
+               interval = 100,
+       },
+       git = {
+               enable = true,
+               ignore = true,
+               timeout = 400,
+       },
+       actions = {
+               use_system_clipboard = true,
+               change_dir = {
+                       enable = true,
+                       global = false,
+                       restrict_above_cwd = false,
+               },
+               expand_all = {
+                       max_folder_discovery = 300,
+               },
+               open_file = {
+                       quit_on_open = false,
+                       resize_window = true,
+                       window_picker = {
+                               enable = true,
+                               chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
+                               exclude = {
+                                       filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" },
+                                       buftype = { "nofile", "terminal", "help" },
+                               },
+                       },
+               },
+               remove_file = {
+                       close_window = true,
+               },
+       },
+       trash = {
+               cmd = "trash",
+               require_confirm = true,
+       },
+       live_filter = {
+               prefix = "[FILTER]: ",
+               always_show_folders = true,
+       },
+       log = {
+               enable = false,
+               truncate = false,
+               types = {
+                       all = false,
+                       config = false,
+                       copy_paste = false,
+                       diagnostics = false,
+                       git = false,
+                       profile = false,
+                       watcher = false,
+               },
+       },
+}) -- END_DEFAULT_OPTS
index 9ed4443c69f35394e2cfb28dd5ea1e0a0c8a35b5..a6e3feb8e45f919e2a0a160caec99596bb3a768f 100644 (file)
@@ -1,39 +1,39 @@
 local options = {
-    backup = false,
-    clipboard = "unnamedplus",
-    cmdheight = 1,
-    completeopt = { "menuone", "noselect" },
-    conceallevel = 0,
-    fileencoding = "utf-8",
-    hlsearch = false,
-    showtabline = 4,
-    pumheight = 10,
-    smartcase = true,
-    smartindent = true,
-    splitbelow = true,
-    splitright = true,
-    swapfile = false,
-    termguicolors = true,
-    timeoutlen = 1000,
-    undofile = true,
-    updatetime = 300,
-    writebackup = false,
-    expandtab = false,
-    shiftwidth = 4,
-    tabstop = 4,
-    number = true,
-    relativenumber = true,
-    cursorline = true,
-    numberwidth = 4,
-    signcolumn = "yes",
-    wrap = false,
-    scrolloff = 8,
-    sidescrolloff = 8,
-    guifont = "monospace:h17",
+       backup = false,
+       clipboard = "unnamedplus",
+       cmdheight = 1,
+       completeopt = { "menuone", "noselect" },
+       conceallevel = 0,
+       fileencoding = "utf-8",
+       hlsearch = false,
+       showtabline = 4,
+       pumheight = 10,
+       smartcase = true,
+       smartindent = true,
+       splitbelow = true,
+       splitright = true,
+       swapfile = false,
+       termguicolors = true,
+       timeoutlen = 1000,
+       undofile = true,
+       updatetime = 300,
+       writebackup = false,
+       expandtab = false,
+       shiftwidth = 4,
+       tabstop = 4,
+       number = true,
+       relativenumber = true,
+       cursorline = true,
+       numberwidth = 4,
+       signcolumn = "yes",
+       wrap = false,
+       scrolloff = 8,
+       sidescrolloff = 8,
+       guifont = "monospace:h17",
 }
 
-vim.opt.shortmess:append "c"
+vim.opt.shortmess:append("c")
 
 for k, v in pairs(options) do
-    vim.opt[k] = v
+       vim.opt[k] = v
 end
index 6f768826bf93585eaf3dab41007dbec02d69aa44..aefad8312671762955447ba3bab87105b1b89c81 100644 (file)
 local fn = vim.fn
 
 -- Automatically install packer
-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
-    PACKER_BOOTSTRAP = fn.system {
-        "git",
-        "clone",
-        "--depth",
-        "1",
-        "https://github.com/wbthomason/packer.nvim",
-        install_path,
-    }
-    print "Installing packer close and reopen Neovim ... "
-    vim.cmd [[packadd packer.nvim]]
+       PACKER_BOOTSTRAP = fn.system({
+               "git",
+               "clone",
+               "--depth",
+               "1",
+               "https://github.com/wbthomason/packer.nvim",
+               install_path,
+       })
+       print("Installing packer close and reopen Neovim ... ")
+       vim.cmd([[packadd packer.nvim]])
 end
 
 -- Autocommand that reloads neovim whenver you save the plugins.lua file
-vim.cmd [[
+vim.cmd([[
     augroup packer_user_config
         autocmd!
         autocmd BufWritePost plugins.lua source <afile> | PackerSync
     augroup end
-]]
+]])
 
 -- Use a protected call so we don't error out on the first use
 local status_ok, packer = pcall(require, "packer")
 if not status_ok then
-    vim.notify("Error with require packer")
-    return
+       vim.notify("Error with require packer")
+       return
 end
 
-packer.init {
-    display = {
-        open_fn = function()
-            return require("packer.util").float {}
-        end,
-    },
-}
+packer.init({
+       display = {
+               open_fn = function()
+                       return require("packer.util").float({})
+               end,
+       },
+})
 
 -- Install plugins here
 return packer.startup(function(use)
-    use "wbthomason/packer.nvim" -- Have packer manage itself
-
-
-
-    -- PLUGINS BEGIN --
-        -- An implementation of the Popup API from vim in Neovim
-        use "nvim-lua/popup.nvim"
-
-        -- Useful lua functions used by lots of plugins
-        use "nvim-lua/plenary.nvim"
-
-        -- Preview markdown files
-        use({
-            "iamcco/markdown-preview.nvim",
-            run = function() vim.fn["mkdp#util#install"]() end,
-        })
-
-        -- Colorschemes
-        use "navarasu/onedark.nvim"
-
-        -- cmp Plugins
-        use "hrsh7th/nvim-cmp"
-        use "hrsh7th/cmp-buffer"
-        use "hrsh7th/cmp-path"
-        use "hrsh7th/cmp-cmdline"
-        use "saadparwaiz1/cmp_luasnip"
-        use "hrsh7th/cmp-nvim-lsp"
-        use "hrsh7th/cmp-nvim-lua"
-
-        -- snippets
-        use "L3MON4D3/LuaSnip"
-        use "rafamadriz/friendly-snippets" -- a bunch of snippets to use
-
-        -- LSP
-        use "neovim/nvim-lspconfig" -- enable LSP
-        use "williamboman/nvim-lsp-installer" -- simple to use language server installer
-
-        --Telescope
-        use {
-            "nvim-telescope/telescope.nvim",
-            requires = {
-                { "nvim-lua/plenary.nvim" },
-                -- { "nvim-telescope/telescope-media-files.nvim" },
-                { "BurntSushi/ripgrep" },
-            },
-        }
-
-        -- Commenter
-        use {
-            "numToStr/Comment.nvim",
-            config = function()
-                require("Comment").setup()
-            end
-        }
-               use 'JoosepAlviste/nvim-ts-context-commentstring'
-
-               -- Treesitter
-               use {
-                       "nvim-treesitter/nvim-treesitter",
-                       run = ":TSUpdate",
-               }
-               use { "p00f/nvim-ts-rainbow" ,
-                       requires = {
-                               { "nvim-treesitter/nvim-treesitter" }
-                       }
-               }
-
-        -- Autopairs
-        use "windwp/nvim-autopairs"
-
-               -- Git
-               use "lewis6991/gitsigns.nvim"
-
-               -- NvimTree
-               use { "kyazdani42/nvim-tree.lua",
-                       requires = {
-                       "kyazdani42/nvim-web-devicons"
-                       },
-               }
-
-               -- Bufferline
-               use { "akinsho/bufferline.nvim",
-                       requires = {
-                       "kyazdani42/nvim-web-devicons"
-                       },
-               }
-               use "moll/vim-bbye"
-
-    -- PLUGINS END --
-
-
-
-
-    -- Automatically set up your configuration after cloning packer.nvim
-    -- Put this at the end after all plugins
-    if PACKER_BOOTSTRAP then
-        require("packer").sync()
-    end
+       use("wbthomason/packer.nvim") -- Have packer manage itself
+
+       -- PLUGINS BEGIN --
+       -- An implementation of the Popup API from vim in Neovim
+       use("nvim-lua/popup.nvim")
+
+       -- Useful lua functions used by lots of plugins
+       use("nvim-lua/plenary.nvim")
+
+       -- Preview markdown files
+       use({
+               "iamcco/markdown-preview.nvim",
+               run = function()
+                       vim.fn["mkdp#util#install"]()
+               end,
+       })
+
+       -- Colorschemes
+       use("navarasu/onedark.nvim")
+
+       -- cmp Plugins
+       use("hrsh7th/nvim-cmp")
+       use("hrsh7th/cmp-buffer")
+       use("hrsh7th/cmp-path")
+       use("hrsh7th/cmp-cmdline")
+       use("saadparwaiz1/cmp_luasnip")
+       use("hrsh7th/cmp-nvim-lsp")
+       use("hrsh7th/cmp-nvim-lua")
+
+       -- snippets
+       use("L3MON4D3/LuaSnip")
+       use("rafamadriz/friendly-snippets") -- a bunch of snippets to use
+
+       -- LSP
+       use("neovim/nvim-lspconfig") -- enable LSP
+       use("williamboman/nvim-lsp-installer") -- simple to use language server installer
+       use("jose-elias-alvarez/null-ls.nvim")
+
+       --Telescope
+       use({
+               "nvim-telescope/telescope.nvim",
+               requires = {
+                       { "nvim-lua/plenary.nvim" },
+                       -- { "nvim-telescope/telescope-media-files.nvim" },
+                       { "BurntSushi/ripgrep" },
+               },
+       })
+
+       -- Commenter
+       use({
+               "numToStr/Comment.nvim",
+               config = function()
+                       require("Comment").setup()
+               end,
+       })
+       use("JoosepAlviste/nvim-ts-context-commentstring")
+
+       -- Treesitter
+       use({
+               "nvim-treesitter/nvim-treesitter",
+               run = ":TSUpdate",
+       })
+       use({ "p00f/nvim-ts-rainbow", requires = {
+               { "nvim-treesitter/nvim-treesitter" },
+       } })
+
+       -- Autopairs
+       use("windwp/nvim-autopairs")
+
+       -- Git
+       use("lewis6991/gitsigns.nvim")
+
+       -- NvimTree
+       use({ "kyazdani42/nvim-tree.lua", requires = {
+               "kyazdani42/nvim-web-devicons",
+       } })
+
+       -- Bufferline
+       use({ "akinsho/bufferline.nvim", requires = {
+               "kyazdani42/nvim-web-devicons",
+       } })
+       use("moll/vim-bbye")
+
+       -- PLUGINS END --
+
+       -- Automatically set up your configuration after cloning packer.nvim
+       -- Put this at the end after all plugins
+       if PACKER_BOOTSTRAP then
+               require("packer").sync()
+       end
 end)
index f0d01b1ae0b470b17e67f03852f9a58c3204462b..d634ebaacb714641167fa65d5578941fdf4822a6 100644 (file)
 local status_ok, telescope = pcall(require, "telescope")
 if not status_ok then
-    return
+       return
 end
 
 -- telescope.load_extension('media_files')
 
-local actions = require "telescope.actions"
+local actions = require("telescope.actions")
 
-telescope.setup {
-    defaults = {
+telescope.setup({
+       defaults = {
 
-        prompt_prefix = " ",
-        selection_caret = " ",
-        path_display = { "smart" },
+               prompt_prefix = " ",
+               selection_caret = " ",
+               path_display = { "smart" },
 
-        mappings = {
-            i = {
-                ["<C-n>"] = actions.cycle_history_next,
-                ["<C-p>"] = actions.cycle_history_prev,
-    
-                ["<C-j>"] = actions.move_selection_next,
-                ["<C-k>"] = actions.move_selection_previous,
-     
-                ["<C-c>"] = actions.close,
-     
-                ["<Down>"] = actions.move_selection_next,
-                ["<Up>"] = actions.move_selection_previous,
-     
-                ["<CR>"] = actions.select_default,
-                ["<C-x>"] = actions.select_horizontal,
-                ["<C-v>"] = actions.select_vertical,
-                ["<C-t>"] = actions.select_tab,
-     
-                ["<C-u>"] = actions.preview_scrolling_up,
-                ["<C-d>"] = actions.preview_scrolling_down,
-     
-                ["<PageUp>"] = actions.results_scrolling_up,
-                ["<PageDown>"] = actions.results_scrolling_down,
-     
-                ["<Tab>"] = actions.toggle_selection + actions.move_selection_worse,
-                ["<S-Tab>"] = actions.toggle_selection + actions.move_selection_better,
-                ["<C-q>"] = actions.send_to_qflist + actions.open_qflist,
-                ["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
-                ["<C-l>"] = actions.complete_tag,
-                ["<C-_>"] = actions.which_key, -- keys from pressing <C-/>
-            },
-
-            n = {
-                ["<esc>"] = actions.close,
-                ["<CR>"] = actions.select_default,
-                ["<C-x>"] = actions.select_horizontal,
-                ["<C-v>"] = actions.select_vertical,
-                ["<C-t>"] = actions.select_tab,
-     
-                ["<Tab>"] = actions.toggle_selection + actions.move_selection_worse,
-                ["<S-Tab>"] = actions.toggle_selection + actions.move_selection_better,
-                ["<C-q>"] = actions.send_to_qflist + actions.open_qflist,
-                ["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
-     
-                ["j"] = actions.move_selection_next,
-                ["k"] = actions.move_selection_previous,
-                ["H"] = actions.move_to_top,
-                ["M"] = actions.move_to_middle,
-                ["L"] = actions.move_to_bottom,
-     
-                ["<Down>"] = actions.move_selection_next,
-                ["<Up>"] = actions.move_selection_previous,
-                ["gg"] = actions.move_to_top,
-                ["G"] = actions.move_to_bottom,
-     
-                ["<C-u>"] = actions.preview_scrolling_up,
-                ["<C-d>"] = actions.preview_scrolling_down,
-     
-                ["<PageUp>"] = actions.results_scrolling_up,
-                ["<PageDown>"] = actions.results_scrolling_down,
-     
-                ["?"] = actions.which_key,
-            },
-        },
-    },
-    pickers = {
-        -- Default configuration for builtin pickers goes here:
-        -- picker_name = {
-        --   picker_config_key = value,
-        --   ...
-        -- }
-        -- Now the picker_config_key will be applied every time you call this
-        -- builtin picker
-    },
-    extensions = {
-        -- media_files = {
-        --     -- filetypes whitelist
-        --     -- defaults to {"png", "jpg", "mp4", "webm", "pdf"}
-        --     filetypes = {"png", "webp", "jpg", "jpeg"},
-        --     find_cmd = "rg" -- find command (defaults to `fd`)
-        -- }
-        -- Your extension configuration goes here:
-        -- extension_name = {
-        --   extension_config_key = value,
-        -- }
-        -- please take a look at the readme of the extension you want to configure
-    },
-}
+               mappings = {
+                       i = {
+                               ["<C-n>"] = actions.cycle_history_next,
+                               ["<C-p>"] = actions.cycle_history_prev,
+                               ["<C-j>"] = actions.move_selection_next,
+                               ["<C-k>"] = actions.move_selection_previous,
+                               ["<C-c>"] = actions.close,
+                               ["<Down>"] = actions.move_selection_next,
+                               ["<Up>"] = actions.move_selection_previous,
+                               ["<CR>"] = actions.select_default,
+                               ["<C-x>"] = actions.select_horizontal,
+                               ["<C-v>"] = actions.select_vertical,
+                               ["<C-t>"] = actions.select_tab,
+                               ["<C-u>"] = actions.preview_scrolling_up,
+                               ["<C-d>"] = actions.preview_scrolling_down,
+                               ["<PageUp>"] = actions.results_scrolling_up,
+                               ["<PageDown>"] = actions.results_scrolling_down,
+                               ["<Tab>"] = actions.toggle_selection + actions.move_selection_worse,
+                               ["<S-Tab>"] = actions.toggle_selection + actions.move_selection_better,
+                               ["<C-q>"] = actions.send_to_qflist + actions.open_qflist,
+                               ["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
+                               ["<C-l>"] = actions.complete_tag,
+                               ["<C-_>"] = actions.which_key, -- keys from pressing <C-/>
+                       },
+                       n = {
+                               ["<esc>"] = actions.close,
+                               ["<CR>"] = actions.select_default,
+                               ["<C-x>"] = actions.select_horizontal,
+                               ["<C-v>"] = actions.select_vertical,
+                               ["<C-t>"] = actions.select_tab,
+                               ["<Tab>"] = actions.toggle_selection + actions.move_selection_worse,
+                               ["<S-Tab>"] = actions.toggle_selection + actions.move_selection_better,
+                               ["<C-q>"] = actions.send_to_qflist + actions.open_qflist,
+                               ["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
+                               ["j"] = actions.move_selection_next,
+                               ["k"] = actions.move_selection_previous,
+                               ["H"] = actions.move_to_top,
+                               ["M"] = actions.move_to_middle,
+                               ["L"] = actions.move_to_bottom,
+                               ["<Down>"] = actions.move_selection_next,
+                               ["<Up>"] = actions.move_selection_previous,
+                               ["gg"] = actions.move_to_top,
+                               ["G"] = actions.move_to_bottom,
+                               ["<C-u>"] = actions.preview_scrolling_up,
+                               ["<C-d>"] = actions.preview_scrolling_down,
+                               ["<PageUp>"] = actions.results_scrolling_up,
+                               ["<PageDown>"] = actions.results_scrolling_down,
+                               ["?"] = actions.which_key,
+                       },
+               },
+       },
+       pickers = {
+               -- Default configuration for builtin pickers goes here:
+               -- picker_name = {
+               --   picker_config_key = value,
+               --   ...
+               -- }
+               -- Now the picker_config_key will be applied every time you call this
+               -- builtin picker
+       },
+       extensions = {
+               -- media_files = {
+               --     -- filetypes whitelist
+               --     -- defaults to {"png", "jpg", "mp4", "webm", "pdf"}
+               --     filetypes = {"png", "webp", "jpg", "jpeg"},
+               --     find_cmd = "rg" -- find command (defaults to `fd`)
+               -- }
+               -- Your extension configuration goes here:
+               -- extension_name = {
+               --   extension_config_key = value,
+               -- }
+               -- please take a look at the readme of the extension you want to configure
+       },
+})
index edf82833a1d3413b706844a0bb64f4960fd565cc..575ecefb3edbfe09663bc56cb4f0e36f011457f7 100644 (file)
@@ -1,14 +1,14 @@
 local configs = require("nvim-treesitter.configs")
-configs.setup {
-       ensure_installed = "all",
-       sync_install = false,
-       ignore_install = { "" }, -- List of parsers to ignore installing
-       highlight = {
-       enable = true, -- false will disable the whole extension
-       disable = { "" }, -- list of language that will be disabled
-       additional_vim_regex_highlighting = true,
-       },
-       indent = { enable = true, disable = { "yaml" } },
+configs.setup({
+       ensure_installed = "all",
+       sync_install = false,
+       ignore_install = { "" }, -- List of parsers to ignore installing
+       highlight = {
+               enable = true, -- false will disable the whole extension
+               disable = { "" }, -- list of language that will be disabled
+               additional_vim_regex_highlighting = true,
+       },
+       indent = { enable = true, disable = { "yaml" } },
        rainbow = {
                enable = true,
                extended_mode = true,
@@ -18,7 +18,7 @@ configs.setup {
                enable = true,
                enable_autocmd = false,
        },
-}
+})
 vim.cmd("hi rainbowcol1 guifg=#FFFFFF")
 vim.cmd("hi rainbowcol2 guifg=#00FF00")
 vim.cmd("hi rainbowcol3 guifg=#2244FF")