added minimal reproduction setup
This commit is contained in:
parent
a0a128b6fe
commit
396db304fd
3
init.lua
3
init.lua
|
|
@ -1,3 +1,2 @@
|
|||
vim.g.mapleader = " "
|
||||
require "plugins"
|
||||
require "basics"
|
||||
require "keys"
|
||||
|
|
|
|||
|
|
@ -1,29 +0,0 @@
|
|||
local set = vim.o
|
||||
|
||||
set.number = true
|
||||
set.relativenumber = true
|
||||
set.clipboard = "unnamedplus"
|
||||
set.mouse = "a"
|
||||
set.termguicolors = true
|
||||
set.swapfile = false
|
||||
set.cursorline = true
|
||||
set.cursorlineopt = "number"
|
||||
set.scrolloff = 5
|
||||
|
||||
vim.cmd [[filetype plugin indent on]]
|
||||
set.tabstop = 2
|
||||
set.shiftwidth = 2
|
||||
set.expandtab = true
|
||||
|
||||
vim.cmd [[autocmd FileType markdown setlocal spell spelllang=de,en]]
|
||||
vim.cmd [[autocmd bufnewfile,bufread *.tsx set filetype=typescriptreact]]
|
||||
vim.cmd [[autocmd bufnewfile,bufread *.jsx set filetype=javascriptreact]]
|
||||
vim.cmd [[autocmd bufnewfile,bufread Jenkinsfile set filetype=groovy]]
|
||||
|
||||
set.splitright = true
|
||||
set.splitbelow = true
|
||||
|
||||
set.signcolumn = "auto:2"
|
||||
|
||||
-- set leader
|
||||
vim.g.mapleader = " "
|
||||
2657
lua/json-schema.lua
2657
lua/json-schema.lua
File diff suppressed because it is too large
Load Diff
45
lua/keys.lua
45
lua/keys.lua
|
|
@ -1,45 +0,0 @@
|
|||
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>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>fh", "<cmd>lua require('telescope.builtin').help_tags()<cr>", {silent = true})
|
||||
vim.api.nvim_set_keymap("n", "<leader>t", "<CMD>TodoTelescope<CR>", {silent = true})
|
||||
vim.api.nvim_set_keymap("", "q:", "<Nop>", {silent = true})
|
||||
|
||||
function _G.toggle_venn()
|
||||
local venn_enabled = vim.inspect(vim.b.venn_enabled)
|
||||
if (venn_enabled == "nil") then
|
||||
vim.b.venn_enabled = true
|
||||
vim.cmd [[setlocal ve=all]]
|
||||
-- draw a line on HJKL keystokes
|
||||
vim.api.nvim_buf_set_keymap(0, "n", "J", "<C-v>j:VBox<cr>", {noremap = true})
|
||||
vim.api.nvim_buf_set_keymap(0, "n", "K", "<C-v>k:VBox<cr>", {noremap = true})
|
||||
vim.api.nvim_buf_set_keymap(0, "n", "L", "<C-v>l:VBox<cr>", {noremap = true})
|
||||
vim.api.nvim_buf_set_keymap(0, "n", "H", "<C-v>h:VBox<cr>", {noremap = true})
|
||||
-- draw a box by pressing "b" with visual selection
|
||||
vim.api.nvim_buf_set_keymap(0, "v", "b", ":VBox<cr>", {noremap = true})
|
||||
else
|
||||
vim.cmd [[setlocal ve=]]
|
||||
vim.cmd [[mapclear <buffer>]]
|
||||
vim.b.venn_enabled = nil
|
||||
end
|
||||
end
|
||||
-- toggle keymappings for venn using <leader>v
|
||||
vim.api.nvim_set_keymap("n", "<leader>v", ":lua toggle_venn()<cr>", {noremap = true})
|
||||
vim.api.nvim_set_keymap(
|
||||
"v",
|
||||
"<Leader>mc",
|
||||
"<Cmd>lua require('nvim-magic.flows').append_completion(require('nvim-magic').backends.default)<CR>",
|
||||
{}
|
||||
)
|
||||
vim.api.nvim_set_keymap(
|
||||
"v",
|
||||
"<Leader>ma",
|
||||
"<Cmd>lua require('nvim-magic.flows').suggest_alteration(require('nvim-magic').backends.default)<CR>",
|
||||
{}
|
||||
)
|
||||
vim.api.nvim_set_keymap(
|
||||
"v",
|
||||
"<Leader>md",
|
||||
"<Cmd>lua require('nvim-magic.flows').suggest_docstring(require('nvim-magic').backends.default)<CR>",
|
||||
{}
|
||||
)
|
||||
193
lua/plugins.lua
193
lua/plugins.lua
|
|
@ -26,196 +26,6 @@ return require("packer").startup(
|
|||
require("monokai").setup()
|
||||
end
|
||||
}
|
||||
use {
|
||||
"glepnir/galaxyline.nvim",
|
||||
branch = "main",
|
||||
config = function()
|
||||
require "plugins/galaxyline"
|
||||
end,
|
||||
requires = {"kyazdani42/nvim-web-devicons"}
|
||||
}
|
||||
use {
|
||||
"kyazdani42/nvim-tree.lua",
|
||||
config = function()
|
||||
require "plugins/nvim-tree"
|
||||
end,
|
||||
requires = {"kyazdani42/nvim-web-devicons", opt = true}
|
||||
}
|
||||
use "JoosepAlviste/nvim-ts-context-commentstring"
|
||||
use {
|
||||
"b3nj5m1n/kommentary",
|
||||
config = function()
|
||||
require("kommentary.config").configure_language(
|
||||
"typescriptreact",
|
||||
{
|
||||
single_line_comment_string = "auto",
|
||||
multi_line_comment_strings = "auto",
|
||||
hook_function = function()
|
||||
require("ts_context_commentstring.internal").update_commentstring()
|
||||
end
|
||||
}
|
||||
)
|
||||
end
|
||||
}
|
||||
use {
|
||||
"nvim-treesitter/playground",
|
||||
requires = {"nvim-treesitter/nvim-treesitter"}
|
||||
}
|
||||
use {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
run = ":TSUpdate",
|
||||
after = "nvim-compe",
|
||||
config = function()
|
||||
local npairs = require("nvim-autopairs")
|
||||
npairs.setup(
|
||||
{
|
||||
check_ts = true,
|
||||
enable_check_bracket_line = true
|
||||
}
|
||||
)
|
||||
|
||||
require("nvim-autopairs.completion.compe").setup(
|
||||
{
|
||||
map_cr = true, -- map <CR> on insert mode
|
||||
map_complete = true, -- it will auto insert `(` after select function or method item
|
||||
auto_select = false -- auto select first item
|
||||
}
|
||||
)
|
||||
require "nvim-treesitter.configs".setup {
|
||||
context_commentstring = {
|
||||
enable = true,
|
||||
enable_autocmd = true
|
||||
},
|
||||
highlight = {
|
||||
enable = true
|
||||
},
|
||||
indent = {
|
||||
enable = true
|
||||
},
|
||||
autotag = {
|
||||
enable = true
|
||||
},
|
||||
autopairs = {
|
||||
enable = true
|
||||
}
|
||||
}
|
||||
end,
|
||||
requires = {"JoosepAlviste/nvim-ts-context-commentstring", "windwp/nvim-ts-autotag", "windwp/nvim-autopairs"}
|
||||
}
|
||||
use {
|
||||
"mhartington/formatter.nvim",
|
||||
config = function()
|
||||
require "plugins/formatter"
|
||||
end
|
||||
}
|
||||
use {
|
||||
"RishabhRD/nvim-lsputils",
|
||||
requires = {"RishabhRD/popfix"}
|
||||
}
|
||||
use {
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
require "plugins/lsp"
|
||||
end,
|
||||
requires = {
|
||||
"RishabhRD/nvim-lsputils",
|
||||
"onsails/lspkind-nvim",
|
||||
"ray-x/lsp_signature.nvim",
|
||||
"jose-elias-alvarez/nvim-lsp-ts-utils",
|
||||
"jose-elias-alvarez/null-ls.nvim"
|
||||
}
|
||||
}
|
||||
use {
|
||||
"hrsh7th/nvim-compe",
|
||||
config = function()
|
||||
require "plugins/compe"
|
||||
end
|
||||
}
|
||||
use {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
config = function()
|
||||
require("telescope").setup {
|
||||
file_ignore_patterns = {"package-lock.json"}
|
||||
}
|
||||
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 {
|
||||
"akinsho/nvim-bufferline.lua",
|
||||
config = function()
|
||||
require "plugins/bufferline"
|
||||
end,
|
||||
requires = "kyazdani42/nvim-web-devicons"
|
||||
}
|
||||
use {
|
||||
"rcarriga/vim-ultest",
|
||||
config = function()
|
||||
require "plugins/ultest"
|
||||
end,
|
||||
requires = {"vim-test/vim-test"},
|
||||
run = ":UpdateRemotePlugins"
|
||||
}
|
||||
use {
|
||||
"vuki656/package-info.nvim",
|
||||
config = function()
|
||||
require("package-info").setup()
|
||||
end,
|
||||
requires = "MunifTanjim/nui.nvim"
|
||||
}
|
||||
use {"npxbr/glow.nvim", run = "GlowInstall"}
|
||||
use {
|
||||
"folke/todo-comments.nvim",
|
||||
requires = "nvim-lua/plenary.nvim",
|
||||
config = function()
|
||||
require("todo-comments").setup {}
|
||||
end
|
||||
}
|
||||
use {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
requires = {
|
||||
"nvim-lua/plenary.nvim"
|
||||
},
|
||||
config = function()
|
||||
require("gitsigns").setup()
|
||||
end
|
||||
}
|
||||
use "jbyuki/venn.nvim"
|
||||
use "editorconfig/editorconfig-vim"
|
||||
use(
|
||||
{
|
||||
"jameshiew/nvim-magic",
|
||||
config = function()
|
||||
require("nvim-magic").setup(
|
||||
{
|
||||
use_default_keymap = false
|
||||
}
|
||||
)
|
||||
end,
|
||||
tag = "v0.2.1", -- recommended to pin to a tag and update manually as there may be breaking changes
|
||||
requires = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"MunifTanjim/nui.nvim"
|
||||
}
|
||||
}
|
||||
)
|
||||
use {
|
||||
"mfussenegger/nvim-jdtls",
|
||||
config = function()
|
||||
|
|
@ -227,8 +37,7 @@ return require("packer").startup(
|
|||
augroup end
|
||||
]]
|
||||
)
|
||||
end,
|
||||
requires = {"mfussenegger/nvim-dap"}
|
||||
end
|
||||
}
|
||||
end
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
require('nvim-ts-autotag').setup()
|
||||
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
||||
local s = " "
|
||||
for e, n in pairs(diagnostics_dict) do
|
||||
local sym = e == "error" and " " or (e == "warning" and " " or "")
|
||||
s = s .. n .. sym
|
||||
end
|
||||
return s
|
||||
end
|
||||
require "bufferline".setup {
|
||||
options = {
|
||||
always_show_bufferline = true,
|
||||
diagnostics_indicator = diagnostics_indicator,
|
||||
diagnostics = "nvim_lsp",
|
||||
separator_style = "thin"
|
||||
}
|
||||
}
|
||||
|
||||
vim.api.nvim_set_keymap("", "<A-1>", ":lua require'bufferline'.go_to_buffer(1)<CR>", {silent = true})
|
||||
vim.api.nvim_set_keymap("", "<A-2>", ":lua require'bufferline'.go_to_buffer(2)<CR>", {silent = true})
|
||||
vim.api.nvim_set_keymap("", "<A-3>", ":lua require'bufferline'.go_to_buffer(3)<CR>", {silent = true})
|
||||
vim.api.nvim_set_keymap("", "<A-4>", ":lua require'bufferline'.go_to_buffer(4)<CR>", {silent = true})
|
||||
vim.api.nvim_set_keymap("", "<A-5>", ":lua require'bufferline'.go_to_buffer(5)<CR>", {silent = true})
|
||||
vim.api.nvim_set_keymap("", "<A-6>", ":lua require'bufferline'.go_to_buffer(6)<CR>", {silent = true})
|
||||
vim.api.nvim_set_keymap("", "<A-7>", ":lua require'bufferline'.go_to_buffer(7)<CR>", {silent = true})
|
||||
vim.api.nvim_set_keymap("", "<A-8>", ":lua require'bufferline'.go_to_buffer(8)<CR>", {silent = true})
|
||||
vim.api.nvim_set_keymap("", "<A-9>", ":lua require'bufferline'.go_to_buffer(9)<CR>", {silent = true})
|
||||
vim.api.nvim_set_keymap("", "<A-0>", ":lua require'bufferline'.go_to_buffer(10)<CR>", {silent = true})
|
||||
vim.api.nvim_set_keymap("", "<A-Left>", "<C-w><Left>", {silent = true})
|
||||
vim.api.nvim_set_keymap("", "<A-Up>", "<C-w><Up>", {silent = true})
|
||||
vim.api.nvim_set_keymap("", "<A-Down>", "<C-w><Down>", {silent = true})
|
||||
vim.api.nvim_set_keymap("", "<A-Right>", "<C-w><Right>", {silent = true})
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
vim.o.completeopt = "menuone,noselect"
|
||||
require "compe".setup {
|
||||
enabled = true,
|
||||
autocomplete = true,
|
||||
debug = false,
|
||||
min_length = 1,
|
||||
preselect = "enable",
|
||||
throttle_time = 80,
|
||||
source_timeout = 200,
|
||||
incomplete_delay = 400,
|
||||
max_abbr_width = 100,
|
||||
max_kind_width = 100,
|
||||
max_menu_width = 100,
|
||||
documentation = true,
|
||||
source = {
|
||||
path = true,
|
||||
buffer = true,
|
||||
nvim_lsp = true,
|
||||
vsnip = false
|
||||
}
|
||||
}
|
||||
|
||||
vim.api.nvim_set_keymap("i", "<C-Space>", "compe#complete()", {silent = true, expr = true})
|
||||
vim.api.nvim_set_keymap("i", "<C-f>", "compe#complete()", {silent = true, expr = true})
|
||||
vim.api.nvim_set_keymap("i", "<CR>", "compe#confirm('<CR>')", {silent = true, expr = true})
|
||||
vim.api.nvim_set_keymap("i", "<C-e>", "compe#close('<C-e>')", {silent = true, expr = true})
|
||||
-- vim.api.nvim_set_keymap("i", "<C-f>", "compe#scroll({ 'delta': +4 })", {silent = true, expr = true})
|
||||
-- vim.api.nvim_set_keymap("i", "<C-d>", "compe#scroll({ 'delta': -4 })", {silent = true, expr = true})
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
local cb = require "diffview.config".diffview_callback
|
||||
|
||||
require "diffview".setup {
|
||||
diff_binaries = false, -- Show diffs for binaries
|
||||
use_icons = true, -- Requires nvim-web-devicons
|
||||
file_panel = {
|
||||
width = 35
|
||||
},
|
||||
key_bindings = {
|
||||
disable_defaults = false, -- Disable the default key bindings
|
||||
-- The `view` bindings are active in the diff buffers, only when the current
|
||||
-- tabpage is a Diffview.
|
||||
view = {
|
||||
["<tab>"] = cb("select_next_entry"), -- Open the diff for the next file
|
||||
["<s-tab>"] = cb("select_prev_entry"), -- Open the diff for the previous file
|
||||
["<leader>e"] = cb("focus_files"), -- Bring focus to the files panel
|
||||
["<leader>b"] = cb("toggle_files") -- Toggle the files panel.
|
||||
},
|
||||
file_panel = {
|
||||
["j"] = cb("next_entry"), -- Bring the cursor to the next file entry
|
||||
["<down>"] = cb("next_entry"),
|
||||
["k"] = cb("prev_entry"), -- Bring the cursor to the previous file entry.
|
||||
["<up>"] = cb("prev_entry"),
|
||||
["<cr>"] = cb("select_entry"), -- Open the diff for the selected entry.
|
||||
["o"] = cb("select_entry"),
|
||||
["<2-LeftMouse>"] = cb("select_entry"),
|
||||
["-"] = cb("toggle_stage_entry"), -- Stage / unstage the selected entry.
|
||||
["S"] = cb("stage_all"), -- Stage all entries.
|
||||
["U"] = cb("unstage_all"), -- Unstage all entries.
|
||||
["R"] = cb("refresh_files"), -- Update stats and entries in the file list.
|
||||
["<tab>"] = cb("select_next_entry"),
|
||||
["<s-tab>"] = cb("select_prev_entry"),
|
||||
["<leader>e"] = cb("focus_files"),
|
||||
["<leader>b"] = cb("toggle_files")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
vim.api.nvim_set_keymap("n", "<leader>g", ":DiffviewOpen<CR>", {silent = true})
|
||||
vim.api.nvim_set_keymap("n", "<leader>G", ":DiffviewClose<CR>", {silent = true})
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
local prettierd = function()
|
||||
return {
|
||||
exe = "prettierd",
|
||||
args = {"'" .. vim.api.nvim_buf_get_name(0) .. "'"},
|
||||
stdin = true
|
||||
}
|
||||
end
|
||||
|
||||
require("formatter").setup(
|
||||
{
|
||||
logging = false,
|
||||
filetype = {
|
||||
typescriptreact = {prettierd},
|
||||
json = {prettierd},
|
||||
css = {prettierd},
|
||||
scss = {prettierd},
|
||||
markdown = {prettierd},
|
||||
typescript = {prettierd},
|
||||
javascript = {prettierd},
|
||||
javascriptreact = {prettierd},
|
||||
lua = {
|
||||
-- luafmt
|
||||
function()
|
||||
return {
|
||||
exe = "luafmt",
|
||||
args = {"--indent-count", 2, "--stdin"},
|
||||
stdin = true
|
||||
}
|
||||
end
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
vim.api.nvim_exec(
|
||||
[[
|
||||
augroup FormatAutogroup
|
||||
autocmd!
|
||||
autocmd BufWritePost *.lua,*.tsx,*.ts,*.js,*.jsx,*.json FormatWrite
|
||||
augroup END
|
||||
]],
|
||||
true
|
||||
)
|
||||
|
|
@ -1,231 +0,0 @@
|
|||
local gl = require("galaxyline")
|
||||
local colors = require("galaxyline.theme").default
|
||||
local theme = require("monokai")
|
||||
local condition = require("galaxyline.condition")
|
||||
local gls = gl.section
|
||||
colors.bg = theme.classic.base3
|
||||
gl.short_line_list = {"NvimTree", "vista", "dbui", "packer"}
|
||||
|
||||
gls.left[2] = {
|
||||
ViMode = {
|
||||
provider = function()
|
||||
-- auto change color according the vim mode
|
||||
local mode_color = {
|
||||
n = colors.green,
|
||||
i = colors.red,
|
||||
v = colors.blue,
|
||||
[""] = colors.blue,
|
||||
V = colors.blue,
|
||||
c = colors.magenta,
|
||||
no = colors.red,
|
||||
s = colors.orange,
|
||||
S = colors.orange,
|
||||
[""] = colors.orange,
|
||||
ic = colors.yellow,
|
||||
R = colors.violet,
|
||||
Rv = colors.violet,
|
||||
cv = colors.red,
|
||||
ce = colors.red,
|
||||
r = colors.cyan,
|
||||
rm = colors.cyan,
|
||||
["r?"] = colors.cyan,
|
||||
["!"] = colors.red,
|
||||
t = colors.red
|
||||
}
|
||||
local mode_map = {
|
||||
["n"] = "NORMAL ",
|
||||
["no"] = "N·OPERATOR PENDING ",
|
||||
["v"] = "VISUAL ",
|
||||
["V"] = "V·LINE ",
|
||||
[""] = "V·BLOCK ",
|
||||
["s"] = "SELECT ",
|
||||
["S"] = "S·LINE ",
|
||||
[""] = "S·BLOCK ",
|
||||
["i"] = "INSERT ",
|
||||
["R"] = "REPLACE ",
|
||||
["Rv"] = "V·REPLACE ",
|
||||
["c"] = "COMMAND ",
|
||||
["cv"] = "VIM EX ",
|
||||
["ce"] = "EX ",
|
||||
["r"] = "PROMPT ",
|
||||
["rm"] = "MORE ",
|
||||
["r?"] = "CONFIRM ",
|
||||
["!"] = "SHELL ",
|
||||
["t"] = "TERMINAL "
|
||||
}
|
||||
vim.api.nvim_command("hi GalaxyViMode guibg=" .. mode_color[vim.fn.mode()])
|
||||
return " " .. mode_map[vim.fn.mode()]
|
||||
end,
|
||||
separator = " ",
|
||||
separator_highlight = {nil, colors.bg},
|
||||
highlight = {colors.bg, colors.bg, "bold"}
|
||||
}
|
||||
}
|
||||
gls.left[3] = {
|
||||
Macro = {
|
||||
provider = function()
|
||||
local reg = vim.fn.reg_recording()
|
||||
|
||||
if (reg == nil) or (reg == "") then
|
||||
return ""
|
||||
else
|
||||
return " " .. vim.call("reg_recording") .. " "
|
||||
end
|
||||
end,
|
||||
highlight = {colors.red, colors.bg}
|
||||
}
|
||||
}
|
||||
gls.left[5] = {
|
||||
FileIcon = {
|
||||
provider = "FileIcon",
|
||||
condition = condition.buffer_not_empty,
|
||||
highlight = {require("galaxyline.provider_fileinfo").get_file_icon_color, colors.bg}
|
||||
}
|
||||
}
|
||||
|
||||
gls.left[6] = {
|
||||
FileName = {
|
||||
provider = "FileName",
|
||||
condition = condition.buffer_not_empty,
|
||||
highlight = {colors.magenta, colors.bg, "bold"}
|
||||
}
|
||||
}
|
||||
|
||||
gls.left[7] = {
|
||||
LineInfo = {
|
||||
provider = "LineColumn",
|
||||
separator = " ",
|
||||
separator_highlight = {"NONE", colors.bg},
|
||||
highlight = {colors.fg, colors.bg}
|
||||
}
|
||||
}
|
||||
|
||||
gls.left[8] = {
|
||||
PerCent = {
|
||||
provider = "LinePercent",
|
||||
separator = " ",
|
||||
separator_highlight = {"NONE", colors.bg},
|
||||
highlight = {colors.fg, colors.bg, "bold"}
|
||||
}
|
||||
}
|
||||
|
||||
gls.left[9] = {
|
||||
DiagnosticError = {
|
||||
provider = "DiagnosticError",
|
||||
icon = " ",
|
||||
highlight = {colors.red, colors.bg}
|
||||
}
|
||||
}
|
||||
gls.left[10] = {
|
||||
DiagnosticWarn = {
|
||||
provider = "DiagnosticWarn",
|
||||
icon = " ",
|
||||
highlight = {colors.yellow, colors.bg}
|
||||
}
|
||||
}
|
||||
|
||||
gls.left[11] = {
|
||||
DiagnosticHint = {
|
||||
provider = "DiagnosticHint",
|
||||
icon = " ",
|
||||
highlight = {colors.cyan, colors.bg}
|
||||
}
|
||||
}
|
||||
|
||||
gls.left[12] = {
|
||||
DiagnosticInfo = {
|
||||
provider = "DiagnosticInfo",
|
||||
icon = " ",
|
||||
highlight = {colors.blue, colors.bg}
|
||||
}
|
||||
}
|
||||
|
||||
gls.right[1] = {
|
||||
FileEncode = {
|
||||
provider = "FileEncode",
|
||||
condition = condition.hide_in_width,
|
||||
separator = " ",
|
||||
separator_highlight = {"NONE", colors.bg},
|
||||
highlight = {colors.green, colors.bg, "bold"}
|
||||
}
|
||||
}
|
||||
|
||||
gls.right[2] = {
|
||||
FileFormat = {
|
||||
provider = "FileFormat",
|
||||
condition = condition.hide_in_width,
|
||||
separator = " ",
|
||||
separator_highlight = {"NONE", colors.bg},
|
||||
highlight = {colors.green, colors.bg, "bold"}
|
||||
}
|
||||
}
|
||||
|
||||
gls.right[3] = {
|
||||
GitIcon = {
|
||||
provider = function()
|
||||
return " "
|
||||
end,
|
||||
condition = condition.check_git_workspace,
|
||||
separator = " ",
|
||||
separator_highlight = {"NONE", colors.bg},
|
||||
highlight = {colors.violet, colors.bg, "bold"}
|
||||
}
|
||||
}
|
||||
|
||||
gls.right[4] = {
|
||||
GitBranch = {
|
||||
provider = "GitBranch",
|
||||
condition = condition.check_git_workspace,
|
||||
highlight = {colors.violet, colors.bg, "bold"}
|
||||
}
|
||||
}
|
||||
|
||||
gls.right[5] = {
|
||||
DiffAdd = {
|
||||
provider = "DiffAdd",
|
||||
separator = " ",
|
||||
separator_highlight = {nil, colors.bg},
|
||||
condition = condition.hide_in_width,
|
||||
icon = " ",
|
||||
highlight = {colors.green, colors.bg}
|
||||
}
|
||||
}
|
||||
gls.right[6] = {
|
||||
DiffModified = {
|
||||
provider = "DiffModified",
|
||||
condition = condition.hide_in_width,
|
||||
icon = " 柳",
|
||||
highlight = {colors.orane, colors.bg}
|
||||
}
|
||||
}
|
||||
gls.right[7] = {
|
||||
DiffRemove = {
|
||||
provider = "DiffRemove",
|
||||
condition = condition.hide_in_width,
|
||||
icon = " ",
|
||||
highlight = {colors.red, colors.bg}
|
||||
}
|
||||
}
|
||||
|
||||
-- File type name
|
||||
-- --------------
|
||||
|
||||
gls.short_line_left[1] = {
|
||||
ShortLineFileName = {
|
||||
provider = "FileName",
|
||||
condition = condition.buffer_not_empty,
|
||||
highlight = {colors.fg, colors.bg},
|
||||
separator = " ",
|
||||
separator_highlight = {nil, colors.bg}
|
||||
}
|
||||
}
|
||||
|
||||
-- Buffer icon
|
||||
-- -----------
|
||||
|
||||
gls.short_line_right[1] = {
|
||||
BufferIcon = {
|
||||
provider = "BufferIcon",
|
||||
highlight = {colors.fg, colors.bg}
|
||||
}
|
||||
}
|
||||
|
|
@ -2,65 +2,7 @@ local M = {}
|
|||
|
||||
function M.setup()
|
||||
local on_attach = function(client, bufnr)
|
||||
require "jdtls.setup".add_commands()
|
||||
require "jdtls".setup_dap()
|
||||
-- require "lsp-status".register_progress()
|
||||
require "compe".setup {
|
||||
enabled = true,
|
||||
autocomplete = true,
|
||||
debug = false,
|
||||
min_length = 1,
|
||||
preselect = "enable",
|
||||
throttle_time = 80,
|
||||
source_timeout = 200,
|
||||
incomplete_delay = 400,
|
||||
max_abbr_width = 100,
|
||||
max_kind_width = 100,
|
||||
max_menu_width = 100,
|
||||
documentation = true,
|
||||
source = {
|
||||
path = true,
|
||||
buffer = true,
|
||||
calc = true,
|
||||
vsnip = false,
|
||||
nvim_lsp = true,
|
||||
nvim_lua = true,
|
||||
spell = true,
|
||||
tags = true,
|
||||
snippets_nvim = false,
|
||||
treesitter = true
|
||||
}
|
||||
}
|
||||
|
||||
require "lspkind".init()
|
||||
|
||||
require "formatter".setup {
|
||||
filetype = {
|
||||
java = {
|
||||
function()
|
||||
return {
|
||||
exe = "java",
|
||||
args = {
|
||||
"--add-exports",
|
||||
"jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
|
||||
"--add-exports",
|
||||
"jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED",
|
||||
"--add-exports",
|
||||
"jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED",
|
||||
"--add-exports",
|
||||
"jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED",
|
||||
"--add-exports",
|
||||
"jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED",
|
||||
"-jar",
|
||||
os.getenv("HOME") .. "/.local/jars/google-java-format.jar",
|
||||
vim.api.nvim_buf_get_name(0)
|
||||
},
|
||||
stdin = true
|
||||
}
|
||||
end
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
vim.api.nvim_exec(
|
||||
[[
|
||||
|
|
|
|||
|
|
@ -1,142 +0,0 @@
|
|||
vim.lsp.handlers["textDocument/codeAction"] = require "lsputil.codeAction".code_action_handler
|
||||
vim.lsp.handlers["textDocument/references"] = require "lsputil.locations".references_handler
|
||||
vim.lsp.handlers["textDocument/definition"] = require "lsputil.locations".definition_handler
|
||||
vim.lsp.handlers["textDocument/declaration"] = require "lsputil.locations".declaration_handler
|
||||
vim.lsp.handlers["textDocument/typeDefinition"] = require "lsputil.locations".typeDefinition_handler
|
||||
vim.lsp.handlers["textDocument/implementation"] = require "lsputil.locations".implementation_handler
|
||||
vim.lsp.handlers["textDocument/documentSymbol"] = require "lsputil.symbols".document_handler
|
||||
vim.lsp.handlers["workspace/symbol"] = require "lsputil.symbols".workspace_handler
|
||||
|
||||
vim.fn.sign_define(
|
||||
"LspDiagnosticsSignError",
|
||||
{texthl = "LspDiagnosticsSignError", text = "", numhl = "LspDiagnosticsSignError"}
|
||||
)
|
||||
vim.fn.sign_define(
|
||||
"LspDiagnosticsSignWarning",
|
||||
{texthl = "LspDiagnosticsSignWarning", text = "", numhl = "LspDiagnosticsSignWarning"}
|
||||
)
|
||||
vim.fn.sign_define(
|
||||
"LspDiagnosticsSignHint",
|
||||
{texthl = "LspDiagnosticsSignHint", text = "", numhl = "LspDiagnosticsSignHint"}
|
||||
)
|
||||
vim.fn.sign_define(
|
||||
"LspDiagnosticsSignInformation",
|
||||
{texthl = "LspDiagnosticsSignInformation", text = "", numhl = "LspDiagnosticsSignInformation"}
|
||||
)
|
||||
|
||||
--- Completion Icons
|
||||
require("lspkind").init({})
|
||||
|
||||
--- Languages
|
||||
require "lspconfig".bashls.setup {}
|
||||
require "lspconfig".ccls.setup {}
|
||||
require "lspconfig".clangd.setup {}
|
||||
require "lspconfig".cssls.setup {}
|
||||
require "lspconfig".html.setup {}
|
||||
require "lspconfig".pyright.setup {}
|
||||
require "lspconfig".tsserver.setup {}
|
||||
require "lspconfig".vimls.setup {}
|
||||
require "lspconfig".yamlls.setup {}
|
||||
|
||||
--- ESLINT
|
||||
|
||||
local eslint = {
|
||||
lintCommand = "eslint_d -f visualstudio --stdin --stdin-filename ${INPUT}",
|
||||
lintIgnoreExitCode = true,
|
||||
lintStdin = true,
|
||||
lintFormats = {
|
||||
"%f(%l,%c): %tarning %m",
|
||||
"%f(%l,%c): %rror %m"
|
||||
}
|
||||
}
|
||||
|
||||
--- ESLINT Actions
|
||||
require("null-ls").config {}
|
||||
require("lspconfig")["null-ls"].setup {}
|
||||
|
||||
require "lspconfig".efm.setup {
|
||||
init_options = {documentFormatting = true},
|
||||
filetypes = {"javascript", "typescript", "javascriptreact", "typescriptreact"},
|
||||
init_options = {documentFormatting = true},
|
||||
settings = {
|
||||
rootMarkers = {".eslintrc.js", ".git/"},
|
||||
languages = {
|
||||
javascript = {eslint},
|
||||
typescript = {eslint},
|
||||
typescriptreact = {eslint},
|
||||
javascriptreact = {eslint}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
--- Keybindings
|
||||
|
||||
local nvim_lsp = require("lspconfig")
|
||||
|
||||
local on_attach = function(client, bufnr)
|
||||
local function buf_set_keymap(...)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, ...)
|
||||
end
|
||||
local function buf_set_option(...)
|
||||
vim.api.nvim_buf_set_option(bufnr, ...)
|
||||
end
|
||||
|
||||
-- Mappings.
|
||||
local opts = {noremap = true, silent = true}
|
||||
buf_set_keymap("n", "gD", "<Cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
||||
buf_set_keymap("n", "gd", "<Cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||
buf_set_keymap("n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts)
|
||||
buf_set_keymap("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
||||
buf_set_keymap("n", "<C-k>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>wa", "<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>wr", "<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>wl", "<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>", opts)
|
||||
-- buf_set_keymap("n", "<leader>t", "<cmd>lua vim.lsp.buf.type_definition()<CR>", opts)
|
||||
buf_set_keymap("n", "<F2>", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
|
||||
buf_set_keymap("n", "<leader>a", "<cmd>lua vim.lsp.buf.code_action()<CR>", opts)
|
||||
buf_set_keymap("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
|
||||
buf_set_keymap("n", "<leader>d", "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>", opts)
|
||||
buf_set_keymap("n", "[d", "<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>", opts)
|
||||
buf_set_keymap("n", "]d", "<cmd>lua vim.lsp.diagnostic.goto_next()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>q", "<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>", opts)
|
||||
end
|
||||
|
||||
require "lspconfig".jsonls.setup {
|
||||
on_attach = on_attach,
|
||||
flags = {
|
||||
debounce_text_changes = 150
|
||||
},
|
||||
settings = {
|
||||
json = require "json-schema"
|
||||
}
|
||||
}
|
||||
|
||||
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 = 150
|
||||
}
|
||||
}
|
||||
|
||||
--[[ require "lspconfig".java_language_server.setup {
|
||||
on_attach = on_attach,
|
||||
cmd = {"java-language-server"}
|
||||
} ]]
|
||||
local servers = {"pyright", "bashls", "clangd", "cssls"}
|
||||
for _, lsp in ipairs(servers) do
|
||||
nvim_lsp[lsp].setup {
|
||||
on_attach = on_attach,
|
||||
flags = {
|
||||
debounce_text_changes = 150
|
||||
}
|
||||
}
|
||||
end
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
vim.g.nvim_tree_auto_close = 1
|
||||
vim.g.nvim_tree_ignore = {".git", "node_modules", ".cache"}
|
||||
vim.g.nvim_tree_indent_markers = 1
|
||||
vim.api.nvim_set_keymap("", "<TAB>", ":NvimTreeFindFile<CR>", {silent = true})
|
||||
|
||||
vim.g.nvim_tree_icons = {
|
||||
default = "",
|
||||
symlink = "",
|
||||
git = {
|
||||
unstaged = "✗",
|
||||
staged = "✓",
|
||||
unmerged = "",
|
||||
renamed = "➜",
|
||||
untracked = "★",
|
||||
deleted = "",
|
||||
ignored = "◌"
|
||||
},
|
||||
folder = {
|
||||
default = "",
|
||||
open = "",
|
||||
symlink = ""
|
||||
}
|
||||
}
|
||||
|
||||
vim.g.nvim_tree_disable_default_keybindings = 1
|
||||
|
||||
local tree_cb = require "nvim-tree.config".nvim_tree_callback
|
||||
-- default mappings
|
||||
vim.g.nvim_tree_bindings = {
|
||||
{key = {"<CR>", "o", "<2-LeftMouse>"}, cb = tree_cb("edit")},
|
||||
{key = {"<2-RightMouse>", "<C-]>"}, cb = tree_cb("cd")},
|
||||
{key = "s", cb = tree_cb("vsplit")},
|
||||
{key = "i", cb = tree_cb("split")},
|
||||
{key = "t", cb = tree_cb("tabnew")},
|
||||
{key = "<", cb = tree_cb("prev_sibling")},
|
||||
{key = ">", cb = tree_cb("next_sibling")},
|
||||
{key = "P", cb = tree_cb("parent_node")},
|
||||
{key = "<BS>", cb = tree_cb("close_node")},
|
||||
{key = "<S-CR>", cb = tree_cb("close_node")},
|
||||
{key = "<Tab>", cb = tree_cb("preview")},
|
||||
{key = "K", cb = tree_cb("first_sibling")},
|
||||
{key = "J", cb = tree_cb("last_sibling")},
|
||||
{key = "I", cb = tree_cb("toggle_ignored")},
|
||||
{key = "I", cb = tree_cb("toggle_dotfiles")},
|
||||
{key = "r", cb = tree_cb("refresh")},
|
||||
{key = "a", cb = tree_cb("create")},
|
||||
{key = "d", cb = tree_cb("remove")},
|
||||
{key = "m", cb = tree_cb("rename")},
|
||||
{key = "<C-r>", cb = tree_cb("full_rename")},
|
||||
{key = "x", cb = tree_cb("cut")},
|
||||
{key = "c", cb = tree_cb("copy")},
|
||||
{key = "p", cb = tree_cb("paste")},
|
||||
{key = "y", cb = tree_cb("copy_name")},
|
||||
{key = "Y", cb = tree_cb("copy_path")},
|
||||
{key = "gy", cb = tree_cb("copy_absolute_path")},
|
||||
{key = "[c", cb = tree_cb("prev_git_item")},
|
||||
{key = "]c", cb = tree_cb("next_git_item")},
|
||||
{key = "-", cb = tree_cb("dir_up")},
|
||||
{key = "q", cb = tree_cb("close")},
|
||||
{key = "?", cb = tree_cb("toggle_help")}
|
||||
}
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
vim.g.signify_sign_add = "│"
|
||||
vim.g.signify_sign_change = "│"
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
vim.cmd([[let test#javascript#reactscripts#options = "--watchAll=false"]])
|
||||
vim.cmd([[let test#javascriptreact#reactscripts#options = "--watchAll=false"]])
|
||||
vim.cmd([[let test#typescript#reactscripts#options = "--watchAll=false"]])
|
||||
vim.cmd([[let test#typescriptreact#reactscripts#options = "--watchAll=false"]])
|
||||
vim.cmd([[
|
||||
augroup UltestRunner
|
||||
au!
|
||||
au BufWritePost * UltestNearest
|
||||
augroup END
|
||||
]])
|
||||
vim.g.ultest_virtual_text = 1
|
||||
vim.g.ultest_output_on_run = 0
|
||||
vim.g.ultest_pass_text = "🎉"
|
||||
vim.g.ultest_fail_text = "💥"
|
||||
vim.g.ultest_running_text = "⌛"
|
||||
14
setup.sh
14
setup.sh
|
|
@ -1,14 +0,0 @@
|
|||
[ -e ~/.local/share/nvim/site/pack/packer/start/packer.nvim ] || git clone https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/start/packer.nvim
|
||||
npm i -g @fsouza/prettierd \
|
||||
diagnostic-languageserver \
|
||||
eslint_d \
|
||||
lua-fmt \
|
||||
typescript-language-server \
|
||||
typescript \
|
||||
vim-language-server \
|
||||
vscode-css-languageserver-bin \
|
||||
vscode-html-languageserver-bin \
|
||||
vscode-json-languageserver \
|
||||
vscode-langservers-extracted \
|
||||
vscode-langservers-extracted \
|
||||
bash-language-server
|
||||
Binary file not shown.
|
|
@ -1,11 +0,0 @@
|
|||
auth/!
|
||||
auth
|
||||
Todo
|
||||
Minecraft
|
||||
FTB
|
||||
Technic
|
||||
Mojang
|
||||
config
|
||||
#echnic
|
||||
technic/!
|
||||
ConfigManager
|
||||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue