Merge branch 'main' of github.com:MasterGordon/neovim-config into main
This commit is contained in:
commit
6a7dc04b6d
11
lua/keys.lua
11
lua/keys.lua
|
|
@ -1,7 +1,12 @@
|
|||
vim.api.nvim_set_keymap("n", "<leader>ff", "<cmd>lua require('telescope.builtin').git_files()<cr>", {silent = true})
|
||||
vim.api.nvim_set_keymap("n", "<leader>fF", "<cmd>lua require('telescope.builtin').find_files()<cr>", {silent = true})
|
||||
vim.api.nvim_set_keymap("n", "<leader>ff", "<cmd>lua require('telescope.builtin').find_files()<cr>", {silent = true})
|
||||
vim.api.nvim_set_keymap(
|
||||
"n",
|
||||
"<leader>fF",
|
||||
"<cmd>lua require('telescope.builtin').find_files({no_ignore=true, no_ignore_parent = true})<cr>",
|
||||
{silent = true}
|
||||
)
|
||||
vim.api.nvim_set_keymap("n", "<leader>fg", "<cmd>lua require('telescope.builtin').live_grep()<cr>", {silent = true})
|
||||
vim.api.nvim_set_keymap("n", "<leader>fb", "<cmd>lua require('telescope.builtin').buffers()<cr>", {silent = true})
|
||||
-- vim.api.nvim_set_keymap("n", "<leader>fb", "<cmd>lua require('telescope.builtin').buffers()<cr>", {silent = true})
|
||||
vim.api.nvim_set_keymap("n", "<leader>fh", "<cmd>lua require('telescope.builtin').help_tags()<cr>", {silent = true})
|
||||
vim.api.nvim_set_keymap("n", "<leader>fb", "<cmd>lua require('telescope.builtin').git_branches()<cr>", {silent = true})
|
||||
vim.api.nvim_set_keymap("n", "<leader>ft", "<CMD>TodoTelescope<CR>", {silent = true})
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
|
|
|
|||
|
|
@ -95,11 +95,6 @@ options = {
|
|||
return vim_item
|
||||
end ]]
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end
|
||||
},
|
||||
mapping = {
|
||||
["<C-f>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.close(),
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -26,4 +26,5 @@ local keymap = vim.api.nvim_set_keymap
|
|||
|
||||
keymap("n", "<leader>tf", ':lua require("neotest").run.run(vim.fn.expand("%"))<CR>', {silent = true, noremap = true})
|
||||
keymap("n", "<leader>tn", ':lua require("neotest").run.run()<CR>', {silent = true})
|
||||
keymap("n", "<leader>tr", ':lua require("neotest").run.run()<CR>', {silent = true})
|
||||
keymap("n", "<leader>td", ':lua require("neotest").output.open({enter=true,short=true})<CR>', {silent = true})
|
||||
|
|
|
|||
Loading…
Reference in New Issue