diff --git a/lua/keys.lua b/lua/keys.lua index e939e4f..29f0a2c 100644 --- a/lua/keys.lua +++ b/lua/keys.lua @@ -1,7 +1,12 @@ -vim.api.nvim_set_keymap("n", "ff", "lua require('telescope.builtin').git_files()", {silent = true}) -vim.api.nvim_set_keymap("n", "fF", "lua require('telescope.builtin').find_files()", {silent = true}) +vim.api.nvim_set_keymap("n", "ff", "lua require('telescope.builtin').find_files()", {silent = true}) +vim.api.nvim_set_keymap( + "n", + "fF", + "lua require('telescope.builtin').find_files({no_ignore=true, no_ignore_parent = true})", + {silent = true} +) vim.api.nvim_set_keymap("n", "fg", "lua require('telescope.builtin').live_grep()", {silent = true}) -vim.api.nvim_set_keymap("n", "fb", "lua require('telescope.builtin').buffers()", {silent = true}) +-- vim.api.nvim_set_keymap("n", "fb", "lua require('telescope.builtin').buffers()", {silent = true}) vim.api.nvim_set_keymap("n", "fh", "lua require('telescope.builtin').help_tags()", {silent = true}) vim.api.nvim_set_keymap("n", "fb", "lua require('telescope.builtin').git_branches()", {silent = true}) vim.api.nvim_set_keymap("n", "ft", "TodoTelescope", {silent = true}) diff --git a/lua/plugins.lua b/lua/plugins.lua index e92765f..ae71152 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -76,7 +76,7 @@ return require("packer").startup( "RishabhRD/popfix", "onsails/lspkind-nvim", "ray-x/lsp_signature.nvim", - "jose-elias-alvarez/nvim-lsp-ts-utils", + "jose-elias-alvarez/typescript.nvim", "hood/popui.nvim" } } @@ -93,24 +93,12 @@ return require("packer").startup( end, requires = {"nvim-lua/popup.nvim", "nvim-lua/plenary.nvim"} } - use { - "nacro90/numb.nvim", - config = function() - require("numb").setup() - end - } use { "norcalli/nvim-colorizer.lua", config = function() require "colorizer".setup() end } - use { - "sindrets/diffview.nvim", - config = function() - require "plugins/diffview" - end - } use { "folke/todo-comments.nvim", requires = "nvim-lua/plenary.nvim", @@ -178,7 +166,6 @@ return require("packer").startup( end, requires = { "kyazdani42/nvim-web-devicons", - "SmiteshP/nvim-gps", "nvim-treesitter/nvim-treesitter" }, after = { @@ -231,5 +218,22 @@ return require("packer").startup( "monokai.nvim" } } + use { + "luukvbaal/statuscol.nvim", + config = function() + require("statuscol").setup( + { + -- setopt = true, + ft_ignore = {"neo-tree"} + } + ) + end + } + use { + "axelvc/template-string.nvim", + config = function() + require("template-string").setup() + end + } end ) diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index b39a2c6..5005433 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -95,11 +95,6 @@ options = { return vim_item end ]] }, - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end - }, mapping = { [""] = cmp.mapping.complete(), [""] = cmp.mapping.close(), diff --git a/lua/plugins/heirline.lua b/lua/plugins/heirline.lua index 7a12991..02182a1 100644 --- a/lua/plugins/heirline.lua +++ b/lua/plugins/heirline.lua @@ -1,20 +1,6 @@ local conditions = require("heirline.conditions") local utils = require("heirline.utils") -require("nvim-gps").setup( - { - icons = { - ["class-name"] = " ", - ["function-name"] = " ", - ["method-name"] = " ", - ["container-name"] = "炙", - ["tag-name"] = "炙" - } - } -) - -vim.o.laststatus = 3 - local colors = { bg = "#333842", brown = "#504945", @@ -41,6 +27,8 @@ local colors = { } } +vim.o.laststatus = 3 + local ViMode = { -- get vim current mode, this information will be required by the provider -- and the highlight functions, so we compute it only once per component @@ -369,18 +357,6 @@ FileNameShortBlock = {provider = "%<"} -- this means that the statusline is cut here when there's not enough space ) -local Gps = { - condition = require("nvim-gps").is_available, - provider = function() - local loc = require("nvim-gps").get_location() - if loc == "" then - return "" - end - return "> " .. loc - end, - hl = {fg = colors.gray, bg = colors.bg} -} - local DefaultStatusline = { ViMode, Space, @@ -428,18 +404,6 @@ local GSpace = {provider = " ", hl = {bg = colors.bg}} local WinBars = { fallthrough = false, - { - -- Hide the winbar for special buffers - condition = function() - return conditions.buffer_matches( - { - buftype = {"nofile", "prompt", "help", "quickfix", "nofile", "promt"}, - filetype = {"^git.*", "fugitive"} - } - ) - end, - provider = "" - }, { -- An inactive winbar for regular files condition = function() @@ -470,7 +434,12 @@ local WinBars = { utils.surround({"", ""}, colors.bright_bg, {hl = {fg = "gray", force = true}, GSpace, FileNameShortBlock, Align}) }, -- A winbar for regular files - {GSpace, FileNameShortBlock, GSpace, Gps, Align} + { + GSpace, + FileNameShortBlock, + -- GSpace, + Align + } } vim.api.nvim_create_autocmd( @@ -611,7 +580,7 @@ local TablineCloseButton = { end, {provider = " "}, { - provider = "", + provider = "", hl = {fg = "gray"}, on_click = { callback = function(_, minwid) @@ -711,7 +680,15 @@ require "heirline".setup( { statusline = StatusLines, winbar = WinBars, - tabline = TabLine + tabline = TabLine, + opts = { + disable_winbar_cb = function(args) + local buf = args.buf + local buftype = vim.tbl_contains({"prompt", "nofile", "help", "quickfix"}, vim.bo[buf].buftype) + local filetype = vim.tbl_contains({"gitcommit", "fugitive", "Trouble", "packer"}, vim.bo[buf].filetype) + return buftype or filetype + end + } } ) vim.o.showtabline = 2 diff --git a/lua/plugins/icons.lua b/lua/plugins/icons.lua index ee7d83a..f981702 100644 --- a/lua/plugins/icons.lua +++ b/lua/plugins/icons.lua @@ -1,36 +1,36 @@ require("nvim-web-devicons").set_icon { ["test.ts"] = { - icon = "", + icon = "", color = "#519aba", name = "TsTest" }, ["test.tsx"] = { - icon = "", + icon = "", color = "#519aba", name = "TsTest" }, ["test.js"] = { - icon = "", + icon = "", color = "#cbcb41", name = "JsTest" }, ["test.jsx"] = { - icon = "", + icon = "", color = "#cbcb41", name = "JsTest" }, ["readme.md"] = { - icon = "", + icon = "", color = "#42A5F5", name = "Readme" }, ["package.json"] = { - icon = "", + icon = "󰎙", color = "#8BC34A", name = "PackageJson" }, ["package-lock.json"] = { - icon = "", + icon = "󰎙", color = "#8BC34A", name = "PackageJson" }, diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index ac3f086..6d7c7f0 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -3,7 +3,7 @@ local util = require "lspconfig.util" vim.fn.sign_define("DiagnosticSignError", {text = " ", texthl = "DiagnosticSignError"}) vim.fn.sign_define("DiagnosticSignWarn", {text = " ", texthl = "DiagnosticSignWarn"}) vim.fn.sign_define("DiagnosticSignInfo", {text = " ", texthl = "DiagnosticSignInfo"}) -vim.fn.sign_define("DiagnosticSignHint", {text = "", texthl = "DiagnosticSignHint"}) +vim.fn.sign_define("DiagnosticSignHint", {text = " ", texthl = "DiagnosticSignHint"}) vim.fn.sign_define("DapBreakpoint", {text = " ", texthl = "DiagnosticSignError"}) vim.fn.sign_define("DapStopped", {text = " ", texthl = "DiagnosticSignInfo"}) @@ -24,7 +24,8 @@ require("null-ls").setup( diagnostic.severity = vim.diagnostic.severity["WARN"] end } - ) + ), + require("typescript.extensions.null-ls.code-actions") } } ) @@ -32,7 +33,19 @@ require("null-ls").setup( --- Languages require "lspconfig".html.setup {} require "lspconfig".vimls.setup {} -require "lspconfig".yamlls.setup {} +require "lspconfig".yamlls.setup { + settings = { + yaml = { + keyOrdering = false, + schemas = { + ["https://raw.githubusercontent.com/instrumenta/kubernetes-json-schema/master/master/all.json"] = "/*.k8s.yaml", + ["https://raw.githubusercontent.com/instrumenta/kubernetes-json-schema/master/master/all.json"] = "/*.k8s.yml", + ["https://raw.githubusercontent.com/instrumenta/kubernetes-json-schema/master/master/all.json"] = "k8s/*.yaml", + ["https://raw.githubusercontent.com/instrumenta/kubernetes-json-schema/master/master/all.json"] = "k8s/*.yml" + } + } + } +} local nvim_lsp = require("lspconfig") @@ -81,22 +94,37 @@ require "lspconfig".jsonls.setup { capabilities = capabilities } -require "lspconfig".tsserver.setup { - on_attach = function(client, bufnr) - local ts_utils = require("nvim-lsp-ts-utils") +-- require "lspconfig".tsserver.setup { +-- on_attach = function(client, bufnr) +-- local ts_utils = require("nvim-lsp-ts-utils") +-- +-- ts_utils.setup { +-- -- eslint_bin = "eslint_d", +-- eslint_enable_diagnostics = false +-- } +-- ts_utils.setup_client(client) +-- on_attach(client, bufnr) +-- end, +-- flags = { +-- debounce_text_changes = 300 +-- }, +-- capabilities = capabilities +-- } - ts_utils.setup { - -- eslint_bin = "eslint_d", - eslint_enable_diagnostics = false +require("typescript").setup( + { + disable_commands = false, -- prevent the plugin from creating Vim commands + debug = false, -- enable debug logging for commands + go_to_source_definition = { + fallback = true -- fall back to standard LSP definition on failure + }, + server = { + -- pass options to lspconfig's setup method + on_attach = on_attach, + capabilities = capabilities } - ts_utils.setup_client(client) - on_attach(client, bufnr) - end, - flags = { - debounce_text_changes = 150 - }, - capabilities = capabilities -} + } +) require "lspconfig".eslint.setup { on_attach = on_attach, @@ -124,7 +152,7 @@ require "lspconfig".eslint.setup { on_attach = on_attach, cmd = {"java-language-server"} } ]] -local servers = {"pyright", "bashls", "clangd", "cssls", "texlab", "prismals"} +local servers = {"pyright", "bashls", "clangd", "cssls", "texlab", "prismals", "solidity"} for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup { on_attach = on_attach, diff --git a/lua/plugins/neo-tree.lua b/lua/plugins/neo-tree.lua index ba3c923..50b6c54 100644 --- a/lua/plugins/neo-tree.lua +++ b/lua/plugins/neo-tree.lua @@ -20,6 +20,38 @@ require "window-picker".setup( require("neo-tree").setup( { + default_component_configs = { + icon = { + folder_empty = "󰜌", + folder_empty_open = "󰜌" + }, + git_status = { + symbols = { + renamed = "󰁕", + unstaged = "󰄱" + } + } + }, + document_symbols = { + kinds = { + File = {icon = "󰈙", hl = "Tag"}, + Namespace = {icon = "󰌗", hl = "Include"}, + Package = {icon = "󰏖", hl = "Label"}, + Class = {icon = "󰌗", hl = "Include"}, + Property = {icon = "󰆧", hl = "@property"}, + Enum = {icon = "󰒻", hl = "@number"}, + Function = {icon = "󰊕", hl = "Function"}, + String = {icon = "󰀬", hl = "String"}, + Number = {icon = "󰎠", hl = "Number"}, + Array = {icon = "󰅪", hl = "Type"}, + Object = {icon = "󰅩", hl = "Type"}, + Key = {icon = "󰌋", hl = ""}, + Struct = {icon = "󰌗", hl = "Type"}, + Operator = {icon = "󰆕", hl = "Operator"}, + TypeParameter = {icon = "󰊄", hl = "Type"}, + StaticMethod = {icon = "󰠄 ", hl = "Function"} + } + }, close_if_last_window = true, -- Close Neo-tree if it is the last window left in the tab popup_border_style = "rounded", enable_git_status = true, @@ -74,7 +106,7 @@ require("neo-tree").setup( modified = "", -- or "", but this is redundant info if you use git_status_colors on the name deleted = "✖", -- this can only be used in the git_status source - renamed = "", + renamed = "󰁕", -- this can only be used in the git_status source -- Status type untracked = "", @@ -196,7 +228,22 @@ require("neo-tree").setup( }, source_selector = { winbar = true, - statusline = false + statusline = false, + sources = { + -- table + { + source = "filesystem", -- string + display_name = " 󰉓 Files" -- string | nil + }, + { + source = "buffers", -- string + display_name = " 󰈙 Buffers" -- string | nil + }, + { + source = "git_status", -- string + display_name = " 󰊢 Git" -- string | nil + } + } } } ) diff --git a/lua/plugins/neotest.lua b/lua/plugins/neotest.lua index 4521e0e..333cb15 100644 --- a/lua/plugins/neotest.lua +++ b/lua/plugins/neotest.lua @@ -26,4 +26,5 @@ local keymap = vim.api.nvim_set_keymap keymap("n", "tf", ':lua require("neotest").run.run(vim.fn.expand("%"))', {silent = true, noremap = true}) keymap("n", "tn", ':lua require("neotest").run.run()', {silent = true}) +keymap("n", "tr", ':lua require("neotest").run.run()', {silent = true}) keymap("n", "td", ':lua require("neotest").output.open({enter=true,short=true})', {silent = true})