improved icons and added rest/http client
This commit is contained in:
parent
bf18835fcb
commit
e29721fd08
|
|
@ -4,6 +4,7 @@ vim.api.nvim_set_keymap("n", "<leader>fb", "<cmd>lua require('telescope.builtin'
|
|||
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})
|
||||
vim.api.nvim_set_keymap("n", "<leader>h", "<Plug>RestNvim", {silent = true})
|
||||
|
||||
function _G.toggle_venn()
|
||||
local venn_enabled = vim.inspect(vim.b.venn_enabled)
|
||||
|
|
|
|||
|
|
@ -26,6 +26,34 @@ return require("packer").startup(
|
|||
require("monokai").setup()
|
||||
end
|
||||
}
|
||||
use {
|
||||
"kyazdani42/nvim-web-devicons",
|
||||
config = function()
|
||||
require("nvim-web-devicons").set_icon {
|
||||
["test.ts"] = {
|
||||
icon = "",
|
||||
color = "#519aba",
|
||||
name = "TsTest"
|
||||
},
|
||||
["test.tsx"] = {
|
||||
icon = "",
|
||||
color = "#519aba",
|
||||
name = "TsTest"
|
||||
},
|
||||
["test.js"] = {
|
||||
icon = "",
|
||||
color = "#cbcb41",
|
||||
name = "JsTest"
|
||||
},
|
||||
["test.jsx"] = {
|
||||
icon = "",
|
||||
color = "#cbcb41",
|
||||
name = "JsTest"
|
||||
}
|
||||
}
|
||||
end
|
||||
}
|
||||
|
||||
use {
|
||||
"glepnir/galaxyline.nvim",
|
||||
branch = "main",
|
||||
|
|
@ -36,6 +64,7 @@ return require("packer").startup(
|
|||
}
|
||||
use {
|
||||
"kyazdani42/nvim-tree.lua",
|
||||
after = "nvim-web-devicons",
|
||||
config = function()
|
||||
require "plugins/nvim-tree"
|
||||
end,
|
||||
|
|
@ -66,6 +95,14 @@ return require("packer").startup(
|
|||
run = ":TSUpdate",
|
||||
-- after = "nvim-compe",
|
||||
config = function()
|
||||
local parser_configs = require("nvim-treesitter.parsers").get_parser_configs()
|
||||
parser_configs.http = {
|
||||
install_info = {
|
||||
url = "https://github.com/NTBBloodbath/tree-sitter-http",
|
||||
files = {"src/parser.c"},
|
||||
branch = "main"
|
||||
}
|
||||
}
|
||||
local npairs = require("nvim-autopairs")
|
||||
npairs.setup(
|
||||
{
|
||||
|
|
@ -93,7 +130,11 @@ return require("packer").startup(
|
|||
}
|
||||
}
|
||||
end,
|
||||
requires = {"JoosepAlviste/nvim-ts-context-commentstring", "windwp/nvim-ts-autotag", "windwp/nvim-autopairs"}
|
||||
requires = {
|
||||
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||
"windwp/nvim-ts-autotag",
|
||||
"windwp/nvim-autopairs"
|
||||
}
|
||||
}
|
||||
use {
|
||||
"mhartington/formatter.nvim",
|
||||
|
|
@ -118,12 +159,6 @@ return require("packer").startup(
|
|||
"jose-elias-alvarez/null-ls.nvim"
|
||||
}
|
||||
}
|
||||
--[[ use {
|
||||
"hrsh7th/nvim-compe",
|
||||
config = function()
|
||||
require "plugins/compe"
|
||||
end
|
||||
} ]]
|
||||
use {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
config = function()
|
||||
|
|
@ -232,5 +267,26 @@ return require("packer").startup(
|
|||
end
|
||||
}
|
||||
use "aklt/plantuml-syntax"
|
||||
use {
|
||||
"NTBBloodbath/rest.nvim",
|
||||
requires = {"nvim-lua/plenary.nvim"},
|
||||
config = function()
|
||||
require("rest-nvim").setup(
|
||||
{
|
||||
-- Open request results in a horizontal split
|
||||
result_split_horizontal = false,
|
||||
-- Skip SSL verification, useful for unknown certificates
|
||||
skip_ssl_verification = false,
|
||||
-- Highlight request on run
|
||||
highlight = {
|
||||
enabled = true,
|
||||
timeout = 150
|
||||
},
|
||||
-- Jump to request line on run
|
||||
jump_to_request = false
|
||||
}
|
||||
)
|
||||
end
|
||||
}
|
||||
end
|
||||
)
|
||||
|
|
|
|||
|
|
@ -235,4 +235,58 @@ function M.setup()
|
|||
require("jdtls").start_or_attach(config)
|
||||
end
|
||||
|
||||
local function buf_set_keymap(...)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, ...)
|
||||
end
|
||||
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", "<leader>wa", "<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>", opts)
|
||||
buf_set_keymap("n", "<leader>wr", "<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>", opts)
|
||||
buf_set_keymap("n", "<leader>wl", "<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>", opts)
|
||||
buf_set_keymap("n", "<leader>D", "<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 require('jdtls').code_action()<CR>", opts)
|
||||
buf_set_keymap("v", "<leader>a", "<Esc><Cmd>lua require('jdtls').code_action(true)<CR>", opts)
|
||||
buf_set_keymap("n", "<leader>r", "<Cmd>lua require('jdtls').code_action(false, 'refactor')<CR>", opts)
|
||||
buf_set_keymap("n", "gr", '<cmd>lua vim.lsp.buf.references() && vim.cmd("copen")<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", "<leader>q", "<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>", opts)
|
||||
buf_set_keymap("n", "<leader>fc", "<cmd>lua vim.lsp.buf.formatting()<CR>", opts)
|
||||
-- Java specific
|
||||
buf_set_keymap("n", "<leader>rt", "<Cmd>lua require'jdtls'.test_class()<CR>", opts)
|
||||
buf_set_keymap("n", "<leader>rn", "<Cmd>lua require'jdtls'.test_nearest_method()<CR>", opts)
|
||||
buf_set_keymap("v", "<leader>ev", "<Esc><Cmd>lua require('jdtls').extract_variable(true)<CR>", opts)
|
||||
buf_set_keymap("n", "<leader>ev", "<Cmd>lua require('jdtls').extract_variable()<CR>", opts)
|
||||
buf_set_keymap("v", "<leader>em", "<Esc><Cmd>lua require('jdtls').extract_method(true)<CR>", opts)
|
||||
vim.fn.sign_define(
|
||||
"DiagnosticSignError",
|
||||
{texthl = "LspDiagnosticsSignError", text = "", numhl = "LspDiagnosticsSignError"}
|
||||
)
|
||||
vim.fn.sign_define(
|
||||
"DiagnosticSignWarning",
|
||||
{texthl = "LspDiagnosticsSignWarning", text = "", numhl = "LspDiagnosticsSignWarning"}
|
||||
)
|
||||
vim.fn.sign_define(
|
||||
"DiagnosticSignWarn",
|
||||
{texthl = "LspDiagnosticsSignWarning", text = "", numhl = "LspDiagnosticsSignWarning"}
|
||||
)
|
||||
vim.fn.sign_define(
|
||||
"DiagnosticSignHint",
|
||||
{texthl = "LspDiagnosticsSignHint", text = "", numhl = "LspDiagnosticsSignHint"}
|
||||
)
|
||||
vim.fn.sign_define(
|
||||
"DiagnosticSignInformation",
|
||||
{texthl = "LspDiagnosticsSignInformation", text = "", numhl = "LspDiagnosticsSignInformation"}
|
||||
)
|
||||
vim.fn.sign_define(
|
||||
"DiagnosticSignInfo",
|
||||
{texthl = "LspDiagnosticsSignInformation", text = "", numhl = "LspDiagnosticsSignInformation"}
|
||||
)
|
||||
|
||||
return M
|
||||
|
|
|
|||
|
|
@ -7,22 +7,19 @@ vim.lsp.handlers["textDocument/implementation"] = require "lsputil.locations".im
|
|||
vim.lsp.handlers["textDocument/documentSymbol"] = require "lsputil.symbols".document_handler
|
||||
vim.lsp.handlers["workspace/symbol"] = require "lsputil.symbols".workspace_handler
|
||||
|
||||
vim.fn.sign_define(
|
||||
"DiagnosticSignError",
|
||||
{texthl = "LspDiagnosticsSignError", text = "", numhl = "LspDiagnosticsSignError"}
|
||||
)
|
||||
vim.fn.sign_define(
|
||||
"DiagnosticSignWarning",
|
||||
{texthl = "LspDiagnosticsSignWarning", text = "", numhl = "LspDiagnosticsSignWarning"}
|
||||
)
|
||||
vim.fn.sign_define(
|
||||
"DiagnosticSignHint",
|
||||
{texthl = "LspDiagnosticsSignHint", text = "", numhl = "LspDiagnosticsSignHint"}
|
||||
)
|
||||
vim.fn.sign_define(
|
||||
"DiagnosticSignInformation",
|
||||
{texthl = "LspDiagnosticsSignInformation", text = "", numhl = "LspDiagnosticsSignInformation"}
|
||||
)
|
||||
local signError = vim.fn.sign_getdefined("DiagnosticSignError")
|
||||
signError["text"] = ""
|
||||
signError["texthl"] = "DiagnosticSignError"
|
||||
vim.fn.sign_define("DiagnosticSignError", signError)
|
||||
local signWarn = vim.fn.sign_getdefined("DiagnosticSignWarn")
|
||||
signWarn["text"] = ""
|
||||
signWarn["texthl"] = "DiagnosticSignWarn"
|
||||
vim.fn.sign_define("DiagnosticSignWarn", signWarn)
|
||||
local signHint = vim.fn.sign_getdefined("DiagnosticSignHint")
|
||||
signHint["text"] = ""
|
||||
signHint["texthl"] = "DiagnosticSignHint"
|
||||
vim.fn.sign_define("DiagnosticSignHint", signHint)
|
||||
vim.fn.sign_define("DiagnosticSignInfo", signHint)
|
||||
|
||||
--- Completion Icons
|
||||
require("lspkind").init({})
|
||||
|
|
@ -37,6 +34,7 @@ require "lspconfig".pyright.setup {}
|
|||
require "lspconfig".tsserver.setup {}
|
||||
require "lspconfig".vimls.setup {}
|
||||
require "lspconfig".yamlls.setup {}
|
||||
require "lspconfig".texlab.setup {}
|
||||
|
||||
--- ESLINT
|
||||
|
||||
|
|
@ -131,7 +129,7 @@ require "lspconfig".tsserver.setup {
|
|||
on_attach = on_attach,
|
||||
cmd = {"java-language-server"}
|
||||
} ]]
|
||||
local servers = {"pyright", "bashls", "clangd", "cssls"}
|
||||
local servers = {"pyright", "bashls", "clangd", "cssls", "texlab"}
|
||||
for _, lsp in ipairs(servers) do
|
||||
nvim_lsp[lsp].setup {
|
||||
on_attach = on_attach,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
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.api.nvim_set_keymap("", "<TAB>", ":NvimTreeFindFile<CR>:NvimTreeFocus<CR>", {silent = true})
|
||||
|
||||
vim.g.nvim_tree_icons = {
|
||||
default = "",
|
||||
|
|
|
|||
|
|
@ -9,3 +9,4 @@ config
|
|||
#echnic
|
||||
technic/!
|
||||
ConfigManager
|
||||
Grenning
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue