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>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("n", "<leader>t", "<CMD>TodoTelescope<CR>", {silent = true})
|
||||||
vim.api.nvim_set_keymap("", "q:", "<Nop>", {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()
|
function _G.toggle_venn()
|
||||||
local venn_enabled = vim.inspect(vim.b.venn_enabled)
|
local venn_enabled = vim.inspect(vim.b.venn_enabled)
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,34 @@ return require("packer").startup(
|
||||||
require("monokai").setup()
|
require("monokai").setup()
|
||||||
end
|
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 {
|
use {
|
||||||
"glepnir/galaxyline.nvim",
|
"glepnir/galaxyline.nvim",
|
||||||
branch = "main",
|
branch = "main",
|
||||||
|
|
@ -36,6 +64,7 @@ return require("packer").startup(
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
"kyazdani42/nvim-tree.lua",
|
"kyazdani42/nvim-tree.lua",
|
||||||
|
after = "nvim-web-devicons",
|
||||||
config = function()
|
config = function()
|
||||||
require "plugins/nvim-tree"
|
require "plugins/nvim-tree"
|
||||||
end,
|
end,
|
||||||
|
|
@ -66,6 +95,14 @@ return require("packer").startup(
|
||||||
run = ":TSUpdate",
|
run = ":TSUpdate",
|
||||||
-- after = "nvim-compe",
|
-- after = "nvim-compe",
|
||||||
config = function()
|
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")
|
local npairs = require("nvim-autopairs")
|
||||||
npairs.setup(
|
npairs.setup(
|
||||||
{
|
{
|
||||||
|
|
@ -93,7 +130,11 @@ return require("packer").startup(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end,
|
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 {
|
use {
|
||||||
"mhartington/formatter.nvim",
|
"mhartington/formatter.nvim",
|
||||||
|
|
@ -118,12 +159,6 @@ return require("packer").startup(
|
||||||
"jose-elias-alvarez/null-ls.nvim"
|
"jose-elias-alvarez/null-ls.nvim"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
--[[ use {
|
|
||||||
"hrsh7th/nvim-compe",
|
|
||||||
config = function()
|
|
||||||
require "plugins/compe"
|
|
||||||
end
|
|
||||||
} ]]
|
|
||||||
use {
|
use {
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
|
|
@ -232,5 +267,26 @@ return require("packer").startup(
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
use "aklt/plantuml-syntax"
|
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
|
end
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -235,4 +235,58 @@ function M.setup()
|
||||||
require("jdtls").start_or_attach(config)
|
require("jdtls").start_or_attach(config)
|
||||||
end
|
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
|
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["textDocument/documentSymbol"] = require "lsputil.symbols".document_handler
|
||||||
vim.lsp.handlers["workspace/symbol"] = require "lsputil.symbols".workspace_handler
|
vim.lsp.handlers["workspace/symbol"] = require "lsputil.symbols".workspace_handler
|
||||||
|
|
||||||
vim.fn.sign_define(
|
local signError = vim.fn.sign_getdefined("DiagnosticSignError")
|
||||||
"DiagnosticSignError",
|
signError["text"] = ""
|
||||||
{texthl = "LspDiagnosticsSignError", text = "", numhl = "LspDiagnosticsSignError"}
|
signError["texthl"] = "DiagnosticSignError"
|
||||||
)
|
vim.fn.sign_define("DiagnosticSignError", signError)
|
||||||
vim.fn.sign_define(
|
local signWarn = vim.fn.sign_getdefined("DiagnosticSignWarn")
|
||||||
"DiagnosticSignWarning",
|
signWarn["text"] = ""
|
||||||
{texthl = "LspDiagnosticsSignWarning", text = "", numhl = "LspDiagnosticsSignWarning"}
|
signWarn["texthl"] = "DiagnosticSignWarn"
|
||||||
)
|
vim.fn.sign_define("DiagnosticSignWarn", signWarn)
|
||||||
vim.fn.sign_define(
|
local signHint = vim.fn.sign_getdefined("DiagnosticSignHint")
|
||||||
"DiagnosticSignHint",
|
signHint["text"] = ""
|
||||||
{texthl = "LspDiagnosticsSignHint", text = "", numhl = "LspDiagnosticsSignHint"}
|
signHint["texthl"] = "DiagnosticSignHint"
|
||||||
)
|
vim.fn.sign_define("DiagnosticSignHint", signHint)
|
||||||
vim.fn.sign_define(
|
vim.fn.sign_define("DiagnosticSignInfo", signHint)
|
||||||
"DiagnosticSignInformation",
|
|
||||||
{texthl = "LspDiagnosticsSignInformation", text = "", numhl = "LspDiagnosticsSignInformation"}
|
|
||||||
)
|
|
||||||
|
|
||||||
--- Completion Icons
|
--- Completion Icons
|
||||||
require("lspkind").init({})
|
require("lspkind").init({})
|
||||||
|
|
@ -37,6 +34,7 @@ require "lspconfig".pyright.setup {}
|
||||||
require "lspconfig".tsserver.setup {}
|
require "lspconfig".tsserver.setup {}
|
||||||
require "lspconfig".vimls.setup {}
|
require "lspconfig".vimls.setup {}
|
||||||
require "lspconfig".yamlls.setup {}
|
require "lspconfig".yamlls.setup {}
|
||||||
|
require "lspconfig".texlab.setup {}
|
||||||
|
|
||||||
--- ESLINT
|
--- ESLINT
|
||||||
|
|
||||||
|
|
@ -131,7 +129,7 @@ require "lspconfig".tsserver.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
cmd = {"java-language-server"}
|
cmd = {"java-language-server"}
|
||||||
} ]]
|
} ]]
|
||||||
local servers = {"pyright", "bashls", "clangd", "cssls"}
|
local servers = {"pyright", "bashls", "clangd", "cssls", "texlab"}
|
||||||
for _, lsp in ipairs(servers) do
|
for _, lsp in ipairs(servers) do
|
||||||
nvim_lsp[lsp].setup {
|
nvim_lsp[lsp].setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
vim.g.nvim_tree_ignore = {".git", "node_modules", ".cache"}
|
vim.g.nvim_tree_ignore = {".git", "node_modules", ".cache"}
|
||||||
vim.g.nvim_tree_indent_markers = 1
|
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 = {
|
vim.g.nvim_tree_icons = {
|
||||||
default = "",
|
default = "",
|
||||||
|
|
|
||||||
|
|
@ -9,3 +9,4 @@ config
|
||||||
#echnic
|
#echnic
|
||||||
technic/!
|
technic/!
|
||||||
ConfigManager
|
ConfigManager
|
||||||
|
Grenning
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in New Issue